Posts

Showing posts from April, 2013

Submitting a Watchkit App to the Appstore - do I create a new App or is it somehow part of my iPhone App -

Image
i tried load app itunesconnect today got error during build re. no provisioning profile found (when run iphone app works fine , has been fine while now). assume because have added watchkit app. how resolve ? do need create new app in itunesconnect watchkit app ? thanks. you don't need create new app watch app. it's part of main app extension . you resolve problem just signing out account settings in xcode , signing in again . worked me. first of click onto accounts tab. then select apple-id , click minus. then click onto plus button , add apple-id once again.

ubuntu server - mysql performance_schema missing tables -

using mysql 5.6.19 on ubuntu box, installed sudo apt-get install , missing few tables (got alert workbench when trying use performance reports). these tables have in performance_schema: +----------------------------------------------+ | tables_in_performance_schema | +----------------------------------------------+ | cond_instances | | events_waits_current | | events_waits_history | | events_waits_history_long | | events_waits_summary_by_instance | | events_waits_summary_by_thread_by_event_name | | events_waits_summary_global_by_event_name | | file_instances | | file_summary_by_event_name | | file_summary_by_instance | | mutex_instances | | performance_timers | | rwlock_instances | | session_connect_att

c++ main function, argc value is weird if command-line arguments contain * -

a simple piece of c++ code this: int main(int argc, char **argv){ std::cout << "argc: " << argc << std::endl; } compiled g++ -o hello hello.cpp when run ./hello u , output argc: 2 ; when run ./hello u + , output argc: 3 ; when run ./hello u * , output argc: 26 , why 26 ? shell expansion. * expanded shell files in current directory, of there appear 24, , passes them individual arguments program. since looks call unix shell, use ./hello u \* or ./hello u '*'

Akka's TestProbe expectMsg to match if expected message is among sent -

i have test particular actor. actor depends on other actors, use testprobe() test in isolation. problem is, receive more messages interested in testing @ particular test. example: val = testprobe() val b = testprobe() val actor = testactorref(new myactor(a.ref, b.ref)) actor ! message(1, 2) b.expectmsg(3) the test fails, because while creating myactor sends kind of "registration" message ones passed in constructor. the message 3 arrives eventually, assertion fails - not first message arrive. avoid asserting more messages need test - can change, etc, not scope of particular test anyway. as testprobe not contain such methods - suspect there may wrong test setup (or rather project architecture then). see there many methods fishformessage require explicit time parameters seems irrelevant whole test purely synchronous. is there way accomplish such test desired message among received? if not, how can setup can improved easy testable? the fishformessage

.htaccess - Website URL redirects to name/%20/auth/login -

i have website hosted on godaddy. when enter url thehotkey.in, url redirects thehotkey.in/%20/auth/login gives me blank page. when go : thehotkey.in/auth/login, gives me distorted login form. every button click on , example, if click on register button on login page, redirects thehotkey.in/%20/auth/register gives me blank page. if go thehotkey.in/index, gives me blank page well. there sort of mis-redirection cant figure out how tackle it. here my.htaccess more help: <ifmodule mod_rewrite.c> rewriteengine on rewritebase / rewriterule ^index\.php$ - [l] rewritecond %{request_filename} !-f rewritecond %{request_filename} !-d rewriterule . /index.php [l] rewriterule ^index.php/(.*)$ [l] </ifmodule> ( didnt write code, bought code) any suggestion appreciated. the base url in fx_cpnfig file had space @ end of url address. due this, sae %20 in every redirected url . alright after removing space.

cordova - error of using purecomputed function of knockoutjs in devextreme -

