Posts

Showing posts from July, 2015

ios - passing __block parameters to class method (for get request) -

i want create following class method: +(void) getvalue4key:(nsstring*)p_key andset:(id)p_variable { nsstring *baseurlstring = <<myurl>>; @try{ afhttprequestoperationmanager *manager = [afhttprequestoperationmanager manager]; [manager get:baseurlstring parameters:nil success:^(afhttprequestoperation *operation, id responseobject) { nsdictionary* element = responseobject[0]; element = [element objectforkey:@"fields"]; p_variable = [element objectforkey:@"value"]; } failure:^(afhttprequestoperation *operation, nserror *error) { nslog(@"getsystemvariablekey error: %@",error); }]; } @catch (nsexception *exception) { nslog(@"exception %@", exception); } } two questions: i following error: variable not assignable (missing __block type specifier) how can s

Optimizing SQL Server 2012 Query -

Image
i have query runs 12 hours. the query left joins on 5 tables , reports on bunch of monthly metrics. here query: select datepart(yyyy,referral_dt) refyear, datepart(mm,referral_dt) refmonth, case when cast(referral_dt date) between '1/1/2013' , '4/14/2013' 'q1' when cast(referral_dt date) between '4/15/2013' , '7/14/2013' 'q2' when cast(referral_dt date) between '7/15/2013' , '9/30/2013' 'q3' when cast(referral_dt date) between '10/1/2013' , '12/31/2013' 'q4' when cast(referral_dt date) between '1/1/2014' , '4/14/2014' 'q1' when cast(referral_dt date) between '4/15/2014' , '7/14/2014' 'q2' when cast(referral_dt date) between '7/15/2014' , '9/30/2014' 'q3' when cast(referral_dt date) between '10/1/2014&

ruby on rails - Active Admin checkboxes not selected when edit model -

i'm using custom collection display checkboxes schedule. saves, when try edit returns me unchecked. why? f.inputs for: :schedule, name: 'employee schedule' |sf| sf.input :sunday, as: :check_boxes, collection: available_hours, method: :to_s sf.input :monday, as: :check_boxes, collection: available_hours, method: :to_s sf.input :tuesday, as: :check_boxes, collection: available_hours, method: :to_s sf.input :wednesday, as: :check_boxes, collection: available_hours, method: :to_s sf.input :thursday, as: :check_boxes, collection: available_hours, method: :to_s sf.input :friday, as: :check_boxes, collection: available_hours, method: :to_s sf.input :saturday, as: :check_boxes, collection: available_hours, method: :to_s end def available_hours (0..23).map { |h| ["#{h}h às #{h.next}h", h] } end helper_method :available_hours i found solution question my collection remains unaltered def available_hours array(0..23) end a

c# - MSAA finds controls UI Automation doesn't -

i'm working on automating windows application. i'm using teststack white framework. i've hit problem. program has 'window' object cannot see inside of. white shows no controls inside of it. inspect.exe shows no controls inside of either when running in ui automation mode. if switch inspect msaa see controls inside fine. there anyway me use msaa c# handle on these controls? if can identify msaa functions need, can use p/invoke call them c#. here's example article doing msaa: http://www.codeproject.com/articles/38906/ui-automation-using-microsoft-active-accessibility also, pinvoke.net can used identify iaccessible (msaa) functions: http://www.pinvoke.net/search.aspx?search=iaccessible&namespace=[all] here's answer along lines: msaa com-based? finally, alternative p/invoke, might able use tlbimp.exe create wrapper assembly oleacc.dll, , access msaa functions through it. i'm not sure if works msaa, it's worth try. as e

php - Parse error: syntax error, unexpected 'return' (T_RETURN) error -

function adddate( $date, $adday ) { list( $year, $month, $day ) = year return date( "y-m-d", mktime( 0, 0, 0, $month, $day + $adday, $year ) ); } cant see error function adddate( $date, $adday ) { list( $year, $month, $day ) = $date; return date( "y-m-d", mktime( 0, 0, 0, $month, $day + $adday, $year ) ); } this should closer looking for. if clarify question can clarify answer.

excel - For or While loop to find data and paste it into correct location -

