Posts

Showing posts from June, 2012

MS Access - Data Entered in a Form Automatically saves when i close the form -

i've been tasked making updates ms access database , forms. each form seems linked query. if enter data text box on form , close form without pressing save record button new record still added database makes no sense to. any insight great, i'm programmer have little experience working access forms , databases. thanks. microsoft access binds forms data default, , automatically save data either move between records or close form you're working on. average user, thing because makes difficult lose data, if accidentally close form after making edit. if functionality isn't you're looking for, i'd suggest removing binding form, is, set record source property blank, manipulate data in code using unbound controls. it's lot more fiddly, gives lot more control. the other option use form's beforeupdate event ask user if want save changes before allowing them go through. if main concern accidentally adding new records, set allow additions prope

c++ - Fill QByteArray from QAudioBuffer -

my goal save qaudiorecorder recording memory. research seems best way store recording use qbytearray . audio recorder probed using qaudioprobe . from audiobufferprobed signal try append data byte array using slot method. qbytearray *bytearr; void audiorecorder::processbuffer(const qaudiobuffer &buffer) { bytearr->append(buffer.constdata<char>()); qdebug() << buffer.bytecount(); qdebug() << bytearr->size(); } however doesn't seem work considering buffer.bytecount(); returns 4092 seems normal bytearr->size(); returns weird , irregular increments starting off 2, 4, 6, 7, 189. the data ends being around 18kb in size leads me believe data not being appended byte array correctly. according qbytearray::size() docs size() should give how many bytes in array. along qaudiobuffer::bytecount() should give amount of bytes in current buffer, shouldn't full 4092 buffer copied array? i open solution doesn't use qbytearray

python - build sklearn error cythonize failed -

$ sudo python setup.py build gives me following: partial import of sklearn during build process. generating cython files cythonizing sources sklearn processing sklearn/_isotonic.pyx traceback (most recent call last): file "/home/scikit-learn/build_tools/cythonize.py", line 198, in <module> main(root_dir_arg) file "/home/ascikit-learn/build_tools/cythonize.py", line 190, in main check_and_cythonize(root_dir) file "/home/scikit-learn/build_tools/cythonize.py", line 182, in check_and_cythonize cythonize_if_unchanged(cur_dir, cython_file, gen_file, hashes) file "/home/scikit-learn/build_tools/cythonize.py", line 156, in cythonize_if_unchanged cythonize(full_cython_path, full_gen_file_path) file "/home/scikit-learn/build_tools/cythonize.py", line 61, in cythonize raise exception('building scikit-learn requires cython >= 0.21') exception: building scikit-learn requires cython >= 0.21

Inno Setup installer defaults to Custom install instead of Full -

installer defaults custom install instead of full no matter what. in case there no solution that, can have checked components default in custom install? if have installed application earlier using setup script , reinstalling, may setup uses previous type default. please check useprevioussetuptype parameter [setup] section.

android - Elevation property is not working and URI is not registered -

i'm following tutorial. instructions make 2 base layout files. 1 applied devices, , other 1 applied devices api level lower 21 on top of first base file. api level of 21 or higher instructions to make folder within layout called layout-v21 has xml file. file identical base layout file api level lower 21 except has android:elevation="5dp". background set can't it.i've noticed xml in layout-v21 has it's property value xmlns:android= in red indicating error. how can fix this? why elevation not working properly? i'm not sure did wrong, want elevation work can move on. have tried running 21, 22 , 23 , same result. no shadow. layout/actitvity_main.xml -> core layout file: <linearlayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent"

javascript - Scheduling and/or Synchronizing HTML5 Video Playback Across Machines -

i'm running 3 different videos identical durations on 3 separate machines , synchronizing them using websocket server. can pretty accurate time sync between machines, changing currenttime attribute of of videos results in significant , unpredictable delay. in past webaudio, i've been able schedule playback of audio source using start() , video.play() doesn't have functionality. , makes impossible "play part of video @ point in time". is not option html5 video? there out-of-the-box solution should trying (e.g. media streams, canvas). i'm using chrome, use browser. unfortunately there exist no method video sync sources way. the problem setting currenttime is asynchronous operation. when time set there no guarantee video play time instantly. browser check cache, possibly load net , decode before video before it's played time (and when reports through seeked event). as long miss form of cue method in web audio api (which require data

Using Python objects in C++ -

