Posts

Showing posts from August, 2012

push - Pushing git subtree changes to upstream repository fails -

i'm trying ensure git's subtrees work me before incorporate project. encountered problem when pushing subtree changes upstream repository. the setup have 2 repos, sub , main , , main includes sub repo subtree . then following: initialize both repos initial commit. update sub repo directly (i.e. outside of main ). update sub repo within main repo. split changes sub (using git subtree split ) separate branch, checkout. attempt push upstream sub repo. naturally, push rejected because lose direct update sub . pull new change sub repo. attempt push upstream sub repo. time, should work, doesn't. i've written script encapsulates problem. i'm using git version 1.8.2.1 subtree module enabled. here's script: #!/bin/bash echo -n "wiping old repositories..." rm -rf main sub sub-home echo "done" echo -n "initializing main , sub repositories..." mkdir sub-home ( cd sub-home ; git init -q --bare ) git clone

vb.net - Parse txt file using a list of objects -

i trying parse .txt file has multiple loans in it. logic is: create loan class properties need, create list of loan objects. create new loan object , add list. read through txt file , fill objects properties. when reach end of file need create new loan object , start on because file has multiple loans in , need 1 object per loan. problem when use code below error "local variable 'myloans' hides variable in enclosing block". there better way this? public class loan public property loanid string public property loanprovider string end class dim listofloans new list(of loan)() dim myloans new loan listofloans.add(myloans) dim line string using r new streamreader("c:text.txt") line = r.readline() while (not line nothing) if (line.substring(0, 10) = "loan id:") myloans.loanid = line.substring(10, line.length - 10).trim() elseif (line.substring(0

c++ - How can I port DeviceIOControl to ioctl? -

in understanding, deviceiocontrol , ioctl same functions. both send control codes hardware , return responses. in effort reuse code, trying create function work in cross-platform manner. therefore, i've decided use deviceiocontrol api since fixed , specific. problem is: how map ioctl that? i have: int deviceiocontrol_issuecommand(devicehandle handle, int command, void *input, ssize_t sizeof_input, void *output, ssize_t sizeof_output, uint32_t *bytes_written){ #if systeminformation_iswindows int result = deviceiocontrol(handle,command,input,sizeof_input,output,sizeof_output,bytes_written,0); if (result == 0){ result = -1; //-1 new error return } return result; #else int result = ioctl(handle, command, input); //this doesnt work! return result; #endif } any appreciated! what asking not possible without lot of internal translation in deviceiocontrol_issuecommand . function calls different , expect different parameters , data. can wor

Convert XML to HTML using jquery/javascript -

i've xml need show in div text. can convert xml format below. <root> <field> <label>have invested before</label> <value>no</value> </field> <field> <label>are looking invest in next 6 months</label> <value>maybe</value> </field> <field> <label>what investments interested in</label> <value>carbon credits, green investments</value> </field> <field> <label>how looking invest</label> <value>£50,000 - £100,000</value> </field> </root> output should below: have invested before : no looking invest in next 6 months : maybe investments interested in : carbon credits,green investments how looking invest : £50,000 - £100,000 is possible using jquery/javascript.?? and should rendering below html. <div class="how-to"> <div class="how-text"> <h3>your requirement

Highstock (Highchart) 1.3.1 behaves erroneously when legend is aligned to right -

in highstock 1.3.1, when legend aligned right, area used draw chart overlaps area used range selector. result mouse click , drag event intended move range selector triggers zoom event of chart area. if legend aligned default location, chart behaves correctly. demo : http://jsfiddle.net/msjaiswal/eexbp/3/ code above fiddle : html: <script src="http://code.highcharts.com/stock/highstock.js"></script> <script src="http://code.highcharts.com/stock/modules/exporting.js"></script> try using range selectorin 2 charts below.<br> <b>erroneous behavior:</b> <div id="container" style="height: 500px; min-width: 500px"></div> <b>correct behavior:</b> <div id="container2" style="height: 500px; min-width: 500px"></div> javascript : $(function() { $.getjson('http://www.highcharts.com/samples/data/jsonp.php?filename=usdeur.json&callback=?',

java - Play Framework await() makes the application act wierd -

i having strange trouble method await(future future) of controller. whenever add await line anywhere in code, genericmodels have nothing placed await, start loading incorrectly , can not access of attributes. the wierdest thing if change in different java file anywhere in project, play try recompile guess , in moment starts working perfectly, until clean tmp again. when use await in controller bytecode enhancement break single method 2 threads. pretty cool, 1 of 'black magic' tricks of play1. but, 1 place play acts weird , requires restart (or found, code changing) - other place can act strange when change model class. http://www.playframework.com/documentation/1.2.5/asynchronous#suspendinghttprequests to make easier deal asynchronous code have introduced continuations. continuations allow code suspended , resumed transparently. write code in imperative way, as: public static void computesomething() { promise delayedresult = verylon

database - Join multiple Tables including 2 join Tables -

i try join multiple tables in 1 query. my entitie relations: person entities\person: type: entity table: person manytoone: address: targetentity: address joincolumn: name: idaddress referencedcolumnname: idaddress manytomany: tags: targetentity: tag jointable: name: persons_tags joincolumns: person_idperson: referencedcolumnname: idperson inversejoincolumns: tag_idtag: referencedcolumnname: idtag tag entities\tag: type: entity table: tag manytomany: sms: targetentity: sms mappedby: tag sms manytomany: tag: targetentity: tag jointable: name: sms_tags joincolumns: sms_idsms: referencedcolumnname: idsms inversejoincolumns: tag_idtag: referencedcolumnname: idtag this valid working sql statement: select distinct person.lastname, person.first

d3.js - D3: Is it possible to add multiple (more than 2) edges between nodes? -

this question has answer here: drawing multiple edges between 2 nodes d3 2 answers i constructing d3 force graph visualize network traffic. need link 2 nodes more 2 paths. possible? appreciated. nothing prevents drawing multiple edges between nodes. thing force directed graph layout made 2 nodes share 1 link. recommend following: from force directed graph point of view have 1 link. on drawing point of view, draw multiple edges if both nodes have multiple edges. which give following data structure edges: links = { source: 0, //index of source node target: 0 //index of target node representations : [{color: "red"}, {color:"blue"}] } thus when give links force directed graph, won't complain. when draw link can iterate through representations array draw different links.

linux - Ordering a loop in bash -

i've bash script this: for d in /home/test/* echo $d done which ouputs this: /home/test/newer dir /home/test/oldest dir i'd order folders creation time 'oldest dir' directory appears first in list. i've tried ls , tree variations no avail. for example, for d in `ls -d -c -1 $pwd/*` returns: /home/test/oldest dir /home/test/newer dir very close, not respect space in directory name. question, how have oldest dir on top , support whitespace? ls -d -c $pwd/* | while read line echo "$line" done

iis 7.5 - Umbraco - two websites on single Umbraco instance - 2nd site gives 404 -

i've set 2 umbraco websites on single instance of umbraco (v 4.7.1.1). if visit 1st website (which listed first under 'content' node): www.mysite.com ... correct homepage (the homepage nested @ content > www.mysite.com > global > homepage) however when go 2nd website (listed directly under 'content' node, below 1st website): m.mysite.com ... 404. homepage site nested same way (content > m.mysite.com > global > homepage), , can homepage using address m.mysite.com/global/homepage. i've checked/tried following: the 'manage hostnames' configuration both sites in umbraco correct i have usedomainprefixes set true in umbracosettings.config there no redirects in iis 7.5 redirecting 2nd domain name my bindings correctly set in iis the default document in iis 7.5 umbraco instance set default.aspx. i've moved top of list the hosts file on web server pointing m.mysite.com correct ip the homepage 2nd site using template t

sql - List system date in 3 different formats? (Oracle 11g) -

i came across 1 question have been asked list system dates in 3 different formats: i used following 2 formats i'm wondering third one? format #1: sysdate http://docs.oracle.com/cd/b19306_01/server.102/b14200/functions172.htm format #2: systimestamp http://docs.oracle.com/cd/b19306_01/server.102/b14200/functions173.htm i'm using oracle 11g. please let me know if above format correct or not , third format in case? thanks if asked question, i'd use to_char(sysdate, 'someformat') thrice.

c# - How to return data in a standard way? -

i trying figure out how return data in standard way. mean when return json or xml nice have 1 format everything(success , errors). say have following json result. { "person": { "id": 12345, "firstname": "john", "lastname": "doe", "phones": { "home": "800-123-4567", "work": "888-555-0000", "cell": "877-123-1234" }, "email": [ "jd@example.com", "jd@example.org" ], "dateofbirth": "1980-01-02t00:00:00.000z", "registered": true, "emergencycontacts": [ { "name": "", "phone": "", "email": "", "relationship": "spouse|parent|child|other" } ] } } this fine happens if there validation error

python - Big-O notation for two simple recursive functions -

i have 2 recursive functions in python , want know big o notation them. big o each these? def cost(n): if n == 0: return 1 else: return cost(n-1) + cost(n-1) def cost(n): if n == 0: return 1 else: return 2*cost(n-1) let's use recurrence relations solve this! first function's runtime can described recursively as t(0) = 1 t(n + 1) = 2t(n) + 1 that is, base case takes 1 time unit complete, , otherwise make 2 recursive calls smaller instances of problem , amount of setup , cleanup work. expanding out terms in recurrence, get t(0) = 1 t(1) = 2t(0) + 1 = 2 + 1 = 3 t(2) = 2t(1) + 1 = 2 × 3 + 1 = 7 t(3) = 2t(2) + 1 = 2 × 7 + 1 = 15 this series 1, 3, 7, 15, ... might familiar, since it's 2 1 - 1, 2 2 - 1, 2 3 - 1, etc. more generally, can prove that t(n) = 2 n+1 - 1 we can induction. our base case, t(0) = 1 = 2 1 - 1, claim holds n = 0. assume n t(n) = 2 n+1 - 1. have that

java - Eclipse Indigo bug -

Image
i have been running eclipse indigo few months now, , have run bug cannot seem find answer to. creating small 2d side-scroller game similar of mario, old zelda, etc. i going show dad new feature had added program. instead of coming upstairs see program on computer, dad decided using sudo screen-viewing thing not sure of. have used before, , let see screen of computer in home (on same ip interface), , can use computer too. i didn't want show program dad way, told him come upstairs. did, , ever since then, eclipse not show graphics inside of jframe in program. show things such words (written on screen), not show graphics. such background image, or character, or else. positive isn't problem coding, because had tested , played game quite few times before dad did screen-viewing thing (we both on linux mint 12, btw). i think bug related screen-viewing thing. i love if help. great. thanks. -this has been solved * board package external; import java.awt.graphics; imp

c++ - Error with reading file in Linux -

in program, take 2 file names command line arguments using following code: ifstream routesfile (arv[1]); ifstream citiesfile (arv[2]); i proceed read through file , grab data. both files csvs: while(citiesfile.good()){ string city; string country; string xstring; string ystring; getline(citiesfile, country, ','); getline(citiesfile, city, ','); getline(citiesfile, xstring, ','); getline(citiesfile, ystring); ... } when in visual studio using hard-coded file names, works fine. when use command line argument in linux after using g++, can open files correctly after has lot of errors. test file reading, printed out of read values resulted in terminate called after throwing instance of 'std::out_of_range' what(): map::at hereelf Ã’Å“c½Ã…¹jn!ýô (eÕl˜c the appearance of here due being printed in program. doesn't arise error, manually printed test code. it seems not able read

angularjs - Access a service from inside a directive's compile -

i having hard time access service inside directive. define service via $http , $q, , inject directive. can;t directive access service. service.js 'use strict'; var app = angular.module('app.services', []); app.factory('classification', function($http,$q) { return { query: function getall() { var deferred = $q.defer(); $http.get('index.php/classifications').then(function(classi) { deferred.resolve(classi.data); }, function getwebsiteserror(reason) { deferred.reject(reason); }); return deferred.promise; } }; }); app.js 'use strict'; /* app module */ var app = angular.module('app', ['app.controllers', 'app.services', 'app.directives', 'ui']); app.config(['$routeprovider', function($routeprovider) { $routeprovider. when('/', {templateurl: 'partials/welc

css - Editing the Reddit Enhancement Suite's Userbar -

Image
i'm trying edit res userbar subreddit. looks this: it collapses. i want float of elements right lined vertically. html bar is: <div id="header-bottom-right" class="res-navtop"> <div id="userbartoggle" title="toggle userbar" class="userbarhide">»</div> <span class="user"> <a href="http://www.reddit.com/user/snowe2010/" style="margin-right: 2px;"> snowe2010 </a> <span id="resaccountswitchericon"></span> &nbsp;( <span class="userkarma" title=""> <a title="link karma" href="/user/snowe2010/submitted/">9</a> · <a title="comment karma" href="/user/snowe2010/comments/"> 2170 </a> </span> ) </span> <span class="separator">|</span> <a

python - Access data of a wiki scraper and store it in a local database -

hi have written scraper on scraper-wiki scrape web page , store data in scraper-wiki database.now want write program in python go scraper-wiki api , fetch data , stores in sq lite database of local machine. first, need query data want. here documentation: 1 2 then, need store using sqlite library documentation can found @ python's official documentation site.

database - Closed Teminal while rails server was running now cannot run again? -

Image
so learning ruby on rails , decided getting started guide here: http://guides.rubyonrails.org/getting_started.html i created test application in tutorial blog. didn't have configure database because said if use 1 that's pre made no changed need made (sqlite3). so created database using rake db:create , started server rails server , worked when went http://localhost:3000/ "welcome aboard" message there. anyways, after went terminal accidentally did command + q quit terminal while server running. opened terminal , connected blog cd blog entered rails server start again, doesn't work... when ever go http://localhost:3000/ "cannot connect server" error. have went , deleted blog folder containing of files , rebooting , creating blog again still no luck. appreciated! thanks! go activity monitor, find "ruby" processes , quit them all:

scheme - How to compile & run programs written in T (a dialect of Lisp) -

i wanna compile , run program written in t programming language (a dialect of lisp) during years of 1980s. checked t project seems applicable vax machines (and accompanied compilers)? are there modern cmpilers t? or modern dialect compatible? this page lists following platforms t have been ported to: ultrix (vax) apollo domain/os (m68k) hp/ux (m68k) mac/aux (m68k) next (m68k) sunos 3 (m68k) sunos 4 , above / solaris (sparc) encore multimax (n32k) dec3100 (pmax mips) sgi iris (mips) unix on connection machine 5 (sparc) the same page provides sparc image, i'd sparc emulator. latter take at: running solaris sparc software on x86-64 also, i'd send mail persons behind t revival project. taylor r. campbell: (format '#f "~a@~a.net" "campbell" "mumble") brian mastenbrook: (format '#f "~a@cs.~a.edu" "bmastenb" "indiana")

java - Changing the recursive insertion of the (binary Search tree) to non-recursive? -

i trying change recursive insert method of bst non-recursive( maybe while loop) reason changing because want see if possible. here code of insertion: public void insert(string value) { //the node stored in root root = insert(value,root); } private character insert(string value,character current) { if(current == null) { //add root if tree empty current = new character(value); } else //if value want insert < root value, keep going left till //it's empty inserted @ left end. done recursion if(value.compareto(current.getelement())<=-1) { current.setleft(insert(value,current.getleft())); } else //if value want insert > root value, keep going right till //it's empty inserted @ right end. done recursion if(value.compareto(current.getelement())>=1) { current.setright(insert(value,current.getright()

r - How to check if a vector contains n consecutive numbers -

suppose vector numbers contains c(1,2,3,5,7,8), , wish find if contains 3 consecutive numbers, in case, 1,2,3. numbers = c(1,2,3,5,7,8) difference = diff(numbers) //the difference output 1,1,2,2,1 to verify there 3 consecutive integers in numbers vector, i've tried following little reward. rep(1,2)%in%difference the above code works in case, if difference vector = (1,2,2,2,1), still return true though "1"s not consecutive. using diff , rle , should work: result <- rle(diff(numbers)) any(result$lengths>=2 & result$values==1) # [1] true in response comments below, previous answer testing runs of length==3 excluding longer lengths. changing == >= fixes this. works runs involving negative numbers: > numbers4 <- c(-2, -1, 0, 5, 7, 8) > result <- rle(diff(numbers4)) > any(result$lengths>=2 & result$values==1) [1] true

Unable to Access Child Node in Parsing XML with Python Language -

i new python scripting language , working on parser parses web-based xml file. i able retrieve 1 of elements using minidom in python no issues have 1 node having trouble with. last node require xml file 'url' within 'image' tag , can found within following xml file example: <events> <event id="abcde01"> <title> name of event </title> <url> url of event <- url tag not need </url> <image> <url> url need </url> </image> </event> below have copied brief sections of code feel may of relevance. appreciate retrieve last image url node. include have tried , error recieved when ran code in gae. python version using python 2.7 , should point out saving them within array (for later input database). class xmlparser(webapp2.requesthandler): def get(self): base_url = 'http://api.eventful.com/rest/events/search?location=dublin&

ios - How to make UIButton dragable but don't trigger click event -

i use method implement uibutton movable; [button addtarget:self action:@selector(dragmoving:withevent:) forcontrolevents:uicontroleventtouchdraginside]; but trigger touchupinside event @ same time, , need touchupinside event other things. so know how avoid this? thanks lot; use these code below solve it; [button addtarget:self action:@selector(touchdown:withevent:) forcontrolevents:uicontroleventtouchdown]; [button addtarget:self action:@selector(touchdraginside:withevent:) forcontrolevents:uicontroleventtouchdraginside]; [button addtarget:self action:@selector(touchupinside:withevent:) forcontrolevents:uicontroleventtouchupinside]; - (void) touchupinside :(uicontrol*)c withevent:ev{ nslog(@"touch inside"); if (count) { nslog(@"here can clicking event"); } } - (void) touchdown:(uicontrol*)c withevent:ev{ nslog(@"touch down"); count = yes; } -(void) touchdraginside:(uicontrol*)c with

c - ORA-24811:While writing into a LOB, less data was provided than indicated -

when ever run pro*c code insert large buffer table using clob. ora-24811:while writing lob, less data provided indicated. code below ocicloblocator *lob; ... exec sql insert tab (msg,status ,error_desc ,access_date ) values (empty_clob(),:status,:error_desc,:sys_date_time); /* allocate , initialize locator: */ exec sql allocate :lob; printf("clob allocated\n"); exec sql select msg :lob tab status = :status update; /***opening clob***/ exec sql lob open :lob read write; /*** writing clob ***/ printf("messlen:%d, actual string length:%d\n",messlen,strlen(buffer)); exec sql lob write 1 :messlen :buffer :lob; sys_check_sql_error output clob allocated messlen:6348, actual string length:6348 ***** error sqlca=|-24811|***** buffer has large xml file. can explain i'm missing?

java - How do I get the `.class` attribute from a generic type parameter? -

the accepted answer this question describes how create instance of t in generic<t> class. involves passing in class<t> parameter generic constructor , callin newinstance method that. a new instance of generic<bar> created, , parameter bar.class passed in. what do if generic type parameter new generic class not known class bar generic type parameter? suppose had other class skeet<j> , wanted create new instance of generic<j> inside class. then, if try pass in j.class following compiler error: cannot select type variable. is there way around this? the specific bit of code triggering error me is: public class inputfield<w extends component & widgetinterface> extends inputfieldarray<w> { public inputfield(string labeltext) { super(new string[] {labeltext}, w.class); } /* ... */ } public class inputfieldarray<w extends component & widgetinterfa

javascript - Datatables.net fnGetPosition returns -1 for iColumnIndex when adding a new row and then clicking on the row 0 -

i getting position using: this.fngetposition = function( nnode ) { var osettings = _fnsettingsfromnode( this[datatable.ext.iapiindex] ); var snodename = nnode.nodename.touppercase(); if ( snodename == "tr" ) { return _fnnodetodataindex(osettings, nnode); } else if ( snodename == "td" || snodename == "th" ) { var idataindex = _fnnodetodataindex( osettings, nnode.parentnode ); var icolumnindex = _fnnodetocolumnindex( osettings, idataindex, nnode ); return [ idataindex, _fncolumnindextovisible(osettings, icolumnindex ), icolumnindex ]; } return null; }; if click row 0, idataindex contains 0 , icolumnindex contains whatever column clicked in. if add new row, lets row 9 , click row 0, idataindex still holds 9 instead of 0 , icolumnindex returns -1. have turn bserverside off when adding new row because if don't, clicking

c# - Regarding LINQ Usage in Large Loops -

i wondering recommended in following scenario: i have large loop traverse id store in database so: foreach (var rate in rates) { // id rate name guid id = dbcontext.differententity .where(x => x.name == rate.name).firstordefault(); // create new object newly discovered // id insert database dbcontext.yetanotherentity.add(new yetanotherentity { id = guid.newguid(), diffid = id, } } would better/ faster instead (first differententity ids, rather querying them separately)? list<differententity> differententities = dbcontext.differententity; foreach (var rate in rates) { // id rate name guid id = differententities .where(x => x.name == rate.name).firstordefault(); // create new object newly discovered // id insert database dbcontext.yetanotherentity.add(new yetanotherentity { id = guid.newguid(), diffid = id, } } is difference negligible or should consider

windows 7 - Script to dynamically change desktop background -

i have requirement generate visualisation (think pie chart) , set desktop wallpaper on windows 7 corporate network. i'm web/mac guy, guessing @ following implementation (assume know nothing). write script , network admins distribute everyones "startup" folder. the script download image from: http://visualisation-server/desktop.jpeg?username={username}&psk={psk} , username domain username , psk custom variable in ad profile. the downloaded image set desktop. for whom don't login/out regularly can there scheduler can use? the psk isn't deal breaker although visualisation custom everyone, doesn't need secure. so question. possible? if so, languages/technology need use? many thanks, si the closest thing find "windows 7 rss themes". http://windows.microsoft.com/en-gb/windows/rss-theme-faq you cannot send username/psk unless prepare different theme each user. possible in situation. we've decided proceed tidesdk mi

ruby - Array of IDs to array of function results -

i have code def objects(ids) array = [] ids.each |id| array << object(id) # => #<object[id]> end array end objects([1, 2, 3]) # => [#<object1>, #<object2>, #<object3>] it seems there should cleaner way this. can help? edit works [1, 2, 3].map |id| object(id) end original go way: [1, 2, 3].map(&:object_id) # => [3, 5, 7] def objects(ids) ids.map(&:object_id) end objects([1, 2, 3]) # => [3, 5, 7]

Logging into OS X Server in a DMZ form a Mac Client -

i have mac os x server (10.8.3) in dmz. has domain name , external , internal ip. when not on network can see server when open server.app on client computer (for example when have wi-fi on). when logged network, cannot see server when try use server.app, , nothing enter allows me connect it. any appreciated. bryan

Python, How to invoke an instance method from inside a another Class -

i have python gui frame has 1 upperpanel , vertical splitterwindow. each panel in splitterwindow created 2 panel classes, 1 listbox , other 1 grid. each class has several buttons. is there way keep button connect event.bind , function code inside class , make work, because, presently i'm getting following error: attributeerror: 'panel' object has no attribute 'm_dirpicker1' i know best practice in reported situation. this example short example of have wrote: class frame ( wx.frame ): ... self.m_datapanel = wx.panel( self, wx.id_any, wx.defaultposition, wx.defaultsize, wx.tab_traversal ) self.m_filespanel = source_panel( self.m_splitter1) self.m_gridpanel = data_viewer( self.m_splitter1) class source_panel ( wx.panel ): ... # connect events self.m_listbox.bind( wx.evt_listbox_dclick, self.m_listboxonlistboxdclick ) self.m_clearbutton.bind( wx.evt_button, self.m_clearbuttononbuttonclick ) self.m_imp

ftp - Invalid Uri: invalid port specified C# -

i created ftp server locally filezilla server. admin port 14147 default. filezilla client got connected no problems. when try connect chrome or ie ftp://(ip) or ftp://(full machine name) or ftp://(user:password)@(machine). everything ok. my admin interface setting port 14147. listing port default 21 no problems @ internet browsers telnet. now created application in c# , when use uri class uri target = new uri(struri); i got exception error: invalid uri: invalid port specified i saved ftp address in database , tried many variations nothing happens: ftp://user:password@fullmachinenamewithdomain ftp://user:password@fullmachinenamewithdomain:21 ftp://user:password@fullmachinenamewithdomain:14147 what doing wrong? afaik username , password not supposed part of url. should pass them separately credentials when you're using ftpwebrequest class. e.g. request.credentials = new networkcredential(username, password);

How accurate is the user locale on Android? -

i want detect local/culture related properties users of our app, display/hide payment methods , preselect currencies. how accurate country , currencies locale.getdefault() returns on android? what sources of information flow that, things sim carrier involved? as far know, locale.getdefault() depends on language select in settings->language & input->language setting only. if switch it, locale.getdefault() switches, too!

c# - Read Specific Strings from Text File -

i'm trying strings out of text file , put in variable. structure of text file looks keep in mind 1 line , each line looks , separated blank line: date: 8/12/2013 12:00:00 source path: \\build\pm\11.0.64.1\build.11.0.64.1.fileserveroutput.zip destination path: c:\users\documents\.net development\testing\11.0.64.1\build.11.0.55.5.fileserveroutput.zip folder updated: 11.0.64.1 file copied: build.11.0.55.5.fileserveroutput.zip i wasn't entirely sure of use delimiter text file or if should using delimiter subjected change. so quick example of want happen this, want go through , grab destination path , store in variable such strdestpath. overall code came far this: //find variables text file string[] lines = file.readalllines(globalvars.strlogpath); yeah not much, thought perhaps if read 1 line @ at time , tried search looking through line i'm not 100% sure if should stick way or not... if skeptical how large file is, should come using readlines deferre

codeigniter - Email Contact retrieivng code running well on localhost but not server -

i have following script retrieves code gmail. code runs in localhost, gives error when upload on server , make eun. script made in codeigniter. <?php class invite_friends extends ci_controller{ var $feed_url = "http://www.google.com/m8/feeds/contacts/default/full"; var $login_url = "https://www.google.com/accounts/clientlogin"; var $username = "my_qmail@gmail.com"; var $passwd = "my_passowrd"; var $postdata = array(); function __construct() { parent::__construct(); session_start(); } function index() { if(isset($_session['logged_user'])) redirect(base_url().'home'); $this->load->view('header'); $this->load->view('invite_friends'); $this->load->view('footer'); } /*function gmailcontacts_lib($gusername, $gpassword) { //constructor function $this-&g

c++ - How do I use FRESetContextNativeData() in AIR native extensions? -

i'm building ane. in 1 of calls native code, there's object gets created, , i'd able keep in memory reference in future call. i thought could creating pointer object, , passing pointer fresetcontextnativedata() in example below: freobject storedata(frecontext ctx, void* funcdata, uint32_t argc, freobject argv[]) { char* data = "testing..."; fresetcontextnativedata( ctx, &data ); return getfrestring(data); } freobject retrievedata(frecontext ctx, void* funcdata, uint32_t argc, freobject argv[]) { char* data; fregetcontextnativedata(ctx, (void**)&data); return getfrestring(data); } this doesn't seem work however. @ end of retrievedata(), data points bunch of randomness. gives? so i'm bit of idiot. mistake made putting & before data in call fresetcontextnativedata(). 1 needs pointer, not pointer pointer fregetcontextnativedata(). the following code produces results expecting: freobject stor

vba - Print value of a header into a TextBox -

i'm trying loop through range of cells until find cell i'm looking for. when found, want note column of cell , print heading, in row 2. code like: for each x in sheets("sheet1").range("a3:ak20") if x.value = sectiontbx.text 'print value of specific row in column x.activate msgbox(cells(2, activecell.column)) end if next i have tried using &activecell.column , quotations , saving activecell.column variable etc. not work, though managed correctly print out msgbox (activecell.column) . i tried incuding .end(xlsup).offset(-1,0) reason, cell chose top cell vary (i'm implementing search , return macro else's spreadsheet table, think may have formatted badly , that's affecting xlsup somehow.) how can print value of header textbox in user form? able print "true" box. assume data type issue couldn't solve it. using find loop faster iterating through each cell individually: dim rngfound range d

javascript - iOS 6: Safari overflow: hidden on containing div not working when modal open -

i can't seem use overflow: hidden trick on body of website in order lock background content when modal open. i'm applying current styles onto body: $('body').css({'overflow':'auto', 'position':'static'}); and being applied, works fine in android, background content locks, in ios devices, doesn't work , content background content still scrollable. idea cause this? this meta viewport tag using: <meta name="viewport" content="width=device-width, maximum-scale=1"> ios6 webview requires overflow hidden on both html , body element work correctly. if wants add webkit bug tracker i'd obliged :). either or question here should marked duplicate.

sql server 2008 - SQL arithmetic with variable operator -

i have query generates results of following fldnum float field, fldop nvarchar field returns values of either '/' or '*', , fldcalc varchar field contains numbers; when attempt execute won't work @ however, error of nvarchar float conversion error... ([fldnum] + [fldop] + convert(float,[fldcalc])) example data if fldop '/' (0.5533/34) i used case statement such following, works fine... (case when [fldop] = '/' ([fldnum]/convert(float,[fldcalc])) else ([fldnum]*convert(float,[fldcalc])) end) i need more dynamic in case need add + or - fldoperator field. there anyway of doing this? you try dynamic query. following gives idea declare @num1 float declare @num2 float declare @op nvarchar declare @ssql nvarchar(500) set @num1 = 0.5533 set @num2 = 34.0 set @op = '/' set @ssql = 'select ' + cast(@num1 nvarchar(255)) + @op + cast(@num2 nvarchar(255)) exec sp_executesql @ssql d

javascript - Clicking on a link first time doesn't trigger jQuery, but clicking on it again triggers it twice -

so, i'm having bit of issue. have links when clicked run function in jquery, however, first time click link nothing happens. if click again, function runs twice, if click third time, runs 3 times off of click. here jquery code function updateentrystatus() { var anime_id = <?php echo $anime_id; ?>; var anime_list_entry_id = <?php echo $anime_list_entry_id; ?>; jquery('.wantedstatus').on('click', function(event) { var wantedstatus = jquery(this).text(); jquery.post("/wp-content/themes/sahifa/phanime_list/updatestatus_animelist.php", {firstparam : anime_id, secondparam : anime_list_entry_id, thirdparam : wantedstatus}, function(data) { //this response data serv console.log(data); jquery('#anime_list_update').html(data); }); return false; }); } and here couple of links