Posts

Showing posts from May, 2011

How to find and replace with regex in excel -

Image
i have excel file 1 column , multiple rows. the rows contain various text, here's example: texts home texts whatever dafds dgretwer werweerqwr texts 21412 texts 346345 texts rwefdg terfesfasd rwerw i want replace "texts *" * after "texts are" specific word, example "texts replaced". how can in excel? as alternative regex, running: sub replacer() dim n long, long n = cells(rows.count, "a").end(xlup).row = 1 n if left(cells(i, "a").value, 9) = "texts are" cells(i, "a").value = "texts replaced" end if next end sub will produce:

angularjs - Declaration or statement expected error when setting up Typescript 1.4 and angularjs2 in Visual Studio 2013 -

Image
i have been trying basic typescript + angular2 application going in visualstudio 2013 . have installed npm , tsd , having no luck following tutorial http://www.codeproject.com/tips/1026938/angularjs-getting-started-with-visual-studio at error i can't figure out why visual studio won't recognize import statement. typescript seems work import statement doesn't. any appreciated thanks

javascript - Enter to Tab script does not pass over a checkbox? -

i trying convert enter tab, , works perfect form fields, not checkbox on page. have ideas why not? enter tab code : <script type="text/javascript"> function tabe(obj, e) { var e = (typeof event != 'undefined') ? window.event : e; // ie : moz var self = $(obj), form = self.parents('form:eq(0)'), focusable, next; if (e.keycode == 13) { focusable = form.find('input,a,select,button,textarea').filter(':visible'); next = focusable.eq(focusable.index(obj) + 1); if (!next.length) { next = focusable.first(); } next.focus(); return false; } } </script> the evil checkbox : <input class="case" type="checkbox" onkeyup="return tabe(this,event);"/> edit: (html code) : <td> <input class="case" type="checkbox" onkeypress="return tabe(this,event);"/> </td> jquery : html += '<td><input c

python - Roman to Numeral calculator with "for i in X" -

i tried build calculator convert roman numeral can tell me how can choose 2 characters words in high priority? ** roman string #roman numeral calculator def romantodecimal(roman): decimalvalue=0 in roman: if == "cm": decimalvalue += 900 if == "iv": decimalvalue += 4 if == "ix": decimalvalue += 9 if == "xl": decimalvalue += 40 if == "xc": decimalvalue += 90 if == "cd": decimalvalue += 400 elif in roman: if == "i": decimalvalue += 1 if == "v": decimalvalue += 5 if == "x": decimalvalue += 10 if == "l": decimalvalue += 50 if == "c": decimalvalue += 100 if == "d": decimalvalue += 500 if == "m": decimalvalue += 1000 return decimalvalue and

javascript - Firebug: How to save rendered Source Code? -

i'm using firebug's inspector view source code. code has been modified javascript. i'd save rendered code file, can more compare unmodified source. i'm having no luck copy/paste. when attempt select code, contents of inspector changes. i'm running osx. how can save rendered source code? hmmm.. expanding html element in fb , hitting cmd+a, cmd+c not help? using js copy inner html of top-most parent?

ruby - how do I kill a port in use -- eventmachine -

i following error: eventmachine.rb:534:in `start_tcp_server': no acceptor (port in use or requires root privileges) i'm not sure process or port , want kill can run script again. how do that? ps ax | grep ruby kill -9 [pid] example: ps ax | grep ruby #=> 857 pts/19 sl+ 0:04 /home/andreydeineko/.rvm/rubies/ruby-2.2.3/bin/ruby bin/rails server #=> 14639 pts/18 s+ 0:00 grep --color=auto --exclude-dir=.bzr --exclude-dir=cvs --exclude-dir=.git --exclude-dir=.hg --exclude-dir=.svn rails #=> 25368 pts/17 sl+ 0:02 /home/andreydeineko/.rvm/rubies/ruby-2.2.3/bin/ruby bin/rails c kill -9 857 ps ax | grep ruby #=> 14639 pts/18 s+ 0:00 grep --color=auto --exclude-dir=.bzr --exclude-dir=cvs --exclude-dir=.git --exclude-dir=.hg --exclude-dir=.svn rails #=> 25368 pts/17 sl+ 0:02 /home/andreydeineko/.rvm/rubies/ruby-2.2.3/bin/ruby bin/rails c

javascript - Ionic, List populating via search -

i using backemnd service (parse in case doesn't matter question) , wanted search it. have textbox upon text being entered searches server , returns array of matchs. my next step display returned objects nicely in list. easy enough ng-repeat because view has been loaded ui won't update reflect array being loading list. make sense? i wondering if there technique refresh list , show returned search elements, , not being greedy here doing in way looks , not clunky. i did lot of googling no luck :( advice amazing. without code provided hard guess wrong. angular has two-way binding, view should updated automatically after changing content of array. if it's not, means did wrong in code. present example code should work in case. controller angular.module('modulename') .controller('viewcontroller', ['viewservice', viewcontroller]); function viewcontroller(viewservice) { var self = this; self.arraywithdata = []; self.sear

reporting services - How to write an expression to display 2 fields in a string in Visual Studio -

i trying take 2 fields , display them in string in ssreport. how write expression type of scenario. fields!title1.value fields!title2.value expression: = fields!title1.value stored in fields!title2.value room. try in textbox: =cstr(fields!title1.value) & cstr(fields!title2.value)

java - add linearlayout dynamically into a Relativelayout -

i have code , want add checkboxes dynamically inside linearlayout nested inside scrollview nested inside relativelayout( relativelayout->scrollview->linearlayout->my chechboxes) li = (relativelayout) findviewbyid(r.id.mainlayout); scrollview sv = new scrollview(this); final linearlayout ll = new linearlayout(this); ll.setorientation(linearlayout.vertical); li.addview(sv); sv.addview(ll); for(int = 0; < 20; i++) { checkbox cb = new checkbox(getapplicationcontext()); cb.settext("i'm dynamic!"); ll.addview(cb); } this.setcontentview(sv); but error: 03-12 20:32:14.840: e/androidruntime(945): caused by: java.lang.illegalstateexception: specified child has parent. must call removeview() on child's parent first. my relativelayout declared in xml file how can fix this? this.setcontentview(sv); this tries add scrollview framelayout android.r.id.content , made li parent of sv ... hence "the specified child has parent.&q

javascript - Is React's setState asynchronous or something? -

hmm. i'm using setstate , reason code following doesn't have access new state! what gives?! yeap. it's asynchronous. i'm posting because isn't obvious new react users. react "queues" updates component's state. if need execute code block that's dependent on new state change, pass callback so: getinitialstate: function () { return { isfinalcountdown: false, } } //blablabla //then somewhere got... this.setstate( {isfinalcountdown: true}, function () {//<--- whoa. solves your synchrosity woes! console.log(this.state.isfinalcountdown); //true! } ); console.log(this.state.isfinalcountdown); //false! all of in docs, it's needs reiterated avoid common bugs new react users come across. check out: https://facebook.github.io/react/docs/component-api.html#setstate

python - Embedding Bokeh plot in Django website results in blank page with no error message -

Image
i'm trying embed bokeh plot django site has upload button. i'm using example given here starting point , adding on instructions on embedding here . follow-up on question here have new problem. plot wont display when go url associated it, there no error message , page loads. i used need-a-minimal-django-file-upload-example/for_django_1.8 , works intended when navigate url http://<port>/myapp/list/ myapp/url.py looks this # -*- coding: utf-8 -*- django.conf.urls import patterns, url . import views urlpatterns = patterns('myproject.myapp.views', url(r'^list/$', 'list', name='list'), url(r'^simple_chart/$', views.simple_chart, name="simple_chart"), ) here views.py , simple_chart.html . when navigate http://<port>/myapp/simple_chart/ simple_chart function should generate plot. views.py import pdb # -*- coding: utf-8 -*- django.shortcuts import render_to_response django.template import req

opendds TAO_IDL_GEN, OpenDDS_XML_QOS_XSC_Generation, and other skipped packages -

i'm building opendds 3.8 source. when running configure command obtain skipping messages. of them java (i don't use it's ok me skip them) other messages take attention: skipping tao_idl_gen (tao_idl_fe.mpc); requires tao_idl_fe_gen skipping opendds_xml_qos_xsc_generation (qos_xml_handler.mpc); requires xsc. skipping opendds_qos_xml_xsc_handler (qos_xml_handler.mpc); requires xerces. skipping opendds_corbaseq (corbaseq.mpc); avoids no_opendds_safety_profile. skipping opendds_corba (opendds_corba.mpc); avoids no_opendds_safety_profile. i did't found regarding these packages. i'd know , if need them (and how build them). export path of java, wireshark, glib , qt bashrc try run "./configure --java --wireshark --glib --qt" working giving me error in later state.

c# - Spring.Data.CannotGetAdoConnectionException : Could not get ADO.NET connection -

we have bunch of unit tests running on build server using command line: mkdir "%workspace%\results" del /q "%workspace%\results*.*" ncover run --project="%job_name%" --buildid="%job_name% %build_number% v%the_version%" -- %nunit_exe% output\xyzlibtests\product.xyzlib.tests.dll /exclude:performance /noshadow /xml=results\xyzlib-testresults.xml the tests dll c# class library, .net v4.5, , nunit nunit 2.6.4. use spring.net, , context.xml file tests dll is: <objects xmlns="http://www.springframework.net" xmlns:db="http://www.springframework.net/database" xmlns:tx="http://www.springframework.net/tx"> <import resource="assembly://product.core.sqlserver/product.core.config/context.xml"/> <import resource="assembly://product.importlib/product.import.config/context.xml"/> <db:provider id="dbprovider" provider="sql

quotes - Load table issue - BCP from flat file - Sybase IQ -

i getting below error while trying bcp flat delimited file sybase iq table. could not execute statement. non-space text found after ending quote character enclosed field. i couldn't observe non space text in file, error stopping me doing bulk copy. | column delimiter " text qualifier , \n row delimiter. below sample template same, using. load table table_name(a null('(null)'),b null('(null)'),c null('(null)')) using client file '/home/...../a.txt' //unix quotes on format bcp strip rtrim delimited '|' row delimited '\n' when perform same query quotes off , load successful. but, same query getting failed quotes on . quotes stripped off, well. sample data 12345|"abcde"|(null) 12346|"abcdf"|"zxf" 12347|(null)|(null) 12348|"abcdg"|"zyf" any leads helpful! if iq bcp same ase, think '(null)' fields being inter

c++ - c_str implemenation for String class -

i reading chapter 12 in accelerated c++ book on implementing string class. there end-of-chapter question implement c_str() function. looking ideas. here have far: my first attempt heap allocate char * , return it. result in memory leaks: cost char * c_star() const { //cannot reference result later //causes memory leaks char* result = new char[data.size() + 1]; std::copy(data.begin(), data.end(), result); result[data.size()] = '\0'; return result; } here attempt: const char* c_str() const { //obviously incorrect implementation not nul('\0') terminated. return &data[0]; } i cannot push_back '\0' data since should not change data. here spec : returns pointer array contains null-terminated sequence of characters (i.e., c-string) representing current value of string object. here book implementation: (renamed str ). internally, characters stored in vector implementation (vec). class str { public:

java - Unable to delete parent JPA entity with @OneToMany relationship using Hibernate -

i've hit problem when using hibernate delete jpa entity has @onetomany relationship child entity, same code works fine when using eclipselink instead of hibernate jpa provider. annotation on parent entity @onetomany(fetch = fetchtype.eager, cascade = {cascadetype.all}, orphanremoval=true) when using hibernate attempts set join column on child entity null fails column not allow nulls. when using eclipselink deletes child entities first , deletes parent entity desired behaviour. my questions are: why behaviour different between hibernate , eclipselink? understand orphanremoval , cascasetype.remove features in jpa2 should function same both providers. is there can change in code allow both eclipselink , hibernate function same when deleting parent entity, without deleting child entities first? 1 constraint code must work both jpa providers. i've found several similar questions on so, of them either relate jpa 1.0, using depreciated hibernate annotations or sugges

react native - getInitialState not working in Movies Tutorial -

trying follow react native tutorial movies app. using ios or android goes fine until try introduce state component. tutorial not use es6 classes hello world app , gets confusing. the tutorial says add getintialstate breaks assume due using es6 classes, using constructor not seem work wanted know correct way proceed? tutorial getinitialstate: function() { return { movies: null, }; }, es6 equivalent? constructor(props) { super(props); this.state = { movies: null, }; }, do not use comma (,) after methods in class! class listapp extends component { constructor(props){ super(props); this.state = { loaded: false }; } //, <--- no comma! ... ... ... }

bash - set -e makes function stop running early? -

i have function seems break when turn on errors set -e . suspect working intended can't see i'm doing wrong. here function: #!/usr/bin/env bash set -e my_function() { base_dir="/tmp/test" if [ ! -d $base_dir ]; echo "creating $base_dir" mkdir -p $base_dir touch $base_dir/some-file.txt fi is_edited=$(grep "foo" $base_dir/some-file.txt) if [ ! -z $is_edited ]; cd $base_dir echo "doing stuff" docker run --rm debian ls fi echo echo "done" echo } my_function with set -e flipped on, function returns seemingly without hit echo statements. set -e turned off, echo statements hit. happening , how fix this? try using: is_edited=$(grep "foo" $base_dir/some-file.txt || test $? -eq 1) the exit status of grep 0 if found match, 1 if didn't find match, , 2 if got actual error. if there's no match foo in fi

lisp - ZIP contents as a Gray stream? -

i'm writing cl library read ms excel(tm) spreadsheets called "xlmanip" (not ready prime time yet -- reads "xlsx" spreadsheets, works 80% use case of "i want operate on cell contents"... digress.) one thing worries me when reading "xlsx" (zip archives in xml format) current zip handling library, common lisp zip, unpacks compressed contents (vector (unsigned-byte 8)) . large spreadsheet, that'll cause issue end user. one alternative i've thought delayed loading -- let-over-lambda closure demand-loads worksheet when needed. however, that's delaying inevitable. are there zip file cl libraries out there return gray stream zip component's contents opposed (potentially large) (vector (unsigned-byte 8)) ? edit: clarification i'm looking zip component function returns stream , not 1 takes stream . functions take stream write zip component's contents directly file associated stream. i'd rather xlmanip reads st

javascript - Script works inline but when i move to external doesnt work? -

i made script navigation. becomes sticky navigation once scrolled top. it works great when have @ bottom of index file via <script> tags when try place in external js file doesnt seam fire @ all. full fiddle heres script: var windw = this; $.fn.followto = function ( pos ) { var $this = this, $window = $(windw); $window.scroll(function(e){ if ($window.scrolltop() > pos) { $this.css({ position: 'fixed', top: "20px" }); } else { $this.css({ position: 'absolute', bottom: '0', left: '0', right:'0', top: 'inherit' }); } }); }; $('#mainnav').followto( $(window).height() - ( $('#mainnav').innerheight() + $('.globalheader').innerheight() )); the jquery library missing must add above external scr

javascript - Browserify working with grunt ReacjJS and yii2 vendor path -

background i'm trying setup yii2 project browserify manage js dependancies. yii2 places js , css dependancies in vendor/bower directory, i'm trying configure browserify use include path vendor dependancies. i have grunt task setup run js build. problem when try compile js files using grunt task getting error trying find react (the first include in js project). error: cannot find module 'react' '{my-working-directory}/modules/contact/asset/js' code i have react installed (bower install) , available in vendor/bower directory. project js src files i'm trying build located in modules/contact/asset/js/ . in js files i'm including react @ top of file. modules/contact/asset/js/main.jsa var react = require('react'); var component = react.createclass({ render: function() { ... } }); ... i have setup grunt browserify task include paths browserify knows how find includes, have additionally added react transform j

java - How to override injection by another instance -

i have class cannot change: class somebean { @inject private dep1 dep1; @inject private dep2 dep2; ... @inject private depn depn; } i have class: class mybean { @inject@named("bean1") private somebean bean1; @inject@named("bean2") private somebean bean2; } how make module configuration bean1 , bean2 injected different instances have different dep2 instances, other dependencies same? if using spring, create bean in context file such as: <bean class="mybean"> <property name="bean1"> <bean class="somebean"> <property name="dep2" ref="dep2instancea"/> </bean> </property> <property name="bean2"> <bean class="somebean"> <property name="dep2" ref="dep2instanceb"/> </bean> </property> </bean> so explicitly

c# - WinForms DataGridView Checkbox -

i trying figure out how set cell in datagridview readonly. checkbox being added boolean property. therefore, looking tips how accomplished task of setting cell readonly based on column boolean property. below snippet of code. [displayname("lock")] public bool revenuelock { get; set; } revenue = new domesticcostrevenue() { revenuelock = convert.toboolean(values[10]), revenue = convert.todouble(values[11]) }; domestic.add(revenue); } costrevenuegridview.datasource = domestic; this i've done no success far. foreach (datagridviewrow row in costrevenuegridview.rows) { if ((bool)row.cells["revenuelock"].value == true) { row.cells["revenue"].readonly = true; //messagebox.show("lock"); } } you can set whole column or whole row or specific cell read only: column: this.datagridview1.columns[1].readonly = true; row: this.datagridview1.rows[0].readonly = true; cell: this.datagridview1.rows[0].cells[1].readonly = true;

JavaScript Object.observe on prototype -

consider code below : function createfoo() { var val; function foo() {} object.defineproperty(foo.prototype, 'foo', { get: function () { return val; }, set: function (value) { val = value; document.write('foo value set : ', value); } }); return new foo(); } var foo = createfoo(); object.observe(foo, function (changes) { document.write(changes); }); foo.foo = 'bar'; why object.observe 's handler never fired? can object prototype "observed"? (please, answers must not suggest use kind of third party library.) update please, read comments more information , resolution problem. this foo.foo = 'bar'; does not modify neither foo object nor prototype observe not report anything. here version triggers observer on this.val = value; : function createfoo() { function foo() {} object.defineproperty(foo.prototype, 'foo

couchDB reduce: does rereduce preserve the order of results from map? -

with couchdb view, results ordered key. have been using values associated highest number. example, take result (in key: value form): {1:'sam'} {2:'jim'} {4:'joan'} {5:'jill'} couchdb sort according key. (it helpful think of key "score".) want find out has highest or lowest score. i have written reduce function so: function(keys, values) { var len = values.length; return values[len - 1]; } i know there's _stat , like, these not possible in application (this slimmed down, hypothetical example). usually when run reduce, either 'sam' or 'jill' depending on whether descending set. want. however, in large data-sets, middle of list. i suspect happening on rereduce. had assumed when rereduce has been run, order of results preserved. however, can find no assurances case. know on rereduce, key null, normal sorting rules not sorted. case? if so, advice on how highest scorer? yeah, don't think sorting

python - Is this an efficient / appropriate use of a bloom filter? -

i have api data comes in, lot of redundant (can determined id). have bloom filter built few million entries start. i using this library handle implementation. reading online: bloom filter compact data structure probabilistic representation of set of variables ensure whether elements in set present or definitely not present in set. source if have pseudocode this newdata #some dataset row in newdata: #filter.add() returns true if in set, want not in set if not filter.add(row.id): #do stuff fresh data this function called every time set of data comes in, 200 new entries/sec. is efficient way use bloom filter? a bloom filter can, given element, give 2 answers. can "i sure have never seen element before" or "i believe have seen element before". in latter case, may bloom filter incorrect (that is, it's saying "i think i've seen before" when, in fact, hasn't). that is, question answers isn't &q

c# - Using .Net Library in Unity5 -

i have huge project written in c# using .net 3.5 need use unity3d project. tried import unity project found out not possible. so, want import code have written in c# unity. created library using code have, import unity , use it. when try import receive following error: unhandled exception: system.typeloadexception: not load type 'speechtools.clsspeechsynthesis' assembly 'myspeechsynthesizer, version=1.0.0.0, culture=neutral, publickeytoken=null'. not load file or assembly 'system.speech, version=3.0.0.0, culture=neutral, publickeytoken=31bf3856ad364e35' or 1 of dependencies. i using system.speech in library. not supported in unity (mono). guess problem caused dependency. can me? there way write wrapper around system.speech.speechsynthesizer , use in unity? i searched online , found lot of tutorials on writing wrappers c++ codes nothing c# , .net libraries. system.speech not supported unity's version of mono, you're out of

git: How can I merge my working file with the latest one -

i'm new git, , still having lot of trouble. say i'm working on a.cpp . modified code in a.cpp . and, change not ready commit or push. then, other people made change in a.cpp . in svn/cvs, checking out either merge or conflict. i thought git pull same thing. but, seems git pull doesn't merge/conflict. correct behavior? also, git checkout rewrites a.cpp , losing changes. is there easy way pull latest version , perform merge/conflict? before pull, stash changes . after pull, can pop stashed changes , rebase them on newest commit. first stash changes git stash you can view stashes running stash show . if haven't stashed before should see 1 stash. can pull without overwriting changes: git pull now remove changes stash , apply them checked out version: git stash pop

javascript - Do JS event listeners cost more than an additional HTTP request? -

i have heard best condense javascript 1 file reduce number of http requests application makes. however, hold true if make use of event listeners each specific 1 page of site? for example, have 3 different pages make ajax requests load random picture server. first page listens button click, second page listens mouseover, , third page listens change in value of select field. make sense have 1 giant js file contains dom-manipulation logic, event listeners? or better define necessary dom-manipulation logic in 1 file , have 1 small js file each page page-specific event listeners page. tl;dr: event listeners elements not exist on page cost more in performance http requests additional js file? reduction of number of requests 1 reason consolidating javascript files one. the other reason this: javascript file can, after browser has downloaded once, retrieved browser cache when subsequent pages use it. fewer files means more streamlined caching. the cost of little javascript

email - Using PHP with IMAP to check POP3 "syntax error" -

i trying connect pop3 email account hosted website host. website shared host. email host check emails windows live mail.mysite.com port 110 , works fine. using php , imap have not had luck. did check , host have imap installed. after fought few hours , learned when imap_open fails tries 3 more times fun. started imap_last_error() error checker telling me cannot connect mail: many login failures once figured out happening did not take long figure out how rest of errors , how turn off not retry. now getting syntax error have tried dozens , dozens different variations of hostname. below include 4 people can see of saner things have tried , results. as new missing obvious more experience. open other ways go this. want able use php script open , read emails on particular account. not picky or kind of interface. have been trying imap 1 have found. //$hostname = '{mail.mysite.com:110}inbox'; //array(1) { [0]=> string(49) "[closed] imap connection broken (serve

How do you setup static paths in javascript? -

this may silly question, can't seem find simple answer via google lets have react component library, full of display component, , want included of smart/container components. because used on place, i'd rather not use relative paths every different component in app import component '../../library/component' , ../library/component , ../../../library/component etc... how set had import component 'library/component' wherever in app wanted be? asked way, prescribed way setup static paths in javascript? with webpack using way of "several root directories". builder find modules several paths. , can write this: "./lodash" instead "../../../../lodash". this more info.

ios - Cutting MPEG-TS file via ffmpegwrapper? -

i have mpeg-ts files on device. cut fairly-exact time off start of files on-device. using ffmpegwrapper base, i'm hoping achieve this. i'm little lost on c api of ffmpeg, however. start? i tried dropping packets prior start pts looking for, broke video stream. packet->pts = av_rescale_q(packet->pts, inputstream.stream->time_base, outputstream.stream->time_base); packet->dts = av_rescale_q(packet->dts, inputstream.stream->time_base, outputstream.stream->time_base); if(startpts == 0){ startpts = packet->pts; } if(packet->pts < cuttimestartpts + startpts){ av_free_packet(packet); continue; } how cut off part of start of input file without destroying video stream? when played back, want 2 cut segments run seamlessly together. ffmpeg -i time.ts -c:v libx264 -c:a copy -ss $cut_point -map 0 -y after.ts ffmpeg -i time.ts -c:v libx264 -c:a copy -to $cut_point -map 0 -y before.ts seems n

python - How do you fix kivy.graphics DLL issue? -

sigh...here's question python's never ending module issues. have python 3.4 , windows 8. can import kivy fine, if try import kivy.graphics, ran dll issue: file "c:\users\young\anaconda3\lib\site-packages\kivy\graphics\__init__.py", line 89, in <module> kivy.graphics.instructions import callback, canvas, canvasbase, \ importerror: dll load failed: specified module not found. does have clue? i had same error, , fixed re-installing kivy administrator. right-click on cmd.exe , select "run administrator." follow install instructions here .

json - Android/Java - JSONException, java.util.HashMap cannot be converted to JSONObject API < 21 -

i running strange problem on devices running api < 21. i have following jsonobject { "saturday":"{notes=walk-ins only, open=2016-01-16t08:00:00-05:00, close=2016-01-16t15:00:00-05:00}", "wednesday":"{notes=walk-ins only, open=2016-01-20t09:00:00-05:00, close=2016-01-20t18:45:00-05:00}", "tuesday":"{notes=walk-ins only, open=2016-01-19t09:00:00-05:00, close=2016-01-19t18:45:00-05:00}", "friday":"{notes=walk-ins only, open=2016-01-22t09:00:00-05:00, close=2016-01-22t18:45:00-05:00}", "thursday":"{notes=appointments & walk-ins, open=2016-01-21t09:00:00-05:00, close=2016-01-21t18:45:00-05:00}", "monday":"{notes=null, open=null, close=null}", "sunday":"{notes=null, open=null, close=null}" } when attempting jsonobject given day, on devices running api >= 21 use following example code jsonobject.getjsonobject(&

javascript - jQuery notify plugin not working in another JS file -

i using jquery notify plugin. include js files in header. calling $.notify function in js file using ajax, there cannot access $.notify function. my ajax file here including in header also: $.ajax({ url:'index.php?page=ajax_insertdimension.php', type:'post', data:'code='+dcode+'&des='+ddesc, success:function(msg){ $.notify({ title: 'email notification', text: 'you received e-mail boss. should read right now!', image: "<img src='images/mail.png'/>" }, { style: 'metro', classname: 'info', autohide: false, clicktohide: true }); addcols(); } }) sometimes success method work, have specify data type "msg" argument there in parameter success function. can done adding datatype parameter post method specified in documentation here jquery.post() $.ajax({ url:'index.p

lua - ROBLOX sandboxing -

i new sandboxing in lua, , learn how filter stuff :getchildren() or :kick(). this have far: function safegetchildren(obj) local objs = {} _,v in pairs(obj) if not v.name:match("^^") table.insert(objs, v.name) end end return objs end function safeclearallchildren(obj) if obj:isa("player") or obj:isa("players") or obj:isa("workspace") or obj:isa("serverscriptservice") or obj:isa("lighting") or obj:isa("replicatedstorage") or obj:isa("startergui") return error("cannot clear object!"); else obj:clearallchildren(); end end function saferemoveobject(obj) local name = obj.name:lower(); if obj:isa("player") or name == "remoteevents" or obj.parent == "remoteevents" or obj.parent == "replicatedstorage" or obj.parent == "startergui" or obj.parent == "serverscript

java - Testing an Android application failed in Eclipse using Appium -

Image
i wanted learn tool test android application. after bit of googling came around wonderful tool called appium used test android application , open source. wanted learn it. went ahead , created simple android application having few button clicks start testing. i have done following: plugged in necessary jar's eclipse ide. downloaded , installed appium server. plugged in maven , testng eclipse . successfullly installed sampleapp.apk emulator . i next created testng class test sampleapp.apk . code pasted below. on running application received java.lang.nullpointerexception . it's been 2 days. tried doing everything, building, cleaning, restarting eclipse, creating new application, re installing dependencies. still receive same exception. had referred video execute automation , have done exact same minus application different in case. package com.example.appium; import java.net.malformedurlexception; import java.net.url; import io.appium.java_client.appiumdr