i'm writing code calculates images of nonlinear maps using methods interval analysis, applies minkowski sum , repeats arbitrary number of iterations. i've written working code in python, able implement of more iteration/recursion intensive parts of algorithm in c++ benefit increased speed. have used cython in past great results, i'd practice c++. also, objects complicated enough i'd rather avoid having implement them in c++ (baby steps!). so questions are: 1) using python objects in c++ prevent improvement in efficiency? 2) if not, possible use cython wrap c++ function iterates/recurses on python object? to more specific, have recursive algorithm recurses on left , right children of bst (though it's heavily modified bst i'd rather not bogged down details of implementing in c++), runtime quite prohibitive, i'd write in c++. yes. speed-up on pure python not on par increase you'd if using pure c/c++ . if want handle python objects y

php - How to get checked inputs from HMTL5 table -

Image
i know if has idea on how checked values of radio-buttons. there 5 columns , several rows, user can select 1 radio-button per column. i have been trying values haven't been able through jquery, or sending through post php file. <table class="table table-striped table-hover " id='tableincoming'> <thead> <tr> <th>#</th> <th>route</th> <th>monday</th> <th>tuesday</th> <th>wednesday</th> <th>thursday</th> <th>friday</th> </tr> </thead> <tbody> {section name=lindex loop=$incoming_list} <tr style="" class="{if $incoming_list[lindex].name eq 'tres rios' || $incoming_list[lindex].name eq 'cartago'}info{/if}" id="tr{$incoming_list[lindex].name}-{$incoming_list[lindex].tim

Removing duplicate entries in an array- Undefined offset error(PHP) -

i new php , trying remove duplicate entries in array. end desired output, getting 2 "undefined offset" errors along way. code have: $this->master refers array declared in beginning of class. public function removeduplicates(){ $var = count($this->master); for($i = 0; $i < $var; $i++){ for($j = 0; $j <$var; $j++){ if(($this->master[$i] == $this->master[$j]) && $i != $j){ $this->shiftleft($j, $var); $var --; } } } } public function shiftleft($t, $s){ while($t < $s){ echo "$t "; $this->master[$t] = $this->master[$t+1]; $t++; } unset($this->master[$t-1]); } it simple logical error cannot seem find where. appreciated. see if works $u

c# - Need help formatting this to get insert query to work -

