Posts

Showing posts from January, 2013

tableau - Split the visualization into smaller parts -

Image
i trying split visualization smaller parts , place them side side shown in image below. how achieve this?

ubuntu - With VirtualBox how do I boot into a newly compiled kernel? -

Image
i running ubuntu 14.04 kernel version 4.4.0-31 , compiled 4.4.31 kernel. when try boot new kernel, error message no init found: but, old kernel still boots fine.

Animate tons of markers with Google Map on Android -

i trying fade in markers on google maps fragment this: valueanimator animator = valueanimator.offloat(0, 1); animator.setduration(1000); animator.addupdatelistener(new valueanimator.animatorupdatelistener() { @override public void onanimationupdate(valueanimator animation) { marker.setalpha((float) animation.getanimatedvalue()); } }); animator.start(); it works single marker when try 200 markers performance terrible , markers appear without animation. i'm going nuts here, help/idea/suggestion appreciated. you may want check on related post . suggested use interpolator class apply animation on marker , handle in handler animation. check sample code snippet . here threads might help: move markers in google map v2 android how animate marker when added map on android? animating markers on google maps v2

mysql - Inserting reservation record to php database -

i have created reservation form housing. user fills form out , submits it. reservation record supposed made inserted reservations table. this code being inserted database record $reservationstable = "reservations"; $r1 = (rand(11111,99999)); createreservationrecord($reservationstable, [$r1, $date,$dormrecord[id], $_post["cwid"], $_post["firstname"], $_post["lastname"], $_post["class"], $_post["gender"], $_post["fullyequippedkitchen"], $_post["laundry"], $_post["specialneeds"]]); these functions transform data: function createrecord($table, $values) { echo "this working"; return insertinto($table, ["name","class","specialneeds","laundry","fullyequippekkitchen","roomsavailable","roomsreserved","roomcapacity"], $values); } function createreservationrecord($table, $values) { echo ...

java - how to add int value to Set<Integer> (HashSet<Integer>)? -

i created set , random number (type of int) want add set: private set<integer> myset = new hashset<integer>(numelements); // capacity of 'numelements' random r = new random(); int rand = r.nextint(maxval - minval + 1) + minval; myset.add(rand); // error: cannot convert int integer so tried these: 1. myset.add(rand); // error: no suitable method found add(int) 2. myset.add(integer.valueof(rand)); //error: cannot find symbol method valueof(int) 3. myset.add(new integer(rand)); // error: type parameter integer cannot instantiated directly they don't work how can add 'rand' set? i succeeded find solution solves problem of collections try add them 'int' value. created class: class number { int number; number(int num) { number = num; } } then, in code, used it: number number = new number(index); // index int type myset.add(number); // adding object collection legal

javascript - Anchor link in Bootstrap 3.7 not Working -

<ul style="font-family:'ralway', serif;" class="nav navbar-nav"> <li><a href="http://www.reachoutcelebration.com/#home">home</a></li> <li><a href="http://www.reachoutcelebration.com/#about">about</a></li> <li><a href="http://www.reachoutcelebration.com/#events">events</a></li> <li><a href="http://www.reachoutcelebration.com/#surrenderstories">surrender stories</a></li> <li><a href="http://www.reachoutcelebration.com/#globalstrategy" >global strategy</a></li> <li><a href="http://www.reachoutcelebration.com/#contact-form">contact</a></li> <li><a href="/#donate">donate</a></li...

objective c - Stripe iOS SDK - Format for State and Country While Creating Token -

i'm wondering format state , country should passing in stpcardparams while creating token in stripe ios sdk. in code, have following: stpcardparams *card = [[stpcardparams alloc] init]; card.number = self.paymentview.cardparams.number; card.expmonth = self.paymentview.cardparams.expmonth; card.expyear = self.paymentview.cardparams.expyear; card.cvc = self.paymentview.cardparams.cvc; card.addresszip = self.zipfield.text; card.addressline1 = self.addressfield.text; card.addresscity = self.cityfield.text; card.addresscountry = self.countryfield.text; card.addressstate = self.statefield.text; [[stpapiclient sharedclient] createtokenwithcard:card completion:^(stptoken *token, nserror *error) { ...... my question is, should formatting user's input state , country. for example, should be: "california, united states of america" or "ca, us" it should permi...

batch file - How to change the value of a variable in a for loop -

@echo off setlocal enabledelayedexpansion if (%1)==(/?) ( echo hilfe zur verwendung des programms: echo.aufruf des programms mit 3 startwerten oder mit keinen startwert. echo.dabei muss jeder startwert eine zahl groesser als 0 sein! goto ende ) if (%1) == () ( echo.anfangskapital eingeben: set /p anfangskapital= ) else ( set /a anfangskapital= %1 ) :checkanfangskapital if %anfangskapital% leq 0 ( echo anfangskapital muss groesser 0 sein. set /p anfangskapital= goto checkanfangskapital ) if (%2) == () ( echo.zinssatz eingeben: set /p zinssatz= ) else ( set /a zinssatz = %2 ) :checkzinsatz if %zinssatz% leq 0 ( echo zinsatz muss groesser 0 sein. set /p zinssatz= goto checkzinsatz ) if (%3) == () ( echo.anzahl jahre eingeben: set /p jahre= ) else ( set /a jahre = %3 ) :checkjahre if %jahre% leq 0 ( echo anzahl jahre muss groesser 0 sein. set /p jahre= goto checkjahre ) /l %%a in ...

Libgdx file not reading (null) when run on android device -

i'm running game android studio android phone connected pc, , i'm not getting errors not finding file when should loaded, in 'android/assets/items/' folder, file 'someshop.csv', , loaded by: bufferedreader br = new bufferedreader(new filereader(gdx.files.internal("items/"+place+".csv").file())); where 'place' = 'someshop' works fine on desktop, , can read lines: line = br.readline() however on phone, entries (text file used build button text) come 'null'. i've cleaned , rebuilt project; no help. need build , deploy (install) project on phone work? on android, internal filetype not backed actual file. rather, points entry in zip (apk). should use filehandle#reader() method obtain reader can used read file contents.

html - Bootstrap 3, how to create a navbar with a brand image and two rows of links? -

Image
i can't understand how code nav bootstrap: as can see composed of brand image on left, space , 2 rows should fit brand length , should fit window width. did doesn't work fine. when resize window nav goes off of window. <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css"> <nav class="navbar navbar-default"> <div class="container-fluid" id="nav"> <div class="row"> <div class="navbar-header"> <a href="#"><img src="~/images/logo.png" class="logo" width="308" height="130" alt="" style="float:left; margin-left:20px;margin-right:100px;"></a> </div> <ul class="nav navbar-nav"> <li class="active">link</li> <li>link</li> <li>link...

How to use iPhone Simulator on VS 2015 without running the XAMARIN Mac Agent? -

how use iphone simulator on vs 2015 without running xamarin mac agent ? i don't have mac machine. when run project, xamarin mac agent window pops " must connected build server before running application. " how should skip pop-up ? you can't run iphone simulator in visual studio without connect mac. requirement. ios applications need connected mac able debug/deploy.

Getting no response when I run the following database connection script from Groovy[Soapui] -

i trying run script groovy[soapui] not getting errors , not sql command not returning results. missing crucial here? import groovy.sql.sql import java.sql.* import com.jcraft.jsch.jsch import com.jcraft.jsch.session // ssh login string sshhost = 'test.com' string sshuser = 'test' string sshpass = 'test' int sshport = 22 // database login targethost = 'localhost' targetuser = 'test' targetpass = 'test' targetport = 3306 lport = 4328 jsch jsch = new jsch(); session session = jsch.getsession(sshuser, sshhost, sshport); session.setpassword(sshpass); session.setconfig("stricthostkeychecking", "no"); system.out.println("establishing connection..."); session.connect(); int assinged_port=session.setportforwardingl(lport, targethost, targetport); connection con = null; string driver = "org.mariadb.jdbc.driver"; string connectionstring = "jdbc:mariadb://" + targethost +":" + lpo...

java - Trying to change a string to altcase -

trying write code makes string become altcase (ie. "hello" becomes "hello". borrowed code question on forum asked similar ( java case switcher ) however, code switched casing of letter instead of having capital letter (first), lowercase letter, etc. pattern. what have far: public string altcase(string text) { string str = ""; (int = 0; <= text.length(); i++) { char ca = text.charat(i); if (text.charat(0).isuppercase) { str += character.tolowercase(ca); } if (text.charat(0).islowercase) { str += character.touppercase; } if(i != 0 && character.isuppercase(ca)) { if (text.charat(i)-1.isuppercase || text.charat(i)+1.isuppercase) { str += character.tolowercase(ca); } else { str += ca; } } if(i != 0 && character.islower...

actionscript 3 - How can I order my string in as3 -

a complex question : i've got code (not complete code, essentials question, think) : var $pmm:string; var $pms:string; var $bmm:string; var $bms:string; function haute1():string { return $pmm; }; function haute2():string { return $pms; } function basse1():string { return $bmm; }; function basse2():string { return $bms; }; accueil.todayhaute_txt.htmltext = haute1; accueil.todaybasse_txt.htmltext = basse1; accueil.todayhautesecond_txt.htmltext = haute2; accueil.todaybassesecond_txt.htmltext = basse2; "haute1" hour (in 24h format). "13h25". it changes everyday. question : how can put them in ascending order in as3 ? example : if haute1 = 15h20, haute2= 6h00, basse1= 11h , basse2 = 17h, function put them in order : " haute2 ", " basse1 ", " haute1 " , " basse2 ". thx edit i add code have. helping ? / assigns hours , tidal heights $pmm = convdateheure($tpbs[1 ...

spring mvc - How to remove records simultaneously? -

case: in package have class performs activirt patients & doctors patient specifict operations( post , get , put , delete ) done patient controller, doctor specifict operations( post , get , put , delete ) done doctor controller there are: 4 doctors: a, b, c , d; 50 patients - 1 of them name z one doctor have multiple patients one patient can consult multiple doctors patient z consults doctors a, b & d. question: how to, upon deletion of patient, remove each of doctors attends, , upon deletion of doctor, remove patients attended him? if understand use case correctly , want doctor attended patients x, y, z… doctor b attended patients x, y, z… doctor c attended patients x, y, k… ( doctor c did not attended patient z). doctor d attended patients x, y, z… now looking in list of patients attended doctor a, , deleted patient z list. , patient z should deleted list of doctor b , d. want model data cassandra database. we need remember goa...

javascript - Having issues responding to an HTTP request with the proper array. Possible way to send results from within function with expressjs? -

problem summary: i'm working on program has sql database on backend , i'm using npm sqlite3 module talk it. when make http request server told in post should res.send function inside after function ran, return whatever came function. easy enough right? ran issue asynchronous function .all (api doc here) . happens call database , returns inside object inside database.all, database.all asynchronous function void , can't return anything. i've got callback sends object inside callback, don't know there, or if need callback. so question is: can send http response somewhere inside .all function or callback, or function have return array called? code below show mean. chain of events (github repo refrence) : i've set angular controller send following http request when page loads: $http.get('/loadwaitinglist') .then(function(response) { // alert("http request set, getting data"); console.log(response.data); }); and when server (...

serialization - How to fix "java.io.NotSerializableException: org.apache.kafka.clients.consumer.ConsumerRecord" in Spark Streaming Kafka Consumer? -

spark 2.0.0 apache kafka 0.10.1.0 scala 2.11.8 when use spark streaming , kafka integration kafka broker version 0.10.1.0 following scala code fails following exception: 16/11/13 12:55:20 error executor: exception in task 0.0 in stage 0.0 (tid 0) java.io.notserializableexception: org.apache.kafka.clients.consumer.consumerrecord serialization stack: - object not serializable (class: org.apache.kafka.clients.consumer.consumerrecord, value: consumerrecord(topic = local1, partition = 0, offset = 10000, createtime = 1479012919187, checksum = 1713832959, serialized key size = -1, serialized value size = 1, key = null, value = a)) - element of array (index: 0) - array (class [lorg.apache.kafka.clients.consumer.consumerrecord;, size 11) @ org.apache.spark.serializer.serializationdebugger$.improveexception(serializationdebugger.scala:40) why? how fix it? code : import org.apache.kafka.clients.consumer.consumerrecord import org.apache.kafka.common.serializa...

SQL Statement WHERE clause -

i have 2 tables in database. 1 applicants , being programmedetail . in programmedetail , capture minimum required applicant . when applicant sign programme, tied programmeid . however, when sql statement, using innerjoin , where clause, kept getting error. programmedetail table sample data: ------------------------------------------- | programmeid | programmerequirement | ------------------------------------------- | p01 | 20 | ------------------------------------------- applicant table sample data: ----------------------------------- | applicantid | programmeid | ----------------------------------- | a001 | p01 | ----------------------------------- | a002 | p01 | ----------------------------------- desired output: ------------------------------------------- | programmeid | programmerequirement | ------------------------------------------- | p01 | 20 ...

github - Remove a git commit between two commits -

i added functionality in project took 4 git commits, business asking functionality no more needed(after more month). need remove particular git commit(s) repo has 27 more commits after that. there 4 ways of doing so: clean way, reverting keep in log revert: git revert --strategy resolve <commit> harsh way, remove altogether last commit: git reset --soft "head^" rebase (show log of last 5 commits , delete lines don't want, or reorder, or squash multiple commits in one, or else want, versatile tool): git rebase -i head~5 and if mistake done: git rebase --abort quick rebase: remove specific commit using id: git rebase --onto commit-id^ commit-id alternatives: try: git cherry-pick commit-id yet alternative: git revert --no-commit as last resort, if need full freedom of history editing (eg, because git don't allow edit want to), can use very fast open source application: reposurgeon . note: of course, these changes done lo...

c - pthread_create passing arguments -

what wrong code? in function() , offset value printing -1 . expect value 10 . offset -1 giving sum = -1000 . note :offset stored in heap memory. test() prints expected output. #include<stdio.h> #include<stdlib.h> #include<pthread.h> pthread_t thread[2]; int sum = 0; void* function(void *arg){ int i; int offset = *((int *)arg); printf("offset = %d \n",*(int *)arg); for(i=0;i<1000;i++){ sum = sum+offset; } printf("\n sum = %d \n",sum); pthread_exit(null); } void test(void* val){ int offset = *((int *)val); printf("inside test function.offset = %d \n",offset); } int main(){ int ret; int *offset = (int *)malloc(sizeof(int)); *offset = 10; test(offset); ret = pthread_create(&thread[0], null, &function,(void *)offset); if(ret!=0) printf("pthread create error \n"); pthread_join(thread[0],null); return 0; } output: inside test function.offset...

How to support variable length arrays in OpenCL linux -

my kernel contains private variable length arrays. kernel can compiled , executed in mac, fails in linux opencl. in linux, error error: variable length arrays not supported in opencl . so, how support variable length arrays in linux opencl? try opencl kma (kernel memory allocator) see https://github.com/rspliet/kma it implements malloc , free opencl

javascript - chrome.cookies: A simple way to remove all cookies of a single domain? -

i using chrome.cookies store , remove cookies in chrome extension. when extension installed, want remove cookies of server domain. at moment, cookies , remove them 1 one loop. isn't there easier way achieve this?

ios - find objects matching id parameter in json -

i've got json contains mixture 2 kind of objects modela , modelb modela has array contains mixture of both. modelb single item. both modela , modelb has id parameter. what best , fastest way find object (may modela or modelb) using id parameter , return object. { "id": 23, "items":[ { "name":"g", "id":10 }, { "id":90 , "items":[ {"name":"a" , "id":11}, {"name":"s" , "id":12}, {"id":93 , items […]}, {"name":"d" , "id":15}, ] }, { "id":92 , "items":[…] } ] } modela has id , items. modelb has id. items array of modela s , modelb s. and each id unique. thanks. i assume have parsed json file [string: anyobject] swift dictionary. method 1: i...

java - How to draw a rectangle moving in a circle around the center of the canvas? -

Image
the code meant draw rectangle, moves in circle around center of canvas 1 time. code have import java.awt.graphics; import java.awt.graphics2d; import java.awt.event.actionevent; import java.awt.event.actionlistener; import java.awt.geom.rectangle2d; import javax.swing.timer; import javax.swing.jcomponent; import javax.swing.jframe; public class q3_circular extends jcomponent { protected int degree = 0; protected double xstart; protected double ystart; protected timer timer; public q3_circular() { timer = new timer(1000, new timercallback()); //creates new times refreshes every 100 ms, , called timercallback class timer.start(); } protected class timercallback implements actionlistener { public void actionperformed(actionevent e) { if (degree < (2 * math.pi)){ xstart = getwidth()/2 * math.cos(degree+1); ystart = getheight()/2 * math.sin(degree+1); degree+= 1; repaint(); } else { ...

cordova - Temporarily Storing Images in Phonegap App -

i want store images , text info same images in phonegap app temporarily. receive images in json format php web server, images base64 encoded. i have seen things using sqlite plugin doesn't support blobs can't store image in database. have seen imgcache.js documentation doesn't seem work me. tried use localstorage , set ajax data key image sizes passed allowed 5mb storage limit. i'm making app similar instagram , want give app offline capabilities.what want when when user clicks on button go lets his/her user profile page "user.html" see images right there when offline instead of blank page waiting ajax data come web server. can please show me how phonegap. thanks! some sample code helpful

android - Send SMS via NFC -

i have contactless nfc card. can send sms sim card in phone card ? no, can send/receive sms via gsm network.

html - Which video formats are accetable? -

i search in google , didn't found. want know, when use input file that: <input type="file" accept="video/*"> which video formats can uploaded? i try upload .flv & browser ignore it. is there different between browsers ? mobile browsers? form controls need name attribute otherwise form they're associated ignores them: <input type="file" name="upload" accept="video/*"> as video formats allowed, depends on os , browser. example, on system (window 10), firefox preselects these extensions: *.avi;*.divx;*.flv;*.m4v;*.mkv;*.mov;*.mp4;*.mpeg;*.mpg;*.ogm;*.ogv;*.ogx;*.rm;*.rmvb;*.smil;*.webm;*.wmv;*.xvid

android - onViewCreated - wrong place to replace fragment? -

i'm showing empty fragment if user has no data. in emptyfragment (in onviewcreated ) check condition , replace empty fragment one, call method on according activity replaced fragment. some users (currently samsung, 6.0.1 don't know if means anything) experience crash on line executependingtransactions : illegalstateexception: fatal exception: java.lang.runtimeexception unable resume activity {....app.activities.myactivity_}: java.lang.illegalstateexception: fragmentmanager executing transactions is bug in 6.0.1 or onviewcreated wrong place this? edit would possible solution? if (addtobackstack) { getsupportfragmentmanager().begintransaction().replace(r.id.fragment_container, contentfragment, name).addtobackstack(name).commitallowingstateloss(); getsupportfragmentmanager().executependingtransactions(); } else { getsupportfragmentmanager().begintransaction().replace(r.id.fragment_container, contentfragment, name).commitnow(); ...

c# - How to add/remove child nodes from textbox to the selected node in combobox -

Image
i'm adding items combobox treeview @ run-time. the code goes follows: private void form1_load(object sender, eventargs e) { combobox1.selectedindex = 0; string[] items = new string[combobox1.items.count]; (int = 0; < combobox1.items.count; i++) { items[i] = combobox1.items[i].tostring(); treeview1.nodes.add(items[i]); } } now want add child node selected node in combobox. when add child root node - 2 goes @ bottom, displayed in picture above. private void addchildnodebutton_click(object sender, eventargs e) { treeview1.nodes.add(combobox1.text, textbox1.text); } to add selected note, use selectednode method, , instead of using combox1 dropdown, can select node in tree, below: private void addchildnodebutton_click(object sender, eventargs e) { treeview1.selectednode.nodes.add(textbox1.text) } if want use combobox, little slower since first have search ...

java - How to give data to recyclerView using getters and setters in fragment. The data stored in a class as String Array -

my aim build recyclerview gridlayoutmanager 5 columns in fragment. i call boardfragment in mainactivity's oncreateview public class mainactivity extends appcompatactivity { public static final string board_fragment = "board_fragment"; public static final string board_number_index = "board_number_index"; @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_main); numbermodel number = new numbermodel(); number.setnumbers(arrays.tostring(boardnumbers.numbers)); boardfragment boardfragment = new boardfragment(); bundle bundle = new bundle(); bundle.putparcelable(board_number_index, savedinstancestate); boardfragment.setarguments(bundle); fragmentmanager fragmentmanager = getsupportfragmentmanager(); fragmenttransaction fragmenttransaction = fragmentmanager.begintransaction(); ...

java - SAXParseException - The entity "szlig" was referenced, but not declare. Error by XML validation? -

please helm me. i have xml string validating. , sometimes, document not pass validation. because there word "weiß". how fix , other similar errors? understand swears on letter "ß". strange behavior, first time error thrown, second time, same line valid. use xerces library. org.xml.sax.saxparseexception; linenumber: 19; columnnumber: 17; entity "szlig" referenced, not declare validation schemafactory factory = new xmlschemafactory(); try { inputstream stream = thread.currentthread().getcontextclassloader().getresourceasstream(wtconstants.xsd_validator); if (xmlstring.startswith("\ufeff")) { xmlstring = xmlstring.substring(1);// remove bom } schema schema = factory.newschema(new streamsource(stream)); validator validator = schema.newvalidator(); validator.validate(new streamsource(new stringreader(xmlstring))); } catch (saxexception | ioexception e) { logger.error("validation error: ", e)...

android - Unable to register with GCM -

i'm trying initialize sns push services based on gcm push services on android app. app working great on former device, samsung galaxy s5. recently, i've changed phone xiaomi redmi 3s prime. on first time i've installed on new phone i've got error log: e/gcmtokenhelper: unable register gcm. main_thread java.io.ioexception: main_thread @ com.google.android.gms.iid.instanceid.gettoken(unknown source) @ com.google.android.gms.iid.instanceid.gettoken(unknown source) @ com.amazonaws.mobile.push.gcmtokenhelper.updategcmtoken(gcmtokenhelper.java:79) @ com.amazonaws.mobile.push.pushmanager.registerdevice(pushmanager.java:202) ...

Remove last slash $request_uri nginx -

i'm trying redirect nginx http traffic incoming web server port 8443 in https. nginx configuration follows: server { listen 80 default_server; return 301 https://$host:8443$request_uri; } unfortunately, configuration leads following result: if visitor pointing http://host nginx redirects him https://host/:8443 , doesn't work. i found way fix using return: return 301 https://my.host.ip.address:8443; however, prefer keep variables $host , $request_uri

python - How to autocomplete list of all arguments to function in PyCharm? -

how autocomplete list of arguments function in pycharm? i want autocomplete arguments function in pydev. def do(a, b, c): pass after typing do(<cursor here>) want autocomplete to do(a, b, c) - possible in pycharm or hidden much. useful in large programs. now can autocomplete single argument not enough. according documentation ( https://www.jetbrains.com/help/pycharm/2016.1/auto-completing-code.html ) you can these things in pycharm autocompletion of code -- i'm understanding need with: basic code completion on ⌃space. type completion on ⌃⇧space. completing punctuation on ⏎. completing statements smart ⏎. completing paths in select path dialog. expanding words ⌥/. see documentation link above more detailed info on each. lots of pictures , each of above. hope helps.

Counting how many words each line has in at text file with Python (using str.split) -

i have 2 files, 1 input "our_input.txt" (same directory code file), oscar wild's dorian gray. anyway, there's output file, , need open original file, , let python count how many words each line has, , write in output. i tried, got lost... you can try this. first read input file: with open('our_input.txt') f: lines = f.readlines() then count number of words per line , write output file: with open('our_output.txt', 'w') f: index, value in enumerate(lines): number_of_words = len(value.split()) f.write('line number {} has {} words.\n'.format(index + 1, number_of_words))

Error sending iOS push notifications using PHP -

i'm getting following error when trying send 'push notifications' connecting apns using php: warning: stream_socket_client(): ssl operation failed code 1. openssl error messages: error:14090086:ssl routines:ssl3_get_server_certificate:certificate verify failed warning: stream_socket_client(): failed enable crypto warning: stream_socket_client(): unable connect ssl://gateway.push.apple.com:2195 (unknown error) here code: $payload = '{"aps":{"alert":"' . $message . '","sound":"default"}}'; $ctx = stream_context_create(); stream_context_set_option($ctx, 'ssl', 'local_cert', 'certificate.pem'); stream_context_set_option($ctx, 'ssl', 'passphrase', $passphrase); stream_context_set_option($ctx, 'ssl', 'cafile', 'entrust_2048_ca.cer'); $fp = stream_socket_client('ssl://gateway.sandbox.push.apple.com:2195', $err, $errstr, 60, ...

ios - why do i can't launch the simulator? error:"Could not find simulator for com.apple.platform.iphonesimulator" -

the error message "could not find simulator com.apple.platform.iphonesimulator" have upgrade macos 10.12 , , i'm using xcode 7.1 beta . have load ios 8.2 simulator after upgraded xcode newest 8.1, thing works well! guess it's question of old xcode 7.1 beta.

java - how to trigger an imagebutton programmatically in android studio -

i want trigger imagebutton according value gets stored in variable. eg: let variable amount. if amount<10 , amount>50 imagebutton should triggered. here, through imagebutton i'm turning on , off flashlight. so, if the amount>10 , <30 flashlight turns on amount>30 , <50 flashlight turns off secondly, i'm getting value in string form function, converted integer , stored in amount variable. java code: integer amount; public void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); log.d("bluetooth_torch", "oncreate()"); setcontentview(r.layout.activity_bluetooth_torch); mtorchonoffbutton = (imagebutton)findviewbyid(r.id.button_on_off); istorchon = false; boolean isflashavailable = getapplicationcontext().getpackagemanager() .hassystemfeature(packagemanager.feature_camera_flash); if (!isflashavailable) { a...

Print First Letter of Each Word in a String in Python (Keep Punctuation Marks) -

first post site apologize if wrong. have looked appropriate answer, not find one. i new python , have been playing around trying take long string (passage in book,) , printing first letter of each word while keeping punctuation marks (though not apostrophe marks.) , have been unsuccessful far. example: input = "hello, i'm writing sentence. (though not one.)" code.... output = h, w s. (t n g o.) --note ",", ".", "()", not " ' ". any tips? thank taking time look to on adventure, i'll give step-by-step logic of it in python first use .split() seperate spaces go through each string in list go through every char in string print punctuation marks specify , first alphabetical character find

twitter bootstrap - Jekyll Blog won't load CSS -

i have cloned jekyll bootstrap installation github pages. working css , javascript aren't being loaded in website. looks barebones html site. here website: https://heavensgospel.github.io/ it's working now here website's files: https://github.com/heavensgospel/heavensgospel.github.io any appreciated. love, love, thank you! apparently files missing file system. /assets/themes/bootstrap/css/ folder seems contain 1 file style.css , while other files seem missing. similarly, javascript files missing.

Giving different names to a html object in a loop in PHP -

how able give different things different names (as creating them in loop) can use data? modify name=\"type\" maybe include $x within name different each time? for($x=0; $x<=$noquestions-1; $x++){ echo "<table>"; echo "<tr>"."question ".($x+1).": ".$question[$x]."</tr>"; echo "<form method=\"post\">"; echo "<select class=\"form-control\" type=\"text\" name=\"type\" required>"; echo "<option value=\"1\">".$optiondata[$x][0]."</option>"; echo "<option value=\"2\">".$optiondata[$x][1]."</option>"; echo "<option value=\"3\">".$optiondata[$x][2]."</option>"; echo "<option value=\"4\">".$optiondata[$x][3]."</option>"; echo ...

unix - Pipeline composed of tr, cut, and xargs does not work -

a program produces sporadically new output on command line. process each new line, , send data via telnet remote server. the initial command line tab-limited, interested in sixth field: 2016-11-08 21:27:01 +0000 017ef7cb-9196-4386-befa-90823e5972a0 47373226168780 ee6626b0-0c65-45d9-b644-40ea42bdc5b7 sleep 9.001473012 0 0 my command looks likes this: $my_application | stdbuf -i0 -ol tr -s '\t' ' ' | cut -d' ' -f8 | xargs -0 -n1 -i time echo runtime time `date +%s`000 | nc <ip> <port> i able filter out 9.001473012 using 'cut' command. term not propagated xargs. nc final step in pipeline, unable reach yet. could please me? don't understand why result 'cut' not piped xargs. there issue tr/cut, found hint use 'stdbuf'. did not me 'cut' or 'xargs' later on. best labrassbandito

PHP Session array not maintained when calling script from iOS app -

i have php script on server. started testing using postman chrome. worked flawlessly. however, if make call same exact url through afnetworking, session array in php not maintained. another interesting issue, if run script localhost using mamp, session array maintained in ios app well. what problem? update: using hostgator , have found session_id() keeps changing when called ios app not postman. neither change on localhost. update 2: session_id() keeps changes if app terminated, , call sign in again on viewdidload without signing out before app terminated. see solution below! yeah bound happen. browser job of handling session data. ios app calling edge needs read cookie data http header session , handle manually. read headers response, store session cookies , add them while making subsequent requests. otherwise stripped. i don't know how in ios app since web developer. sorry that.

java - Android SQLite greater than query isn't working how I expect it to -

okay i'm missing fundamental here can't figure out is. the problem: i'm writing unit test database query search shifts have happened after date (the dates i'm storing in epoch milliseconds) logic dictates construct query shift start dates greater than specified date, seems simple enough yet test failing, , weirdly when flip greater lesser test passes o_o. this query: public cursor getautoclockedshifts(long datesince) { string sortorder = col_start_date + " desc"; string selection = col_added_manually + " = " + "?" + " , " + col_start_date + " > " + "?"; string[] selectionargs = {"0", datesince.tostring()}; cursor = database.query(false, gettablename(), null, selection, selectionargs, null, null, sortorder, null); return cursor; } this fake data i'm using unit test: private hashmap<string, ?> createshifthashmap(){ hashmap<string, object> val...

linux - In which condition "nice" command's return value will be 33? -

"nice" command returning value 33. please me understand why nice returning value 33. in systems works fine giving return value 0 on system gives me return value 33. nice -n -10 <doing process here> returnvalue=$? here returnvalue gets value 33 in spite of 0. it looks nice(1) returning exit code of niced command * . try nice bash -c 'exit 13' ; echo $? and 13. niced command got exit code of 33. can't tell how that happen, because don't tell command nicing. btw, shells might have nice builtin might use explicitly /usr/bin/nice instead of nice note *: when nice fails (e.g. nice -n -12 id without being root), says stderr exit 0

Gulp task output missing file -

i cant create output.css file in root directory via gulp .. want output compressed 1 file stylesheet, gulp doesnt work them. i have structure - bower_components - bootstrap - sass - custom.scss - output.css my gulp file: var gulp = require('gulp'), sass = require('gulp-sass'), watch = require('gulp-watch'); var concat = require('gulp-concat'); gulp.task('scss', function () { return gulp.src('bower_components/bootstrap/scss/_custom.scss') .pipe(sass({outputstyle: 'compressed'})) .pipe(concat('output.css')) .pipe(gulp.dest('./')); }); gulp.task('watch', function () { gulp.watch('bower_components/bootstrap/scss/_custom.scss', ['scss']); }); gulp.task('default', ['watch']); you forgot include 'scss' task in default ...

swift - Realm-iOS: Model object becomes nil when it's added to realm -

it's rss reader app. instantiate model object, call setupfavicon() on download favicon nil when creating object. add each object realm. when icon fetched, self nil, can't update app's ui. don't understand why self becomes nil. class article: object { dynamic var source = "" dynamic var title = "" dynamic var link = "" dynamic var pubdate = date() dynamic var favicon: data? dynamic var favicondidload: (() -> ())? func setupfavicon(_ source: string) { downloadmanager.sharedinstance.downloadfavicon(source) { [weak self] icon in if let icon = icon { self?.favicon = icon self?.favicondidload?() } } } override class func primarykey() -> string? { return "link" } override class func ignoredproperties() -> [string] { return ["favicondidload"] } } closure favicondidload defined in tableviewcell class , invoked when favicon downloaded. fil...

angularjs - Error during Karma Test execution -

i have problem current directives build following : selectprice.directive.js file (function() { 'use strict'; angular .module('app.buyouts.selectprice') .directive('selectprice', selectprice); however when starting karma, following error: chrome 54.0.2840 (windows 7 0.0.0) error uncaught referenceerror: angular not defined @ app/buyouts/selectprice/selectprice.directive.js:5 i don't know do. maybe directives aren't created properly? can u please help. you need add angular karma.config.js example: module.exports = function(config) { config.set({ // base path, used resolve files , exclude basepath: '../..', frameworks: [ 'mocha' , 'chai' ], // list of files / patterns load in browser files: [ 'assets/libs/angular.min.js', 'assets/libs/angular-cookies.min.js', 'assets/libs/angular-route.min.js', 'assets/libs/angula...