this dxview:- using knockoutjs in visual studio. <div data-options="dxview : { name: 'home', title: 'home' } " > <div class="home-view" data-options="dxcontent : { targetplaceholder: 'content' } " > <p>first name: <input data-bind="value: firstname" /></p> <p>last name: <input data-bind="value: lastname" /></p> <h2>hello, <span data-bind="text: fullname"> </span>!</h2> </div> </div> this javascript in visual studio using devextreme:- myfirstproject.home = function (params) { var viewmodel = function (first, last) { this.firstname = ko.observable(first); this.lastname = ko.observable(last); this.fullname = ko.purecomputed(function () { return this.firstname() + " " + this.lastname(); },this); }; ko.applybin

c# - Migrate Post action to web forms -

i have action on mvc application , need same thing in application uses web forms. i'm sorry if such stupid thing i'm not expert on web forms. this action: [httppost] public actionresult login(string username) { } how do httppost in web form? update i discovered if put (page.request["login"]) in code i'm able retrieve post parameters. i believe want use httpwebpost class class. something private void onpostinfoclick(object sender, system.eventargs e) { string strid = userid_textbox.text; string strname = name_textbox.text; asciiencoding encoding=new asciiencoding(); string postdata="userid="+strid; postdata += ("&username="+strname); byte[] data = encoding.getbytes(postdata); // prepare web request... httpwebrequest myrequest = (httpwebrequest)webrequest.create("http://localhost/default.aspx"); myrequest.method = "post

Complete word-database for Java-App to check if a word is actually a legit word, is SQL appropriate in this case? -

i going write game in have have check if string of letters word or not. question how fastest least computation-able power possible (for instance old smart-phone). if possible not start-up time make quick , responsive app. i once did look-up first reading in word-file words appropriate sized hash-map of around 650,000 words*. (* might more, not sure if exhausted list yet). would sql database appropriate here? thinking of buying book can learn , implement one. have no idea how create hash-map, save later , load one. of hacker solution or technique used more often? make sense me learn sql or saving hashmap , later restoring it. a database sql appropriate if plan query every time need check word, not fastest solution; querying every single word slows down response time should use less memory if words number high (you must measure memory consumed db vs memory consumed map). checking if word inside map not computationally expensive, must calculate hash , iterate on array of

cordova - phonegap navigator.app.exitApp in windows, advice sought -

i have phonegap app working in both ios , android , planning release on windows phone. have used navigator.app.exitapp in android not in ios heard apple interpret crash. is there such advice using in windows phone? i didn't encounter problems using it, our app approved , still in store. it's alright use it.

security - Lock rptdesign file -

i trying find out if possible lock rptdesign file. the idea run report service, without being able change default parameters. know hide parameter window still user edit rptdesign file , hard code new values. does has previous experience this? is possible make rptdesign file non-editable? if want prevent users modifying rptdesign file, should on os level enable users.

ios - Array of arrays in Swift -

i want make , array contains arrays, of double's, of int's. this not work: var arrayzero = [1,2,3] var arrayone = [4.0,5.0,6.0] var arrayofarrayzeroandone: [[anyobject]] = arrayzero.append(arrayone) how can append arrays array can 5.0 if write arrayofarrayzeroandone[1][1] ? i take advantage of swift's type safety. going route introduce bugs if you're not careful adding , retrieving array. var numbers = array<array<nsnumber>>() // bit clearer imo var numbers = [[nsnumber]]() // way declare numbers.append(arrayzero) numbers.append(arrayone) then when like let 5 = numbers[1][1] // 5.0 you know of type nsnumber. further swift won't let put else array unless it's nsnumber without appends solution var numbers = array<array<nsnumber>>() [ [1,2,3,4], [1.0,2.0,3.0,4.0] ]

stress testing - Gatling. Live users. Remotely closed / Connection timeout -

i'm trying exec scn.inject(constantuserspersec(300) during (300 seconds) randomized), when running, number of active users growing fast around 2000. connection either 'timeout' or 'remotely closed' few questions: why though define 300 users per second have 'active users' grow 2k. i'm testing on local environment test mysql database performance. guess fails because of system requirements and/or configuration. anything can ? if users don't terminate fast enough (long test journey, long response times), you'll 2k concurrent users within 7 sec (2000 / 7).

javascript - setTimeOut AFTER jQuery form submit -

here deal: have form, takes quite time submit, because i'm waiting third party web services. i'm trying achieve is, after submit button clicked, gets disabled, assigned special class , if takes more 5 seconds submit form, notice displayed. i've came this: $('#register_index_button').click(function(){ $(this).addclass('bt_button_loader'); $(this).val('please wait'); $(this).attr('disabled', 'disabled'); $('#register_index_form').submit(); //it takes more 5 seconds, display notice settimeout(function() { $('#notice').html('still waiting ...'); }, 5000); }); everything works fine, except timeout function. guess after submit form jquery, else after ignored? thank help! try attaching event handler on form "submit" event. put timeout event handler function. ( https://developer.mozilla.org/en-us/docs/web/events/submit ) $('#register_index_form').on('submit', fun

Eclipse StatET for R can't find installed libaries (windows) -

i have working eclipse workspace r development using statet plugin. can install libraries normal way, example: install.packages("rgdal") but when attempt use library: library(rgdal) r says: error in library(rgdal) : there no package called 'rgdal' using r gui on same computer works fine. also, in case relevent - using installed.packages() doesn't show newly installed rgdal package when use eclipse. in r gui does. it turns out, having eclipse , r gui open @ same time causing conflict, closing down r gui solved issue

php - Universal multiple file uploader for Laravel 5 -

i want create universal multiple file uploader, don't know approach should choose develop it. i have attachment model , attachments table in database. have model item , table items. these 2 connected via item_attachment table (maybe morph connection in future, many models can have attachments). i thought several approaches (examples create form item): use js uploader (like dropzone) , develop separate controller handle uploads (attachmentscontroller). when upload files, controller return json response id's js, , inserted form hidden elements. after submitting form, attached item. don't use js, , process uploads directly in itemscontroller. don't use js, develop service, uploads handled , call it's methods in itemscontroller. what can recommend? maybe have approach? thanks

python - What path to enter in PyQt QIcon.setThemeSearchPaths() in pyqt on win7? -

as written in docs edit setthemesearchpaths() current code: if __name__ == "__main__": app = qtgui.qapplication([]) path in qtgui.qicon.themesearchpaths(): print "%s/%s" % (path, qtgui.qicon.themename()) it prints out: c:/python27/icons/ :/icons/ and no icons found. ask path have pass input argument in function setthemesearchpaths() on win7? as found out icons should on path/file: c:\windows\system32\imageres.dll but if input path .dll file nothing happens? windows doesn't have icon themes. qt uses freedesktop icon specification . using default paths, either extract icon theme c:/python27/icons/ or embed qt resource. you can try download faenza icons. should end file structure like: icons/<theme name>/index.theme icons/<theme name>/apps/ icons/<theme name>/actions/ ...

Jquery checkbox does'n work (checked and unchecked) -

it's doesn't work ( why? can explain, please function checkbox() { if($('.checkbox').prop('checked', true)) { $('body').css('background','yellow'); } else if ($('.checkbox').prop('checked', false)) $('body').css('background','blue'); } fiddle: https://jsfiddle.net/7rpel2gu/4/ thats answer html: <input class="checkbox" type="checkbox" /> js: $(document).ready(function(){ $('.checkbox').on('click', function(){ checkbox( $(this) ); }); }); function checkbox($this){ if( $this.prop('checked') ){ $('body').css('background-color','yellow');} else{ $('body').css('background-color','blue'); } } p.s. code not work, because $(input).prop('checked', true) - set input checked , $(input).prop(&

DeezerConnect.setAccessToken() method is missing in latest Deezer Android SDK 0.10.17 Beta -

today replace old stable deezer sdk version(v0.10.16) latest sdk (v0.10.17), when observed new sdk class deezerconnect.class not have setaccesstoken() method anymore. this useful me logging different users, different deezer accounts, because made accesstoken persistent on server each user, , setting deezerconnect.class when user reentered in application. is there other way set acces token deezerconnect? indeed setaccesstoken not public anymore in v0.10.17, it's mistake. please note though sdk 0.10.17 still in beta of today.

html - Wrapping items vertically inside DataList when re-sizing browser -

i have 3 column datalist , i'm trying wrap 3 items appear horizontally vertically. believe problem prevents happening 3 column datalist should change 1 column datalist. at moment i'm trying wrap 'boxer' divs verically no success. any ideas how achieve this? <div class="dottedx"> <div class="wrapping"> <asp:datalist id="datalist2" runat="server" datakeyfield="productid" datasourceid="sqldatasource2" bordercolor="black" cellpadding="5" cellspacing="5" repeatdirection="horizontal" repeatcolumns="3" borderwidth="0px" > <itemtemplate> <div id="boxer" class="column"> <asp:image id="image1" runat="server" imageurl='<%# "~/images/topimages/" & eval("image") %>' cssclas

wolfram mathematica - How can I make a Tooltip to show only the epilog value on a ListLinePlot when hover? -

so, have many images of zeeman interference patterns. task find positions of intensity peaks. i've written script finds maximum values, choose values need "hand", very-very boring, , take long time. kep = import["c:\users\martin\documents\egyetem\4. félév\modern fizika \labor\6. zeeman-effektus\sigma_50.png"]; adat = imagedata[kep, "byte"][[577]][[all, 1]]; csucsok = n[findpeaks[adat, 0.6, 0.6, 75]]; listlineplot[adat, axeslabel -> {"pixel", "intenzitás"}, plotlabel -> "sigma_50.png", imagesize -> large, plottheme -> "classic", epilog -> {red, pointsize[0.008], point[csucsok]}] i have little tooltips shows position(x axis value) of red dot(and red dots), , intensity value(y axis) when click on them, or mouse on them. there way this? maybe make tooltip points separate plot: data = table[{i, randomreal[{-1, 1}]}, {i, 20}]; toplot = select[data, #[[2]] > 0 & ]; show[{

javascript - How to determine if variables from sockets match -

i have node.js server , im using socket.io communicate between 2 html pages.the 2 html pages send data across socket, each page has entity associated e.g host entity: 'host' , responder vice versa.they both have name associated them same keep them 'paired' session e.g name: 'test' . when server accepts these connections have trouble finding out if there set. have is: socket.on('hostresponderstatus', function(msg) { if(msg.status == 'connecting') { if(msg.entity == 'host') { namehost = msg.name; //grab name associated host socket.emit('staringgl', {status: 'starting', name: namehost}); //send socket stating gl starting } if(msg.entity == 'responder') { nameresponder = msg.name; //grab name associated responder socket.emit('staringgl', {status: 'starting

visual studio - trying to use regular expression to surround my text with double quotes -

the following small scale example. how use search , replace (regular expression option) surround each line double quotes in visual studio 2012 search , replace? list item item 1 item 2 end list item "list item" "item 1" "item 2" "end list item" i agree, vs find & replace regexes pretty confusing. let's start. need surround text of each line quotes, leading spaces outside of quotes. so need create first group catch leading whitespaces , tabs, , second 1 catch every word , space until end of line, , catch nothing if line empty. then replace first group, quote char, second group, , quote char. regex translation: find: ([\t ]*)([\w ]+) replace by: $1"$2"

How to insert a record for each result in a mySQL query? -

hello call mysql query select in console (or in phpmyadmin sql cmd) select hf, id ah hf !=0 group hf; after need execute command each returned line previous select foreach if (select count(*) `tot` `id` = @selectedid , `uto` = @selectedhf ) = 0 insert `tot` (`id`, `hf`) values (@selectedid, @selectedhf); end if; endforeach; how can "foreach" loop in mysql? you can single query, insert . . . select . no need loop, want check non-existence: insert `tot` (`id`, `hf`) select id, hf ah hf <> 0 , not exists (select 1 tot tot.id = a.id , tot.uto = @selectedhf) group hf;

java - Dynamically change drawable colors -

in application have lot of drawables defined xml files. example have button defined that: button.xml <?xml version="1.0" encoding="utf-8"?> <layer-list xmlns:android="http://schemas.android.com/apk/res/android"> <!-- bottom 3dp shadow --> <item android:top="3dp"> <shape android:shape="rectangle"> <corners android:radius="3dp" /> <solid android:color="@color/black_30" /> </shape> </item> <!-- green top color --> <item android:top="3dp" android:bottom="3dp" android:id="@+id/background"> <shape android:shape="rectangle"> <corners android:radius="3dp" /> <solid android:color="@color/green1" /> </shape> </item> </layer-list> and display button that: layout.xml <button android:

hover - Select outer elements CSS -

can hover selector in li.options affects .image? know can done in jquery, i'm curious if it's possible pure css. <nav class="menu"> <ul class="list"> <li class="option"><a href="#">option 1</a></li> <li class="option"><a href="#">option 2</a></li> <li class="option"><a href="#">option 3</a></li> <li class="option"><a href="#">option 4</a></li> </ul> </nav> <div id="image_set"> <div class="image image1"></div> <div class="image image2"></div> <div class="image image3"></div> <div class="image image4"></div> </div> yes can css have change structure or use jquery or javascript: $(

mongodb - efficient way to transform a playframework JsValue to a MongoDBObject -

i'm receiving json graph (payload) client, @ web api jsvalue. want take that, decorate couple of fields , store in mongo. this: case class plan(_id: objectid, name: string, payload: jsvalue) { "_id" = 12345, "name" : "test model", "payload" : {a json graph} } from jsvalue database... builder += "payload" -> json.parse(json.stringify(model.payload)) from database jsvalue... payload = json.parse(dbo.as[mongodblist]("payload").tostring)) while works go jsvalue -> string -> mongodbobject, have 2 valid typed objects , have use untyped intermediate format go 1 another. if want store graph string "payload", can of course that. you may want consider using reactivemongo instead of casbah, along play-reactivemongo , provides direct-to-json capability. have not used play-reactivemongo.

how to enter prompt input through shell script -

i have shell script (main.sh) in first few lines read data through user's input. echo "enter model !!" read model echo "enter weight !!" read wgt echo "enter data file !!" read datafile echo "enter 2 column names !!" read coll1 coll2 these variables $model, $wgt, $datafile, $coll1, $coll2 being used in rest of programs. when run ./main.sh , give inputs respectively model, wgt, data, col1 col2, running fine. want give these inputs through file. created script file contains echo "col1 col2" | echo "data" | echo "wgt" | echo "model" | ./main.sh its taking first input i.e. model. there way correctly? don't pipe echo echo. echo doesn't read standard input , losing last one. if worked written backwards. you want more this: { echo "model" echo "wgt" echo "data" echo "col1 col2" }

Offset + match with a variable vba -

i'm trying use variable in offset() , match() function. doesn't work. for each valid_type in valid_sec_type_range 'test = valid_sec_type_range.cells(1, valid_type_index).value 'test1 = chr(34) & valid_type & chr(34) new_range = [offset(market_value_range,match(valid_type,sec_type,0)-1,0,countif(sec_type,valid_type),1)] and when use works, seems function match , offset not recognize valid_type string. for each valid_type in valid_sec_type_range 'test = valid_sec_type_range.cells(1, valid_type_index).value 'test1 = chr(34) & valid_type & chr(34) new_range = [offset(market_value_range,match("asset backed",sec_type,0)-1,0,countif(sec_type,"asset backed"),1)] new_range = [offset(...)] syntactic sugar this: new_range.value = application.evaluate("[offset(...)]") so yes, variable name understood literal string, understood range name, , don't have range of name. if using vba, in vba way:

Facebook Android sdk Game Request Dialog shows "Game Requests are only available to games" -

i'm updating android app latest facebook sdk (4.0.0). when create gamerequestdialog, shows me message: "game requests available games", instead of showing facebook friends. using webdialog before in older sdk , didn't happen. tried using webdialog in sdk 4 still shows me message. update: here's logcat output {facebookserviceexception: httpresponsecode: -1, facebookerrorcode: 3405, facebookerrortype: null, message: game requests available games.} you must set facebook app game category , in app settings . otherwise, can't use gamerequestdialog , because app not game. in case, facebook gives appinvitedialog .

javascript - Bootstrap CSS and JS do I have to include them in seperate files or can compile them? -

i wondering bootstrap css , js in have list them seperate files i.e. <script src="bower_components/bootstrap/dist/js/bootstrap.js"></script> <link rel="stylesheet" href="bower_components/bootstrap/dist/css/bootstrap.css" /> and lets have custom css , js file <script src="custom.js"></script> <link rel="stylesheet" href="custom/.css" /> to make easier on other people particular javascript control , running , including 4 files, can join bootstrap js , css custom js , css single css & js file ofcourse keeping copyright information etc bootstrap. or legally bootstrap require listed seperately ? yes, ok. whether best method or not whole other subject. http://getbootstrap.com/getting-started/#license-faqs license faqs bootstrap released under mit license , copyright 2015 twitter. boiled down smaller chunks, can described following conditions. it

class - c++ no suitable conversion function from "Camera" to "Actor *" -

fairly new c++ so, please gentle. getting str8 point: first actor class: class actor { vec3 location; vec3 rotation; } then camera class: class camera: public actor { float fov; } and controller class: class controller { actor* pawnactor; void setpawnactor(actor* actor); } now problem... considering camera derives actor tried like... controller.setpawnactor(camera); ...but... compiler says: no suitable conversion function "camera" "actor *" exists. of course use: void setpawnactor(camera* camera); seems pointless me create function each possible actor become 'pawnactor'. ideas??? again i'm new whole c++ thing so... thanks time everyone. pass &camera if camera object function expecting pointer not object .

javascript - Manage dependency of dependencies with Bower -

i have angular app has bower dependencies. angular-gridster has in bower.json : "dependencies": { "jquery-ui": "*", } that meant computer hadn't updated in while, has older version of jquery-ui. coincidentally enough, version of jquery-ui works, whilst newer 1 doesn't. for quick fix, force gridster use older version? i guess modify there in bower.json file, seems hacky, best course of action achieve this? on bower.json can this: "dependencies": { "jquery-ui": "1.0", "angular-gridster": "5.0" }, "resolutions": { "jquery-ui": "1.0" }

java - PreparedStatement executeUpdate on an OracleDataSource connection does not auto commit -

call preparedstatement.executeupdate() returns (with count of rows updated). db not reflect update. seeing issue ojdbc7.jar (tried both java 7 , java 8 ses). final string update_sql = "update myportfolio set stock = ? key = ?"; final string stock = 'so';// pre ipo :) final long key = 12345l; try (connection conn = pds.getconnection(); preparedstatement proc = conn.preparestatement(update_sql)) { //conn.setautocommit(false); --> works conn.setautocommit(true); // default...but making sure proc.setstring(1, stock); proc.setlong(2, key); int rowcount = proc.executeupdate(); //conn.commit(); --> works logger.info("updated {} rows. sql = {}. stock = {}, key = {}, inboundkey = {}", rowcount, update_sql, stock, key); // logs 1 row updated. db still shows stale data (old stock) key 12345l. } catch (sqlexception e) { throw new persistenceexception(e); } // p

php - Install script on non wordpress subdirectory folder -

im trying install script "moodle" in subdirectory of wordpress website if keep in first level folder wordpress 404 page not available or if go deeper "2 level folders" show me blog post! however url changing moodle/install.php ! how can tell wordpress ignore specific subdirectory , inside it? did search , tried of .htaccess hits non worked!

java - Testing WebSockets With The Gretty Gradle Plugin -

i created simple war includes servlet (defined in web.xml) , jsr 356 websocket (defined annotations). when deploy tomcat 7.0.59 (via tomcat manager) both servlet , websocket work correctly. when use gretty gradle plugin test out war servlet works jsr 356 websocket not. have tried tomcat 7.0.59, tomcat 8.0.20 , jetty 9.2.9.v20150224 in gretty. obvious doing wrong here? i assume using latest gretty version adding gretty gradle build file via: apply plugin: 'war' apply from: 'https://raw.github.com/akhikhl/gretty/master/pluginscripts/gretty.plugin' please check gretty 1.2.1 - https://github.com/akhikhl/gretty it supports websockets out-of-the-box, no configuration needed. gretty includes 2 working examples of using websockets: https://github.com/akhikhl/gretty/tree/master/examples/websocket https://github.com/akhikhl/gretty/tree/master/examples/springbootwebsocket

Linking Marketo Custom Object to Lead via SOAP -

how link custom object created via marketo's soap api existing lead? in custom object, can define 1 of fields 'link'. in web interface , when select 'link', reloads dialog , gives option select linked object type (lead) , field link (id). when create object using soap api link field this, can give custom object lead id link it.

sql - Inserting data into table variable -

i want know if it's possible insert data table variable select query. when using variable table before have inserted values , typed them myself. i have come following select query displays latest comment repair order. returns 37 records , wanted know if it's possible insert variable table. select a.ch_repref, a.ch_date, a.ch_crtime, b.[latest customer comment], a.ch_cruser, a.ch_ccommnt (select ch_repref, max(ch_repref1) [latest customer comment] dbo.v_csrpch ch_ccommnt not null , ch_ccommnt not 'x' group ch_repref) b, (select ch_repref, ch_date, ch_crtime, ch_repref1, ch_cruser, ch_ccommnt, ch_account dbo.v_csrpch) ch_repref1 = [latest customer comment] , ch_account = 'ddchc' i have started table variable following, stuck whether it's possible fill data returned select query: declare @tbl_last_customer_comment table (ch_rep

java - Ensuring right data is read from an InputStream -

i have root application supposed capture screen @ point during execution. in order accomplish this, interact android shell using following code: private static process su = runtime.getruntime().exec("su"); private static dataoutputstream outputstream = new dataoutputstream(su.getoutputstream()); private static datainputstream inputstream = new datainputstream(su.getinputstream()); private void capturescreen() { outputstream.writebytes("/system/bin/screencap -p\n"); outputstream.flush(); bitmap bitmap = bitmapfactory.decodestream(inputstream); //outputstream.writebytes("echo test\n"); //outputstream.flush(); } it works fine, when call multiple times, moment issue dummy command produces shell output between capturescreen calls, bitmapfactory.decodestream fails. considering this, have few questions: i assume happens because data within inputstream no longer purely related image data. since runtime single instance (as referred h

linker - Problems with libturbojpeg compiling love-0.9.2 -

just starting löve , i'm loving it! i'm testing under ubuntu 14.04. i able compile love 0.8.0 no trouble, i'm having problems compiling 0.9.2 bitbucket. seems, might have been eaten grue... i got error when linking, due libturbojpeg : /usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/4.8/../../../x86_64-linux-gnu/libturbojpeg.a(libturbojpeg_la-turbojpeg.o): relocation r_x86_64_32 against `.data' can not used when making shared object; recompile -fpic according this stackoverflow entry , seems default libturbojpeg binary installed in ubuntu via apt-get: tomas@ubuntu:~/tomas/love/love-0.9.2-bitbucket$ dpkg -l libjpeg-turbo8-dev | grep libturbojpeg.a /usr/lib/x86_64-linux-gnu/libturbojpeg.a tomas@ubuntu:~/tomas/love/love-0.9.2-bitbucket$ dpkg -l libjpeg-turbo8-dev desired=unknown/install/remove/purge/hold | status=not/inst/conf-files/unpacked/half-conf/half-inst/trig-await/trig-pend |/ err?=(none)/reinst-required (status,err: uppercase=bad) ||/ name

iis - Permissions for ASP -

i've inherited quite intranet, amongst other systems. not written programmers, there's fair bit of getting things work done. one of asp pages has worked since i've gotten here, today of sudden got error 500.19. none of asp pages in other folders had issue. on hunch, checked permissions on folder , folder did work. 1 worked shared everyone, added folder doesn't work. seems have fixed problem. i'm wondering cause. no 1 changed permissions, issue group policys changed? remember setting iis decade ago, , had share folder local user. , root folder shared local user. possible due group policy changes, share no longer cascading root folder subfolders?

Better way to improve the for loop for my case in R? -

prob stat : data set holds 2 columns mstr_program_list, loc_cat 600000. loc_cat column holds both missing , non missing cells. other columns not havings na's. each prog in mstr_program_list, need find total number of loc-cat associated program, % of non missing rows , among non missing rows find count of categories divided into. ex : unknown prog - total number of rows = 3, non missing rows in loc_cat 1 therefore % (2/3)*100 , number of categories divided 2 (rests:full) (rests:lim) > head(data) l.name mstr_program_list loc_cat 1 6 j'sgroup unknown <na> 2 bj's- maine roasted tomat rests: full 3 bj's- maine unknown rests: full 4 brad's q q unknown rests: lim expected output: mstr_prog total_count %good(non missing rows) number of loc_cat unknown

How to carry data from one controller to another in angularJS? -

i have 2 controllers , 2 models in angular. in first view controller combines data provided 2 models , creates combined view. not want merge data again in second controller(if want use again). how carry combined data first controller second?

r - dplyr::tbl_df fill whole screen -

Image
dplyr::as.tbl(mtcars) fills 10 rows of screen, in screenshot below: can r configured if tbl_df can fill whole r window without data 'falling off window' (as in case of mtcars ), dplyr force tbl_df fill whole window. so want output of dplyr::as.tbl(mtcars) be: several ways accomplish this: # show 1000 rows , columns *capital v in view* df %>% view() # set option see columns , fewer rows options(dplyr.width = inf, dplyr.print_min = 6) # reset options defaults (or close r) options(dplyr.width = null, dplyr.print_min = 10) # measure, don't forget glimpse()... df %>% glimpse()

python - Flash event ceases upon input -

Image
i attempting add victory event causes screen flash blue , yellow rapidly, there have been problems. initially, tried wait function issue froze else during time. tried recall color 4 times before switching worked, issue on faster or slower computer behave differently. currently, use pygame.time.set_timer issue if apply other input such arrow key, cease flashing until stop inputting. ideally, continue flash until v = 0. should flash blue , yellow v = 2, , v = 1 make flash red , else have not yet decided. using flashing if v == 2: if event.type == event_500ms: if blue == 1: d.fill(blue) blue = 2 elif blue == 2: d.fill(yellow) blue = 1 this of code. code shown above located @ bottom of entire code. import pygame, sys, random pygame.locals import * pygame.init() black = ( 0, 0, 0) abino = ( 34, 45, 102) pindler = (255, 123, 90) mexon = (200

java - Play 2.3.7 when fork in Test = false config options are ignored -

i'm using play 2.3.7 when fork in test := false in build.sbt conf files aren't loaded play when running tests. the line javaoptions in test += "-dconfig.file=conf/test.conf" in build.sbt should load test.conf when running tests that's not happening. the workaround run activator , pass above param on command line so: activator -dconfig.file=conf/test.conf "test-only test.integration.sometest" if remove fork in test := false , play finds conf resources - of course can't step through tests sucks. what missing in build.sbt ? bug in play? forking tests means run on separate jvm. not forking tests means run in same jvm sbt , cannot change parameters jvm started after has been started. the solution if not want fork pass flags jvm sbt runs on when start it, mention in end of question.

c - Freeing an array within a struct -

for assignment have write circular queue (which imagine of familiar with). made structure , function initializes queue struct using dynamic memory. note have array arr within struct assign memory. for reason can't seem free array memory. struct queue { element_t *arr; // dynamic array containing data elements int current_size; // counts number of elements in queue int front, rear; // remark later: fields need added here make thread-safe queue needed assigment }; queue_t* queue_create(){ struct queue *queue = malloc(sizeof(struct queue)); if(queue == 0){ //check if memory available printf("out of memory\n"); return null; } queue -> current_size = 0; queue -> front = -1; queue -> rear = -1; queue -> arr = malloc(queue_size*sizeof(element_t)); return queue; } i'm trying free memory when i'm done using function queue_free. function takes in double pointer queue (part of assignment). void queue_free(que

javascript - d3 with jade template -

i new both d3 , jade. have jade template below, div(id='viz') script(type="text/javascript") d3.select("#viz") .append("svg") .attr('width', 600) .attr('height', 300) .append('circle') .attr('cx', 300) .attr('cy', 150) .attr('r', 30) .attr('fill', '#26963c') i trying add small circle in div viz . when page loaded dont see circle, html code via inspector below, <div id="viz"></div> <script type="text/javascript"><d3 body class="select"><div svg class="append"><div width 600 class="attr"></div><div height 300 class="attr"></div><div circle class="append"><div cx 300 class="attr"></div><div cy 150 class="attr"></div><div r 30 class="attr"&g

Fastest way to convert between two bases in arbitary precision floating point arithmetic for over a billion digits -

which fastest way convert between base 2 ^ 64 other base? "any other base", mean any base less 2 ^ 64 itself. think it's using divide-and-conquer based methods bernstein scaled remainder trees? more details: want convert on 1 billion digits of famous constants in different bases future version of isitnormal . there 2 approaches can use: 1. calculate billion digits of constant in every base wish. 2. digits somewhere (e.g. y-cruncher) , convert every base wish. plan use approach #2 seems faster. as far know can done in o(n*log(n)) operation using fft big-integer multiplication , fast sqrt algorithm. basic idea follow. step 1. large integer x of k digits in base b1, found 2 integers y & z, such y & z both have no more k/2 digits, , x=y*y+z. (notice z can negative). can done doing sqrt(x) operation, let y nearest integer of sqrt(x) , z remainder. step 2. convert y & z base b1 base b2, recursively using step 1. step 3. compute x in base b2 u

c# - What causes this strange behaviour of an enum? -

while messing around enums, found out strange behaviour of 1 of enums. consider following code : static void main() { console.writeline("values"); console.writeline(); foreach (month m in enum.getvalues(typeof(month))) { console.writeline(m.tostring()); } console.writeline(); console.writeline("names"); console.writeline(); foreach (var m in enum.getnames(typeof(month))) { console.writeline(m); } console.readline(); } public enum month { january, may, march, april } this code produces following output (as expected): values january may march april names january may march april now, lets change little bit enum, : public enum month { january = 3, may, march, april } if run same code, same results apear (which strange is). if change enum :

Command Line to open ReadMe file when opening project in Visual Studio -

i want open readme.html file located in project/solution visual studio opened. there command line switch open readme.html file of project? for example, devenv myproj.csproj /f:readme.html note: want automate through program, not looking manual solution open visual studio , click on readme file :) please help! found it!!! i able open readme html file in browser window inside vs solution/project opened. below command: devenv.exe webapplication1.sln /command "navigate [filepath]\project_readme.html" fyi, visual studio has number of command line switches, 1 useful here " /command " switch. starts vs ide , executes command specified after /command switch. the commands in question not dos commands, visual studio commands can execute inside vs. here reference visual studio commands arguments . hope helps else too!

java - Combining xmelements with constructor -

i have class order wich has 3 fields: id, name , showing-id. have xml-file orders , reading them worked perfect. however, made constructor order , doesn't work anymore. how can have constructor , xml-elementbinding @ same time? jaxb requires no-arg constructor. should able provide 1 (try marking private) , things should work. if object isn't root one, create object default constructor , use xmladapter convert to/from avoid having add no-arg constructor domain object (see linked article below example). http://blog.bdoughan.com/2010/12/jaxb-and-immutable-objects.html

jquery - Issues with $.getJSON in IE8 -

i'm unfortunately required support ie8 , i'm unable simple $.getjson request work properly. here code: url = "http://www.somejson.com/data.json"; $.getjson(url, function(data) { var funds = []; var benchmarks = []; funds.push(data.funds); benchmarks.push(data.benchmarks); $.each( data.funds, function(key, value) { var ticker = key; // monthly: var appendtodaily = function(ticker) { $.each($("#"+ticker), function(key, value, index) { $(this).children("td").filter(":nth-child(1)").html( '<td>'+funds[0][ticker].name+'</td>' ); $(this).children("td").filter(":nth-child(2)").html( '<td>'+ticker+'</td>' ); $(this).children("td").filter(":nth-child(3)").html( '<td>'+funds[0][ticker].fund.inception_date+'</td>' );