i struggling hard try figure out how this. trying have inputs textboxes allow admin update data in archive_decade_tbl , insert row in archive_image_tbl if chose add photos. have update query working cannot life of me insert working. conscious new code disgusting of , not worried security @ moment know vulnerable sql injection please me here code update function: protected void update_clicked(object sender, eventargs e){ string connectionstring = "provider=microsoft.ace.oledb.12.0;data source=" + server.mappath("~\\database\\archive_master_database.accdb") + "; persist security info=false;"; dataset infods = new dataset(); oledbdataadapter oledbadapter; classme.attributes.add("class", "productinfocontainernofloat"); string cmd1 = @"select * archive_decade_tbl archive_id_number=@buttonclicked"; string cmd2 = @"select * archive_image_tbl archive_id_number=@butt

Disable QuickEdit in Windows 10 cmd.exe -

i made upgrade windows xp windows 10 on important machine @ observatory (i should have done long ago, know...). i've noticed in windows 10, if run script on windows command line (cmd.exe) can interrupt script running clicking on terminal window. when click on terminal title bar changes , word 'select' prepended title. have done accident several times (when reorganising open terminals) , caused cascade of errors important running script has been interrupted , several things depend on have fallen ever. the 'select' mode can unselected hitting return in terminal, code interrupted continues run before. i disable feature if possible. has encountered this? thanks right click on title bar, choose properties, uncheck quickedit mode, , click ok. if want disable future command prompts too, same defaults instead of properties.

amazon web services - Lambda processing same SNS event multiple times? -

i have aws lambda function configured process sns events single topic. when function runs potentially send out other notifications , call context.succeed, or context.fail if error occurs. problem same sns event seems invoking lambda multiple times. looking @ cloudwatch logs see start requestid: cd7afdf8-2816-11e6-bca2-6f2e3027c5e1 version: $latest which ends end requestid: cd7afdf8-2816-11e6-bca2-6f2e3027c5e1 report requestid: cd7afdf8-2816-11e6-bca2-6f2e3027c5e1 ... immediately followed in same log start exact same requestid start requestid: cd7afdf8-2816-11e6-bca2-6f2e3027c5e1 version: $latest looking cloudwatch @ topic sending sns event seems publishing , delivering 1 had expected, seems lambda-side problem. know of reason event might triggering lambda multiple times this? edit: i've noticed seems happening when lambda receives failure. don't see sort of retry configuration on lambda , wouldn't expect behaving way default. from amazon lambda f

css - Recaptcha graphic being display incorrectly -

Image
this default <%= recaptcha_tags %> being displayed on page: i've tried bunch styles, think following promising, no luck: #recaptcha_table > tbody > tr:nth-child(6) { height:18px !important; } can give me guidance? thanks. the html captcha looks like: just add below given css in .css file , solve issue. can change line-height s value according needs. .recaptchatable { line-height: 12px; }

java - JavaFx erron in running -

i have got problem javafx. created fxml file in scenebuilder , put in same directory package folder. here codes: public class main extends application { public static void main(string[] args){ launch(args); } @override public void start(stage window) throws exception { pane mainpane = (pane)fxmlloader.load(main.class.getresource("../sas.fxml")); scene scene = new scene(mainpane); window.setscene(scene); window.show(); } } when run gives me error: exception in application start method java.lang.reflect.invocationtargetexception @ sun.reflect.nativemethodaccessorimpl.invoke0(native method) @ sun.reflect.nativemethodaccessorimpl.invoke(unknown source) @ sun.reflect.delegatingmethodaccessorimpl.invoke(unknown source) @ java.lang.reflect.method.invoke(unknown source) @ com.sun.javafx.application.launcherimpl.launchapplicationwithargs(unknown source) @ com.sun.javafx.application.launcherimpl.launchapplication(unknow

android - Activity crashes, but only if launched from the lockscreen, and only if landscape is forced? -

i have activity launches on lockscreen, similar alarm. however, if set activity landscape in androidmanifest, app crash on launch. if remove landscape designation, launches without issue. additionally, if launch landscape only, not lockscreen, has no issues. what launching in landscape lockscreen cause this? the error get, 1 of variables running in async thread null. again, no problem doing same thing in portrait lockscreen , bno problem staying in landscape, not launching lockscreen.

php - how to get output of this code. sometimes it shows output and sometime it doesnot? -

<?php include 'config.php'; $tid = $_get['tid']; $sql="select topics tid='$tid'"; $result=mysql_query($sql); while($rows=mysql_fetch_array($result)){ ?> <div class="topics"><font size="4"><?php echo $rows['title']; ?></font></div><div class="tdm"><br/><center><img src="http://appricart.com/test/img/<?php echo $rows['photo']; ?>" height="100" width="100"/><br/> <small><?php echo $rows['message']; ?></small></div> <?php } include 'foot.php'; ?> sometime code works not please me problem. it shows error mysql_fetch_array() expects parameter 1 resource <?php include 'config.php'; $tid = $_get['tid']; $sql="select topics tid='$tid'"; // here error $result=mysql_query($sql); you not selecting table topic.

python - ImportError: cannot import name IRCBot -

i'm importing module , done in same file: from irc import ircbot, run_bot class greeterbot(ircbot): def greet(self, nick, messege, channel): return 'hi %s' % nick def command_patterns(self): return ( self.ping('^hello', self.greet), ) host = "coolwhizserver" port = 6667 nick = 'alfred' run_bot(greeterbot, host, port, nick ['#randomchannel']) this code, i'll print output below: traceback (most recent call last): file "greeter.py", line 1, in <module> irc import ircbot, run_bot importerror: cannot import name ircbot please check version have - if have 32-bits version of package , 64-bits version of python (or reverse situation) import never running .

javascript - Hyperlink target in Google Spreadsheets -

i'm embedding google spreadsheet contains links (=hyperlink(url, [link_label])) in iframe. want set link target current tab, it's set _blank default. is there solution this? use .setlinktarget(linktarget) set link target links embedded in search result. linktarget supplies target iframe in open links. here's sample linktarget: link_target_blank opens links in new window (for example, href=... target=_blank ...>). default. link_target_self opens links in same window , frame (for example, href=... target=_self ...>). link_target_top opens links in topmost frame (for example, ). link_target_parent either opens links in topmost frame, or replaces current frame (for example, href=... target=_parent ...>). anything-else specifies links open in specified frame or window (for example, href=... target=anything-else ...>).

Why is Firefox displaying svg images wrong? -

i encountered weird firefox's behaviour. renders svg images cutting parts of them or not displaying them @ all, of images, not of them. chrome , ie displaying them properly. here link website put said images on: funjo.pl images not being displayed logo in top menu bar , big blue logo transparency on big top banner. funny thing 2 icons bit down on same page (three rolls , woman's legs), svgs being displayed properly. please tell me what's going on? suppose there wrong svg image code can't detect exactly. i'm not pasting whole images' code beacuse it's of it. can download these images http://funjo.pl/media/2016/06/logo.svg , http://funjo.pl/media/2016/06/logo2.svg . ps: if want me badly paste whole code let me know. ps2: created of svgs on website using corel x7, if information helps in anything. ps3: i'm using newest ff v 46.0.1. applying width of 300px or above gave me correct results in chrome , ie. so give width below , can ad

Tableau - I want to filter my data based on one dimension, but is being controlled using 2 parameters -

i have group of users each have variable assigns them group. can't share data, example data prove sufficient. +-----+-----------+--------------+ | id | age group | location | +-----+-----------+--------------+ | 1 | 18-34 | east spain | | 2 | 35-44 | north china | | 3 | 35-44 | east china | | 4 | 65+ | east congo | | 5 | 45-54 | north japan | | 6 | 0-17 | north spain | | 7 | 65+ | north congo | | 8 | 45-54 | east japan | | 9 | 0-17 | north spain | | 10 | 18-34 | east china | | 11 | 18-34 | north china | +-----+-----------+--------------+ my end goal create sheet/dashboard, pie chart age grouping. want filter pie chart based on area, however, want there 2 selections, 1 area (east/north), , 1 country (spain/china/congo/japan). filters both "single value lists", 1 area , 1 country able selected @ time, combine filter patients. example, if 'east' chosen ar

c++ - Partial Specialization for an Integral Constant vs a Type -

is possible specialize template based on whether template argument either type or integral constant? here's example doesn't compile illustrates intent: #include <cstdio> #include <cstddef> // tag struct struct dynamicsize {}; template<class t, class size> class container; template<class t> class container<t, dynamicsize> { public: container() { std::puts("dynamic size"); } }; template<class t, int size> class container<t, size> { public: container() { std::puts("static size"); } }; int main(int argc, char* argv[]) { container<char, 20> a; container<char, dynamicsize> b; } the eigen library has support matrices of fixed size or runtime determined size , similar this. implementation there template argument integral constant , dynamic tag constant equal -1 i'm curious if there's way. i think way have container template take type parameter

ios - swift Completion handlers cannot convert value of type to specified type -

Image
i'm trying implement completion handlers i'm getting error: cannot convert value of type specified type. here code: override func viewdidload() { super.viewdidload() let sss : string = dosomethingelse { (data) in } print(sss) } func dosomethingelse(completion:(data:string) -> void) { let s = "blablabla" print(s) completion(data:s) } on line i'm getting error: let sss : string = dosomethingelse { (data) in any of knows why i'm getting error? i'll appreciate help. you have declared sss string have attempted assign closure it; compiler gives error. i think trying assign closure sss , pass closure dosomethingelse : func viewdidload() { super.viewdidload() let sss : ((data:string) -> void) = { data in print ("data \(data)") } dosomethingelse(sss) } func dosomethingelse(completion:(data:string) -> void) { let s = "blablabla" print

sql server - Change SSMS Default File Location (Specifically Templates) -

Image
tldr: how change default location sql server management studios 2014 without uninstalling , reinstalling? i installed sql server management studio 2014, , default file locations aren't want them. able change default query location , default project location through tools -> options, cannot life of me figure out how change template location. if delete folder, every time run ssms, creates new folder used be. i'm guessing missed option somewhere (possibly xml section?), pointers appreciated. in case matters, want move default location "documents/sql server management studios" "documents/programming/sql server management studios" thanks in advance. edit: changed file path on import , export settings, , query result -> sql server tabs. try changing import , export settings.

python - How to make a field immutable after creation in MongoDB? -

use case: i'm writing backend using mongodb (and flask). @ moment not using orm mongoose/mongothon. i'd store _id of user created each document in document. i'd impossible modify field after creation. backend allows arbitrary updates using (essentially) collection.update_one({"_id": oid}, {"$set": request.json}) i filter out _creator_id field request.json (something del request.json["_creator_id"] ) i'm concerned doesn't cover possible ways in syntax modified cause field updated (hmm, dot notation?). ideally i'd way make fields write-once in mongodb itself, failing that, bulletproof way prevent updates of field in code. imho there no know methods prevent updates inside mongo. can control app behavior, still able make update outside app. mongo don't have triggers - in sql world have possibility play data guards , prevent field changes. as re not using odm, can have cqrs pattern allow control app behavior , p

pydev - Eclipse version for python develpment -

what clean eclpse distro use python development? distro comes java plugin , other stuffs. i want clean eclipse distro + pydev. for pre-configured environment, see http://www.liclipse.com (note it's commercial -- , has other niceties). aside it, option getting platform runtime binary , follow instructions http://pydev.org/download.html , http://pydev.org/manual_101_root.html install pydev.

php - Bool is returning an array causing true response every time in Laravel 5.2 -

i getting true return query in laravel 5.2. making query in controller , returning array. if($term = $request->get('term')){ $booking = guests::where('booking', '=', $term)->get(); $active = guests::where('booking', '=', $term)->pluck('active'); } // dd($active); if($active){ echo ' i have read potentially solved attribute casting attempts have not worked. thanks both get() , pluck() return collection, making if condition 1 doing - not return false if collection empty (collection method isempty() return false though). result of if ($active) in code has nothing value of 'active' field itself. you can try adding first() chain, assuming have or need 1 item: $booking = guests::where('booking', '=', $term)->get()->first(); $active = guests::where('booking', '=', $term)->pluck('active')->

ruby on rails - PaperClip gem Paperclip::Errors::NotIdentifiedByImageMagickError -

there numerous stackoverflow questions regarding this, after many hours, i've exhausted every angle think of, , still following error when try upload image using paperclip gem (in tandem papercrop, cropping image). paperclip::errors::notidentifiedbyimagemagickerror - paperclip::errors::notidentifiedbyimagemagickerror: paperclip (4.3.6) lib/paperclip/geometry_detector_factory.rb:10:in `make' paperclip (4.3.6) lib/paperclip/geometry.rb:26:in `from_file' papercrop (0.3.0) lib/papercrop/model_extension.rb:95:in `image_geometry' papercrop (0.3.0) lib/papercrop/helpers.rb:45:in `cropbox' app/views/users/_crop_photo_modal.html.haml:12:in `block in _app_views_users__crop_photo_modal_html_haml___1410212035753490924_70365684359680' here prints in logs prior error: [aws s3 200 0.554305 0 retries] head_object(:bucket_name=>"xxx-development-bucket-us",:key=>"profiles/profile_images/1/original/main_sized_small.png") [aws s3 200 0.049585 0

mysql - how can I constrain a foreign key relationship where it may refer to multiple other tables? -

i have table called inventory_movements , , i'm planing save products movements in , out warehouse , has fields like 1- movement_id(pk) 2- product_id(fk) 3- quantity int 4- unit_price decimal 5- movement enum('in','out') 6- date datetime 7- ????????? (reference )(e.g. sell(out)- purchase(in)- fire loss(out) - sales return (in) - purchase return (out) my problem want store reference of movement (the cause of movement) whither order id , or purchase id , purchase return id, .... etc but want make constrain on field make sure no invalid data (e.g. not exist purchase) stored in database, of curse can't make 1 foreign key references many tables (sales, purchases, purchase returns , ...etc) a bad solution add column every reference type (sell id, purchase id, sales return id,etc.. ) , fill right 1 in each movement , let others null , of curse against normalization , can't add more reference later. what can in situation ? please consider i'm n

android - How to avoid reload data when tabs change? -

how can avoid recyclerview reload when tabs change? example, have tablayout 3 tabs, viewpager is: class viewpageradapter extends fragmentpageradapter { public viewpageradapter(fragmentmanager fm) { super(fm); } @override public fragment getitem(int position) { switch (position) { case 0: return new tab1fragment(); case 1: return new tab2fragment(); case 2: return new tab3fragment(); } return null; } @override public int getcount() { return 3; } @override public charsequence getpagetitle(int position) { switch (position) { case 0: return "tab1"; case 1: return "tab2"; case 2: return "tab3&qu

android - Extraction of Face From the picture -

i wanted add android application. editing getup of person. takes picture camera. remove in picture other face. using of link problem: http://www.stanford.edu/class/ee368/android/tutorial-2-opencv-for-android-setup-windows-api8.pdf now taking time research on this. thinking should ask experts here going in right direction? there other made solutions solve problem? extracting face picture accurate level. other suggestions work? after intend change hair styles of person picture! you can use v&j face detector opencv, works profile , near-profile faces. if you're willing consider options outside of opencv, should take @ blog post summarizes 48 face detection , recognition libraries: http://blog.mashape.com/post/53379410412/list-of-40-face-detection-recognition-apis

c# - Unit test for a Web API method without any injected dependency -

i have method in web api project , since it's pretty simple , there no injected dependency , deals concrete posted object, i'm not sure how create unit test it. there in design of below code change make more test-friendly? public class homecontroller : apicontroller { public httpresponsemessage post(rootobject root) { httpresponsemessage httpresponse; return trycreateresponse(root, out httpresponse) ? httpresponse : request.createerrorresponse(httpstatuscode.internalservererror, "an unhandled exception occurred on server."); } private bool trycreateresponse(rootobject root, out httpresponsemessage httpresponse) { var success = false; httpresponse = null; try { var creator = (modelstate.isvalid)? new okresponsecreator(root) ihttpresponsecreator: new badreqeuestresponsecreator(applicationsettings.httpbadrequesterrormessage); var abstract

android - Dagger 2 : Presenter is null -

need assistance in understanding why splash presenter returned null. following clean architecture. public class splashactivity extends baseactivity implements hascomponent<logincomponent> { @inject splashpresenter splashpresenter; private logincomponent logincomponent; @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); requestwindowfeature(window.feature_indeterminate_progress); //setcontentview(r.layout.spla); this.initializeinjector(); if (savedinstancestate == null) { // addfragment(r.id.fragmentcontainer, new userlistfragment()); } splashpresenter.initialize(); } private void initializeinjector() { this.logincomponent = daggerlogincomponent.builder() .applicationcomponent(getapplicationcomponent()) .activitymodule(getactivitymodule()) .loginmodule(new loginmodule())

amazon s3 - S3 Post Policy key not honoring folders -

i'm trying s3 html uploads working, i'm trying hard code define key name rather use ${filename} . controlled api server, when specify key folder separators , it's uploaded it's converted html entities of %2f . so have post policy of this: { "expiration": "2017-01-01t00:00:00z", "conditions": [ {"bucket": "mybucket"}, {"key": "i/1/1.png"}, {"acl": "public-read"}, {"content-type": "image/png"}, ["content-length-range", "0", "1048576"] ] } using html form so: <html> <head> <title>s3 post form</title> <meta http-equiv="content-type" content="text/html; charset=utf-8" /> </head> <body> <form action="https://mybucket.s3.amazonaws.com/" method="post" enctype="multip

PHP Associative array from encoded data -

i'm kinda new php , mysql simple syntax error or i'm having no luck using other examples. the array in db (json encoded): ["[\"option1\"=\u003e\"1\",\"someotherthing\"=\u003e\"abc\"]",""] fetching json encoded array userdata: if ($stmt = $con->prepare("select userdata users username=?")) { $stmt->bind_param("s", $username); $stmt->execute(); $result = $stmt->get_result(); $data = $result->fetch_assoc(); $json = json_decode($data['userdata']); echo $json[0]; } result: ["option1"=>"1","someotherthing"=>"abc"] why replacing "echo $json[0];" "echo $json['option1'];" won't work, although array decoded? edit: got sorted! trick using following: if ($stmt = $con->prepare("select userdata users username=?")) { $stmt->bind_param("s", $

c - How can I store the bits of a uint64_t inside of a double? -

basically have uint64_t actual value not care about. need store in double can store bits in object in r (if don't know is, that's fine, doesn't matter question). so means of storing 64 bits of uint64_t inside of double , convert double holding bits original uint64_t . i've been banging head against wall on quite bit (is pun?) , appreciated!!! as stated in comments, can use memcpy copy bits uint64_t double . this works because size of double same 1 of uint64_t (8 bytes). if try display values, won't same result, though. indeed double stores both positive , negative values, floating point, whereas uint64_t is... unsigned , whole. the binary representation same, interpreted value different.

javascript - Spring Boot Static Resources -

Image
i trying create spring boot mvc , angularjs. modified view resolver of app can point application on "web-inf/pages/" folder static html files. on html file declared source of angularjs libraries using webjars dependency <script src="webjars/angularjs/1.5.5/angular.min.js"></script> i know in order make work have declare classpath of webjars libray on application's resourcehandlerregistry on configuration file added line of code @override public void addresourcehandlers(resourcehandlerregistry registry) { registry.addresourcehandler("/webjars/**").addresourcelocations("classpath:/meta-inf/resources/webjars/"); } after adding line code somehow works makes me curious line on html file <script src="resources/js/angular/app.js"></script> i noticed on spring mvc application in order spring detect javascript files under webapp's resource folder have declare folder on resourcehandlerregistry

php - Laravel 5.1 Session not working outside Route::get -

i have code , working: route::get('addnew',function(){ $user = users::where('username','=',session('username'))->first(); $data = $user->toarray(); return view('layout.addnew')->with($data); }); route::post('addnew', ['uses'=>'userscontroller@addnew']); with code above: session('username') not null but, when use code below: $user = users::where('username','=',session('username'))->first(); $data = $user->toarray(); route::get('addnew',function() use($data){ return view('layout.addnew')->with($data); }); route::post('addnew', ['uses'=>'userscontroller@addnew']); with code above: session('username') null => $data non-object , code not working. somebody me, please! thank much! its better if this routes.php route::get('/addnew', &

Log4j Could Not Read Configuration File SELENIUM JAVA -

how log4j read properties file. i'm writing java testing selenium want use log4j. encounter error of log4j not read configuration file [error] ignoring configuration file . kindly advise , . in main method if have this: static logger log = logger.getlogger(testing.class); log4j.properties: log4j.rootcategory=debug, r # file log4j.appender.r=org.apache.log4j.rollingfileappender log4j.appender.r.file=d:/log4j.log # control maximum log file size log4j.appender.r.maxfilesize=100kb # archive log files (one backup file here) log4j.appender.r.maxbackupindex=1 log4j.appender.r.layout=org.apache.log4j.patternlayout log4j.appender.r.layout.conversionpattern=[%d{iso8601}]%5p%6.6r[%t]%x - %c.%m(%f:%l) - %m%n my testcase : @test //tested login public void testlogin_success() throws exception { try{ //propertyconfigurator.configure("log4j.properties"); driver = new firefoxdriver();

php - Nginx + php5-fpm = 404 Error with alias location -

i amateur front end web developer, , bought ubuntu server try hand @ backend development. trying figure out how serve php file aliased location block using php5-fpm. getting 404 - page not found error. have tried of proposed solutions find here no luck. still beginner love quick eli5 , pointers on rest of conf file, can learn too. should mention main root folder running flask app, , reason using aliased location. my virtual host: nginx conf file server { listen 80; listen [::]:80; server_name www.example.com example.com; root /var/www/example; large_client_header_buffers 8 32k; access_log /var/www/example/logs/access.log; error_log /var/www/example/logs/error.log; location / { proxy_http_version 1.1; proxy_set_header upgrade $http_upgrade; proxy_set_header connection "upgrade"; proxy_set_header x-real-ip $remote_addr; proxy_set_header x-forwarded-for $remote_addr; #$proxy_add_x_forwarded_for; proxy_set_header host $http_host; proxy_set

laravel - Nested eager loading with constraint not working -

i having hard time using nested constraint. can me group subjects based on semester offered. mycontroller public function show($id) { $student = student::with(['course', 'course.curriculum', 'course.curriculum.subjects' => function($query){ $query->groupby('sem_offered'); }])->findorfail($id); return view('students.show', compact('student')); } show.index @foreach($student->course->curriculum->subjects['first first-sem'] $subject) <tr> <td>{{ $subject->subject_code }}</td> <td>{{ $subject->subject_description }}</td> <td>{{ $subject->units }}</td> <td></td> <td>98</td> </tr> @endforeach

javascript - Angular Model value is not updated when select value changes -

i have following code in controller $scope.currencies = [ { "currency_code": "usd", "currency_name": "american dollar" }, { "currency_code": "aud", "currency_name": "australian dollar" }, { "currency_code": "brl", "currency_name": "brazilian real" }, { "currency_code": "cad", "currency_name": "canadian dollar" }, { "currency_code": "chf", "currency_name": "swiss franc" }, { "currency_code": "clp", "currency_name": "chilean peso" } ] $scope.selectedcurrency = "usd"; $scope.dostuffs = function(){ alert($scope.selectedcurrency); } and in view <div class="selected_currency">{{selectedcurrency}}</div> <select id="currency" name="currency" ng-model="selec

How are number of iterations and number of partitions releated in Apache spark Word2Vec? -

according mllib.feature.word2vec - spark 1.3.1 documentation [1]: def setnumiterations(numiterations: int): word2vec.this.type sets number of iterations (default: 1), should smaller or equal number of partitions. def setnumpartitions(numpartitions: int): word2vec.this.type sets number of partitions (default: 1). use small number accuracy. but in pull request [2]: to make our implementation more scalable, train each partition separately , merge model of each partition after each iteration. make model more accurate, multiple iterations may needed. questions: how parameters numiterations & numpartitions effect internal working of algorithm? is there trade-off between setting number of partitions , number of iterations considering following rules ? more accuracy -> more iteration a/c [2] more iteration -> more partition a/c [1] more partition -> less accuracy

Need help in XSLT for timezone conversion -

this xml data need change time zone indian time through xslt 2016-05-31t16:45:37.556z kindly on regards, siva try: <xsl:template name="utc-to-indian"> <xsl:param name="datetime"/> <xsl:variable name="date" select="substring-before($datetime, 't')" /> <xsl:variable name="time" select="substring-before(substring-after($datetime, 't'), 'z')" /> <xsl:variable name="year" select="substring($date, 1, 4)" /> <xsl:variable name="month" select="substring($date, 6, 2)" /> <xsl:variable name="day" select="substring($date, 9, 2)" /> <xsl:variable name="hour" select="substring($time, 1, 2)" /> <xsl:variable name="minute" select="substring($time, 4, 2)" /> <xsl:variable name="second" select=&qu

mysql - Error adding index to mysqlcluster database table -

i using root user (on sql node) , cannot alter/modify database tables accessed remotely. database table accessed locally can modified though. view concurrently used database used show full processlist . below command/errors occured. how past these errors ? mysql> alter table `sks_staff_office` add index `pid_index` (pid); error 1296 (hy000): got error 156 'unknown error code' ndbcluster mysql> create online index pid_index on sks_staff_office(pid); error 1296 (hy000): got error 156 'unknown error code' ndbcluster mysql> alter online table `sks_staff_office` add index `pid_index` (pid); error 1296 (hy000): got error 156 'unknown error code' ndbcluster thank you.

Android Studio not recognizing imported Module as Git -

i searched internet on solution problem , maybe using wrong keywords: i imported open source library module android project version controlled svn. use git , after deleting of .svn folders committed library git command line. however, after doing android studio still highlights them red meaning unknown vcs. when try add module vcs through android studio brings massive error saying each file not recognized .svn! have deleted .svn files have no idea issue lie. any suggestions debugging (or easier ways eliminate svn , put git) appreciated. i able solve problem in ".idea/vcs.xml" file in project root. here's issue: <?xml version="1.0" encoding="utf-8"?> <project version="4"> <component name="vcsdirectorymappings"> <mapping directory="$project_dir$" vcs="git" /> <mapping directory="$project_dir$/sdktools" vcs="svn" /> </component> &l

Django 1.9 with Python 3.4 with MySQL support (Fedora) -

the question simple: how can used mysql database django 1.9 + python 3.4 in fedora? i'm using virtualenv if adds more info. i tried installing mysqlclient didn't work. , don't know how go mysql connector python described here: mysql db api drivers when try install mysqlclient pip fails with: oserror: mysql_config not found . for python2 try steps: yum install mysql mysql-server chkconfig --levels 235 mysqld on /etc/init.d/mysqld start # create username , password in mysql # create db in mysql yum install mysql-python for python2 or python3: pip install mysqlclient sudo apt-get install python3-dev libmysqlclient-dev in settings.py databases = { 'default': { 'engine': 'django.db.backends.mysql', 'name': db name, 'user': username, 'password': password, 'host': 'localhost', 'port': 80, } }

javascript - How to append multiple child elements to a div in d3.js? -

i'm trying append 2 span s div using following code: d3.select("#breadcrumb") .append("span") .attr("class","breadcrumb-link") .text(d.name) .append("span") .text("/"); but adds elements like: <div id="breadcrumb"> <span> <span> </span> </span> </div> i want add span s siblings: <div id="breadcrumb"> <span> </span> <span> </span> </div> i know can done first selecting div , using 2 statements each span . can in single chained statement? d3.js based on idea of data-driven documents. said, typically you'll have data array gonna join selection . with in mind try simple hack joining selection d3.select("#breadcrumb") "artificial" array [1, 2] . this: d3.select("#breadc

sql - R language sqldf package update table not working -

i exported data csv file r. using sqldf package udpate data. below query runs. can provide csv file dont know how attach files here :( > sqldf("select * + ( + + select disposition dummy_disposition, case disposition + when 'disposition' 'unknown' + when 'donate' 'eol' + when 'resale' 'eol' + when 'harvest' 'eol' + when 'intelspinoff' 'eol' + when 'scrap' 'eol' + when 'bufferfeedforward' 'active' + when 'fb' 'unknown' + when 'unknown' 'unkown' + when 'harvestresale' 'eol' + when 'returntosupplier' 'eol' + when 'icapresale' 'eol' + when 'nonemsmanaged' 'eol' + when 'buffereol' 'eol' + when 'resalescrap' 'eol' + when 'st' 'unknown' + when 'as' 'unknown' + else null end new_status, + + *