Posts

Showing posts from March, 2010

javascript - Ambiguous grammar when parsing boolean expressions with Peg.js -

i'm writing parser generates abstract syntax tree boolean expressions. i have following peg.js grammar supports ^ , ∨ , & , | respectively: start = operation // optional whitespace _ = [ \t\r\n]* operation "operation" = "("? _ left:(operand / operation) _ operator:operator _ right:(operand / operation) _ ")"? { return { operation: operator, between: [ left, right ] }; } operator "operator" = operator:["&"|"|"] { return operator; } operand "operand" = operand:[a-z] { return { operand: operand }; } it parses expressions a & b , a & (b | c) , fails if expression starts operation: (a | b) & c line 1, column 8: expected end of input " " found. the expression gets parsed correctly if surround parenthesis: ((a | b) & c) my guess peg.js taking (a | b) operation, instead of operand of parent operation, failing...

Facebook Graph API apprequests node doesn't return "from" -

moving fql graph api, found v2.2 graph api apprequests node returns inconsistent responses. https://graph.facebook.com/v2.2/<id>/apprequests sometimes returns json "from" field , not. correct json is: "application": { "name": "myapp", "namespace": "my ns", "id": "123456" }, "created_time": "2015-03-16t19:34:00+0000", "data": "invite", "from": { "id": "111111", "name": "sender name" }, "message": "come , play!", "to": { "id": "99999", "name": "recipient" }, "id": "123_456" } however, "from" field in json missing (even when requesting in "fields" parameter). when using ...

How to delete multiple rows in datagridview and database using vb.net window forms -

i have data gridview loads these codes: mycom.connection = cn mycom.commandtext = <sql> select username,activity,cdate `date` tbl_activity </sql>.value dim myadap new mysqldataadapter(mycom) dim mydt new datatable grdactivity.columns.add(colcb) myadap.fill(mydt) grdactivity.datasource = mydt myadap.dispose() and have delete button these codes: dim selected integer selected = grdactivity.selectedrows.count if grdactivity.selectedrows.count > 0 'you may want add confirmation message, , if user confirms delete integer = 0 selected myr.close() mycom.connection = cn mycom.commandtext = "delete tbl_activity id = '" & & "' " mycom.executereader() myr.close() next else messagebox.show("select 1 row before hit delete") end if can me right codes can delete databases bounded rows n...

Lost connection to mysql during query, mysql workbench -

i have same problem this when want index large table on 1 of non-unique columns integer, , tried solutions proposed in post has @ least 1 vote up. still couldn't fix it. other ideas? i have enough memory: max_allowed_packet: 2g, innodb_buffer_pool_size: 9g all time out settings mentioned in this post , here set higher numbers default. while not necessary answer loosing connection in mysql workbench workaround. when comes long running queries in mysql workbench, if 1 changes mysql workbench parameters, there seems connection time_out issue still occuring. so, run query mysql command line , see if works. if works when run mysql command line , not workbench, know mysql workbench issue , not other issue.

sql - cross referencing with queries -

i've been working sql 6 months now. i'm pretty adept when comes pulling information tables , sorting when want compare or cross reference multiple tables, little more shaky. mean should simple answer. i'm guessing i'm not thinking of correct clause , need select distinct 1 of tables. i'm going try explain question thoroughly can without using specific names. general situation i'm trying check this. i've got toolbox has assortment of tools in it. have list of tasks might need , list of problems might performing tasks , using tools on. i've got table tools has columns descriptions of tools, unique id tools, , classification tools (power tools, manual tools, building materials, etc.). table different tasks. columns task descriptions, , unique id. primarily, want write query can show me tools might labeled power tools aren't being used specific task. here's sample of code. has more tables because in reality data spread out among more tables ...

c# - ASP.net and Word 365 API -

so starting learn office 365 api's, have experience c# , asp.net. wondering there way make website allows me edit documents word online , download them server example. i know can download user files using office file api's , there way integrate word online editor? base idea create simple website allow me create/edit files form backend (admin interface) using word online editor , have these files available download on frontend. the question not creating practical don't want use alternative editor ckeditor, want see if it's possible , if how can it.