this simple questions have been unable find answer. i'm trying iterate through column of operator names on 1 worksheet appear on worksheet in same workbook. each name want trigger if statement pulls data original worksheet pastes data in cell next operator's name. problem i'm having don't know how set loops. code below, know mess because cannot loop variables defind correctly (it gives compile error "next without for" right now). appriciated. sub operatorscrap() dim str_datemin string dim str_datemax string dim datemin date dim datemax date dim lastrow long dim subtotal double dim lookupdate date dim subtotal2 dim oprange dim orange variant dim opname dim scraprange dim scrapr variant oprange = "b32:b" & range("b" & cells.rows.count).end(xlup).row scraprange = "c32:c" & range("c" & cells.rows.count).end(xlup).row lastrow = sheet1.cells(rows.count, 1).end(xlup).offset(0, 0).row subtotal = 0 subt

Delete first two columns in CSV with PowerShell -

i need delete first 2 columns in csv. not know header names, not static. figured out how remove first 2 rows, not first 2 columns. sample code working below $csv = import-csv 'input.csv' $headers = $csv[0].psobject.properties | select -expand name $step = 4 ($i = 0; $i -lt $headers.count; $i += $step) { $csv | select $headers[$i..($i+$step-1)] | export-csv "output_$($i/$step).csv" -notype } this seems work: $csv = import-csv 'input.csv' $include = $csv[0].psobject.properties | select -expandproperty name -skip 2 $csv | select $include -skip 2 | export-csv output.csv -notypeinformation that should take care of pruning off first 2 columns , skipping first 2 rows.

html - Dynamic text in email -

i'd make system can send emails dynamic content. instance, let's regret email sent , want delete last paragraph out of it. my first idea link (not embed) image loads server, , since have control of server can change image. image screenshot of whatever rendered html looking send. have text, images, etc. thing receive in inbox single image. this question identifies difference between linking , embedding: images in email: link or embed? however, kind of obnoxious receiver because can't select text. there way link text/html/anything besides image?

javascript - replacing <select> aroow with a custom image and make it open dropdown -

Image
i have drop down in page. disabled default arrow comes select , on layed custom arrow ( icon font). issue facing when click on custom arrow, drop down doesn't open up. there way working. html mark up: <span class="drop-down-arrow"></span> <select name="" id="subject" class="applicationdropdown"> <option value="option 1">o[tion 1</option> <option value="o[tion 2">o[tion 2</option> <option value="other">other</option> </select> css code: select{ -webkit-appearance: none; -moz-appearance: none; } .applicationdropdown{ background:#e6e6e6; color:#989898; @include rem-px(font-size,(16px)); @include rem-px(height,(50px)); max-height:200px; overflow-y:scroll; outline : none; transition: none; } span.drop-down-arrow{ background: #a4cf53; display: blo

Ordering cluster list by cluster size, R igraph -

Image
i have network (g) thousands of clusters, can't seem figure out how order them size. looks membership attribute sorts clusters arbitrarily. example: c <- clusters(g) c$membership gs <- induced.subgraph(g, c$membership==1) this indeed give me largest cluster, if try gs <- induced.subgraph(g, c$membership==2) it doesn't give me second largest cluster, arbitrary cluster happens second in list. is there way order c$membership according cluster size, i.e., 1 – largest, 2 – second largest, etc.? you way: # largest subgraph gs <- induced.subgraph(g, c$membership==order(-c$csize)[1]) # second largest subgraph gs <- induced.subgraph(g, c$membership==order(-c$csize)[2]) # etc... here's working example. library(igraph) g <- graph.full(5) %du% graph.full(4) %du% graph.full(3) set.seed(1) # reproducible plots par(mar=c(0,0,0,0),mfrow=c(1,2)) plot(g) c <- clusters(g) gs <- induced.subgraph(g, c$membership==order(-c$csize)[1]) plot(g

ruby - Tests not run automatically -

