Posts

Showing posts from March, 2015

Flash.h errors with Arduino 1.0.6 and Teensy 3.1 (Teensyduino, Version 1.20) -

i have been using flash.h library ( http://arduiniana.org/libraries/flash/ ) version 5 arduino 1.0.5 , teensy 3.1 without issues. had upgrade version 1.0.6 , getting error [removed path message] /.../libraries/flash/flash.h: in member function 'char* _flash_string::copy(char*, size_t, size_t) const': /.../libraries/flash/flash.h:79:44: error: operands ?: have different types 'int' , 'char*' and code in flash.h char *copy(char *to, size_t size = -1, size_t offset = 0) const { return size == -1 ? strcpy_p(to, _arr + offset) : strncpy_p(to, _arr + offset, size); } at first glance can see operand comparing strcpy , strncpy , both of them return char* not sure why thinks 1 int. this page has reference 2 functions used http://tuxgraphics.org/common/src2/article12051/avr-libc-user-manual/manual/group__avr__pgmspace.html any appreciated figure out problem. library test works vailla arduino 1.0.6, when install teensyduino, version 1.20 ,

c# - Read All Bytes Line By Line In .txt -

i need read in bytes on 1 line , throw them array, , move onto next line , on , forth. for instance: .txt file word apple zzz now in program have read in first line bunch of bytes, , array consist of 4 elements. i'd processing , move on next line , on. i have looked in many places no luck. ideally, need readallbytes() except instead of reading entire file need read 1 line. edit: since going speed, cannot readalllines() or anything require me read string first , convert array of bytes. edit2: have backtrack bit because understand not best @ explaining anything, try. ideally, how code work loop through lines of txt file loop through bytes on line read byte , process if need to, break loop , move on next line this give better understand of dilemma. even though problem remains unsolved i'd still thank tried me: thank trying assuming text file ascii: var lines = file.readlines(@"c:\temp\foo.txt"); foreach (var line i

c# - XamlReader and Custom ContentPropertyAttribute -

i'm trying make custom graphic layout engine. it's xaml-based , thought reusing system.xaml types deal xaml. as objects defined inside portable class libraries, cannot decorate them standard contentpropertyattribute , problem, because have specify each content explicitly this: <window> <window.content> <textblock /> </window.content> </window> as can appreciate, set textblock window.content withing tags. i work does: <window> <textblock /> </window> can configure xamlreader/xamlobjectwriter use property default when nothing specified? thanks!

java - Spring Data 'Left Join Fetch' query returning null -

my query looks this: @query("select p pilot p left join fetch p.playerships p.nickname = (:nickname)") so far good. i'm getting pilot instance when playerships empty. now, want fetch inactive ships modified query this: @query("select p pilot p left join fetch p.playerships s p.nickname = (:nickname) , s.active = false") and i'm getting null pilot doesn't work. i'd glad if explain me how create join fetch query clause applies child elements. in advance. just move join condition: @query("select p pilot p left join fetch p.playerships s on s.active = false p.nickname = (:nickname)") the on clause defined in jpa 2.1

variables - Extract line below Findstr criteria in Batch file for cycle -

i'm trying extract set of txt files line placed 2 rows below 1 matching search criteria , redirect output csv file. i managed specific txt file in set, i'm getting troubles in writing cycle batch-scan each txt in given folder. through this , wrote following code scan a specific file. works fine: setlocal enabledelayedexpansion cd "myfolder" if exist myoutput.csv del myoutput.csv /f "delims=:" %%a in ('findstr /b /n /c:"mycriteria" "myfile.txt"') ( set /a linebelow=%%a+2 set "linebelow=!linebelow!: " ) (for /f "tokens=1* delims=:" %%a in ('findstr /n "^" "myfile.txt" ^| findstr /b "%linebelow%"') ^ echo %%b>>myoutput.csv) start myoutput.csv endlocal when tried generalize code in cycle scan each txt in myfolder got error in findstr: !linebelow! happens empty variable... here's flawed cycle: setlocal enabledelayedexpansion cd "myfolder"

supress PATH in batch file -

i have batch file: set path=c:\cygwin\bin\;%path%@ c:\cygwin\bin\bash.exe c:\cygwin\home\cmccabe\newbatch.sh that outputs: c:\users\cmccabe\desktop>set path=c:\cygwin\bin\;c:\windows\system32;c:\windows; c:\windows\system32\wbem;c:\windows\system32\windowspowershell\v1.0\;c:\program files (x86)\intel\opencl sdk\2.0\bin\x86;c:\program files (x86)\intel\opencl sdk \2.0\bin\x64;c:\program files (x86)\microsoft sql server\100\tools\binn\vsshell\ common7\ide\;c:\program files (x86)\microsoft sql server\100\tools\binn\;c:\prog ram files\microsoft sql server\100\tools\binn\;c:\program files (x86)\microsoft sql server\100\dts\binn\@ c:\users\cmccabe\desktop>c:\cygwin\bin\bash.exe c:\cygwin\home\cmccabe\newbatch. sh menu ================================== 1 match patient 2 sanger analysis 3 batch analysis 4 individual analysis 5 supplemental analysis 6 exit ================================== choice: how c

java - Shuffling a deck of cards - array or stack? -

im planning develop simple card game on android-java, in app shuffle cards wonder best way store deck of cards in array or in stack..? problem stack dont know how shuffle it. i believe trick stack: stack<card> deck = new stack<>(); // add card types deck... collections.shuffle(deck);

c - Texture mapping a circle -

first off, used following resource generate circles. http://slabode.exofire.net/circle_draw.shtml now trying apply texture circle using following, cant seem math right. void drawcircle(float cx, float cy, float cz, float r, int points, float red, float green, float blue) { float theta; theta = 2 * pi / (float)points; float c = cosf(theta);//precalculate sine , cosine float s = sinf(theta); float t; int i; float x = r; //we start @ angle = 0 float y = 0; float tx = c * 0.5 + 0.5; float ty = s * 0.5 + 0.5; glpushmatrix(); gltranslatef(cx, cy, cz); glenable(gl_texture_2d); glbindtexture(gl_texture_2d, newbelgtex); glbegin(gl_polygon); // glcolor3f(red/255.0, green/255.0, blue/255.0); for(i = 0; < points; i++) { gltexcoord2f(tx, ty); glvertex2f(x, y);//output vertex //apply rotation matrix t = x; x = c * x - s * y; y = s * t + c * y; // not sure how update tx , ty } glvertex2f(-r, 0);

c# - How to capture values from panel placed on a form -

Image
i not understanding how capture values in text box placed in panel on form. trying update database table these values. can point me in right direction? code: private void btnsupplier_click(object sender, eventargs e) { try { panel pnladdsupplier = new panel(); textbox txtsupplierid = new textbox(); textbox txtsuppliername = new textbox(); button btnaddsupplier = new button(); label lblsupplierid = new label(); label lblsuppliername = new label(); // initialize panel control. pnladdsupplier.location = new point(56, 74); pnladdsupplier.size = new size(200, 200); // set borderstyle panel three-dimensional. pnladdsupplier.borderstyle = system.windows.forms.borderstyle.fixed3d; // initialize label , textbox controls. lblsupplierid.location = new point(60, 0); lblsupplierid.text = "supplier

How can I execute a shell command in a child process in Python? -

i need use multiprocessing module (rather subprocess, need use pipes) execute shell command new child process. @ moment i'm using: p = subprocess.popen(subprocess_command, stdout=subprocess.pipe, stderr=subprocess.pipe, env=parent_env) where subprocess_command shell command (it runs python script arguments) , parent_env current environment environmental variable (ld_preload) set differently. equivalent using multiprocessing module? child process (python script) needs able pipe parent. this demonstrate how streaming output popen file1.py import time,os while true: print "ok ?"+os.environ["ld_preload"] time.sleep(1) file2.py import os os.environ["ld_preload"] = "5" p = subprocess.popen(subprocess_command, stdout=subprocess.pipe, stderr=subprocess.pipe, env=os.environ) p.start() line in iter(p.stdout.readline, b''): print line time.sleep(0.6)

Unset array in multi dimensional array php -

i have multi dimensional array , try add sum of audience if have same division_id different post_page_id , return array total value of each division , unset rest. i've tried double foreach did not work. help? thanks array ( [0] => array ( [id] => 1 [post_page_id] => 22130 [audience] => 276 [type] => facebook [division_id] => 1 [tw_audience] => ) [1] => array ( [id] => 14 [post_page_id] => 22465 [audience] => 6 [type] => facebook [division_id] => 1 [tw_audience] => ) [2] => array ( [id] => 2 [post_page_id] => 22189 [audience] => 175 [type] => twitter [division_id] => 2 [tw_audience] => ) [3] => array ( [id] =>

Matlab, looking to place the next value from an array in the legend each time a loop executes -

i trying legend show fixed value , 1 array. have managed fixed value display , when manually enter position array display. want position selected array advance 1 each time. tried use n variable have defined in script doesn't seem work. @ moment have entered value of 4 , selects 4th value array. new matlab , can't life of me think how this. appreciated. here script working with. clear clc f = @(x,k,lamda) ((lamda.^k).*(x.^(k-1)).*(exp(-lamda.*x))./(factorial(k-1))); colors = ['k', 'r' , 'g', 'b', 'y', 'm', 'c']; hold on n=1; k = 5; x = 0 :0.1: 10; lamda = 1 : 0.2 : 2; ncol= mod(n,7)+1; plot(x,f(x,k,lamda), 'color', colors(ncol)) l = 1 : 0.2 : 2; legstr(n,:) = strcat ('k = ', num2str(k), ' lamda = ', num2str (l(4))); legend(legstr) title('erlang distribution') xlabel('x') ylabel('f(x,k,lamda)') n=n+1; end hold off

Excel VBA taking user input to check a cell across multiple sheets and save specific sheets for later use -

i'm new vba, , trying write program in excel allow me manually input row , column program. program should check specified cell in multiple sheets see if it's 1 or 0. if it's 0, need specific worksheet in saved , identified later in output box. below have far. parts i'm unsure saving specified worksheet, , specifying cell used check input box (ie if cj.range(d h) vs cj.cell(dh) etc.). option explicit sub trial1() dim hr single dim d single d = inputbox("please enter day study. monday = a, tuesday = b, wed = c, thurs = d, fri = e, sat = f, sun = g.") hr = inputbox("please enter hour study in military time.") if hr >= 7 or hr <= 22 exit loop call worksheet1() end sub sub worksheet1() dim availability() string dim c1 worksheet dim c2 worksheet dim c3 worksheet dim c4 worksheet dim c5 worksheet dim c6 worksheet dim c7 worksheet dim c8 worksheet dim c9 worksheet set c1 = activeworkbook.sheets("3043") set c2 = activeworkbook.shee

Python - delete multiple list elements in dictionary -

i have simple dictionary structure in python being used pseudo database. example of 6 entries shown below: a={} a['name'] = ['a','b','c','d','e','f'] a['number'] = [1 ,2 ,3 ,4 ,5 ,6 ] a['sum'] = [2 ,1 ,4 ,3 ,6 ,5 ] each key in dictionary refers specific field type e.g. name, number, sum etc , data stored against key list of length n, n number of entries. note lists of length n. set allows me access records each entry, example, 3rd entry fields can use: a['name'][2] a['number'][2] a['sum'][2] filling structure easy using dictionary append method. question deleting entries. suppose want remove 1 of records leave rest in same dictionary / lists, how do this? mean, how remove third entry such dictionary , lists now: a['name'] = ['a','b','d','e','f'] a['number'] = [1 ,2 ,4 ,5 ,6 ] a['sum'] = [

java - Create JLabel Array -

Image
i have 34 labels images can't figure how make when ill click label selected , in down right corner "selected: " changed on every label select. the labels variable names n1 n34 have code far in list getselectednumbers() list<jlabel> lotteryboxes = new arraylist<>(); list<jlabel> getselectednumbers() { list<jlabel> numbers = new arraylist<>(); iterator<jlabel> = lotteryboxes.iterator(); while (it.hasnext()) { jlabel nr = it.next(); if (nr.iscursorset()) { numbers.add(nr); selected.settext("selected: " + nr); } return numbers; } i not know do, please give me answers. if create labels in loop, can add handler them. either same handler checks of labels clicked, or separate handler each one. here there separate handler each , labels put array can use them later (outside loop). int numberoflabels = 34; jlabel[] labels = new jlabel[numb

groovy - Wrong paths in grails.xml in generated war -

i have issue when trying deploy .war or when try run grails run-war seems resources in grails.xml generated incorrectly. normally resource declared follows: <resource>bootstrap</resource> but in .war looks like: <resource>grails-app.conf.bootstrap</resource> has found same problem , if how did solved it? as jeff pointed out problem due folder structure root directory being detected 2 levels down, this: /project/grails-app/project/

ruby - Cannot install gem - make is not recognized as an internal or external command operable program or batch file -

i wanted install rspec-rails gem ruby 1.9.3 on windows 7. got errors saying json libraries not installed. so, used instructions below solve it. source = the 'json' native gem requires installed build tools download [ruby 1.9.3][2] [rubyinstaller.org][3] download devkit file [rubyinstaller.org][3] for ruby 1.9.3 use [devkit-tdm-32-4.5.2-20110712-1620-sfx.exe][4] extract devkit path c:\ruby193\devkit run cd c:\ruby193\devkit run ruby dk.rb init run ruby dk.rb review run ruby dk.rb install to return problem @ hand, should able install json (or otherwise test devkit installed) running following commands perform install of json gem , use it: gem install json --platform=ruby ruby -rubygems -e "require 'json'; puts json.load('[42]').inspect" when execute above first step, error - c:\ruby193\devkit>gem install json --platform=ruby temporarily enhancing path include devkit... building native extensions. take while... error: error

vb.net - Cannot find the reference specified-Visual Basic 2013 -

i've got new system. trying connect , run system through 64-bit windows 7 pc. company sent me visual basic project that. uses .net framework 4 , windows form applications. target cpu x86. in references tab, next 3 of com references there "the system cannot find reference specified" statements. when built, project gives namespace errors , warnings because of these objects. other references work fine. i've seen .dll files in debug folder. think generated company before sending me. exist in bin\debug folder. i've removed 3 references list in project , tried following separately: 1) in project, refer .dll files exist in debug folder. (seems fake way, removes errors when project built. when debug, gives "retrieving com class factory component clsid ... failed due following error: 80040154" error.) 2) copy .dll files in debug folder c:\windows\syswow64 folder, register through regsvr32 "name.dll" in console admin. way, ".dll loaded,

php - Can't echo out user data on home page -

this code function public function getuserdata() { session_start(); $username = $_session['user']; $getdata = $this->db->prepare("select * users username=?"); $getdata->bindparam(1, $username); $getdata->execute(); $row= $getdata->fetch(pdo::fetch_assoc); $email = $row['email']; $user = $row['username']; echo $email. '<br />'; echo $user; } <?php require_once "class/user.php"; echo $user; echo $email; $object = new user(); $object->getuserdata(); ?> and here home.php, username, , email echo out function, if try echo $email; on home.php doesn't print. need print out on home page can style output. already tried starting session on home.php , still doesn't work, started in getuserdata() function. those variables in scope of function itself, if want access information, you'd have return values function. user.php public function getuserdata() {

python - How to use django-scheduler app in existing app -

i looking django apps handle task calendar kind of event , django-schedule example project provides sample project dont know how map task class (title & starttime) event class of django schedule. documentation doesn't make clear how can that? apprciate if pointers or steps can provided here use django-schedule app existing app the solution here using django scheduler app own models present not able make out of it. looking tutorial on how hook django-scheduler own model found conversation on internet https://groups.google.com/forum/#!topic/pinax-users/9norwjmdiym , reference explain logic below: assume task class having startdatetime & enddatetime & title from schedule.models import event, eventrelation, calendar ( coming schedule app) override save method of task object create new event below , modified code provided in link above make clearer the code looks existing calendar , attaches event linked task object via relationship tried code below e

java - map three tables with primary keys and foreign keys Composite in hibernate -

i have map these tables in hibernate , truth have tried in many ways , has not worked me, having if can this, not paste code have because suppose it's not right , changed lot. table country idcountry (pk) countryname table region idregion (pk) idcountry (pk, fk) regionname table provinces idprovinces (pk) idregion (pk,fk) provincesname hopefully can me, thank much here tables mapping: @entity @table(name = "country") public class country implements serializable { @id @generatedvalue(strategy = generationtype.auto) @column(name = "idcountry", unique = true, nullable = false) private int countryid; @column(name = "countryname", nullable = false) private string countryname; @onetomany(mappedby = "regionpk.country", cascade = cascadetype.all) private set<region> regions = new hashset<region>(0); // generate getters, setters, hashcode() , equals() } @enti

php - Remove single quotes from sql query -

i trying run sql query using codeigniter unable success due single quotes in query. following query: function getstaffuser($uid, $participant_list=0) { $rid='1,2,3'; $where = "find_in_set(users.role_id, '".$rid."')"; $where_plist = "not find_in_set(users.uid, '".$participant_list."')"; $this->db->select("users.uid, concat(`users`.`given_name`, ' ',`users`.`surname`) 'user_name'", false); $this->db->from('users'); $this->db->where($where); $this->db->where("users.uid!=", $uid, false); if($participant_list!=0){ $this->db->where($where_plist, false); } $data = $this->db->get(); pr($this->db->last_query()); exit; if ($data->num_rows() == 0) return false; else return $data->result(); } it returns following query: select users.uid, concat(`users`.`given_name`, ' ', `users`.`surname`) 'user_name&

Relative References in Excel 2011 Mac for Dynamic Report Macros (VBA) -

input: text file (csv) apple remote desktop on application usage dynamic series of macs. goal: to convert csv file apple remote desktop easy-to-read format using series of excel macros (or other options possible). used among numerous teams, amount of data changing in every report. methodology far: i'm doing in series of small macros, make easier troubleshoot. primary issue way ard records application usage: every instance of application starting , shutting down , length of time running in separate row. in row there 2 kinds of time: "front most" , "front in seconds." "front most" recorded in format: "1h, 5m" making impossible use sort of total. "front in seconds" recorded standard number , focus of project. macros: here macros i've built without issue: macro 1 : ard_convert1_import - import text file predetermined location new sheet in existing workbook. contains basic conversion csv excel. macro 2 : ard_c

css - Div shifting after ng-show using Bootstrap -

Image
i have following: when click on picture on right, following: the 2 boxes should aligned, in first picture. the containing div follows: <div align="center" class="top-buffer"> <div class="img-thumbnail"> <img id="face-img" class="search-face" ng-src="{{faceimg}}"> </div> <div class="overlaid img-thumbnail"> <img id="face-img" class="search-face" ng-src="{{processedresults[selectedsearchresultindex].img}}" ng-hide="showsearchresultdetails" ng-click="togglesearchresultdetails()"> <div class="search-face wrapword" ng-show="showsearchresultdetails" ng-click="togglesearchresultdetails()"> name: <strong>{{processedresults[selectedsearchresultindex].name}}</strong> </div> <span class="glyphicon glyphicon-info-sig

Referencing previous frames values Python Pygame -

i have simple piece of code. program loops @ 60 fps want reference previous mouse click state. i.e. have 'one' variable mouse click state, 0 not clicked , 1 clicked. want happen if mouse clicked i.e. 1 = 1 & previous value of 1 0 i.e. unclicked save value of mx , mouse co-ordinates. please see code below: pdimagefull = pygame.image.load('f:\project files\coils\pdsinwaveresize.jpg') pdresx = 300 pdresy = 720 gamedisplay = pygame.display.set_mode((display_width,display_height)) pygame.display.set_caption('pd diagnostic tool') clock = pygame.time.clock() def pdimage(x, y): gamedisplay.blit(pdimagefull, (x, y)) # defining our main programing loop def mainprogram_loop(): dx1 = (display_width-pdresx) dy1 = (display_height-pdresy) gameexit = false # event handling while not gameexit: mx, = pygame.mouse.get_pos() one, two, 3 = pygame.mouse.get_pressed() event in pygame.event.get(): if event.

ios - UITableView not populating cell completely until moved off screen -

i using parse populate cells in tableview. each cell contains username, user's picture, , actual post content. when run app, username , post content loaded each cell. picture not loaded until cell moved off screen , moved back. here code involving query: -(void)retrievefromparse { pfquery *retrieveposts = [pfquery querywithclassname:@"posts"]; [retrieveposts orderbydescending:@"createdat"]; retrieveposts.cachepolicy = kpfcachepolicycachethennetwork; [retrieveposts findobjectsinbackgroundwithblock:^(nsarray *objects, nserror *error) { if (!error) { postsarray = [[nsarray alloc] initwitharray:objects]; dispatch_async(dispatch_get_main_queue(), ^{ [self.tableview reloaddata]; }); } dispatch_async(dispatch_get_main_queue(), ^{ [self.refreshcontrol endrefreshing]; }); }]; } here code tableview: -(uitableviewcell *)tableview:(uitableview *)tableview cellforrowatindexpath:(nsindexpath *

google apps script - How do I delete individual responses in FormApp -

shouldn't formresponse have remove or delete response method? https://developers.google.com/apps-script/reference/forms/form-response is there , i'm missing in docs? i'm talking responses here not items. nope, not there. , no external api fill gap. so here's crazy idea. you write script gets responses, calls deleteallresponses() , writes one(s) want deleted. you'd have summary info reflects responses care about, you'd have lost submission dates (...which add non-form data in spreadsheet), , submitter userid (in apps domains only, , again retain outside form). whether or not compromises acceptable depend on intended use of form data is. code this forms-contained script simple menu & ui, delete indicated responses. content of deleted responses logged. /** * adds custom menu active form, containing single menu item * invoking deleteresponsesui() specified below. */ function onopen() { formapp.getui() .createmenu('my

ruby 2.1 - Mail gets send from smtp username setting not from "from" method in ActionMailer rails -

in user_mailer.rb class usermailer < actionmailer::base default from: "email.1@gmail.com" def approved_mail(user) @user = user @greeting = "hi" mail to: @user.email end end and in development.rb config.action_mailer.smtp_settings = { address: "smtp.gmail.com", port: 587, domain: "gmail.com", authentication: "plain", enable_starttls_auto: true, user_name: "email.2@gmail.com", password: env["gmail_password"] } i email "email.2@gmail.com" why not "email.1@gmail.com", waiting clarification guys. in smtp_settings , need set user_name , password if our mail server requires authentication. in case have provided authentication 'email.2@gmail.com' in development.rb file. hence action mailer ignore default from: "email.1@gmail.com" cannot authenticate it.

ibm mobilefirst - JSON store hangs while retrieving data -

we have observed @ times accessing jsonstore api's hangs long time, make work have call function again or app has taken background & bring foreground again. note : when application faces issue, behaviour same until reinstall app or reboot device. there doesn't appear proper scenarios this, have searched many articles did not find solution, solutions welcome. we observed issue on android devices s5 , s4. here code snippet: function getwidgets(w_id, getwidgetssuccesscallback, getwidgetsfailurecallback) { var query = { user_id : w_id }; var options = {}; wl.jsonstore.get(storagecollections.widgets).find(query, options) .then(function(arrayresults) { var count = arrayresults.length; logger.debug("getwidgets: success, count: " + count); ... getwidgetssuccesscallback(widgets); }) .fail(function(errorobject) { logger.error("getwidgets: failed, error: " + json.stringify(errorobject)); getwidgetsfailurecallback(errorobje

ios - How to select all uitableview cells on button click -

i making app in using buttons in form of checkboxes in uitableview cell.i changing images on checkbox select , unselect state. want when click on button cells of table view select , image of checkboxes of cells changed? how can done below sample code - (nsinteger)tableview:(uitableview *)tableview numberofrowsinsection:(nsinteger)section { return self.lblarray.count; } - (uitableviewcell *)tableview:(uitableview *)tableview cellforrowatindexpath:(nsindexpath *)indexpath { static nsstring *tableviewidentifier = @"cell"; tablecelltableviewcell *cell= [self.tblvie dequeuereusablecellwithidentifier:tableviewidentifier]; if(cell==nil) { cell = [[tablecelltableviewcell alloc] initwithstyle:uitableviewcellstylesubtitle reuseidentifier:tableviewidentifier]; } cell.lblimage.layer.cornerradius=3.0f; cell.lblimage.layer.borderwidth=1.0f; cell.backgroundcolor=[uicolor colorwithred:(245/255.0) green:(245/255.0) blue:(245/255.0) alp

microsoft dynamics - GP proc only executes 42 transactions - Dexterity call to a SQL Procedure contains cursor -

i having issue calling sql procedure dexterity. procedure contains cursor. cursor suppose call procedure has call dynamics gp procedure 'tacomputerchecklineinsert'. working supposed overall process has insert transactions in payroll transaction entry. fixed number of 42 transactions inserted. have more 42 transactions. if execute same procedure sql server same parameters gives required result. issue comes when call dexterity. wrong?...i have been on long....and cannot figure out issue. resolved finally. has got nothing go of 2 econnect procedures namely 'tacreatepayrollbatchheaderinsert' , 'tacomputerchecklineinsert'. it had raised due select statement before batch creation tacreatepayrollbatchheaderinsert. select statement in place select parameters tacreatepayrollbatchheaderinsert. the code worked fine when select statement commented. create proc [dbo].[gtg_pr_create_abs_trx] @cmpanyid int , @uprbchor int -- 1 = computer check

javascript - A small code to impress friends is int working -

ok, im beginner, working javascript. im making small game impress friends, , reason, code isnt working. part of code, part has deal isnt working. when run it, doesn't go else command, if dont type stay, tell me why? here is: var qestionone = prompt("an old man emerges shadows of forest standing in. farther ahead, can see forest breaks up, , trees become less , less thick. if squint, can see small town. * chose either, stay, , talk old man, or leave, , continue down path following, , go town? *"); if (questionone = "stay") { alert("the old man approaches you, , speaks. 'i must warn you, there trap @ end of forest. undergrowth thins,there horrable , evil sludge monster. please, go around' old man rasped. thankfull information, proceed journey, , avoid big portion of forest ahead."); } else { alert("you travel ahead, down path. suddenlly become hungry. notice trees around have juicy looking fruit on branches.you have never seen

javascript - Mouse event firing but not performing function -

i'm trying make simple drawing program using grid made of boxes class .box . want boxes gradually darken on each pass of mouse altering opacity. $('.box').mouseenter(function() { var currentop = parseint($(this).css('opacity')); $(this).css('opacity', currrentop + .1); }); the event fires once , changes opacity 0 .1, won't continue increase opacity on subsequent mouse passes. i'm able desired results using code: $('.box').mouseenter(function() { $(this).css('opacity', '+=1'); }); could tell me why first attempt won't work? here jsfiddle whole code. thanks! the result of parseint() integer , 0, in case. want use parsefloat() instead. change: var curop = parseint($(this).css('opacity'), 10); to: var curop = parsefloat($(this).css('opacity'), 10); demo

c# - Linq Query with DateTime Compare is not Working as Expected -

at approximately 12/1/2014 9:40:12 pm, following code retrieves null value. campaign camp = repo.campaigns .where(ca => ca.starttime <= datetime.now) .where(ca => ca.endtime >= datetime.now) .firstordefault(); when there campaign in database following values: start time: 2014-11-30 00:00:00.000 end time: 2014-12-02 00:00:00.000 i @ complete loss why occur. try this: campaign camp = repo.campaigns .where(ca => ca.starttime.value.date <= datetime.now.date && ca.endtime.value.date >=datetime.now.date).firstordefault();

Successful Purchase but has Class not found when unmarshalling: com.google.android.finsky.billing.lightpurchase.PurchaseParams -

i have app in-app billing in adapter (list of items buy). having problem during testing in app billing. everything works fine - user able go through whole purchase process. "successful purchase" shown @ end of purchase flow , there email being sent user confirming purchase. however, item not seem consumed , server call add item user not being called. upon checking logs, see error 12-02 13:04:47.701 29663 29663 d iabhelper: launching buy intent xxxxxxxxxxx. request code: 10001 12-02 13:04:47.701 2450 3128 d enterprisedevicemanager: containerid: 0 12-02 13:04:47.711 2450 3128 e parcel : class not found when unmarshalling: com.google.android.finsky.billing.lightpurchase.purchaseparams 12-02 13:04:47.711 2450 3128 e parcel : java.lang.classnotfoundexception: com.google.android.finsky.billing.lightpurchase.purchaseparams 12-02 13:04:47.711 2450 3128 e parcel : @ java.lang.class.classforname(native method) 12-02 13:04:47.711 2450 3128 e parcel : @ jav

linux - Raspberry Pi, Dealing with Crontab -

i'm not familiar linux , it's first time using raspberry pi. trying set play mp3 file every day , came across using crontab viable option. i'm not sure how save files in correct location because every time write script using crontab can't seem save viable location...even writing new crontab desktop won't work. there more viable folder putting crontabs? again i'm new system help, thank taking time read message. you can type crontab -e in command line , add file want run in 1 of lines. here's short overview on how write cronjob: your cron: 30 20 * * 1-5 omxplayer /home/pi/desktop/wakeupsong.mp3 how setup cronjob in general: # * * * * * command execute # │ │ │ │ │ # │ │ │ │ │ # │ │ │ │ └───── day of week (0 - 6) (0 6 sunday saturday, or use names; 7 sunday, same 0) # │ │ │ └────────── month (1 - 12) # │ │ └─────────────── day of month (1 - 31) # │ └──────────────────── hour (0 - 23) # └───────────────────────── min (0 - 59)

php - How to get all p tags after particular class in dom -

i have html: <p class="story-body__introduction">2013 yazındaki gezi parkı eylemlerinin başlarından itibaren çeşitli medya kurumları, gösterilerin arkasında sırp gençlik örgütü otpor'un olduğunu iddia etti.</p> <p>geçtiğimiz günlerde ise, "emniyet genel müdürlüğü kaçakçılık ve organize suçlarla mücadele daire başkanlığı'nın gezi parkı eylemlerinin devam ettiği 15 haziran 2013'te İstanbul organize suçlarla Şube müdürlüğü'ne gönderdiği yazıda eylemlerle ilgili otpor'u işaret ettiği" bildirildi.</p> <p>radikal.com.tr'de yer alan habere göre, "bu yazı üzerine dönemin İstanbul organize suçlarla Şube müdürü nazmi ardıç, İstanbul cumhuriyet başsavcılığı'na yazdığı yazıda ve savcı muammer akkaş da İstanbul 1 no'lu hakimliği'ne başvurarak çeşitli bilgiler istedi."</p> <p>yazıda "türkiye'de otpor / canvas örgütü tarafından bir halk hareketi geliştirilmeye çalışıldığı ve otpo

java - Searching in Pre Order Traversal way -

i have binary search tree. know how search using search property. task search tree without using search property.(say, search in binary tree) how have search. 1 . if find value in current node return it. 2 . else search in right. if not found in right, search in left 3 . if not found in whole tree return null. this tried. public node search(int val) { node target = this; if(target.getval() == val) return this; else if(target.getright() == null && target.getleft() == null) return null; if(target.getright() != null) { return target.getright().search(id); } if(target.getleft() != null) { return target.getleft().search(id); } return null; } problem code is, if right child exists , val not found in right i'm getting null value. (not searching in left). how resolve this? public node search(int val) { node target = this; if(target.getval() == val) return this; else

mysql - how to display the entire variable with space in textbox in php -

i want display value space in text box.database value "usman road". in text box shows "usman". $value="select * employee e_id=$ses"; $value1=mysql_query($value); $vfet=mysql_fetch_assoc($value1); echo '<p>first name<input type="text" name="f" size=18 maxlength=50 style="background-color:transparent;border:0px solid white;" readonly value='.$vfet['e_first_name'].'></p>'; put quotes around value ... value="'.$vfet['e_first_name'].'"... what have is invalid html , breaks value on space ... value='.$vfet['e_first_name'].' ... // value = john doe ^ after making change become value = "john doe" to use unquoted value attributes have follow following html specifications an unquoted attribute value specified providing follo

Can't draw histogram of Date Class properly in R -

Image
given list of dates, when try draw bar graph hist() function below, date1 <- c(as.date("2010/01/06"),as.date("2010/01/07"),as.date("2010/01/18"),as.date("2010/01/09")) hist(date1, "days",ylim=c(0,2),freq=t) the output link below. as list has "2010/01/06" , "2010/01/07", graph should count each date. how can resolve this? or bug of r? my environment is: mac os x 10.9.5 r version 2.15.3

multithreading - Unable to access variables after creating a daemon thread in python -

this first program in threading , new os concepts. trying understand how asynchronously stuffs using python. trying establish a session , send keepalives on daemon thread , send protocol messages using main thread. noticed once created thread unable access variables able access before creating thread. not see global variables used see before created new thread. can 1 me understand how threading working here. trying understand: how print logging useful. how kill thread created? how access variables 1 thread def pcep_init(ip): global pcc_client,keeppkt,pkt,thread1 accept_connection(ip) send_pcep_open() # create new daemon thread send ka thread1 = mythread(1, "keepalive-thread\r") thread1.setdaemon(true) # start new threads print "this thread1 before start %r" % thread1 thread1.start() print "this thread1 after start %r" % thread1 print "coming out of pcep_init" return 1 however when

javascript - How should I make a poll for my website? -

i want make poll website.the poll want should poll on http://www.premierleague.com/en-gb.html.i not sure if should use php,javascript or etc make poll.can me in this? thanks... you're going need create form , receive data on server side using php. you're going put information database. i hope not come across mean but, decision on language use pretty simple when compared coding it. i'm betting not entirely experienced web-based programming languages. suggest pre-made scripts in interim: here simple tutorial on creating polls: http://code.tutsplus.com/articles/creating-a-web-poll-with-php--net-14257 if ok idea of using cms, here wordpress plugin should trick: http://code.tutsplus.com/articles/creating-a-web-poll-with-php--net-14257 otherwise, it's important understand flow of data: display poll end user (use html forms , css style) client submits data (either built in submit functionality or ajax) server receives data , stores database (php) pa

ios - reduce left space and right space from navigation bar left and right bar button item -

Image
i adding 2 custom buttons on navigation bar. 1 @ left , other @ right. done it, but failed reduce space between starting point , frame of buttons. i tried lot, gave negative value of x, still didn't helped. here code buttons -(void)addleftbutton { uibutton *abutton = [uibutton buttonwithtype:uibuttontypecustom]; abutton.backgroundcolor = [uicolor redcolor]; [abutton settitle:@"h" forstate:uicontrolstatenormal]; abutton.frame = cgrectmake(0.0, 0.0, 40, 40); [abutton settitlecolor:[uicolor blackcolor] forstate:uicontrolstatenormal]; uibarbuttonitem *abarbuttonitem = [[uibarbuttonitem alloc] initwithcustomview:abutton]; [abutton addtarget:self action:@selector(backbtnclicked:) forcontrolevents:uicontroleventtouchupinside]; [self.navigationitem setleftbarbuttonitem:abarbuttonitem]; } -(void)addrightbutton { uibutton *abutton = [uibutton buttonwithtype:uibuttontypecustom]; abutton.backgroundcolor = [uicolor greencolor]; [a

actionscript 3 - Text gets cut off in tooltip - FLEX ( action script 3 ) -

in flex (as3) text in tooltip gets cut off when font size - 10 last letter "w" a small portion of "w" gets cut off. i have tried setting padding, changing skins. doesn't work. i want solution issue. thanks.

optimization - Subset data with dynamic conditions in R -

i have dataset of 2500 rows bank loans. each bank loan has outstanding amount , collateral type. (real estate, machine tools.. etc) i need draw random selection out of dataset example sum of outstanding amount = 2.5million +-5% , maximum 25% loans same asset class. i found function optim, asks function , looks constructed optimization portfolio of stocks, more complex. there easy way of achieving this? i created sample data set illustrate question better: dataset <- data.frame(balance=c(25000,50000,35000,40000,65000,10000,5000,2000,2500,5000) ,collateral=c("real estate","aeroplanes","machine tools","auto vehicles","real estate", "machine tools","office equipment","machine tools","real estate","auto vehicles")) if want example 5 loans out of dataset sum of outstanding balance = 200.000 (with 10% margin) , not more