ti basic - How to display a value to the homescreen during a ti-89 titanium program -

in relationship thread , kind of trying have had bit more leeway in this. my problem working on defining program (for ti-89 titanium) write out definitions of variables. however, considering had indefinite amounts of variables add, thought using define function on , on again waste memory , processing power. thinking save variable variable defined in later portion of program. prompt x lbl x_d_r x_d_r->q:goto def lbl def define expr(q)[1]=x where x_d_r has no assigned value. program supposed use defined string list value x. obvious error came about. so played around on home screen , program screen bit , came across entry(1) , ans(1). see on ti-83 (or 84) go (if remember correctly) disp q*1 x->ans(1) however ans(1) on ti-89 titanium based upon last answer submitted homescreen. then, ans(1) or entry(1) gets replaced in program that. lucky me, found way avoid this. prgm expr(char(120)&char(22)&char(97)&char(110)&char(115)&char(40)&char(49)...

sublimetext3 - Translate accented to unaccented characters in Sublime Text snippet using regex -

i'm writing st3 snippet inserts \subsection{} label. label created converting header text conform latex standards labels using (rather lengthy) regular expression: ${1/(?:([ \t_]+)?|\b)(?:([ÅÄÆÁÀÃ])?|\b)(?:([åäæâàáã])?|\b)(?:([ÉÈÊË])?|\b)(?:([éèëê])?|\b)(?:([ÌÌÎÏ])?|\b)(?:([íìïî])?|\b)(?:([Ñ])?|\b)(?:([ñ])?|\b)(?:([ÖØÓÒÔÖÕ])?|\b)(?:([öøóòôõ])?|\b)(?:([ÜÛÚÙ])?|\b)(?:([üûúù])?|\b)/(?1:-)(?2:a)(?3:a)(?4:e)(?5:e)(?6:i)(?7:i)(?8:n)(?9:n)(?10o)(?11:o)(?12:u)(?13:u)/g} actually, longer. if add groups like, st3 crashes when execute snippet. ${1/(?:([ \t_]+)?|\b)(?:([ÅÄÆÁÀÃ])?|\b)(?:([åäæâàáã])?|\b)(?:([Ç])?|\b)(?:([ç])?|\b)(?:([ÉÈÊË])?|\b)(?:([éèëê])?|\b)(?:([ÌÌÎÏ])?|\b)(?:([íìïî])?|\b)(?:([Ñ])?|\b)(?:([ñ])?|\b)(?:([ÖØÓÒÔÖÕ])?|\b)(?:([öøóòôõ])?|\b)(?:([ÜÛÚÙ])?|\b)(?:([üûúù])?|\b)(?:([Ý])?|\b)(?:([ÿý])?|\b)/(?1:-)(?2:a)(?3:a)(?4:c)(?5:c)(?6:e)(?7:e)(?8:i)(?9:i)(?10:o)(?11:o)(?12:n)(?13:n)(?14:u)(?15:u)(?16:y)(?17:y)/g} is there more efficient way of doing this? preferably 1 wo...

python - Assigning One Name to multiple DataFrame Columns -

i'm working feature vectors in machine learning vary in length; scalars, others vectors. represent 1 feature vector entire row in pandas dataframe object. suppose have dataframe created using: feature_matrix = pd.dataframe(data,columns=['feat1','feat2'...,'featn']) now suppose 'feat1' corresponded scalar c , 'feat2' vector values [m,n] , how can have such calling feature_matrix returns sort of array in following form: 'feat1', 'feat2' image 1 [ c1 , m1 , n1 , ....] image 2 [ c2 , m2 , n2 , ....] ... i need such if index feature_matrix such: feature_matrix['feat2'] then returns image 1 [[m1,n1], image 2 [m2,n2], ...]]

swift - Convenience initializer with non-optional property -

an object of mine has integer id. since required property not defining optional , requiring in designated initializer: class thing { var uniqueid: int var name: string? init (uniqueid: int) { self.uniqueid = uniqueid } } since creating 1 of these json, usage along lines of: if let uniqueid = dictionary["id"] as? int { let thing = thing(uniqueid: unique) } (i love sanity check on have far way). next, able add convenience initializer thing class accepts dictionary object , sets properties accordingly. includes required uniqueid , other optional properties. best effort far is: convenience init (dictionary: [string: anyobject]) { if let uniqueid = dictionary["id"] as? int { self.init(uniqueid: uniqueid) //set other values here? } //or here? } but of course isn't sufficient since designated initializer isn't called on paths of conditional. how should handling scenario? poss...

excel - Including start year and end year in YEAR calculations -

for calculation i'm trying perform 1 year = 1 season , data have start year , end year. so 1952 1953 needs add 2 (seasons) if use =year(a1)-year(a2) result 0 - there simple way include start year , end year value in these calculations? it looks have found problem , rectified it. benefit of others might have found thread, why behaving ways was. background - excel (and many other applications) treat dates 1 every day past dec 31, 1899 . today happens 42,079 . time decimal portion of day 42,079.75 mar 16, 2015 06:00 pm . you had years numbers in a1:a2; not full dates. using 1-per-day formula, 1952 may 5, 1905 , 1953 may 6, 1905 . if peel out year of each of year() function, subtracting 1905 1905; resulting in zero. the solution either type full dates a1:a2 , format cells yyyy display 1952 & 1953 retain full date nature e.g. =abs(year(a1) - year(a2)) + 1 , or use years numbers , discard year() function altogether, e.g. =abs(a1 - a2) + 1 spanned (i...

java - CardLayout, panels from separate class not showing -

i'm making first gui rather simple board game. besides game view need main menu , other views too. unfortunately gui looking uglier me in morning, entire menu structure in 1 class. i'm using card layout switch between different views, figured separate views different classes. sadly, ran problems. got blank window. after 4 hours of reserach haven't been able solve problem i'm asking guys, have idea what's wrong code? tough think i've ruled out obvious problems (not adding panels panel card layout, not setting layout etc.) still think problem must simple. yet nothing i've found, has helped. so business, here's "base gui" package teekkariloikka.gui; import java.awt.*; import java.awt.event.*; import javax.swing.*; public class tlgui extends jframe { private static final long serialversionuid = 1l; private static final int width = 1000; private static final int height = 800; private static final string mainmenu = ...

if statement - Comparison with string literal C++ -

i'm writing function program allows student copy template text file. function checks user's input see if desired template allowed class. i'm getting error "comparison string literal results in unspecified behavior" on lines 21 , 25. have done "cout << name" verify variable storing correctly, is, know that's not problem. #include <iostream> #include <string> #include <fstream> using namespace std; //template check //first check see if student allowed use template int templatecheck() { //declare file name variable char name[256]; //prompt user input cout << "enter file name: "; //cin user input cin >> name; //begin check //cs221 first template can't use if(name == "/home/cs221temp.txt") cout << "you not allowed use cs221 templates./n"; //cs 321 other template can't use else if (name == "/home/cs32...

asp.net - Add to an aspx button an css id -

having code below button, can add id can add css button?? or can put class?? <asp:button id="registerlink" runat="server" text="create account"> </asp:button> in webforms, id="" attribute of controls transformed of form ctl0__ctl1__registerlink (where ctl0 , ctl1 id="" values of parent controls). means rendered id="" attribute (generally) unpredictable , cannot relied upon styling or javascript uses. there 3 possible solutions: use ctrl.clientid final rendered id="" attribute value, works when want reference rendered html client script on same page, isn't of use styling unless it's inline <style> element. use clientidmode setting override how id="" attribute rendered. requires asp.net 4.0 or later. can set in web.config , in <%@ page declaration, or on each element. set static value verbatim ( with exceptions ). implement own ...

.net - Unhandled DivideByZero exception from an external DLL - C# -

i have c# (.net 4.0) program, main calling methods external ftp library - dll project references. logic in try-catch block, , catch prints error. exception handler has generic parameter: catch(exception ex) . ide vs. sometimes ftp library throws following division 0 exception. problem is not caught in catch block, , program crashes. exceptions originated in wrapper code caught. has idea difference , how exception can caught? the exception: description: process terminated due unhandled exception. exception info: system.dividebyzeroexception stack: @ componentpro.io.filesystem+c_ou.c_f2b() @ system.threading.executioncontext.runtrycode(system.object) @ system.runtime.compilerservices.runtimehelpers.executecodewithguaranteedcleanup(trycode, cleanupcode, system.object) @ system.threading.executioncontext.run(system.threading.executioncontext, system.threading.contextcallback, system.object, boolean) @ system.threading.executioncontext.run(system.threading.executio...

Selenium not working with JQWidgets listbox or Datagrid -

i testing web site using selenium ide 2.9.0 firefox. web site uses jqwidgets. selenium seems work fine until need simulate clicking on list item or selecting row data grid. i have seen other posts similar problem 1 selenium webdriver ‘jqwidgets – jqxgrid ‘ data grid java: how scroll , rows visible? but can't work out problem. when use record button record interaction website shows following :- command=click target=//div[@id='listitem1site_list']/span when double click on execute command not select line in list. i have tried mousedown , clicking on outer div first , every combination. any ideas ? thanks

javascript - json data to table with multiple headers -

i'm having hard time grasping how done, i have json file menu card restaurant, , data table since it's menucard has multiple headers (like 'starters', 'main course', 'whisky', ...). contains name , price of every object. it's not problem parse json, it's more of problem shape table. this json: {     "drinks": [     {         "beers vessel": [             {                 "name": "jupiler / 33cl / 50cl"                 "price": "2.00 / 2.60 / 4.00"             },             {                 "name": "bruges zot blond"                 "price": "3.50"             },             {                 "name": "extra tap crescent"                 "price": "4:30"             },             {                 "name": "extra tap"                 "price": ""             ...

SQL Server FOR XML Path make repeating nodes -

i'd generate following output using sql server 2012: <parent> <item>1</item> <item>2</item> <item>3</item> </parent> from 3 different columns in same table (we'll call them col1, col2, , col3). i'm trying use query: select t.col1 'item' ,t.col2 'item' ,t.col3 'item' tbl t xml path('parent'), type but this: <parent> <item>123</item> </parent> what doing wrong here? add column null value generate separate item node each column. select t.col1 'item' ,null ,t.col2 'item' ,null ,t.col3 'item' dbo.tbl t xml path('parent'), type; result: <parent> <item>1</item> <item>2</item> <item>3</item> </parent> sql fiddle why work? columns without name inserted text nodes. in case null value inserted text node between item nodes. if add act...

opengl - How to evade color stripes -

Image
here convertion 32bit float per channel "unsigned byte" per channel color normalization save pci-express bandwidth other things. there can stripes of color , unnatural. how can avoid this? on edge of spheres. float color channels: unsigned byte channels: here, yellow edge on blue sphere , blue edge on red 1 should not exist. normalization used(from opencl kernel) : // multiplying r doesnt picture color gets bright , reddish. float r=rsqrt(pixel0.x*pixel0.x+pixel0.y*pixel0.y+pixel0.z*pixel0.z+0.001f); unsigned char rgb0=(unsigned char)(pixel0.x*255.0); unsigned char rgb1=(unsigned char)(pixel0.y*255.0); unsigned char rgb2=(unsigned char)(pixel0.z*255.0); rgba_byte[i*4+0]=rgb0>255?255:rgb0; rgba_byte[i*4+1]=rgb1>255?255:rgb1; rgba_byte[i*4+2]=rgb2>255?255:rgb2; rgba_byte[i*4+3]=255; binding buffer: gl11.glenableclientstate(gl11.gl_color_array); gl15.glbindbuffer(gl15.gl_array_buffer, id); gl11.glcolorpointer(4, gl11.gl_unsigned_byte, 4, 0); u...

spreadsheet - How Do I Update OpenOffice Calc Sheets With New Formulas and Formats -

i have created spread sheet in openoffice calc has multiple sheets each month of year. sheet has specific formulas , data laid out in several months. there easy way go modifying formula , having transfer across sheets? or if format changes, there way merge sheets through type of macro or something? i flexibility of spread sheets , create similar calculations non accounting data otherwise, move accounting software. if data laid out in regular way, may able copy+paste modified formula each sheet , have adjust cell references correctly. however, type of flexibility (being able make change in 1 location , have reflected in how existing data displayed) database required. openoffice has database component base, , information base can imported calc if have specific spreadsheet requirements. learning curve base long, might worthwhile if handle kind of data frequently.

python - Import modules from parent folder with Flask -

my folder tree: project/ app/ __init__.py models.py dir/test1.py dir/__init__.py run.py dir/test2.py dir/__init__.py if want a from app.models import whatever from test1 , test2 thing works manually sys.path.append os.path.join(os.path.dirname(__file__), "../..") however there ton of answers on saying messing sys.path give me troubles down line (why?); sadly, after 1+ hour of googling still haven't figured out right way import stuff , i'm getting confused. it enormously better test not test, if need append paths sys.path make work--and in directory configuration, will--that's reasonable , pragmatic step. however, in general better not fiddle module load paths manually. assumes code will loaded in directory right outside test folder, might not true. "you run problems down line" pretty weak tea. the bigger issue cannot use little path-patch accomplish kind of automated testi...

is there a way to set independent random streams in c++ using the armadillo c++ library? -

i want 2 independent random streams armadillo rand library. seems both use same global random stream. i can generate random numbers using armadillo library via following: arma::arma_rng::set_seed(13) double r = arma::randu() but not sure how 2 random streams. in python know can following using random library numpy: rn = random.randomstate(13) rn2 = random.randomstate(11) now if run rn.rand() , rn2.rand() independent , don't effect 1 another. ideas? thanks! independent random number generators can used in conjunction .imbue() function in armadillo. the code below adapted armadillo documentation . c++11 compiler required use std::mt19937 , std::uniform_real_distribution . std::mt19937 engine1; // mersenne twister random number engine std::mt19937 engine2; // ... set seeds engine1 , engine2 here ... std::uniform_real_distribution<double> distr(0.0, 1.0); mat a(4,5); mat b(4,10); a.imbue( [&]() { return distr(engine1); } ); b.imbue( [&...

Cognos 10.1 Charts with multiple Axis, multiple series with and multiple axis lining up -

Image
here report structure: mm-yy category (x axis) referral method 1, referral method 2 , referral method 3 primary y axis referral method 1%, referral method 2%, , referral method 3% secondary y axis. i have been able create chart contains multiple axis. issue if primary y axis bar, , secondary y axis line values secondary axis not match primary y axis series. of values secondary axis stick in middle of category. my primary axis series not line secondary axis series. (there 3 items in each series) look @ first image below. secondary values clump in middle of jan-15. want them separate within jan-15 bars do. me accomplish this? thank you edit: image links below:

c++ - GLEW Odd Segmentation fault issue -

i have 6 models load , display in window. 5 of them load perfectly, transformations perform on them have no issue , lighting looks great. 1 segmentation faults when bind vbo narrowed down below: glgenvertexarrays(1, &myvao); glbindvertexarray(myvao); glgenbuffers(1, &myvbo); cerr << "cerr" << endl; glbindbuffer( gl_array_buffer, myvbo ); //seg faults here cerr << "made here 370" << endl; gdb glbindbuffer( gl_array_buffer, myvbo ); (gdb) 0x000000000040474e 369 glbindbuffer( gl_array_buffer, myvbo ); (gdb) 0x0000000000404754 369 glbindbuffer( gl_array_buffer, myvbo ); (gdb) 0x0000000000404756 369 glbindbuffer( gl_array_buffer, myvbo ); (gdb) 0x000000000040475b 369 glbindbuffer( gl_array_buffer, myvbo ); (gdb) program received signal sigsegv, segmentation fault. 0x00000038c167e296 in _int_malloc () /lib64/libc.so.6 yes include glenum err = glewinit(); has expi...

java - Do not print "not found" when something is found -

i trying project , reason having issue life of me can not solve. public static void printlist(string n){ for(int i=0; i< roomlist.size(); i++){ if(roomlist.get(i).name.equals(n)){ system.out.println("room name: " + roomlist.get(i).name + " state: " + roomlist.get(i).state); system.out.println("description: " + roomlist.get(i).desc); system.out.println("creatures in room: " + roomlist.get(i).fred()); if(roomlist.get(i).north != null){ system.out.println("north neighbor: " + roomlist.get(i).north.name); } if (roomlist.get(i).south !=null){ system.out.println("south neighbor: " + roomlist.get(i).south.name); } if (roomlist.get(i).east !=null){ system.out.println("east neighbor: " + roomlist.get(i).east.name); } if (roomlist.get(i...

css3 - need css trick to solve this issue -

hi guys i'm working on website orange background. i'm using white social icons font awesome library. here result of work css @import url('http://netdna.bootstrapcdn.com/bootstrap/3.0.0/css/bootstrap-theme.min.css'); @import url('http://maxcdn.bootstrapcdn.com/font-awesome/4.1.0/css/font- awesome.min.css'); body { margin: 10px; background:#da4a10; } #social:hover { -webkit-transform:scale(1.1); -moz-transform:scale(1.1); -o-transform:scale(1.1); } #social { -webkit-transform:scale(0.8); /* browser variations: */ -moz-transform:scale(0.8); -o-transform:scale(0.8); -webkit-transition-duration: 0.5s; -moz-transition-duration: 0.5s; -o-transition-duration: 0.5s; } .fa-3x{ color: white; } .social-fb:hover { color: #3b5998; } .social-tw:hover { color: #4099ff; } .social-gp:hover { color: #d34836; } .social-em:hover { color: #f39c...

Rails routes with not-equal-to constraint -

i add not-equal-to constraint on routes rule. specifically, assert parameter should not equal something. for instance, in following code: get ':menu/:submenu', constraints: { # put here } . i'd impose :submenu not equal abc . i've tried write submenu: /(?!abc)/ constraint, somehow affects other params. suggestions?

php - Showing validation errors to view -

i want show validation errors users in comma seperated i.e., the username field required, password field required so far can able send validation error messages view this $validation->messages() but thing can't able @if(session::has('message')) <p class="alert">{{ session::get('message') }}</p> @endif or {{ $errors->first('username', '<div class="error">:message</div>') }} the thing can pass messages normal text. so, how can pass validation messages view plain text (rather array or object) update : i mean can works in controller , not in view in controller: return implode(',',$validation->errors()->all());

c - error convert character in string to uppercase -

i'm trying convert character of string uppercase letters int main (void) { int = 0; int n = 0; static char *str[] = { "wow", "racecar", "no devil lived on.", "rotor" }; for(i = 0; < strlen(*str); i++) { if(str[i] != null) { n = function(str[i]); } } return 0; } int function(char* x) { int = 0; int j = strlen(x); char c; for(i = 0; < j; i++) { c = toupper(x[i]); x[i] = c; } return 0; } i got error saying exc bad access, code 2 @ line x[i] = c; i'm not sure why error, need create string , assign c new string? toupper return uppercase version of character didnt change element itself, i'm not sure wrong assigning value return toupper element. your code attempts modify string literal , causes undefined behaviour. the string "no d...

reactjs - When should I use getInitialState in a React component -

i have react component toggles classname when component clicked var foo = react.createclass({ getinitialstate: function() { return {classname: ''} }, render: function(){ var classname = 'bar ' + this.state.classname return react.createelement('div', {classname: classname, onclick: this.onclick}) }, onclick: function() { this.setstate({classname: 'baz'}) } }); it works fine, when rendering app server side, following error warning: getinitialstate defined on component, plain javascript class. supported classes created using react.createclass. did mean define state property instead? my build step setup so var foo = require('./foo'); var factory = react.createfactory(foo); module.exports = react.rendertostring(factory({})); why doing wrong, , how should done? i not sure if helps, while using fluxible, syntax used jsx part of require component var app = new fluxible({ component: react.createf...

javascript - Splitting an array into columns -

expected result below. trying split old array 3 arrays. don't want "chunk" instead want items put 'columns' var old_array = ["1","2","3","4","5"]; var new_array = new array(); for(i=0; i<old_array.length; i++) { new_array[i%3].push(old_array[i]); } the result should be: new_array[0] = [3] new_array[1] = [1, 4] new_array[2] = [2, 5] start @ 1 , reference values old_array[i - 1] var old_array = ["1","2","3","4","5"]; var new_array = new array(); for(i = 1; < old_array.length + 1; i++) { new_array[i%3] = new_array[i%3] || []; new_array[i%3].push(old_array[i - 1]); }

Jquery Date in GridView? -

i have included jquery datepicker inside item template, if select date datepicker in second row textbox (tbxeffectivefromdate), selected date has been stored in first row textbox not in selected grid row index. kindly resolves jquery datepicker in grid view. if mentioned textbox class name, it's not working. 1 me,i'm struggling 2 days. <asp:updatepanel id="mainupdatepanel" runat="server"> <asp:gridview id="gvbasetarget" runat="server" cssclass="gvbasetarget"> <columns> <asp:templatefield itemstyle-width="18%" itemstyle-cssclass="gvbasetargetleft" headertext="effective from" headerstyle-cssclass="gvbasetargetleft"> <itemtemplate> ...

ms access - INSERT INTO number value with comma thousand delimiter -

my sql is "insert table1 (item, price) value ('" & itemstring & "', " & pricevalue & ")" it works fine. but, if price 12,345.67. sql error message is number of query values , destination fields not same. it because value thousand comma delimiter. how should modify sql let number value has comma delimiter (and possible $ sign)? thanks in advance. this must use str convert decimal number us-formatted string expression ignoring local settings: "insert table1 (item, price) value ('" & itemstring & "', " & str(pricevalue) & ")" the magic str is always inserts dot decimal separator, nothing more, nothing less. makes bullet-proof , simplest possible solution. most other methods fail in international environments decimal separator not dot.

objective c - Implement phone call lengh monitoring iOS -

i can make user call app. want length of call in app, once call ended no,you can't officially.as once initiate telprompt:// leave application & once call has been ended there no delegate called later , outside app.you can't access call related information in non-jailbroken phone.

c# - Microsoft Sync Framework: one field fk the other description -

i trying use microsoft sync framework syncing 2 tables. using syncorchestrator synchronize 2 tables. the problem employees has field cate_id has id of category(this fk categories) , employees2 has field called cat , storing name of category in field directly so(is not fk), if see 1 table has id other name directly, how sync tables? advice? this code static void main(string[] args) { //setup connections var serverconn = new sqlconnection(@"data source=win-r9d162fo6e3\hcnsql07;user id=mauricio;password=maitolin26; initial catalog=test;"); var clientconn = new sqlconnection(@"data source=win-r9d162fo6e3\esp;user id=sa;password=maitolin26#; initial catalog=medicaldirector;"); //setup scope name const string scopename = "differentschemascope"; //ienumerable<string> tablesthatchanged //ienumerable<string> tablesthatchanged = enumerable.empty<string>(); ...

ios - Error running pod install with swift -

i new swfit , cocoapods. followed instruction cocoapods below podfile: platform :ios, '8.2' pod 'swiftyjson', '~> 2.1' pod 'swiftspinner', '~> 0.6' pod 'alamofire', '~> 1.1' pod 'superrecord', '~> 1.2' pod 'toucan when did pod install got following error: pods written in swift can integrated frameworks; feature still in beta. add `use_frameworks!` podfile or target opt using it. please ? updated: below console log: $ pod install analyzing dependencies downloading dependencies installing alamofire (1.1.4) installing superrecord (1.2) installing swiftspinner (0.6.0) installing swiftyjson (2.1.3) installing toucan (0.2.0) [!] pods written in swift can integrated frameworks; feature still in beta. add `use_frameworks!` podfile or target opt using it. add "use_frameworks!" podfile because: because apple doesn't let build static libraries contain swift....

Difference between Very sleepy and Callgrind for C++ profiling -

i trying learn difference between very sleepy , callgrind profiling. code intend profile written in c++ , works under both linux , windows. on linux, able use callgrind @ self , inclusive relative costs. understand, callgrind uses instrumented profiling technique , takes considerable time. however, sleepy uses statistical profiling , quick. since both uses different approaches profiling, cannot compare results two. is there way can sort of profile comparison on both linux , windows? unfortunately, callgrind unavailable windows , vice versa sleepy. no. such comparison between 2 unlike things. use sampling when accurate profiling cannot afford overhead. use instrumentation when need understand control flow on time.