Posts

Showing posts from April, 2012

jquery - Editing value in JavaScript through phantomJS not Working -

Image
i using phantomjs execute js code on webpage automate script me, in example trying login through webpage. kinda not ordinary web logins, uses js submit button not form. so anyways here problem facing. as can see. submited page. problem can see values of username , passwords not added webpage. using this: document.getelementbyid("txtusername").vlaue="plaplapla"; document.getelementbyid("txtpassword").vlaue="plapalpla"; html code login : <a id="btnlogin" href="javascript:webform_dopostbackwithoptions(new webform_postbackoptions(&quot;btnlogin&quot;, &quot;&quot;, true, &quot;&quot;, &quot;&quot;, false, true))"><b>login</b></a> html code username , password : <input name="txtusername" type="text" id="txtusername" style="width:190px;" /><br> <input name="txtpassword" type="password"

java.util.scanner - How to read and add only numbers to array from a text file -

i'm learning java , have question regarding reading file want read numbers file contains strings well. here example of file: 66.56 "3 java 3-43 5-42 2.1 1 and here coding: public class test { public static void main (string [] args){ if (0 < args.length) { file x = new file(args[0]); try{ scanner in = new scanner( new fileinputstream(x)); arraylist<double> test = new arraylist<>(); while(in.hasnext()){ if(in.hasnextdouble()){ double f=in.nextdouble(); test.add(f);} else {in.next();} } catch(ioexception e) { system.err.println("exception during reading: " + e); } } my problem add 66.56,2.1 , 1 doesn't add 3 after "3 or ignores 3-43 , 5-42 can tell me how skip strings , add doubles here? thanks all said 3 ie; "3, 3-43 , 4-42 strings either u read string , split , check number @ " , - or put in space between characters , integers. jvm after compilation tre

sql - how to save any file in specific folder in c# programatically -

i want save backup file in specific folder. i'm using savefiledialog box give path , file name on button click . want create backup giving name (datetime.today.date.toshortdatestring()) , save in "d:\database" directly on button click. , don't want use savefiledialog box. i'm using code: sqlcommand cmd = new sqlcommand("use master backup database plproject disk = '" + savefiledialog1.filename + "'", connectionsql); i guess looking this public static void writealltext( string path, string contents ) file.writealltext("d:\\database\\"+datetime.today.date.toshortdatestring(),yourdatastring); note: overwrite file same name. there many other useful methods available in file class. can check suits best. edit 1 try this string filename="d:\\backup\\"+datetime.today.date.toshortdatestring(); sqlcommand cmd = new sqlcommand("use master backup database plproject disk = '&quo

How to add date and time information to time series data using python numpy or pandas -

