Posts

Showing posts from May, 2012

ios - Passing Data through ViewControllers - Make settings page -

so i've been having problem while , if can bring me onto right path appreciate it. making app settings button. whenever enable segmentedcontrol or uiswitch, , go back default. want have segmented control change color. have set colors info want change on view controller #1. how make settings page keep changes. heres code far. - (ibaction)colorcontroller:(id)sender { if (controller.selectedsegmentindex == 0) { //app title text color apptitle.textcolor = [uicolor colorwithred:1.00 green:1.00 blue:0.00 alpha:1.0]; //background color when selected controller.tintcolor = [uicolor colorwithred:1.00 green:1.00 blue:0.00 alpha:1.0]; //the font of selected nsdictionary *fontcolor = [nsdictionary dictionarywithobjectsandkeys: [uicolor blackcolor],nsforegroundcolorattributename, nil]; [controller settitletextattributes:fontcolor forstate:uicontrolstateselected]; } if (controller.selectedseg...

javascript - ReactJS manipulate existing DOM element -

i got task during job interview. i'm new reactjs couldn't find proper solution. i'm supposed make bootstrap's toggle box: image example the important thing here component should invoked way: <togglebox header="the title goes here"> content of toggle box </togglebox> i'm not sure think mean invoking html code attached dom , not using react.render(). however, far know, reactjs isn't structured rebuilding existing dom, there workaround accomplish task? maybe got wrong , "invoking" mean use react.render()? thanks! :-) the component need use this.props.children . can @ documentation here . here's example: var withchildren = react.createclass({ render: function() { var child = this.props.children; var header = this.props.header; return ( <div> <div>{header}</div> <div>{child}</div> </di...

ember.js - ember-data render belongsTo attribute -