i'm trying setup guard in exercism folder, tests automatically run (using guard-minitest). the folder structure looks this: . ├── exercism └── ruby    ├── bob    │   ├── bob.rb    │   ├── bob_test.rb    ├── etl    │   ├── etl.rb    │   ├── etl_test.rb ...    └── binary_search_tree       ├── bst.rb       ├── binary_search_tree.rb       └── readme.md due unusual folder structure, made following configuration in guardfile: # tell guard watch folders under ruby/ all_dirs = dir.glob('ruby/*') directories all_dirs options = { test_folders: all_dirs, test_file_patterns: '*_test.rb', pride: true } guard :minitest, options watch(%r{^ruby/([^/]+)/([^/]+).rb$}) end with setup expect tests run after edit .rb file. i run guard in debug mode. all tests run on startup, expected. however, when edit .rb file tests not run again, although guard outputs this: 20:43:26 - debug - interactor stopped or killed 20:43:26 - debug - hook :

jquery - How do I integrate variable in strings (javascript) -

i trying this: var newpositiononx = 400px; $(".element").css("transform", "translate(0,newpositiononx)"); thank you! try this: var newpositiononx = 400; $(".element").css("transform", "translate(0, " + newpositiononx + "px)");

javascript - Execute function after the user finishes using the slider -

i want execute function after user has finished using slider , not while slider being manipulated. only after handle stops, start function. remember doing using settimeout , cleartimer don't remember how exactly. $('#slider').on('slide', function(){ some_function(); }); note using nouislider , not jquery. looks me want callback on set event, occurs when user stops sliding. $('#slider').on('set', function(){ some_function(); }); http://refreshless.com/nouislider/events-callbacks/

ios - Integration from mobile app with passbook to direct user to add credit card to Apple Pay -

is there way re-direct user ios mobile app passbook enter credit card apple pay? for example, can mobile banking or credit card application credit issuer -create button direct user add credit card apple pay? presume require launching of passbook appropriate place add credit card in passbook. think physical card still required. you can't detect whether user has card or not (at least, there's no documented way; credit card issuers might have access special api). user doesn't physically need card add it. you can open passbook app so: [[uiapplication sharedapplication] openurl:[nsurl urlwithstring:@"shoebox://"]]; however, isn't documented, , might break in future versions of ios, settings url scheme broke in ios 6.

How can is initialize all variables in a Java class at once to zero -

i have java code class variables , rather set them particular value, i'd initialize zero. in c/c++, can memset() on size of structure, how do same thing in java? primitives default zero. objects default null. see https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html . however, article mentions, relying on default value in java considered bad practice. better practice set them either when declare them or in constructor.

jquery - overriding backbone js sync method to add xhr event listener -

sync: function(method,model,options){ options.beforesend = function(xhr,settings) { settings.xhr = function() { console.log('test'); } } return backbone.sync(method,model,options); } i implement progress bar model fetch, , have added code above override sync access xhr method. however, doesn't seem fire or anything. i'm using jquery 2.0.3 , backbone 1.1.2 edit: the problem have updateprogress fire once @ end. options.beforesend = function(xhr,settings) { settings.xhr = function() { var xhr = $.ajaxsettings.xhr(); xhr.addeventlistener("progress", updateprogress, false); function updateprogress(event){ console.log('loaded:'+event.loaded+' total:'+event.total); math.ceil(event.loaded/event.total*100); } return xhr;

SUMIFS Values from non consecutive Column Cells -

i need tu sum several cells separated 1 another, these cells c3,f3,i3,l3,o3,r3,u3,x3,aa3,ad3,ag3,aj3,am3,ap3,as3,av3,ay3,bb3,be3,bh3,bk3,bn3,bq3,bt3,bw3,bz3,cc3,cf3,ci3,cl3,co3 if other cells $c$1,$f$1,$i$1,$l$1,$o$1,$r$1,$u$1,$x$1,$aa$1,$ad$1,$ag$1,$aj$1,$am$1,$ap$1,$as$1,$av$1,$ay$1,$bb$1,$be$1,$bh$1,$bk$1,$bn$1,$bq$1,$bt$1,$bw$1,$bz$1,$cc$1,$cf$1,$ci$1,$cl$1,$co$1 that on same column different row >= number given , <= other given number, returns #value, can me find out doing wrong? this function writing: =sumifs((c3,f3,i3,l3,o3,r3,u3,x3,aa3,ad3,ag3,aj3,am3,ap3,as3,av3,ay3,bb3,be3,bh3,bk3,bn3,bq3,bt3,bw3,bz3,cc3,cf3,ci3,cl3,co3),($c$1,$f$1,$i$1,$l$1,$o$1,$r$1,$u$1,$x$1,$aa$1,$ad$1,$ag$1,$aj$1,$am$1,$ap$1,$as$1,$av$1,$ay$1,$bb$1,$be$1,$bh$1,$bk$1,$bn$1,$bq$1,$bt$1,$bw$1,$bz$1,$cc$1,$cf$1,$ci$1,$cl$1,$co$1),">="&b55,($c$1,$f$1,$i$1,$l$1,$o$1,$r$1,$u$1,$x$1,$aa$1,$ad$1,$ag$1,$aj$1,$am$1,$ap$1,$as$1,$av$1,$ay$1,$bb$1,$be$1,$bh$1,$bk$1,$bn$1,$bq$1,$bt$

go - Golang Virtual Memory - heroku -

using gorelic plugin, i've noticed virtual memory on heroku dyno steadily climbing though memory usage looks fine. virtual memory never appears exceed 1000m, when gets close start notice performance degradation. i've used pprof profile memory usage of app , looks it's free of leaks. also, i've read suggests go reserve large blocks of virtual memory , it's nothing worry about. is possible large virtual memory usage affecting performance on 1x heroku dyno? need use 2x dynos because go memory hog? possible configure go uses less virtual memory? thanks!

ios - in what object OR cons type should I store countDownDuration data? -

i have model class sub-class of nsmanagedobject, class created .model entity. whenever click "save" method want give model class count down time, each object of class have it's countdown time , can fire each object... i'm beginner helpful if can give me guidance in type of object should store count down time selected? i know how log it: - (ibaction)save:(id)sender { nsdateformatter *formatter = [[nsdateformatter alloc] init]; [formatter setdateformat:@"hh:mm"]; nslog(@"%@", [formatter stringfromdate:[datepicker date]]); } thanks

php - symfony2 rendering of a form as form type -

i have 2 entities invoice , customer. have 2 forms invoiceform , customerform. when create new invoice (with invoiceform), want able create new customer (just one). here how (and works): <?php namespace acme\demobundle\form; use symfony\component\form\abstracttype; use symfony\component\form\formbuilderinterface; class customerform extends abstracttype { public function buildform(formbuilderinterface $builder, array $options) { $builder ->add('firstname') ->add('lastname') ->add('phone'); } public function getname() { return 'customer_create'; } } <?php namespace acme\demobundle\form; use symfony\component\form\abstracttype; use symfony\component\form\formbuilderinterface; class invoiceform extends abstracttype { public function buildform(formbuilderinterface $builder, array $options) { $builder ->add('title')

xcode - UIViewController leaving Space in bottom -

Image
i upgrading old project ios4 latest ios8. there 2 or 3 view controllers don't right, navigationbar seem cover portion of view , leaving space in bottom. can't seem figure out no matter changed settings removing/adding topbar/statusbars/bottombars, xib file looks alright, not when run on simulator or device. here screenshot of looks like. if see right, uiimageview holding backgroundimage... ?!? i can guess, should change uinavigationbarstyle translucent opaque... bring lower, supposed be.

linux - Managing php daemon -

how can manage daemon web without changing simple cli runtime php-fpm? the daemon starts automatically after os starts , works cli-application without php-fpm pool. basic ideology of daemon eco-system work without php-fpm pool (cli-sapi). server configuration: debian 7 apache 2.2 php5-fpm (v 5.4.35) — mod_fastcgi daemon.php daemon_manager.php — management script start|stop|restart|kill daemon.php command line. daemon_manager_web.php — administrator script managing daemon browser. daemon.php regular php daemon this: <?php declare(ticks=1); ini_set("max_execution_time", "0"); ini_set("max_input_time", "0"); set_time_limit(0); /* catching signals */ function sig_handler($signo) { switch ($signo) { case sigquit: case sigterm: // work pcntl_wait($status); break; //... } } pcntl_signal(sigterm, 'si

c# - VS2013 publish Web deployment task failed The file is in use -

i using vs2013 premium publish site windows server 2012. files publish ok except these: sqlservertypes\x64\msvcr100.dll sqlservertypes\x64\sqlserverspatial110.dll sqlservertypes\x86\msvcr100.dll sqlservertypes\x86\sqlserverspatial110.dll i kind of errors each of above files tried publish: web deployment task failed. (the file 'msvcr100.dll' in use. learn more at: http://go.microsoft.com/fwlink/?linkid=221672#error_file_in_use .) interrestingly, these files published first time (when not on server), no longer overwritten. tried 2 different web servers. have followed guide here: http://blogs.msdn.com/b/webdev/archive/2013/10/30/web-publishing-updates-for-app-offline-and-usechecksum.aspx ...but managed put site offline (vs placing app_offline.htm) publish still fails same error. other files publish perfectly. any ideas? you can take app offline during publishing should free lock on file , allow update it. i blogged this while back. support outlined

django - celery parallel tasking error 'no result backend configured' -

running django-celery 3.1.16, celery 3.1.17, django 1.4.16. trying run parallel tasks using 3 workers , collect results using following: from celery import group positions = [] jobs = group(celery_calculate_something.s(data.id) data in a_very_big_list) results = jobs.apply_async() positions.extend(results.get()) the task celery_calculate_something returns object place in results list: app.task(ignore_result=false) def celery_calculate_something(id): <do stuff> no matter try, same result when calling get() on results: no result backend configured. please see documentation more information. however, results backend configured - have many other tasks ignore_result=false merrily adding tasks meta table in django_celery. using results returned group(). should note not set explicitly in settings - seems django-celery has set automatically you. i have worker collecting events using: manage.py celery worker -l info -e and celerycam running python manage.py cel

Issues with understanding "this" in javascript -

i have following function. javascript tutorial i'm reading says should output 2, i'm getting undefined in text editor (js fiddle). what reason? have strict mode vs non-strict mode? function foo(){ console.log( this.a ); } var = 2; foo(); //should output "2" i'm getting undefined. why? that's because running code in function wrapper jsfiddle creates. default onload puts code in function runs on load event. that makes a variable local function, , not global variable. when try access using this.a variable in window.a (as this point window object), variable not global can't found there. if choose no wrap - in <head> or no wrap - in <body> put code, 2 output.

singleton class misuse, c++ - explanation needed -

i came across tought wasn't possible in c++ (i learning it) i called nonstatic function without initializing class(singleton class) object or wtf happend, im not grasping it, == null , way did - my singleton class example: class lightslogic { public: void lightslogic::request_color_shift_group_after_x_msecs(blabla); int current_used_chase_list = 0; // singleton class thing below private: lightslogic() { // constructor here ! }; lightslogic(lightslogic const&); // don't implement. // singleton void operator=(lightslogic const&); // don't implement // singleton public: static lightslogic& getinstance() // return reference. // singleton { static lightslogic instance; return instance; } }; so somewhere defined: static lightslogic* logicofligths; and called method class logicofligths->request_color_shift_group_after_x_msecs(blabla); now happend - method used variable: void light

linux - Writing variables into X window titlebars other than terminal/console windows -

long story short i wish replicate function of microsoft windows (probably tm / (c) / r or something) application titlebarclock on x - fluxbox 1.3.5 on arch linux (3.17.4-1-arch on i686). would able me that? thanks. long story long to time @ moment command executed on terminal/console window titlebar export ps1="[\e]2;\t : \u@\h \w\a\e[32;1m]>[\e[0m] " to updating time moment command executed on terminal/console window titlebar while : sleep 1 & echo -ne "\033]0; date +"%d-%b-%y %i:%m:%s %p" \007" wait $! done ) & but if want information on top of active window, not permanently on specific terminal window (possibly on different desktop active one)? i found out wmctrl yesterday, don't know i'm talking (no s**t, sherlock!) but, if it's @ possible replicate it, using wmtrl -r, -t , :active: and/or other method, couldn't say, because don't know enough x myself , haven't found closer answer after week o

java - How do I add a key listener to a LWJGL display? -

i trying add key listener display lwjgl. can see getting error in code, , think problem caused because trying trying add key listener, "input", class. in examples have seen key listener added jframe, not using 1 don't know add to. i'm providing class having error in , key listener created. please ignore of comments because majority of them failed pieces of code. error i'm getting on line 39 of initializer. line "this.addkeylistener(input);". thing wanted add, code between long lines of "/"s useless better ignore them. thank help. import java.awt.cursor; import java.awt.point; import java.awt.toolkit; import java.awt.image.bufferedimage; import java.util.random; import org.lwjgl.lwjglexception; import org.lwjgl.input.keyboard; import org.lwjgl.input.mouse; import org.lwjgl.opengl.display; import org.lwjgl.opengl.displaymode; import static org.lwjgl.opengl.gl11.*; public class initializer { static int height = 800; static int wid

Rails: Render Form on Index -

i want able use <%= render 'form' %> on index page. correct way go that? appears work, however, want ensure correct method of doing this. class reminderscontroller < applicationcontroller ... def index @reminders = reminder.all @reminder = reminder.new end .... there nothing wrong including 'new'/'edit' form in index view. it's not 'normal' rails way work. remember, once filled out form on page, still need submit form (you can submit 1 @ time). kinda gets tricky. if want create , update reminders same page, must have different forms different actions. 'new' form like: <%= form_for @reminder, url: {controller: "reminders", action: "create"} |r| %> <form code goes here> <%= r.submit %> <% end %> and 'edit' form(s) like: <%= @reminders.each |reminder| %> <%= form_for reminder, url: {controller: "reminders", action: &

spring - Polling Multiple email accounts from one app -

i supposed poll 3 email inboxes on our mail server using spring integration have 3 inbound email adapters doing , each poller handling different business logic. assuming inboxes i1,i2 , i3 problem arises when , sends 1 email 3 email ids in address .(i1@domain.org,i2@domain.org,i3.domain.org) . 3 pollers pick emails each inbox expected. is there way determine right 'to' address each email poller , value in mail_to header . right has (i1@domain.org,i2@domain.org,i3.domain.org) in . according comment other answer, "right" mean identify adapter email originated at. it's not clear why need this, given each processed "different business logic" anyway. can see if adapters feed same logic might useful. there's no way have adapter add header itself. you add <header-enricher/> right after each adapter add header identify adapter received message. edit: (for comments below). you can't use <int-mail:header-enricher/&g

spring - The specified HTTP method is not allowed for the requested resource -

i using spring 4.1 , rest controller signature looks like: @restcontroller @requestmapping("/api/device") public class apirestcontroller { public responseentity<response> singleresponse() { system.out.println("sdr get"); singledataresponse res = new singledataresponse(); res.setcmd("8028"); res.setdata("xyz"); res.setrfu("rfu"); res.setsid("99"); return new responseentity<response>(res, httpstatus.ok); } @requestmapping(value = "/single-res-post", method = requestmethod.post) @responsestatus(httpstatus.created) public responseentity<response> singleresponsepost( @requestbody singledatarequest req, httpservletrequest request, httpservletresponse response) { system.out.println("sdr post"); singledataresponse res = new singledataresponse(); res.setcmd(req.getcmd(

MySQL - DELETE FROM with subquery -

im trying execute query i'm getting error #1064. delete tableabc id in (select id `tablexyz` `qty` = 0); but following statement works select * tableabc id in (select id tablexyz qty = 0); here answer: to use delete query subquery has condition, following: delete `tableabc` join (select id `tablexyz` `qty`=0) b on b.id = a.id

css - Delay for 1 second the disappearance of a dropdown menu when the mouse is moved away, unless it is returned -

Image
here html navbar <nav> <ul id="mainnav"> <li><a href="#">a thing</a></li> <li><a href="#">some stuff</a> <ul> <li><a href="###">dropdown1</a></li> <li><a href="###">dropdown2</a></li> </ul> </li> </ul> </nav> and javascript <script type="text/javascript"> $('#mainnav ul').hide(); $('#mainnav li > a').hover( function () { //show submenu $('ul', this.parentnode).stop().slidedown(0) = set } ); $('#mainnav li').hover(null, function () { //hide submenu $('ul', this.parentnode).stop().delay(1000).slideup(0); }); i got javascript jsfiddle , made work out. quite competent in html , css, ap

css - Placeholder text padding -

is possible have individual padding or margins on placeholder text or forced text-align:center; example http://www.bootply.com/ei0b9daoqq you have give class name each of input , give specific padding each of them link html <input class="form one" type="text" name="name" placeholder="first , last name"></div> </div> <div class="row col-md-3"> <input class="form second" type="email" name="phone" placeholder="@gmail.com"> </div> <div class="row col-md-3 "> <input id="email" class="form third" type="tel" name="zip" placeholder="zip "> </div> css .form { background-color: #666; color:#fff; } .second::-webkit-input-placeholder{ color:white; letter-spacing: 1px; font-family: "helvetica neue", helvetica, arial, sans-serif; padding-left:40px; } .third::-

php - mysql db normalization help required -

please forgive me ive been confused , need in normalization of next mysql database (will work on along php). if not allowed post ignore :) i've need record large number students visit library in order document , create analysis , reports later on. these visits hold lots of data , criteria each student single visit, , filled different supervisor people because student visit more 1 section. hence, there limitations entry , disallowing parts of form accessed users...etc. my plan have single form initial student information , select boxes, radio, checkboxes, , notes free text, each visit, mentioned, using php frontend this have in mind, 2 main tables + other smaller tables hold select boxes data foreign keys. table1: students student_id student_number student_name student_gender student_grade student dateofbirth student age table2: visits studnet_id (referring , pulling student info table1) date_of_visit have_did_this_during_the_visit (dropdown) psychol

java - If connection is closed by a Database, do I need to close it manually? -

this question has answer here: closing database connections in java 6 answers i have connection pool. in getconnection() method poll connection queue variable , check whether closed isclosed() method. if closed set variable new connection drivermanager.getconnection(url, user, password) method. the question is: need close connection mannualy close() method before rewriting varible ensure connection collected garbage collector? it not needed (recommended) . if call close() manually after connection has been closed, there no action performed on connection object.

Google Distance Matrix API - Find distance between a given place and nearest bus stop, restaurant etc -

i need use google distance api find distance between given place , nearest bus stop, atm, police station etc. not being able so. whenever write atm+cityname, gives weird results. destination perceives thousands of kms away origin. think need know format of url achieve goal. what looking not possible in 1 step, distancematrix-api uses geocoding(which requires addresses or latlng's), looking places. first run places-nearbysearch , request distancematrix-service based on locations returned nearbysearch

java - Axis2 web service invocation error -

i tried create simple tester service , exception: exception in thread "main" org.apache.axis2.axisfault: java.lang.unsupportedoperationexception: access occurred not valid. @ org.apache.axis2.util.utils.getinboundfaultfrommessagecontext(utils.java:531) @ org.apache.axis2.description.robustoutonlyaxisoperation$robustoutonlyoperationclient.handleresponse(robustoutonlyaxisoperation.java:91) @ org.apache.axis2.description.outinaxisoperationclient.send(outinaxisoperation.java:421) @ org.apache.axis2.description.outinaxisoperationclient.executeimpl(outinaxisoperation.java:229) @ org.apache.axis2.client.operationclient.execute(operationclient.java:165) @ pinservice.pinoperationstub.changepin(pinoperationstub.java:496) @ pinservice.pinoperationtester.main(pinoperationtester.java:22) any on troubleshooting error or thoughts on why happens ? it incorrect use of message receiver (in-out , in-only). make sure update services.xml file correct c

javascript settimeout on Android context switch -

in javasscript, use settimeout repeatedly redraw html5 canvas. function dodraw() { drawoncanvas(); settimeout(dodraw, 20); } i have problem on android browser. (perhaps on ios, haven't tested yet...) : 1. runs ok 2. press android "home" button , someting else 3. come browser. 4. problem: settimeout not scheduled execute again. so screen refresh loop stops, , game "dead". edit: now, continued investigating. turns out settimeout still works. real problem canvas disapeard screen, , nothing draw shows. canvas blank. for rendering loops advised use requestanimationframe because knows when schedule callback, best possible time slot in browser repaint completed. using settimeout skip frames , that'll result in serious jankyy animation and far question concerned can restart loop on document load window.onload = function() {dodraw();} i hope works .

node.js - Tabular Browser Windows for Atom-Shell? -

i'm playing around atom-shell , wondering if has used/written module making tubular browser windows? currently, seems, atom-shell opens new window when instantiating browserwindow : var win = new browserwindow({ width: 800, height: 600, show: false }); win.on('closed', function() { win = null; }); win.loadurl('https://github.com'); win.show(); is there way of tabularising window, in atom application? or have write functionality inside current browserwindow in order work? there no way create native tabs in atom shell. being said, @zcbenz suggests entirely doable <webview> tag, allows safely host arbitrary web content inside atom shell.

c# - EFilm converted DICOM image displaying in accurately -

Image
i trying view dicom image has been converted efilm workstation . used toolkit http://www.codeproject.com/articles/36014/dicom-image-viewer but if loading other images direct workstation okay . the study ct brain plain ge machine . if lack of information please ping .

C++ "Bus error: 10" and working with pointers -

i'm doing data structures exercise , have been blocked since yesterday bus error, reckon because i'm doing bad things memory. cannot figure out exactly. these requirements have established practice: able add product (any way do) list able retrieve product in list @ current position (next, prev, movetostart, movetoend… there's cursor pointer, called "actual" here) any changes retrieved product should updated in data structure (ie. list::retrieve(*product), product->visits++) this code have. apologies var names, have in spanish , therefore names in spanish. class producto { // product public: string marca; double precio; int visitas; int compras; producto () {} producto (string m, double p, int v = 0, int c = 0) : marca(m), precio(p), visitas(v), compras(c) {} }; class nodo { public: producto valor; // value nodo *siguiente; // next nodo *anterior; // prev nodo (producto p, nodo *a = null, nodo *s = null)

android - Error when executing an asynchTask -

i have viewpager actiontabs each action tab has own layout. in 1 of layouts have button when clicked asynctask changes background color should executed shown below. at run time receive below errors logcat. please have @ logcat errors , kindly let me know missing in code. code class asynccolor extends asynctask<string, integer, string> { @override protected void onpreexecute() { // todo auto-generated method stub super.onpreexecute(); } @override protected string doinbackground(string... params) { // todo auto-generated method stub (int = 0; < params.length; i++){ rl_3.setbackgroundcolor(color.parsecolor(params[i])); } return "done"; } @override protected void onprogressupdate(integer... values) { // todo auto-generated method stub super.onprogressupdate(values); } @override protected void onpostexecute(string result) { //

r - shiny: plot a graph from source file dependent on input -

so trying out shiny, , have problem. what want selectinput can select different option , graph. these different graphs ggplot2 graphs created in source file. graphs have called. not seem figure out how that. graphs ggplot2 graphs , fine, load perfectly, assume that not problem. i want have text output depends on selectinput. so here server script: shinyserver( function(input, output) { output$map <- renderplot({ plot <- switch(input$activity, "" = null, "act1" = plot1, "act2" = plot2, "act3" = plot3, "act4" = plot4, "act5" = plot5, "act6" = plot6) plot }), output$text1 <- rendertext({ text <- switch(input$activiteit, "" = null, "act1" = paste("blabla"), "a

spring - @ResponseStatus and @ResponseBody not working with @ExceptionHandler -

i tried implement @controlleradvice globally handle general exceptions related web application. wanted send wrapped json response response status set accordingly. here code sample. @controlleradvice public class globalerrorhandler { @responsestatus(httpstatus.bad_request) @exceptionhandler(exception.class) @responsebody public response handleallerrors() { response wrapped = new response(httpservletresponse.sc_bad_request, "error"); wrapped.setmessage("could not retrieve data"); return wrapped; } } response pojo used wrap response. problem is, despite @responsestatus annotation, response has status code 500 (internal server error) default error page showing stack trace. @responsebody seems not work. documentation states send json response on @exceptionhandler method. don't understand i'm doing wrong in here. i'm using spring 3.2.8 release framework , gson used message conversion, if matters. a

detect - What is the state-of-art algorithms for planar object recognition? -

i read sift, surf, fern, brift , evolution algorithms. not sure algorithms best. need help. of course know each algorithms have own advantages, here key classify: which fastest in training/ recognize phases? which consume fewest memory in runtime? which can implement detect 3d object? thank you, , sorry bad english. in case, want implement application on smartphone recognize known object . your question bit complicated. there no optimal methods cases methods suit specific cases. if decide use local descriptors in method advise started using sift / surf popular descriptors not efficient (slow) , require lot of memory. after that, can try replace them binary descriptors (eg. brief, orb, brisk, freak) more efficient , require less storage. but said before depends on want implement, , requirements of application.