i have trouble using date & time calculation pandas. i think there logics calculate duration automatically beginning specific date & time. still couldn't find it. i'd know how add date & time info 1 second duration time series data. before: 10 12 13 .. 20 21 19 18 after: 1013-01-01 00:00:00 10 1013-01-01 00:00:01 12 1013-01-01 00:00:02 13 .. 1013-10-04 12:45:40 20 1013-10-04 12:45:41 21 1013-10-04 12:45:42 19 1013-10-04 12:45:43 18 any appreciated. thank in advance. the documentation gives similar example @ beginning using date_range . if have series object, can make datetimeindex starting @ appropriate time (i'm assuming 1013 typo 2013 ), frequency of 1 second, , of appropriate length: >>> x = pd.series(np.random.randint(8,24,23892344)) # make random data >>> when = pd.date_range(start=pd.datetime(2013,1,1),freq='s',periods=len(x)) >>> when <class 'pandas.tseries.index.datetimeindex'>

xml - Web Api Post value is always null when using Chrome Postman Plugin -

i'm following example here http://www.asp.net/web-api/overview/creating-web-apis/creating-a-web-api-that-supports-crud-operations i'm having trouble getting receive post request chrome postman plugin. here's example of xml i'm posting. have set content-type header in postman application/xml. <?xml version="1.0" encoding="iso-8859-1"?> <product> <category>groceries</category> <name>new post</name> <price>1.39</price> </product> i have tried following solution model null on xml post doesn't seem make difference. here's webapiconfig file. public static void register(httpconfiguration config) { config.formatters.add(new xmlmediatypeformatter()); config.formatters.xmlformatter.usexmlserializer = true; config.routes.maphttproute( name: "defaultapi", routetemplate: "api/{controller}/{i

How to get Rails to serve my dynamic Greasemonkey script with the proper MIME type? -

this question has answer here: rendering file mime type in rails 4 answers i have static greasemonkey script , works fine. have rails 4 application, , want customize script current user. problem can render script named script.user.js , content type text/html , greasemonkey can't detect install. here few lines of code : routes.rb resources :users 'script.user.js', :action => 'script', :on => :collection end users_controller.rb def script render file: 'users/script.user.js', content_type: "application/x-javascript" end how app serve file right type? try (untested): def script render file: 'users/script.user.js', content_type: mime::js end similar problem , answers: " rendering file mime type in rails ". also, op comment (i should have remembered this): clear browser

weka - Convert NA values to ? automatically while loading -

is there way automatically convert na values ? in weka while loading .csv files? or have use other script/program either replace them ? or blank space before loading weka. any or suggestions welcome. thanks unfortunately not believe weka has way conversion. case because weka's native format .arff files. in .arff files, missing values denoted "?". when .csv file loaded, expects missing values denoted "?". depending on method of using weka suggest: for weka gui, use " find , replace" in simple text editor change "na" "?" before loading .csv weka. for weka java api, write method preprocess ".csv" file before handing on weka .csv loader.

php - Jquery/Javascript: adding pictures and text dynamically -

forgive me if simple question, kinda novice jquery/javascript. know how can add image , comment @ same time 1 press on enter key. mean is: user types in comment in textarea, hits enter , his/her comment appears in div username. want profile picture corresponding user appears, option rate or favourite comment. have got far following: $(document).ready(function() { $('.comment').keyup(function(e) { if (e.keycode == 13){ var post_id = $(this).attr('post_id'); var comment = $(this).val(); $(this).val(''); $.post('../php_includes/comment.php', {post_id: post_id, comment: comment}); $(this).parent().children('.comments').append("<div class='view'><?php echo $_username;?> remarks: " + comment + "</div>"); } }); }); this works. in div "view" appears: username remarks: comment. however, when this: $(doc

c# - Can I use tryParse output parameters to populate an array in a for-loop? -

i've got homework stickler need set of eyes. assignment create program prompts student's name, iterates through array of days ( string[] days = {"sunday","monday","tuesday","wednesday","thursday","friday","saturday"}; ) prompting number of hours studied each day. finally, program display daily average number of hours studied week. i'm stuck data entry method: public void enterhours() { // entry area header console.writeline("enter study hours {0} ", name); (int = 0; < days.length; i++) { console.write("{0}'s study hours: ", days[i]); string dailyhours = console.readline(); int.tryparse(dailyhours, out hours[i]); // problematic statement } sumhours(hours); } currently, name variable property that's been set; days string[] above, , i've instantiated hours int[

algorithm - Efficiently determine which units are in the range of AOE spells in RPG games, like World of Warcraft and dota 2? -

as aoe, area of effect, circle, first thought came calculate distance between each unit in map center of circle, , determine unit in range of circle formula (x unit - x center ) 2 + (y unit - y center ) 2 < r 2 , r radius of circle. apparently, not efficient algorithm. maybe can improved downsizing calculating area first, , use formula above. calculations still time consuming operations, , hashing may efficient way solve problem while don't know how :( . , wonder algorithms used in games. these might help: collision detection, bounding circle http://mastrgamr.net/xna/xna-collision-detection-bounding-circle/ bounding box collision detection http://www.dreamincode.net/forums/topic/180069-xna-2d-bounding-box-collision-detection/ https://en.wikipedia.org/wiki/quadtree

wamp - Invoke php script from another using popen -

my index.php resides on wamp, , when start url invoked wish kick off php process.php script run asynchronously. when process.php script invoked index.php return , not blocked. then in future, when stop url invoked wish terminate process started. my index.php contains following: $script = "process.php"; $handle = popen ("php $script", "r"); echo $handle; both scripts reside in same directory the handle prints resource id #2 process.php not seem have been invoked. what doing wrong here?

c# - Mapping UV to a bulged triangle strip -

Image
i don't know if "bulged" correct term it's can think of right now. i'm trying map 1-pixel wide (though technically every texture have problem) image along triangle strip simulate laser. when it's uniform , square, how looks: and wireframe of that: but problem arises when slide points inwards. uv wrong, since tries map if triangle horizontal. and wireframe of that: right can't think of term search work out how i'd map it. want map stripe shrinks along strip itself, not frontal mapping. tips? i'm sure it's easy i'm not able think of right now. you want perspective correct texture mapping. see affine transformation, doesn't take depth account. this link explains problem , suggests how solve it: http://www.reedbeta.com/blog/2012/05/26/quadrilateral-interpolation-part-1/ i did myself recall pass 3rd attribute in addition uv coordinates have homogeneous texture vector passed vertex shader fragment shader. in

c++ - SFINAE overload choice for has or has not operator<<? -

consider these 2 functions: template <class type, class = typename std::enable_if</*has operator <<*/>::type> void f(std::ostream& stream, const type& value); template <class type, class... dummytypes, class = typename std::enable_if<sizeof...(dummytypes) == 0>::type> void f(std::ostream& stream, const type& value, dummytypes...); as non-variadic overload has priority on variadic overload, want check whether type has operator<< std::ostream using std::enable_if in first version. so should write instead of /*has operator <<*/ ? the following should work template <class type, class = decltype(std::declval<std::ostream&>() << std::declval<type>())> void f(std::ostream& stream, const type& value) { stream << value; } (note don't need use std::enable_if in case)

java - Android - Need to Pause playing mediafile at particular instance -

i have page consisting of 3 different buttons play | pause | stop. play | stop working fine, i'm not able pause @ particular instance. want pause playing @ instance, pressing pause button. , resume saved instance again pressing play button. below code sound.java file public class sound extends activity { mediaplayer mp = null; string play = "play!"; string stop = "stop!"; string pause = "pause"; int length; @override public void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.sound); final imagebutton play = (imagebutton) findviewbyid(r.id.idplay); play.setonclicklistener(new view.onclicklistener() { @override public void onclick(view v) { managerofsound("play"); toast toast_play = toast.maketext(getbasecontext(), "playing first&

ruby on rails - git merge .idea/workspace error -

i'm relatively new programming, i've been working ruby on rails because i'm interested in web development figured thing start with. i've been using git keep version tidy, , i've read everywhere it's habit into, it's been flaking on me lately. know it's user error, don't know i'm doing wrong , how fixed. i working on branch off of master, called layout, made bunch of changes, , merged master branch. when went master branch, changes didn't seem commit , lost day's worth of work. i've since kept backup folder on desktop in case happens again. i go layout branch, redo changes made, commit it, switch master , use git merge layout it gives me error: conflict (content): merge conflict in .idea/workspace.xml the thing can seem doesn't delete these files continue working on layout branch. don't want because it's not 'proper' way things. what doing wrong? sounds you're using rubymine. make s

php - Counting the frequency in 100 arrays, want the 6 most frequent numbers to be displayed -

i display 6 frequent numbers out of 100 arrays displayed, far have this: foreach($lottotickets $i =>$ivalue) { $counts = array_count_values($tickets); arsort($counts); $list = array_keys($counts); var_dump($list); } but shows frequency seperate arrays, not want. the below code fetch 6 frequent elements among 100 arrays: $freqarr = array(); foreach($allarrays $array) { foreach($array $num) { if(isset($freqarr[$num])) { $freqarr[$num] += 1; } else { $freqarr[$num] = 1; } } } arsort($freqarr); $counts = array_slice($freqarr, 0, 5); $list = array_keys($counts); var_dump($list);

c# - soap client working from console app, timeout when called from within wcf service -

Image
here deal: have class library makes calls web service via soap client. when called within console application works fine. when called within wcf service invoked http call "endpointnotfoundexception - there no endpoint listening @ http://blablabla.asmx accept message. caused incorrect address or soap action..." both app.config , web.config contain exact same configuration client endpoint so, whats going on? way, wcf running locally visual studio. soap web service trying call located on internet. this how service model configuration looks like. using basic authentication , user , password being set in code in class library: <system.servicemodel> <bindings> <basichttpbinding> <binding name="vocalserversoap"> <security mode="transportcredentialonly"> <transport clientcredentialtype="basic" /> </security> </binding> </basichttpbinding> </bindings>

php - Using login data to direct user traffic -

i need redirect please. have piece of code , redirect user specific page. table contains username , password contain third piece of data, org name. each org have own page. --i added name of company in line 17 keep getting echo @ bottom. great. $dbc = dbconnect(); $username = "exampleuser"; $sql = "select 'password' users 'username' = '$username';"; $result = mysql_query($sql, $dbc); //run query if ($result) { $row = mysql_fetch_assoc($result); $password = $row['password']; // echo '<h2>result found '.$password.'</h2>'.php_eol; $mypassword = $_post['password']; $row = mysql_fetch_assoc($result); //$password = $row['password']; //match passwords if($mypassword == $password){ //decide send user depending on company column: $privilege = $row['company']; if

visual c++ - C++ syntax error: Getting several errors expecting ';' -

this first post/question on so. following bjarne stroustrup's book "programming: principles , practice using c++" , , trying 'switch'-statements. getting several syntax errors, like: error c2146: syntax error : missing ';' before identifier 'value', error c2143: syntax error : missing ';' before 'string', warning c4552: '*' : operator has no effect; expected operator side-effect, also, every time want use variable 'value' inside statement, a: intellisense: expected ';' error. i using visual studio 2013 rc, , not sure why can't run program. ran similar version of week ago on osx, compiling through terminal, , ran fine. ide problem here, or code? sure rookie mistake, i'm not seeing problem. i've gone through code several time. hope can me point out rookie mistake here!.. thank input, sincerly appreciate it! here code: #include "../std_lib_facilities.h" int main()

css - Firefox support for alignment-baseline property? -

does firefox have support @ alignment-baseline property ? when inspect (using firebug) svg elements alignment-baseline property has been explicitly set, firebug not list property @ (iow treats noise). no matter value assign property, appearance of displayed text never changes, further suggesting ff ignores property altogether. (one other sign ff's support property may busted link given in page cited above css documentation property dead-as-a-doornail .) assuming that, appears, ff not support alignment-baseline property, value of property closely replicate ff's default behavior? edit: example, view jsfiddle both chrome , ff; each line of displayed text displayed highlighted word has been produced code of following form: <tspan style="alignment-baseline:alphabetic">alphabetic</tspan> note lines same in ff, not in chrome. there few possible candidate values property replicate ff's default behavior (namely, auto , alphabetic , mathema

html - Susy span-columns Mis-alignment -

i have number of susy layouts working fine on site. i'm trying add has 2 column side bar on left of entire body followed 2 5 column sections. code: css $total-columns : 12; // 12-column grid $column-width : 3.5em; // each column 4em wide $gutter-width : 1em; // 1em gutters between columns $grid-padding : 0; // grid-padding equal gutters @include border-box-sizing; // part of susy .side-bar { @include span-columns(2,12); border-right: 2px solid $darkred;} .body-title { @include span-columns(10 omega,12);} .body-double-column { @include span-columns( 10 omega, 12); column-count: 2; } .body-left-column { @include span-columns( 5, 12);} .body-right-column { @include span-columns( 5 omega, 12);} html <div id="bounding-box"> <div class="side-bar"> </div> <!-- /side-bar --> <section class="body-title"> </section> <s

css - Double Line Behind Header Stops Working When Bootstrap Applied -

the stack overflow community helped me figure out how add 2 different sized lines behind section title on website. method can viewed in js fiddle: http://jsfiddle.net/dczr4/1/ it working properly, until included twitter bootstrap 3.0 css in layout. now, 2 lines appear right on top of each other, making 1 thick line behind text. can seen here: http://onedirectionconnection.com/tester/ if advice me on causing hiccup, appreciated. the css header below: .section-title{ font-family: 'lato', 'asap','quicksand', 'droid sans', sans-serif; position: relative; font-size: 30px; z-index: 1; overflow: hidden; text-transform: uppercase; text-align: center; } .section-title:before, .section-title:after { position: absolute; top: 40%; overflow: hidden; width: 50%; height: 4px; content: '\a0'; border-bottom: 3px solid #da5969; border-top: 1px solid #da5969; } .section-title:before { marg

c# - No mapping exists from object type System.Web.UI.WebControls.TextBox to a known managed provider native type -

this code sqlcommand cmd = new sqlcommand("spregisteruser", con); cmd.commandtype = commandtype.storedprocedure; sqlparameter username = new sqlparameter("@username", txtusername.text); sqlparameter password = new sqlparameter("@password", txtpassword); sqlparameter email = new sqlparameter("@email", txtemail.text); sqlparameter usertype = new sqlparameter("@usertype", sqldbtype.nvarchar, 200); usertype.value = "student"; cmd.parameters.add(username); cmd.parameters.add(password); cmd.parameters.add(email); cmd.parameters.add(usertype); con.open(); int returncode = (int)cmd.executescalar(); //this displays error message if (returncode == -1) any ideas? here error message no mapping exists object type system.web.ui.webcontrols.textbox known managed provider native type. description: unhandled exception occurred during execution of current web request. please review stack trace more information error , origina

c# - WebClient DownloadDataAsync current download speed -

i'm trying current download speed of webclient downloading file, when use formula i'm pretty sure should work out: stopwatch.stop(); double mselapsed = stopwatch.elapsed.totalmilliseconds; int bytesdownloaded = (int)e.bytesreceived - lastbytesdownloaded; double downloadspeed = (double)bytesdownloaded / (mselapsed / 1000); lastbytesdownloaded = (int)e.bytesreceived; stopwatch.restart(); where stopwatch stopwatch i've started started file download, lastbytesdownloaded class variable, , inside downloadprogresschanged event, download speed varies wildly off course is. for example if downloading file @ 500kb/s, rapidly jump (for example) 10kb/s 50mb/s randomly. i can accurate average download time making couple edits that: double selapsed = stopwatch.elapsed.totalseconds; int bytesdownloaded = (int)e.bytesreceived; double downloadspeed = bytesdownloaded / selapsed; but isn't want. how can more stable reading current download speed? you need smooth

Install new APK version of my Android app from SD card -

i fixed bug in demo version of app. it's not out on store yet, we're still testing. the phone doesn't : tells me there's apk called that. that's true, why doesn't suggest replace ? and in "apps" settings screen, "force quit" , "uninstall" greyed out - unclickable, can't app. yes, did quit app, , background service associated it. because yes, app require following permissions : full internet access system tools : prevent sleeping, disable key lock, auto-start on boot hardware controls : audio volume storage : sd card any clues or things do/check before uninstalling ? other (empty) app that's installed (an app made when discovering android testing purposes) uninstalled fine ... thanks in advance, charles possible causes know of not offering replace it: you changed package name, using same file name apk. you signed package different keystore or key. note when clicking run in eclipse, uses de

excel - Userform to specify workbook/worksheet to copy -

i appreciate on following.... i looking create userform import external worksheets open workbooks current workbook - aim use 2 drop down lists , 1 submit button: first drop down box : lists open workbooks - user clicks specify required. second box : lists worksheets within selected workbook in first box - user clicks specify required. submit button : when submit clicked, macro take copy of workbook/worksheet combination specified in dropdown boxes , paste new tab in main workbook. thanks in advance. you can list workbooks , worksheets in combo box did in post you can link workbook / worksheet combo boxes 'dependent drop down list', see post . note need on-change event fired when first combo value selected in order populate second combo. finally, can copy worksheets workbook shown in post

html - Pseudo Elements - best practice to "over-ride" the parent of a pseudo-element -

i want add href of link after link using pseudo-element not keep parent's text-decoration. code below shows "a" , "a:after" having different text-decoration. a { text-decoration: none; color:#000000; } a:after { content: attr(href); color:#999999; text-decoration: underline; padding-left: 10px; } even though text-decoration set differently both "a great link" , "www.stackoverflow.com" have same text-decoration. (see below) <a href="wwww.stackoverflow.com"> a great link </a> wwww.stackoverflow.com changing text-decoration of pseudo-element doesn't work it's specificity 1. way can solve problem adding span link itself. .underline-kludge { text-decoration:underline; } <a href="wwww.stackoverflow.com"><span class="underline-kludge"> a great link </span></a> wwww.stackoverflow.com i'm not happy solution. there better way? have add spans links

c# - LINQ Include command mvc3 and webgrid -

i'm doing asp.net mvc3 application similar amazon gift card system. have model named cards related models users, cardstatus, paymentmethod , cardhistory. i'm doing grid displays data of cards (creator, initial amount, status). i'm using webgrid display data. card can have multiple status in time, when added controller, asp generated code: public viewresult index() { var cards= db.cards.include(t => t.cardstatus).include(t => t.paymentmethod).include(t => t.users); return view(cards.tolist()); } the problem need show in webgrid latest card status generated query brings status, gives me error in webgrid "column cardstatus.status.name doesn't exists" here webgrid code: @grid.gethtml( headerstyle: "header", tablestyle: "table table-striped table-bordered table-hover", columns: new[] { grid.column("cardid", header: "card"), gr

parallel processing - moving elements between arrays in a CUDA kernel -

i stuck in simple thing , need opinion. have simple kernel in cuda copies elements between 2 arrays (there reason want in way) , __global__ void kernelexample( float* a, float* b, float* c, int rows, int cols ) { int r = blockidx.y * blockdim.y + threadidx.y; // vertical dim in block int c = blockidx.x * blockdim.x + threadidx.x; // horizontal dim in block if ( r < rows && c < cols) { // row-major order c[ c + r*cols ] = a[ c + r*cols ]; } //__syncthreads(); } i taking unsatisfying results. suggestions please? the kernel called this: int numelements = rows * cols; int threadsperblock = 256; int blockspergrid = ceil( (double) numelements / threadsperblock); kernelexample<<<blockspergrid , threadsperblock >>>( d_a, d_b, d_c, rows, cols ); updated (after eric's help): int numelements = rows * cols; int threadsperblock = 32; //talonmies comment int blockspergrid = ceil( (double) numelements /

javascript - {no answer yet} Getting comment scores from the YouTube JSON Api -

i want able retrieve comment scores youtube's json api, example: http://gdata.youtube.com/feeds/api/videos/qh2-tgulwu4/comments?v=2&alt=json&prettyprint=true i not able find hints of comment score in above link. know of way retrieve scores these comments? does url format ? http://gdata.youtube.com/feeds/api/videos?q=qh2-tgulwu4/comments&v=2&alt=json&prettyprint=true it contains gd$rating: { average: 4.737795, max: 5, min: 1, numraters: 846063, rel: "http://schemas.google.com/g/2005#overall" } (this should comment, little large one)

c - Searching number without reminder -

what main problem in algorithm,i need find smallest positive number divided 1 20 out divider... #include <stdio.h> #include <stdbool.h> int main(int argc,char* argv[]) { int num,j=2; int savenum=20; bool flag = false; while(!flag) { num = savenum; while(num%j==0 && j<=20) { num /= j; j++; } if(j>20) flag = true; else { savenum++; j=1; } } printf("done"); printf("%d",savenum); } are missing printf see intermediate results are? might idea going on internally. but don't understand you're trying solve. want result: 2*3*4*5*6*7*8*9*10*11*12*13*14*15*16*17*18*19*20 ? because think that's computing. however, you'll overflow before there , iterating point take while. if instead you're trying find smallest number divisible every number less or equal 20, may want revisit update of num /= j .

android - How to keep MediaPlayer going no matter what -

so i've been working on music player android , i've run problem i'm having trouble fixing. when user starts song, store playing song in public variable in "player" class. used determine song play next, among other things. the problem app crashes when user opens lot of other memory intensive apps. mediaplayer stops playing, , reference playing song lost. i'm pretty sure happens because these other apps claim memory app using. my question is: how can make sure mediaplayer keeps on playing? standard android music player doesn't seem have problem should possible keep playing @ times somehow. the best can host mediaplayer in foreground service.

c# - Error 1 Non-invocable member 'System.IO.SearchOption.AllDirectories' cannot be used like a method -

string[] files = directory.getfilesystementries(directorytosearch, filenametofind, searchoption.alldirectories()); just error says, can't invoke searchoption.alldirectories method, because isn't method. think want this: string[] files = directory.getfilesystementries(directorytosearch, filenametofind, searchoption.alldirectories); putting parentheses after tells compiler should execute method. confusing compiler. searchoption.alldirectories value, not method.

iphone - iOS kill myapp issue -

oct 5 16:23:07 com.apple.launchd[1] <notice>: (uikitapplication:com.gx.uxart[0x57b0]) exited: killed: 9 oct 5 16:23:07 com.apple.launchd[1] <notice>: (uikitapplication:com.hahainteractive.bookswing[0x2339]) exited: killed: 9 oct 5 16:23:07 com.apple.launchd[1] <notice>: (uikitapplication:com.nike.nikeplus-gps[0xf40f]) exited: killed: 9 oct 5 16:23:07 backboardd[28] <warning>: application 'uikitapplication:net.nyvra.nysliderpopoverdemo[0x43d]' exited abnormally signal 9: killed: 9 oct 5 16:23:07 backboardd[28] <warning>: application 'uikitapplication:com.croquis.cookiewords[0xcc22]' exited abnormally signal 9: killed: 9 oct 5 16:23:07 backboardd[28] <warning>: application 'uikitapplication:com.gx.uxart[0x57b0]' exited abnormally signal 9: killed: 9 oct 5 16:23:07 backboardd[28] <warning>: application 'uikitapplication:com.hahainteractive.bookswing[0x2339]' exited abnormally signal 9: killed

winbugs - 2 Models in JAGS - kind of 'non-trivial' case -

i trying build garch(1,1) model in jags, , simplicity let's assume mean equation follows ar(1) process. trying build 1 jags model allow joining ar(1), , garch(1,1) processes. for can achieve results building 2 separate jags models (they simplified clarity of presentation). first jags model estimates parameters of ar(1) process: modelstring=" model { (i in 2:n) { y[i]~dnorm(alpha0+alpha1*y[i-1],1) } alpha0 ~ dnorm(alpha0.mean,alpha0.prec) alpha1 ~ dunif(-1,1) } having parameter's estimates generate data of ar(1) process, obtain residuals, , variances (assuming window): alpha0=summary(output1)$statistics[1] alpha1=summary(output1)$statistics[2] y_hat=alpha0+alpha1*y[1:(dim(data)[1])] eps=y-y_hat window=30 var=rep(na, dim(data)[1]-window) (i in 1:length(var)){ var[i]=var(eps[i:(i+window)]) } the next block garch(1,1) proses in jags: modelstring=" model { (i in 2:n) { var[i]~dnorm(beta0+beta1*var[i-1]*+beta2*eps[i-1]^2,1) }

Analogue of devar in Python -

when writing python code, find myself wanting behavior similar lisp's defvar. basically, if variable doesn't exist, want create , assign particular value it. otherwise, don't want anything, , in particular, don't want override variable's current value. i looked around online , found suggestion: try: some_variable except nameerror: some_variable = some_expensive_computation() i've been using , works fine. however, me has of code that's not paradigmatically correct. code 4 lines, instead of 1 required in lisp, , requires exception handling deal that's not "exceptional." the context i'm doing interactively development. i'm executing python code file frequently, improve it, , don't want run some_expensive_computation() each time so. arrange run some_expensive_computation() hand every time start new python interpreter, i'd rather automated, particularly code can run non-interactively. how season python programmer

html - Padding is part of a link -

i wrote html-code , i've got problem. added link image, image has got padding. padding part of link image. can it, image linked ? <!doctype html> <html lang="en"> <head> <meta charset="utf-8"> <title>just testing</title> <style type=text/css> .design {background-color: orange; padding: 50px; border: thick double red; margin: 500} .design2 {background-color: yellow; padding: 10px 100px; border: thick groove red; margin: 10} .centered {text-align: center} #blink {text-decoration: underline overline;;color: red} </style> </head> <body style="background-color: lightgray"> <h1 class="centered design2">this <span style="color:red">my</span> site :d:d</h1> <a href="http://upload.wikimedia.org/wikipedia/commons/8/83/neugierige-katze.j

PHP imagecreatefrom gif() not working for animated gif -

i'm letting users upload image files desktop , using php image routines create thumbnails , resize images user's directory. doesn't seem work @ animated gif. imagecreatefromgif(), example, seems peel off first image of animation , work it. need bypass these functions complete uploaded animated gif user's directory? thanks you cannot resize animated gif image in way jpeg, bmp or other image formats. function imagecreatefromgif() not going means, take @ below link. http://phpimageworkshop.com/tutorial/5/manage-animated-gif-with-imageworkshop.html it should solve problem.

javascript - How to capture Facebook notifications? -

how capture "notifications" (events) facebook profile, preferably using javascript (but open others if that's infeasible)? request "manage_notifications" extended permission when users approve access app. may deny ability (as "extended" ), ensure app capable of working without information

asp.net - Issue with Sum on a colum in Rdlc Report -

i have rdlc report. supposing there 2 columns trval status 10000 yes 20000 yes 30000 no total= 30000 currently using expression above: =sum(iif(fields!lead_status.value = "yes", fields!trvalrange.value, 0)) assuming add trvalrange result each time yes. in case there no status=yes says 0. when there rows status=yes gives error . also trvalrange string field need sort of conversion here sum? suggestions. thank you as thought needed convert string value int can summed changed expression : =sum(iif(fields!lead_status.value = "satisfactory",cint(fields!trvalrange.value), 0)) and works perfectly.

WordPress Custom Post Types -

i trying use wordpress custom post types create support ticket system have below , working fine. add_action( 'init', 'create_support_tickets' ); function create_support_tickets() { register_post_type( 'support_ticket', array( 'labels' => array( 'name' => 'tickets', 'singular_name' => 'ticket', 'add_new' => 'add new', 'add_new_item' => 'add new ticket', 'edit' => 'edit', 'edit_item' => 'edit ticket', 'new_item' => 'new ticket', 'view' => 'view', 'view_item' => 'view ticket', 'search_items' => 'search tickets', 'not_found' => 'no tickets found', 'not_found_in_trash' => 'no tickets found in trash', 'parent' => 'parent ticket' ), 'public' => true, 'menu_position' => 15, 'supports

Time Complexity in Reversing a C++ String -

i have problem on homework reverse words in c++ string, in place, o(1) additional memory. i'm confused means o(1) additional memory. understand o(1) means, no matter how big input is, time compute constant i'm guessing should add 1 piece of memory keep track of words in reverse. suggestions? o(1) additional memory means "using @ constant additional memory." example, couldn't store copy of string, since take o(n) space, store constant number of int s, char s, etc. more generally- statements "o(1)" or "o(n)" don't refer runtimes. big-o notation way of describing functions. algorithm can't o(n), runtime can o(n). algorithm's space usage can o(1), o(n), o(2 n ), etc. hope helps!

javascript - display or read colspan value -

i created table contain colspan , rowspan. or read these colspan , rowspan value. i'm doing because want use xml generation. need value. play around code test: <!doctype html> <html> <head> <script> function displayresult() { document.getelementbyid("myheader1").colspan="2"; } function displaycolspan() { var te; document.getelementbyid("myheader1").colspan=te; alert(te); } </script> </head> <body> <table border="1"> <tr> <th id="myheader1">month</th> <th id="myheader2">savings</th> </tr> <tr> <td>january</td> <td>$100.00</td> </tr> <tr> <td>february</td> <td>$10.00</td> </tr> <tr> <td>march</td> <td>$80.00</td> </tr> </table> <br> <button type="button" o

c++ - trigger warning from boost spirit parser -

how can add warnings in boost spirit parser. edit: ... report issue position for example if have integer parser: ('0' >> oct) | int_ i able this: ('0' >> oct) | "-0" --> trigger warning("negative octal values not supported, interpreted negative decimal value , leading 0 ignored") | int_ q. can create own callback? how? a. sure. way you'd in c++ (or @ boost signal2 and/or boost log) parser(std::function<bool(std::string const& s)> callback) : parser::base_type(start), callback(callback) { using namespace qi; start %= as_string[+graph] [ _pass = phx::bind(callback, _1) ] % +space ; boost_spirit_debug_nodes((start)); } as can see, can make handler decide whether warning should ignored or cause match fail. update #1 i've extended sample show of unrelated challenges mentioned in comments (position, duplicate checking). h

android - Are there any examples or tutorials on how you can use a URL SCHEME for Line by Naver? -

i trying create application connect line , allow post messages , stamps user's account. i tried searching , did see library naver documentations either blank or in korean. thus, don't know start. there scant examples on net. have here tried doing same thing am? grateful , thankful if shed light on this! :) check http://media.line.me/howto/en/ you can share text or images in contacts or post in home.

git - How do I pull files from remote without overwriting local files? -

i trying set new git repo pre-existing remote repo. i want local files overwrite remote repo, git says first have pull remote files in , merge them. is there way pull make sure local files not overwritten remote? well, yes, , no... i understand want local copies "override" what's in remote, but, oh, man, if has modified files in remote repo in different way, , ignore changes , try "force" own changes without looking @ possible conflicts, well, weep (and coworkers) ;-) that said, though, it's really easy "right thing..." step 1: git stash in local repo. save away local updates stash, revert modified files pre-edit state. step 2: git pull to modified versions. now, hopefully, won't new versions of files you're worried about. if doesn't, next step work smoothly. if does , you've got work do, , you'll glad did. step 3: git stash pop that merge modified versions stashed away in step 1 ve

java - Why is the graphic not working when the button number 8 is pressed? -

i have code , works until bottom middle button pressed. import java.awt.*; import javax.swing.jframe; import javax.swing.jpanel; import java.awt.borderlayout; import java.awt.gridlayout; import javax.swing.jbutton; import javax.swing.jlabel; import java.awt.event.actionevent; import java.awt.event.actionlistener; public class memory extends jframe { /** * */ private static final long serialversionuid = 1l; public void paintcomponent(graphics g) { super.paintcomponents(g); g.setcolor(new color(156, 93, 82)); g.fill3drect(21, 3, 7, 12, true); g.setcolor(new color(156, 23, 134)); g.filloval(1, 15, 15, 15); g.filloval(16, 15, 15, 15); g.filloval(31, 15, 15, 15); g.filloval(7, 31, 15, 15); g.filloval(22, 31, 15, 15); g.filloval(16, 47, 15, 15); } public memory() { gridlayout h = new gridlayout(3, 3); final jframe frame = new jframe(); final jpa

sql group by time periods 10 mins -

i change time periods '1 hour' '10 mins'. and change display time '10' '10:00' declare @periodstart datetime declare @periodend datetime set @periodstart = convert(varchar(10), getdate() - 1, 120) set @periodend = convert(varchar(10), getdate() , 120) set @periodstart = dateadd(hh, datepart(hh,@periodstart), convert(varchar(12),@periodstart,112)) set @periodend = dateadd(hh, datepart(hh,@periodend), convert(varchar(12),@periodend,112)) ;with dh ( select top 144 dateadd(hour,row_number() on (order [object_id])-1,convert(varchar(12),@periodstart,112)) hodstart, dateadd(hour,row_number() on (order [object_id]),convert(varchar(12),@periodstart,112)) hodend, row_number() on (order object_id)-1 dayhour sys.columns ) select d.dayhour, count(f.hostname) 'counter' dh d left join filebackup f on f.starttime < d.hodend , f.endtime >= d.hodstart d.hodstart between @periodstart , @periodend group d.dayhour order d.dayhour

Spring MVC URL not getting resolved correctly -

i created spring project in eclipse. problem that, url not getting resolved in way think should. web.xml <servlet> <servlet-name>mvc-dispatcher</servlet-name> <servlet-class>org.springframework.web.servlet.dispatcherservlet</servlet-class> <load-on-startup>1</load-on-startup> </servlet> <servlet-mapping> <servlet-name>mvc-dispatcher</servlet-name> <url-pattern>/files/*</url-pattern> <url-pattern>/filestest/*</url-pattern> </servlet-mapping> this mvc-dispatcher-servlet.xml <?xml version="1.0"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:mvc="http://www.springframework.org/schema/mvc" xmlns:context="http://www.springframework.org/schema/context" xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xsi:schemalocation="http://www.springf

javascript - Using jQuery to check if a class exist -

is there way see if layer has sub layer specific class. so in html have; html <div class='tab'> <div class='not-loaded'></div> </div> js/jq $('.tab').contains('not-loaded'); //to return boolean or $('.tab').classexist('not-loaded'); //to return boolean basicly want check if tabs have loaded dynamic html content. test length using find if($('.tab').find('.not-loaded').length) or using has if($('.tab:has(".not-loaded")').length)

c++ - terminate called after throwing an instance of 'std::out_of_range' -

why happen program says has no errors when run terminate called after throwing instance of 'std::out_of_range' what(): vector:_m_range_check. new c++ don't understand these errors #include <vector> #include <iostream> #include <random> #include <time.h> using namespace std; using std::vector; int main() { vector<int> deck; vector<int> nums; default_random_engine eng(time(0)); uniform_int_distribution<int> dis(0, 51); int pos1; int pos2; int num1; int num2; int i; int n; int m; (i = 0; < 52; i++) { nums.push_back(i); } for(int j = 0; j < 52; j++) { cout << nums.at(i) << "\n"; } for(n = 0; n < 50; n++) { pos1 = dis(eng); pos2 = dis(eng); cout << pos1 << "\n" << pos2 << "\n"; num1 = deck.at(pos1); num2 = deck.at(pos2); } } it looks me if due typo, , should use variable 'j' in second loop. after fir