ember-cli 0.2.3; ember-data 1.0.0-beta.15 i'm struggling figure out how display attributes belongsto object inside template. i've found few other similar questions here they're either out of date or don't provide solution. user model: export default ds.model.extend({ ... agency : ds.belongsto("agency"), }); agency model: var agency = ds.model.extend({ ... users: ds.hasmany("user"), }); user serializer: export default applicationserializer.extend(ds.embeddedrecordsmixin, { attrs: { agencies: { embedded: "always" } } }); applicationserializer: export default ds.restserializer.extend({}); the json (for index route) looks so: { "users": [ { "id" : "1", "name" : "...", "agency_...

jquery - Evaluating/validating all app JavaScript in a minitest unit test -

is crazy thing attempt? :) sprockets.context_class.class_eval def image_path(dummy); end def asset_path(dummy); end end sprockets.append_path(rails.root.join('app/assets/javascripts').to_s) asset = sprockets['application.js'] jquery = file.read(file.join(rails.root, "app/assets/javascripts/vendor/jquery.js")) js = execjs.exec jquery + asset.to_s my premise quite simple. want test loads , validates javascript assets in app. many js.erb need push them through asset pipeline first (or otherwise evaluate them). my thinking when load page in chrome validates js app (because it's crammed application.js ), should able unit test. absolutely doesn't work -- keep gettiing random errors, like: error (0:00:01.874) js files should using correct escaping typeerror: cannot read property 'defaultview' of undefined but i'm trying isn't special - i'm sure other apps validate js part of tests... right? missing here? to put ...

javascript - How do I set the Select All "checkbox" iMacros Without using the button "Play (Loop)" -

how set select "checkbox" imacros without using button "play (loop)" , without making tag 50 lines since our site visited no key select , need choose 50 categories. here's code use , try this version javascript imacros: var macro; macro = "code:"; macro += "tag pos={{i}} type=input:checkbox form=id:post_form attr=name:category[] content=yes" + "\n"; macro += "wait seconds=0" + "\n"; for(i=1;i<=50;i++){ iimset("i",i); iimplay(macro); } this version imacros tag pos=1 type=input:checkbox form=id:post_form attr=name:category[] content=yes tag pos=2 type=input:checkbox form=id:post_form attr=name:category[] content=yes tag pos=3 type=input:checkbox form=id:post_form attr=name:category[] content=yes tag pos=4 type=input:checkbox form=id:post_form attr=name:category[] content=yes tag pos=5 type=input:checkbox form=id:post_form attr=name:category[] content=yes tag pos=6 type=input:checkbox f...

mysql - InnoDB Corruption in Xampp -

i have backup 2 weeks ago last resort, db files seem fine , appears it's libdata1 file having issues. stated, i'm using xampp , mysql crashes right after start it. here error log: http://textuploader.com/7vfd i hadn't done out of ordinary; seemingly , stopped working. i looked innodb recovery, solutions tried required mysql functional, isn't due corruption. there way salvage presumably intact ibd files bad libdata1 file? edit: aware of using innodb_force_recovery = # , had tried it...except had tried in wrong my.ini . had use 1 in bin folder. appears fixed now. the ibdata1 file contains tablespace information , other metadata mysql database(s). you can try using innodb_force_recovery = 1 way innodb_force_recovery = 6 see if rectifies problem. try changing in my.cnf ( my.ini windows) file , attempt restart mysql server again. if able start mysql using recovery flag, database in read-only mode. should mysqldump of data, stop mysql, re-insta...

swift - Audio from MPMoviePlayerController continues playing after segue to next view controller -

after adding video file, audio video preview continues after segue next vc pressed. is there way stop audio playing after segue pressed? var objmovieplayercontroller: mpmovieplayercontroller = mpmovieplayercontroller() var urlvideo: nsurl = nsurl() @iboutlet weak var videoprofileview: uiimageview! @iboutlet weak var addvideobtn: uibutton! override func viewdidload() { super.viewdidload() var thewidth = view.frame.size.width var theheight = view.frame.size.height videoprofileview.frame = cgrectmake(0, 50, thewidth, thewidth) addvideobtn.center = cgpointmake(thewidth/2, self.videoprofileview.frame.maxy+50) } @ibaction func addvideobtn_click(sender: anyobject) { var ipcvideo = uiimagepickercontroller() ipcvideo.delegate = self ipcvideo.sourcetype = uiimagepickercontrollersourcetype.photolibrary ipcvideo.allowsediting = true ipcvideo.videomaximumduration = 15 var kuttypemovieanyobject : anyobject = kuttypemovie anyobject ipcvide...

jenkins - Sonarqube 4.2 X-Frame options and Cross site scripting vulnarabilities -

i running sonarqube 4.2 instance on linux box. since in our system have central portal page navigate child pages, need have sonarqube inside frame. when have href, sonarqube denying guess due x-frame options set sameorigin . clue how can modify this? also need provide csrf protection in sonarqube. jenkins, comes built in option enable csrf protection. sonarqube have similar? thanks in advance inputs. for x-frame option, has been fixed in sq 5.1 , can verify on our nemo instance . for csrf protection, have open ticket this: sonar-5040 . note when xss vulnerability discovered, fix in upcoming version in latest lts version (currently 4.5.x).

java - Why can't I use an apache httpcomponents object in spring-boot, even though it is listed in the MVN dependancies? -

spring-boot has following maven dependencies around org.apache.httpcomponents <dependency> <groupid>org.apache.httpcomponents</groupid> <artifactid>httpasyncclient</artifactid> <version>${httpasyncclient.version}</version> <exclusions> <exclusion> <groupid>commons-logging</groupid> <artifactid>commons-logging</artifactid> </exclusion> </exclusions> </dependency> <dependency> <groupid>org.apache.httpcomponents</groupid> <artifactid>httpclient</artifactid> <version>${httpclient.version}</version> <exclusions> <exclusion> <groupid>commons-logging</groupid> <artifactid>commons-logging</artifactid> </exclusion> </exclusions> </dependency> <dependency> <groupid>or...

Pass array to C# from C++ via mono -

i need pass array c++ c# using mono. can't mono_array_set() compile. how can pass array c++ c#? i've tried mono_runtime_invoke() compiles gives runtime error. mcs /nologo /warn:4 /debug:pdbonly /o /nowarn:3003 /platform:x64 /out:array.dll /target:library array.cs g++ array.cpp -g3 `pkg-config --cflags --libs mono-2` -o array <snip> array.cpp:32:5: note: in expansion of macro ‘mono_array_set’ // array.cpp #include <mono/jit/jit.h> #include <mono/metadata/assembly.h> #include <mono/metadata/debug-helpers.h> int main(int argc, char* argv[]) { monodomain* domain = mono_jit_init("./array.dll");; monoassembly* assembly = mono_domain_assembly_open(domain, "./array.dll"); monoimage* image = mono_assembly_get_image(assembly); monoclass* containsclass = mono_class_from_name(image, "intarray", "containsanint"); monomethoddesc* containsdesc = mono_method_desc_new("intarray.containsanint:...

arrays - java object oriented programming -

first off im new here. , dont know if peoples able me hope can me. thing have java exam object oriented programming , methods , classes , wasnt there when had , received image of exam , have = 0 knowledge java. can basic java code never looked new stuff. have on exam 2 tasks . post exam down below . task 1. ------------------------------ class student classvariable (private) lastname, firstname, gender, birthyear of student constructor 4 values added constructor.the values in constructor assigned class variables. method tostring() data students (the 4 class variables) connected string , stored in variable . form: lastname: muster firstname: max birthyear : 1997 gender: male variable returned mehod. method outputstudentdata() string method tostring() print out. task 2. ------------------------------- class schoolclass classvariable suitable container store school class indefinite number of students (static, array, arraylist ...) method outputclasslist() every student ...

hadoop - Resource usage from Ambari -

i have few hive jobs , mapreduce programs running in cluster. able check in ambari general resource utilization. want see resources utilized individual applications. possible through ambari api? can provide clues? to knowledge metrics provided ambari whole cluster. can check mapreduce2 job history ui, seems looking stuff. check link out, there more detailed description there http://hortonworks.com/blog/elephants-can-remember-mapreduce-job-history-in-hdp-2-0/

java - Fix dependency issue gradle -

i trying use unirest library in android application, in order use mashape.com. unfortunately unirest apache dependencies conflict android apache dependencies. issue can resolved following blog post ( link ), using maven. in project using gradle , not know how resolve issue. best way resolve issue , if cannot http client can use instead unirest. help.

powershell - tee with utf-8 encoding -

i'm trying tee server's output both console , file in powershell 4. file ending utf-16 encoding, incompatible other tools i'm using. according help tee -full : tee-object uses unicode enocding when writes files. ... specify encoding, use out-file cmdlet so tee doesn't support changing encoding, , both tee , out-file don't show examples of splitting stream , encoding utf-8. is there simple way in powershell 4 tee (or otherwise split stream) file utf-8 encoding? one option use add-content or set-content instead of out-file . the *-content cmdlets use ascii encoding default, , have -passthru switch can write file, , have input pass through console: get-childitem -name | set-content file.txt -passthru

java - Google Appengine Old Blob File Service-- do we still have more time until we have to convert our code -

we have google appengine application uses blobservice being deprecated. google sent electronic mail saying service deleted july 28th. says may 20th "no new applicaitons have access files api." our application (on june second) received error message lines in our application: final fileservice fileservice = fileservicefactory.getfileservice(); file = fileservice.createnewblobfile("text/xml"); com.google.apphosting.api.apiproxy$callnotfoundexception: api package 'file' or call 'create()' not found. ... @ com.google.appengine.api.files.fileserviceimpl.makesynccall(fileserviceimpl.java:590) @ com.google.appengine.api.files.fileserviceimpl.create(fileserviceimpl.java:512) @ com.google.appengine.api.files.fileserviceimpl.createnewblobfile(fileserviceimpl.java:111) @ com.google.appengine.api.files.fileserviceimpl.createnewblobfile(fileserviceimpl.java:93) has google removed capability earlier expecting or have misunderstood ...

forward - Forwarding Outlook Item as attachment and adding it to a category in the same VBA macro -

i have macro works forwarding multiple outlook items attachments. i've pasted below, want add forwarded message(s) category in outlook. so, not forward items in inbox recipient, mark items in category. way track items have forwarded using macro. now, show me item has been forwarded on such , such date, may have been regular forwarding action. hence need macro add item specialized category. sub forwardselecteditems() on error resume next dim objitem outlook.mailitem if application.activeexplorer.selection.count = 0 msgbox ("no item selected") exit sub end if each objitem in application.activeexplorer.selection set objmsg = objitem.forward() objmsg .attachments.add objitem, olembeddeditem .subject = "example" .to = "example@example.com" .body = “” .send end next set objitem = nothing set objmsg = nothing end sub the categories property of mailitem class allows set string rep...

import - Exporting powerpivot data into access -

i trying export 5.5m rows powerpivot (excel 2010) access 2010 table. know how can that? also, access has no option of importing data powerpivot. not have powerquery in excel 2010 using. please help!! if had excel 2013 use vba write directly powerpivot access. , power query give easy way alternative of writing powerpivot data excel sheet in chunks , use access import piece piece. power query free download , works excel 2010. without think should use flattened pivot table materialize powerpivot data in excel. have in chunks because of 1m row limits in excel , resource constaints. add filter , iterate through dataset. handled vba if rerunnable process - wouldn't pretty.

Make XML elements required based on attribute values in XSD -

my requirement have xsd file checks elements based on attribute values. able write xsd point can restrict attribute values of application/@type . can me complete xsd file can make elements required based on application/@type attribute? i want make packagearg required when application/@type "batch" version required when application/@type "service" project required when application/@type web" or "service" xml file <applications> <application name="configmanagement" type="web"> <projectdirname>configmanagement</projectdirname> <project>web.configmanagement.csproj</project> <outputdirname>configmanagement</outputdirname> </application> <application name="util" type="web"> <projectdirname>web</projectdirname> <project>web.c...

C# Keywords Implement IDispose -

what keywords implement or call dispose() in background in c#? when necessary explicitly call dispose on versus using idispose? if object implements idispose , yes, call dispose on object. for example, objects using block: using (var ms = new memorystream()) { //... } here more information on implementing dispose method edit: old stack overflow post great: do need dispose of objects , set them null?

jquery - Javascript execute function after other function completes -

i have function called save: function save(callback){ var ed=tinymce.get('body'); var data=ed.getcontent(); $('#saving').show(); $('#save_err').hide(); $.post('/article/ajax/save',{title:$('#title').val(),body:data,token:token,aid:<?php echo $article_id; ?>},function(d){ $('#saving').hide(); if(d.suc==1){ $('#saved').show(); settimeout(function(){$('#saved').hide()},2000); }else{ $('#save_err').html(d.err).show(); } return true; },"json"); }; when element #preview clicked, save execute, , redirect happen after function completes. $('body').on('click','#preview',function(){ save(function(){ window.open('/article/preview/<?php echo $article_id; ?>','_blank'); }); }); i have used both accepted answer , highest rated answer here, nei...

django - phant : No 'Access-Control-Allow-Origin' -

i trying json data phant django application everytime getting following error : no 'access-control-allow-origin' header present on requested resource. i have tried adding 'access-control-allow-origin' both node.js phant , django unable data. you requesting data phant app django app. need add access-control-allow-origin header on django app. posting how adding 'access-control-allow-origin' django app helpful answer. you may consider using django-cors-headers . check configuration options carefully.

wysiwyg - How do I get the word count from the TinyMCE editor? -

i have web page several textareas, each uses tinymce editor. the wordcount plugin shows me word count in bottom right corner of editor. however, need retrieve value editor, not display it. how ask editor give me word count javascript variable can display outside of editor? the id of element count called: content-word-count . you can value of element in js: parseint(document.getelementbyid('content-word-count').innerhtml) or jquery can this: parseint($('#content-word-count').text())

What Redemption MAPITag does the RDORecipient.MessageResponseStatus property map to? -

in redemption, can query recipients collection each appointment , fetch messageresponsestatus see if recipient has accepted or declined meeting. working on changing our implementation use mapitable functionality in redemption, need mapitag property. however, can't find 1 looks right. which mapitag property should request value? i tagged cdo because messageresponsestatus cdo property under covers, must map mapi field down deep. i figured out. looks pr_recipient_trackstatus (0x5fff0003) mapitag looking for.

web services - REST vs Session-Based-Applications -

i got question regarding rest vs other web services, can't figure out start. know rest ist , how services implemented should work, have basic understanding of soap , rpcs, can't tell meant question differs rest session-based-applications. i know rest stateless, how can answer question correctly? hints or sources read through? what differs rest session-based apps? rest different fron session-based applications because stateless , session-based not. keeping "session" nothing more server keeping state of user. rest doesn't that, uses hypermedia guide state of app. that's hateoas acronym comes ( h ypermedia a s t he e ngine o f a pplication s tate). basically, hateoas means service should guide clients same way regular website guides users: means of hyperlinks (and media types). roy fielding expands on in blog.

javascript - inspect element with jquery -

i want id(or class) of element when clicked on that. write codes. <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js"></script> <script> $(document).ready(function() { $('*').click(function() { var idname = $(this).attr('class'); alert(idname); }); }); </script> <div class="test"> <div class="test1"> <div class="test2"> test </div> </div> </div> but give me class(id) of parent class.(and undefined) how can delete that?(give me class(or id) of 1 element) add event.stoppropagation , use event.target : $(document).ready(function() { $('*').click(function(e) { e.stoppropagation(); var idname = $(e.target).attr('class'); alert(idname); }); });

What does SWIG do by default with a double* argument that is an output? -

this first encounter swig, , i'm not finding useful searching, means i'm not looking in right direction. if me vectored, great. i have c function takes double* argument , uses output: int myfunc(double* p, int len){ int i; for(i=0; i<len; i++){ p[i] = (double)i; } return 0; } to wrap it, didn't tricky or custom, let swig whatever default: %module mymodule %{ /* includes header in wrapper code */ #include "mymodule.h" %} /* parse header file generate wrappers */ %include "mymodule.h" this worked in compiled , built module can load. however, 1 might reasonably expect able call python this, , can't: numbers = [0.0]*5 myfunc(numbers, 5) swig complains first argument wrong type. i've been reading thing called typemaps.i lets specify type conversions manually. necessary standard example? i'd grateful if tell me should read or google for. using builtin types input parameters swig handled automatically, ...

How do I log back into my HR database for Oracle SQL Developer( the password expired )? -

i'm having trouble logging hr database comes sql developer : first log sql*plus so: sqlplus sys/sys_password sysdba how connect hr database after ? tried open hr but doesn't work. you reset password: alter user hr identified new_password; and use password log in.

android - Getting relational data faster with Parse -

i'm using parse number of places recyclerview. problem it's quite slow, has workflow. in recyclerview show: picture, textfields, tags, how many likes place has, , how many comments. for query place object, has relations picture object (which holds parsefile), tag objects & comments object. getting 10 places takes 10 seconds, seems extremely show. worksflow: in asynctask have query places. loop on these places , per place relations pictureurls, tags & comments. (these loaded arraylists pass adapter). by way, in adapter pictures loaded picasso. any on appreciated :) i solved it, now. what makes getting placeobject slow iterating on each object, getting relation picture object, tags & comments. dropped iteration, instead i: pictures - stored url thumb in place object, load picture picasso comments - added field "commentscount" , increment everytime there one. needed count, enough. (i show comments in detailfragment) tags -...

asp.net - Dependency Injection in service and for web application -

i use dependency injection business layer, contains services, such example 1 below: public class myservice : imyservice { private imydbcontext dbcontext; public myservice(imydbcontext dbcontext) { this.dbcontext = dbcontext; } public dosomething(int id) { // use business layer var user = this.dbcontext.set<user>().find(id); } } as can see, service has entity framework dbcontext dependency. using ninject ioc container, think apply any. asp.net mvc website configuration for asp.net website, have configured using ninject create single imydbcontext per request , 1 instance of imyservice required per request - it's nice , straightforward. imyservice - transient imydbcontext - per request windows service configuration i wish configure each iteration of window service, don't have 'new up' service every iteration. i want have following configuration: imyservice - single instance or transie...

python - mapping a numpy array to a function, passing along the indices -

i have trained per-pixel models on many images , want evaluate them on new images. what i'd each image of shape (n, m, 3), apply function in fashion: myfunc(array[i, j, :], i, j) # takes (3,1) input , indices def myfunc(input, i, j): ret1, ret2 = model[i,j].predict(input) # returns single float value return ret1[1] where i, j indices, myfunc correct model parameters apply. if helps, model can numpy array of objects, same dimensions original input's first 2 dimensions (n, m) i looking @ ufuncs , vectorize , wasn't sure if did wanted. there provided interface doing this, or have loop through array myself (ugly , possibly slower in python). alternatively, applying same function each value? e.g. myfunc(array[i, j, :]) # takes (3,1) input def myfunc(input): ret1, ret2 = model.predict(input) # returns single float value return ret1[1]

data visualization - Prevent y-zoom for specific series/y-axis on highcharts -

i've got spline chart 2 y-axis both use same x-axis cycles (seconds). zoom (xy) enabled , works fine want zoom xy on 1 series connected 1 of 2 y-axis. other series should static y-axis (y-zoom disabled), not zoom y-axis... possible? chart: { renderto: 'container', type: 'spline', zoomtype: 'xy', alignticks: false, resetzoombutton: { theme: { display: 'none' } } }, title: { text: '', x: -20 //center }, legend: { enabled: false //hide legend }, credits: { enabled: false //hide credits (highcarts.com link) }, exporting: { enabled: false //hide export menu }, xaxis: { title: { text: 'sec' }, type:'second', linecolor: '#666666', linewidth: 2, endontick: false, showfirstlabel: false,...

math - Alternate plain English algorithm for Towers of Hanoi -

Image
there 4 plain english algorithms towers of hanoi puzzle available on wikipedia , when first solving puzzle, came algorithm different of solutions have seen. wikipedia algorithms: iterative solution simpler statement of iterative solution equivalent iterative solution recursive solution of course results of algorithms same, , different ways of thinking same thing, talking plain english ways of describing process. my process goes this: never move same tile twice in row(obviously) prioritize moving right when moving right, move closest pole can legally moved to. when moving left, move farthest pole can legally moved to. .. these rules differ other descriptions of algorithm in that: the initial stack can placed on of 3 pillars , still work without adjustment rules needed. (unlike solutions 2 , 3 , 4 ) you don't have number disks (unlike solutions 1 , 3 , 4 ) i have tested programmatically, , solved puzzle in (2^n)-1 moves n number of rings. ...

javascript - re order key/values in object based on values in array -

this question has answer here: sort javascript object key 22 answers just found sort javascript object key i trying reorder key/values of object match values of array using underscore input { 'red':'one', 'blue':'two', 'green':'three' } array map to ['green','red','blue'] expected output { 'green':'three', 'red':'one', 'blue':'two' } js objects have no inherent order ( does javascript guarantee object property order? ). what can though, use array "apply" order . . . create array entries matches keys in object (as appear have) , then, when loop through array, reference key in object matches current value in array. for (var = 0; < thearray.length; i++) { if (theobject.hasownpro...

clang - Libclang returning incorrect cursor types (stdlib and namespaced types) -

i using libclang basic reflection of c++. creating translation unit header , visiting tree elements using cursors, in cases fall onto qualtypes necessary information out. problem right cursor types libclang returns incorrect. example header file below: #include <vector> #include <string> namespace somenamespace { struct b { std::string m_string; std::vector<float> m_vector; }; } i parse using clang_parsetranslationunit2 following inputs: args: "-x", "c++" options: cxtranslationunit_detailedpreprocessingrecord | cxtranslationunit_skipfunctionbodies | cxtranslationunit_incomplete; now when visiting fields struct b get: cxtype_int cursor m_vector instead of cxtype_unexposed but std::string member m_string, cxtype_unexposed allows me visit field , extract necessary info. when visiting field string correctly "namespace" "typeref" cursor types. i out of ideas going on, why lib cla...

c# - How do I copy a DataColumn from DataTable1 into DataTable2? -

i copy datacolumn datatable datatable , don't know how do... datacolumn[] dc = new datacolumn[datatable1.columns.count]; datatable1.columns.copyto(dc, 0); datatable2.columns.add(dc[index]); error datacolumn belongs datatable! you use dataview.totable method accepts column names want have in new table. datatable datatable2 = datatable1.defaultview.totable(false, new string[] {"customername"}); keep in mind creates new datatable original table column specified in string array (of course original table should have column named "customername")

c# - How to increase a counter whilst a key is pressed in Unity? -

i creating app turns sphere earth when w pressed speed , s used slow down. unable how find out how make speed increase. here code: using unityengine; using system.collections; public class spin : monobehaviour{ public float speed; void update () { transform.rotate(vector3.up,speed * time.deltatime); if (input.getkey ("escape")) { application.quit(); } if (input.getkey ("w")) { transform.rotate(vector3.up,speed + 1); } if (input.getkey ("s")) { transform.rotate(vector3.up,speed - 1); } } } does have idea how can increase speed how long button pressed? p.s wish write in c# excuse lack of knowledge unity, looks if statements don't update value of speed . now, if key pressed, rotating @ value of speed + 1 . speed never changed. maybe try this? if (input.getkey("w")) { transform.rotate(vector3.up, speed + 1); speed++; }

javascript - Send Lat and Long details via Ajax -

i trying write code once button pressed sends lat , long coordinates via ajax test.php file. problem having not seem call test.php file. <button onclick="getlocation()">join me</button> <p id="demo"></p> <script> var x = document.getelementbyid("demo"); function getlocation() { if (navigator.geolocation) { navigator.geolocation.getcurrentposition(showposition); } else { x.innerhtml = "geolocation not supported browser."; } } function redirecttoposition(position) { // ... $.ajax({ type: "post", url: "http://www.domain.co.uk/test.php", data: "lat="+position.coords.latitude+"&long="+position.coords.longitude, }); } below content of test.php file, $lat=(isset($_post['lat']))?$_post['lat']:''; $long=(isset($_p...

Facebook Graph Query with PHP -

so trying fetch images posted hashtag in facebook. using facebook php api. code: facebooksession::setdefaultapplication('my-api-key', 'secret'); $session=facebooksession::newappsession(); try { $session->validate(); } catch (facebookrequestexception $ex) { var_dump($ex); echo $ex->getmessage(); } catch (\exception $ex) { // graph api returned info, may mismatch current app or have expired. echo $ex->getmessage(); } $request = new facebookrequest( $session, 'get', '/gatos' ); $response = $request->execute(); $graphobject = $response->getgraphobject(); var_dump($graphobject); i know request executing not pulling hashtags, anyways, getting following error: fatal error: uncaught exception 'facebook\facebookauthorizationexception' message 'unsupported request. please read graph api documentation @ https://developers.facebook.com/docs/graph-api' in /var/www/experiments/gatopull/vendor/facebook/php-sd...

excel - Issue with Arrays/Match/Index -

here current formula use pull latest live date customer out of web query. {=large( if(table_owssvr_1[hq name]=b1,1,0)* if(isnumber(table_owssvr_1[live date]),table_owssvr_1[live date],0), 1)} b1 name of customer. hq name column a , contains customer names. this formula give me latest open date customer doesn't filter whether live, closed, or customer on hold. problem having need have formula check 1 more column in table see matches live -3 before giving me largest date. column c in table status . if data in column says live -3 customer, need pull largest date among multiple entries live -3 . dates in column l , live date . i've been attempting using match , index function have had no luck. appreciate help. this should simple multiplying in condition returns 1/0 . 0 unless both conditions met. {=large( if(table_owssvr_1[hq name]=b1,1,0)* if(table_owssvr_1[status]="live -3",1,0)* if(isnumber(table_owssvr_1[live ...

git - How to see all local commits which are not pushed to the remote branch? -

i using following commands see local commits not pushed remote branch not getting local commits. git log git log origin/master..master i want see at-least 10 local commits(only local). this show not pushed commits branches git log --branches --not --remotes and must show local commits git log origin/master..head

Delphi / Android- TabItem Icon doesn't appear in device -

i'm trying put icons in tabitems following http://docwiki.embarcadero.com/radstudio/xe7/en/mobile_tutorial:_using_tab_components_to_display_pages_(ios_and_android) . icons appear on emulator when run app in tablet android, icons doesn't appear. why happening? tabitemcustom i had problem , missed 1 thing on tutorial. have put stylelookup=tabitemcustom for tabitem. can verify working when can see on design mode. image shows mean.

Optional Multi-Value parameter in BIRT -

Image
i have birt report have 4 optional parameters. startdate; enddate; stringparam , listparam (multi-value parameter). i followed "bluish" code on link how set parameter list of values in birt report? and works if give either 1 or of value parameter. however, when leave parameter blank, got blank report (which incorrect result). this query: select f1,f2,f3,f4 f1 >= ? -- startdate parameter or f2 <= ? -- endate paramter or f4 = ? -- stringparam , ( f3 in (''/*?listparam*/) ) i did query on oracle db see parameter being passed query got 'null' value_string when leave parameters values blank. any appreciated. it sounds want search records on 1 3 of 4 criteria in parameters. there couple ways this: one way use like, , set default parameter value % wild card. when parameter runs returns values. aware can problematic if fields contain null. or f4 ? so need use similar below return null values. ...

jquery - Why does JSHint claim I'm missing a semicolon? -

jshint telling me last line missing semicolon: $('#radbtnemp').click(function () { if ($('#radbtnemp').attr('checked', true)) { alert("radbtnemp checked"); } else { alert("radbtnemp not checked"); } }; as can plainly see, i've got semicolon there; surely it's not blind or gluttonous (not seeing semicolon, or wanting more one)...? you have not missed ; ) @ end of jquery code. changing }; }); valid here.

r - Is it possible to do transpositions of big.matrix objects from the bigmemory package? -

i perform transpose of large bigmemory big.matrix b can compute ab t . possible in bigmemory? , more importantly how can find documation this? on page 5 of paper on bigmemory http://www.stat.yale.edu/~mjk56/temp/bigmemory-vignette.pdf , authors package supports operations such prod(), colmean(), colsd(), etc, cannot locate documentation on this. that documentation rather old @ point , rapidly becoming more so. 1 of current developers of bigmemory packages. have begun quite few new updates bigmemory package make more modern , accessible. hope releasing new updated version cran shortly. that said, transpose functionality part of bigalgebra package. @ moment, under heavy development have been working on extending functions include more simple functions t . fair warning, there chance find bug or two. so, after talking perhaps here potential solution. install current development branch of bigalgebra library(devtools) # install dev bigmemory # install_github("...

java - Google Maps API error location manager -

i started playing around today google maps api first time got error , have no idea how fix it. i have no idea why locationmanager giving error: cannot resolve symbol 'locationmanager' thanks in advance, for full code go to: http://pastebin.com/7cy8gyyf here part of code: private void setupmap() { mmap.addmarker(new markeroptions().position(new latlng(52.279413, 5.194046)).title("l")); // enable mylocation layer of google map mmap.setmylocationenabled(true); // locationmanager object system service location_service locationmanager locationmanager = (locationmanager) getsystemservice(location_service); //create criteria object retrieve provider criteria criteria = new criteria(); //get name of best provider string provider = locationmanager.getbestprovider(criteria, true); //get current location location mylocation = locationmanager.getlastknownloacation(provider); //set map type mmap.setmaptype(goo...

multithreading - Java Unsafe.storeFence() documentation wrong? -

java 8 has added 3 fences sun.misc.unsafe . i feel confused after read documentation. so, searched web, , found link . according page above, believe these methods add nothing in practice. correct me if i'm wrong, speaking, loadfence(), storefence() , fullfence() correspond volatile read, lazy write , volatile write respectively, although technically these fences stronger volatile variables. loadfence() acquire fence, , storefence() release fence, , fullfence() full fence. but documentation storefence() looks strange. it says, /** * ensures lack of reordering of stores before fence * loads or stores after fence. */ void storefence(); that doesn't release fence. how supposed used? shouldn't be /** * ensures lack of reordering of loads or stores before fence * stores after fence. */ void storefence(); i assume before means earlier , after means later. edit i don't mean "we don't use them in usual development" when these ...

c# - How to get hostname of the machine that the user logged in on? -

i hostname of machine enduser logged last. able user name, , last login directoryentry . here code: var dirs = new directoryentry("winnt://dcname"); foreach (directoryentry de in dirs.children) { var user = string.empty; var lastlogin = string.empty; var lastlogoff = string.empty; if (de.schemaclassname == "user") { user = de.name; if (de.properties["lastlogin"].value != null) { lastlogin = de.properties["lastlogin"].value.tostring(); } if (de.properties[lastlogoff].value != null) { lastlogoff = de.properties[lastlogoff].value.tostring(); } } } how can hostname well? help. directly, no, information not stored user in active directory. however want still possible, if want accomplish need enable audit logon events on domain controller, record logon events in event log similar...

python - Where is the best place to put support functions in a class? -

in python, have class i've built. however, there 1 method apply rather specific type of substring-search procedure. procedure standalone function (it requires needle haystack string), feels odd have function outside class, because class depends on it. what typical design paradigm this? typical have myclassname.py main class, support functions outside class itself, in same file? or better have support function embedded within class @ expense of modularity? you can create staticmethod , so: class yo: @staticmethod def say_hi(): print "hi there!" then, can this: >>> yo.say_hi() hi there! >>> = yo() >>> a.say_hi() hi there! they can used non-statically, , statically (if makes sense). about put functions... if method required class, , appropriate method perform data specific class, make method. want: class yo: self.message = "hello there!" def say_message(self): print self.messa...

html - How to fix erb tag in Atom from requiring a space to tab-complete? -

up until 2 versions of atom ago, doing h={tab} autocomplete h<%= %> . still happens now, reason required "=" after space. example: hello={tab} does not autocomplete to hello<%= %> which desired syntax. instead, have do hello ={tab} => hello <%= %> and click/arrow on , delete space. annoying. i've gone snippets assuming typo , "=" accidentally prepended space. far can tell snippet written correctly , bug? know of way fix this? for clarification, of other snippets have no issue working against character. seems ={tab} / -{tab} .

python - Find cliques of length k in a graph -

i'm working graphs of ~200 nodes , ~3500 edges. need find cliques of graph. using networkx's enumerate_all_cliques() works fine smaller graphs of 100 nodes, runs out of memory bigger ones. "this algorithm however, hopefully, not run out of memory since keeps candidate sublists in memory , continuously removes exhausted sublists." source code enumerate_all_cliques() is there maybe way return generator of cliques of length k, instead of cliques, in order save memory? it seems priority save memory rather getting cliques. in case use of networkx.find_cliques(g) satisfactory solution maximal cliques (largest complete subgraph containing given node) instead of cliques. i compared number of lists (subgraphs) of both functions: g = nx.erdos_renyi_graph(300,0.08) print 'all:',len(list(nx.enumerate_all_cliques(g))) print 'maximal',len(list(nx.find_cliques(g))) all: 6087 maximal 2522 and when number of edges in...

javascript - Why does an Angular model prevent a checkbox from being checked by default? -

i'm using angularjs website , want use checkbox. first created checkbox this: <input type="checkbox" checked> i can of course remove , add checked liking have checked default or not. add model (the model not defined in controller yet): <input type="checkbox" ng-model="settings.myswitch" checked> the checkbox still displays, of sudden checked has no effect @ anymore; checkbox unchecked default. why oh why model prevent checked having effect? tips welcome! that because when element rendered browser sets checked property angular processes ng-model on check box (whose value falsy) , gets unchecked. instead if ng-checked="true" work (because ng-checked directive sets property after ng-model processed priority lower ng-model ). but model's initial state messed (if using 1.3.x+), ng-checked not update state of ng-model . set ng-model value true instead. just demonstration using ng-init (you should se...

javascript - Minified all images - Grunt -

i have more 100 images in images/ folder. here imagemin - grunt config // following *-min tasks produce minified files in dist folder imagemin: { dist: { files: [{ expand: true, cwd: '<%= config.app %>/images', src: '{,*/*/}*.{gif,jpeg,jpg,png,ico}', dest: '<%= config.dist %>/images' }] } } when run grunt build saw running "imagemin:dist" (imagemin) task minified 7 images (saved 492.79 kb) only 7 of images got minified. not all. i've tried changing * around in diff combination, far - no luck. src: '{,*/*/}*.{gif,jpeg,jpg,png,ico}' how fix src minified everything in images folder ? i think problem might in src globbing pattern . pattern using matches images in cwd root or in 2 levels deep ones ( {,*/*/} ). if want images in cwd directory minified regardless levels of subdirectories reside, should use **/* globbing pattern instead: imagemin: { dist: ...

php - a 500 Internal Server Error error was encountered -

Image
i have upload local project(overwrite existing 1 working correctly) remote server . my .htaccess looks like: rewriteengine on rewritecond %{request_filename} !-f rewritecond %{request_filename} !-d rewriterule ^(.*)$ index.php/$1 [l] <files "index.php"> acceptpathinfo on </files> rewriterule ^username http://www.google.com #^([a-za-z0-9_-]+)$ user/profile/username=$1 log error: softexception in application.cpp:256: file "/home/fewextra/public_html/index.php" writeable group browser error: any idea how fix ? tried this , this far no luck . note: same project when upload server works. the fixes tried have nothing message , not access issue. saying permissions permissive. try make changes , see. change permissions on public_html 755 , index.php 644 .