Posts

Showing posts from April, 2015

jquery ui - What kind of chart is suitable for work flow? and it should be free -

Image
i have requirement in product create widget have workflow kind of process. if see attached image , looking similar kind of chart. have fusion charts us, possible have similar stuff? since have fusioncharts, recommend using drag node chart. chart of type need , dragging functionality can turned off! http://www.fusioncharts.com/charts/drag-node-charts/ in fact, 1 of examples close image in question , far can tell, chart can customised same - http://www.fusioncharts.com/charts/drag-node-charts/ only downside can think of have manually calculate position of workflow nodes (the connectors connect automatically.) however, positions can computed writing simple function on beforedataupdate event fired chart. ps: using annotations feature , can dynamically position texts labels, images, , other such items arounds process diagram.

debugging - ”Correct” way to debug print custom classes in Swift -

for custom classes implementing custom debug description following one: struct scfile: customdebugstringconvertible { let path: string let status: scfilestatus var debugdescription: string { return "<scfile path:\(path), status:\(status)>" } } what's ”correct” way debug print custom class in swift? like this? <scfile path:/path/file.stuff, status:modified> or this? scfile(path: "/path/file.stuff", status: scfilestatus.modified) there isn't "correct" way second seems closer swift does. an example: var str = "hello, playground" let range = (range(start: str.startindex, end: str.endindex)) print(range.debugdescription) prints: range(0..<17)

if statement - PHP "if" condition error -

error in if condition. trying generate 5digit random no, , verify random no , textbox values ($_post['otp1']) equal move thank.php page else show popup error. i did everything, if textbox values , $otp value equal showing popup message. following code otp.php <form action="otp.php" method="post"> <label>mobile :</label> <input type="text" name="mobile" /> <br /><br /> <label>otp :</label> <input type="text" name="otp1" /> <br /><br /> <input type="submit" name="send" value="verifiy" /> </form> <?php $otp = intval( "0" . rand(1,9) . rand(0,9) . rand(0,9) . rand(0,9) . rand(0,9) ); echo $otp; if(isset($_post['send'])) { $mobile = $_post['mobile']; $otp_no = $_post['otp1']; if($otp_no != $otp) \\ condition not work { echo "<scr

php - Printing matrix table from MySQL with PDO -

Image
i have 3 tables countries , product_categories , vats including following information product_categories includes 2 columns product_category_code , product_category_name_en countries vats and 1 view vats_view contains following query select countries.country_code, product_categories.product_category_code, product_categories.product_category_name_en, vats.vat, vats.editedby, vats.editedtimestamp vats, countries, product_categories countries.country_code = vats.country , product_categories.product_category_code = vats.product_category i'd create html matrix table based on information. in case table like --------------------------------------------------- | | al | de | dk | se | --------------------------------------------------- | category 10 | 14.00 | | | 10.00 | | category 20 | 15.00 | | | | | category 30 | | | | | --

c# - Use reflection to get app.dispatcher from class library -

is there way app dispatcher class library using reflection? nothing i've tried has worked. you can dispatcher calling system.windows.application.current.dispatcher you need add references presentationframework , windowsbase , system.xaml access application class ordinary class library.

unity3d - Instantiate object over network that doesn't appear on the player that created it -

a normal instantiate on photon network create object in client machine not on network want achieve opposite of that, object appear on system except player created it. maybe instantiate object on network , use photons ismine function destroy on client right after spawned.

Spring boot - security java config - LDAP -

i trying set ldap authentication through java config. code auth.getobject inside method init returns null , unable set authentication manager , no exception seen. there wrong in config? how can authentication manager object? @configuration public class ldapauthenticationconfig extends globalauthenticationconfigureradapter { /** environment. */ private environment environment; @bean(name="ldapauthmanager") public authenticationmanager getauthmanager(){ return authenticationmanager; } private authenticationmanager authenticationmanager; @override public void init(authenticationmanagerbuilder auth) throws exception { auth.ldapauthentication() .usersearchfilter( "(&amp;(samaccountname={0})(objectclass=organizationalperson))") .usersearchbase("ou="+environment.getproperty("ldap.user-

javascript - Twitter-Bootstrap, iFrames and Viewport -

hope makes sense, couldn't understand why twitter-bootstrap loading in iframe on mobile not being responsive. until realized after alot of investigations, viewport size being reported parent page. when use code on parent, size of viewport reported iframe changes , therefore bootstrap responds accordingly , works mobile. when remove it, page unreadable , zoomed out. <meta content="initial-scale=1.0" name="viewport" /> even though above code included in bootstrap theme in iframe, has no affect , seems viewport resize happens on parent page level, viewport not work inside of iframe? which causes issue can never control goes on parent page ensure right viewport? how 1 overcome issue? this basic html iframe, see when visit site in iframe, though twitter-bootstrap, zoomed out <html> <head> <title>page title</title> <style> </style> </head> <body> <if

asp.net - Cannot load second form c# -

i'm working web form. want open windows form in web page. cannot load windows form. can it. protected void btn_insertperson_click(object sender, eventargs e) { if (txt_tagetstartdate.text != "" && txt_targetenddate.text != "") { slmslct = new salemanselect(); slmslct.show(); btn_insertperson.enabled = false; } } i believe proper usage is slmslct.showdialog();

http status code 404 - Adding a catch to ignore 404 web exception (C#) -

i writing app scrape website keywords. running issue if try read page not follow through 404 (not problem). however when app encounters 404 web exception not continue. know need try , catch can't quite figure out how add 404 webexception catch without errors. here code snippet issue: think problem not know put try/catch have return source; error not returning value when add catch. string url = string.format(@"http://127.0.0.1/website/" + searchterm); httpwebrequest req = (httpwebrequest)httpwebrequest.create(url); req.method = "get"; req.useragent = "mozilla/5.0 (windows; u; msie 9.0; windows nt 9.0; en-us))"; uri target = req.requesturi; string source; using (streamreader reader = new streamreader(req.getresponse().getresponsestream())) { source = reader.readtoend(); } return source; thanks alex k : i forgot declare source = ""; @ top instead of bottom. thank alex k!

javascript - How to properly reset an object item -

i'm working on requires me put value of input field object item. var test = { item1:{ subitem1: "", <------- 1 i'm trying fill subitem2: "", subitem3: "", subitem4: "" } }; this value gets filled when input field #thecontent changes $('.wrapper').on('change', '#thecontent', function(){ var thecontent = $(this).val(); test.item1.subitem1 = thecontent; }); now, input text field visible after check input checkbox #checkit if(this.checked) { $('#thecontent').show(); } if checkbox unchecked however, not input field disapear, object item needs reset. i'm doing following: else{ $('#thecontent').hide(); //this part needs reset in different way test.item1.subitem1 = ""; } this works, however, if try fill object item again after reset once, doesn't fill new value anymore. how go resetting value

c - "malloc in local function, free memory in main" is it ok? How? -

this question has answer here: when use free() free malloc() used memory? 3 answers i learned in book if need return pointer function, use malloc() , memory heap. wondering how can free() memory allocated after function. is ok did in following code free memory? if it's not correct, what's correct way free memory after function? int *add_them_up (int *x, int *y) { int *p = (int *) malloc(sizeof (int)); *p = *x + *y; return p; } int main () { int c = 3; int d = 4; int *presult = null; presult = add_them_up (&c, &d); printf ("the result of adding is:%d\n", *presult); free (presult); return 0; } yes, code correct. condition apply, see note below to free() allocated memory, need pass returned pointer malloc() , family. as you're getting same pointer returned malloc() add_them_

javascript - RactiveJS and Stapes model not updating -

i trying create filtering stapes object in ractivejs, seem 2 way binding not responding correctly update. i can't work out going wrong thought should work without issue, have created code example here: https://jsbin.com/sajeje/4/edit?html,output here's pattern use using computed property filter adapted use case. couldn't stapes object directly usable result, there getallasarray() seems work: computed: { filtered: function () { var query = this.get( 'query').trim(), users = this.get( 'users' ); return query ? users.search(query) : users.getallasarray(); } }, data: function () { return { users: usersmodel, query: '' } } works sub-component pure reactive programming without need event: <search query="{{query}}" placeholder="search users" /> updated bin here: https://jsbin.com/bomumajagu/edit?html,output push works against stapes model:

c# - Bind WPF user control property inside code -

i have mainwindow.xaml has user control , togglebutton : <togglebutton x:name="toggle" content="wait" /> this button sets busydecorator user control property called isbusyindicatorshowing , works expected, whenever user clicks on toggle button sets user control property: <window x:class="mainwindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:ctrls="clr-namespace:controls" title="busy" height="300" width="300"> <grid> <grid.rowdefinitions> <rowdefinition height="322*" /> <rowdefinition height="53*" /> </grid.rowdefinitions> <togglebutton x:name="toggle" content="show" margin="228,12,255,397" /> <ctrls:busydecorator horizontalalignment

python - How to determine multiword A is a B in wordnet? -

i using nltk here post process classification labels(from imagenet) of model. instance, model might put label 'black bear' on image. how should determine if 'black bear' kind of 'animal'(animal's hyponym) using wordnet? i tried this method tricking part when use code below synset of 'black bear', empty list! can't decide whether 'black bear' hyponym of 'animal' from nltk.corpus import wordnet wn blackbear = wn.synsets('black bear') is there solution problem? thanks! for multiword expressions, use underscores instead of spaces, i.e. >>> nltk.corpus import wordnet wn >>> wn.synsets('black bear') [] >>> wn.synsets('black_bear') [synset('asiatic_black_bear.n.01'), synset('american_black_bear.n.01')] and hyper/hyponym determining hypernym or hyponym using wordnet nltk : >>> bear = wn.synsets('bear', pos='n')[0] >

javascript - Mitigating XSS attacks from submitted data - is the < character the heart of all attacks? -

i have been perusing owasp xss filter evasion cheat sheet , appears (all?) user-input based xss attack vectors depend on ability submit < character or encoded version thereof. per owasp document, can't find attack vectors bypass need inject < character in way. if input filter checks , removes or replaces instances of < user-submitted data, xss risks mitigated? specifically i'm asking if there other xss attack vectors against user-submitted data don't depend on < character. obviously doesn't mitigate sql injection etc, that's separate issue. thanks input! i not going does prevent, address of allows through. let's filter takes string, , returns string of < replaced empty strings. ignoring mess implementation if not careful. if inject un-trusted data html attributes or javascript strings , example, you've done nothing mitigate xss. here's example of xss attack vector use bypass filterleftbrackets() : <div id=

html - CSS Floating Divs and Footer? -

Image
i have this: so see, 2 floating divs @ top , solid div @ bottom. solid div (footer) hides under 2 floating divs. how can make stays under 2 floating divs , not in them on imgur? .left { float:left; width:300px; } .right { float:right; width:300px; } .footer { width:600px; } add clear:both; footer rules. .footer { width:600px; clear:both; } https://developer.mozilla.org/en-us/docs/web/css/clear

javascript - one of the two input fields is required -

i have 2 input fields 1 file other textarea <input class="input_field" type="file" name="title" /> <textarea class="input_field" name="info"></textarea> user has either upload file or type text. if user leaves blank both of inputs, should " choose file or type info " if he/she fills both, ok. my jquery: $(function(){ $(".input_field").prop('required',true); }); i have this code . how can implement if else condition make required 1 of fields? see fiddle https://jsfiddle.net/lez4r/652/ i modified code each elements class of input_field when form submitted. $(function(){ $('form').submit(function (e) { var failed = false; $(".input_field").each(function() { if (!$(this).val()) { failed = true; } }); console.log(failed); if

ruby on rails - Active Record association has_many with multiple foreign keys -

i'm trying set referral model. referral contains user referred, user referring, , doctor class user < activerecord::base has_many :referrals belongs_to :profile, polymorphic: true end class referral < activerecord::base belongs_to :user belongs_to :referrer, :class_name => "user" belongs_to :doctor, :class_name => "user" end i'm able create generic has_many :referrals see doctors have been referred user i'd see doctors you've referred others (using referrer column). i've tried has_many :doctors_referred, primary_key: "referrer_id" , has_many :doctors_referred, through: :referrals ,source: "referrer" no luck. how can see doctors user has referred? # irrelevant class patientprofile < activerecord::base has_one :user, as: :profile end class doctorprofile < activerecord::base has_one :user, as: :profile end my first attempt this: class user < activerecord::base has

c++ - An accumulated computing error in SSE version of algorithm of the sum of squared differences -

i trying optimize following code (sum of squared differences 2 arrays): inline float square(float value) { return value*value; } float squareddifferencesum(const float * a, const float * b, size_t size) { float sum = 0; for(size_t = 0; < size; ++i) sum += square(a[i] - b[i]); return sum; } so performed optimization using of sse instructions of cpu: inline void squareddifferencesum(const float * a, const float * b, size_t i, __m128 & sum) { __m128 _a = _mm_loadu_ps(a + i); __m128 _b = _mm_loadu_ps(b + i); __m128 _d = _mm_sub_ps(_a, _b); sum = _mm_add_ps(sum, _mm_mul_ps(_d, _d)); } inline float extractsum(__m128 a) { float _a[4]; _mm_storeu_ps(_a, a); return _a[0] + _a[1] + _a[2] + _a[3]; } float squareddifferencesum(const float * a, const float * b, size_t size) { size_t = 0, alignedsize = size/4*4; __m128 sums = _mm_setzero_ps(); for(; < alignedsize; += 4) squareddifferencesum(a, b, i, sums);

c - Assembler generates negative forms of conditions, not positive one -

i wondered why gcc assembler use negative form of conditions instead of positive one. suppose have following c code: if (x == 10) { x ++; } y ++; when use gcc compile , produce object file, result of assembly code in powerpc assembly follows: 20: 2c 00 00 0a cmpwi r0,10 24: 40 82 00 10 bne 34 <main+0x34> 28: 81 3f 00 08 lwz r9,8(r31) 2c: 38 09 00 01 addi r0,r9,1 30: 90 1f 00 08 stw r0,8(r31) 34: 81 3f 00 0c lwz r9,12(r31) 38: 38 09 00 01 addi r0,r9,1 3c: 90 1f 00 0c stw r0,12(r31) the assembly uses bne while used equal == in c code. edit 1: i know code working perfectly. means why assembler use negative form not positive one. edit 2: using compiler level 0 optimizer , know that, not intelligent. means question that, why assembler couldn't produce assembly such below: cmpi x, 10 beq label1 b label2 label1: add x, x, 1 label2: add y, y, 1 could 1 please explain happens? t

Checking for date in c++ -

#include <iostream> #include <stdio.h> #include <cstdlib> using namespace std; int main() { int d,m,g; int correctly=1; cout<<"insert date \n"; cin>>d; cin>>m; cin>>g; if (d<1 || m<1 || m>12) correctly=0; int numberofdays; switch(m) { case 1: case 3: case 5: case 7: case 8: case 10: case 12: numberofdays=31; break; case 4: case 6: case 9: case 11: numberofdays=30; break; case 2: if (g%4==0 && g%100=0 || g%400==0) numberofdays=29; else numberofdays=28; break; default: numberofdays=0; } if (d>numberofdays) correctly=0; if (correctly==1) cout<<"date good.\n&q

plsql - Oracle cusor return result and get value by dynamic column name -

as tittle, want value column name paramater in cursor result. i not find answer after searching long time,could give help? --common usage begin rowvalue in (select code, name tablea) loop -- rowvalue.code rowvalue.name end loop; end begin rowvalue in (select * tablea) loop -- tableb keep column's names talbea columnnames in (select name tableb) loop -- want use like: rowvalue.(columnnames.name) end loop; end loop; end you can use dbms_sql, this: declare l_cursor integer; l_column_count integer; l_column_descriptions sys.dbms_sql.desc_tab; l_column_value varchar2 (4000); l_status integer; type col_map_tab_type table of integer index varchar2 (30); col_map_tab col_map_tab_type; begin l_cursor := sys.dbms_sql.open_cursor; -- parse sql sys.dbms_sql.parse (c => l_cursor, statement => 'select * db

Using Python to read data and use it in an if statement -

i have python script writing .txt file (temperature in c). looking way read data , use in if statement. the .txt file contains temp, ex. (20.0), , know how read data , print it, cant use data reason. your problem expect 20.0 read file float. doesn't work way. when read file string, when say: temp = my_data_read_from_file if temp >= 20.0: print("hot") you're saying: if '20.0' >= 20.0: print("hot") strings , floats don't compare way. see mean try this: >>> '0' > 10000 true you need cast file input float comparison: temp = float(my_data_read_from_file) if temp >= 20.0: print("hot")

Is RedHat provide openLDAP package with RHEL5? -

my software needs system openldap libraries. redhat provide openldap package (with libraries)with rhel5 or not? rhel5 not comes openldap need install manually.

sql - Select n number of records from oracle database -

i have select n number of rows oracle database sap using native sql. in open sql query select * mydb size > 2000 upto n rows. what learnt other posts equivalent native sql query select * mydb size > 2000 , rownum <= 100 is correct? do need have rownum 1 of fields in db table? rownum pseudocolumn generated oracle whenever perform select . assignment of value rownum last thing done before query returns row - thus, first row emitted query given rownum = 1, second row emitted query given rownum = 2, , on. notice: means statement following return no rows: select * some_table rownum >= 2 why return no rows? it's because first row emitted query given rownum = 1, , since query looking rows rownum >= 2 no rows selected because first rownum value of 1 applied first row emitted. however - if really want rows except first (or first 10, or have you) can this: select * (select *, rownum inner_rownum some_table =

Generating UML diagram from project file in Visual Studio Express 2013 -

how can generate uml diagram c++ project file in visual studio express 2013. have read answer here , cannot find "view" option anywhere. class diagrams not available visual studio express. source: https://www.visualstudio.com/products/compare-visual-studio-2015-products-vs under architecture , modeling > uml® 2.0 compliant diagrams (activity, use case, sequence, class, , component), not available vs community, @ same level of express. 2015, same 2013. additional links other versions: vs2010 it's not there in express version. vs2012 no, unfortunately, think can in premium or ultimate editions. :o(

How can we do some calculations using last row within a group in data.table in R? -

i have data.table: sample: id cond date 1 a1 2012-11-19 1 a1 2013-05-09 1 a2 2014-09-05 2 b1 2015-03-05 2 b1 2015-07-06 3 a1 2015-02-05 4 b1 2012-09-26 4 b1 2015-02-05 5 b1 2012-09-26 i want calculate overdue days today's date within each group of 'id' , 'cond', trying difference of days between last date in each group , sys.date. desired output ; id cond date overdue 1 a1 2012-11-19 na 1 a1 2013-05-09 832 1 a2 2014-09-05 348 2 b1 2015-03-05 na 2 b1 2015-07-06 44 3 a1 2015-02-05 195 4 b1 2012-09-26 na 4 b1 2015-02-05 195 5 b1 2012-09-26 1057 i tried achieve following code: sample <- sample[ , overdue := sys.date() - date[.n], = c('id','cond')] but getting following output, value recycling: id cond date overdue 1 a1 2012-11-19 832 1 a1 2013-05-09 832 1 a2 2014-09-05 348 2 b1 2015-03-05 44 2 b1 2015-07-06 44 3 a1 2015-02-05 1

php - NetworkError: 500 Internal Server Error - Mailchimp API -

i'm trying add email list using mailchimp api. i'm using code // add user mailchimp newsletter list function addtomailchimp($email,$fname,$lname){ require_once(get_stylesheet_directory().'/assets/mailchimp.php'); $apikey = '"xxxxxxxxxx-us7"'; $list_id ="7xxxxxxxe"; $mailchimp = new mailchimp($apikey); $result = $mailchimp->call('lists/subscribe', array( 'id' => $list_id, 'email' => array('email'=>$email), 'merge_vars' => array('fname'=>$fname, 'lname'=>$lname), 'double_optin' => false, 'update_existing' => true, 'replace_interests' => false, 'send_welcome' => false, )); die(var_dump($result)); } it return error: networkerror: 500 internal server error - i don't know how tackle

Symmetric Bijective Algorithm for Integers -

i need algorithm can one-to-one mapping (ie. no collision) of 32-bit signed integer onto 32-bit signed integer. my real concern enough entropy output of function appears random. looking cipher similar xor cipher can generate more arbitrary-looking outputs. security not real concern, although obscurity is. edit clarification purpose: the algorithm must symetric, can reverse operation without keypair. the algorithm must bijective, every 32-bit input number must generate 32-bit unique number. the output of function must obscure enough, adding 1 input should result big effect on output. example expected result: f(100) = 98456 f(101) = -758 f(102) = 10875498 f(103) = 986541 f(104) = 945451245 f(105) = -488554 just md5, changing 1 thing may change lots of things. i looking mathmetical function, manually mapping integers not solution me. asking, algorithm speed not important. use 32-bit block cipher! definition, block cipher maps every possible input value in r

visual studio 2015 - t4 Debuging: ReflectionTypeLoadException "Unable to load one or more of the requested types" -

i have custom t4 template. when right-click , select "run custom tool" run without error. if right-click , select "debug t4 template" error above addition of === pre-bind state information === log: displayname = my.interfaces, version=1.0.5708.24057, culture=neutral, publickeytoken=null (fully-specified) log: appbase = file:///c:/program files (x86)/microsoft visual studio 14.0/common7/ide/ log: initial privatepath = null calling assembly : (unknown). === log: bind starts in default load context. log: no application configuration file found. log: using host configuration file: log: using machine configuration file c:\windows\microsoft.net\framework\v4.0.30319\config\machine.config. log: policy not being applied reference @ time (private, custom, partial, or location-based assembly bind). log: attempting download of new url file:///c:/program files (x86)/microsoft visual studio 14.0/common7/ide/my.interfaces.dll. log: attempting download of new url file:///

python - Anomalous constrained scipy.optimize.minimze behavior based on initial conditions -

i'm testing out scipy.optimize project , found anomalous behavior when setting initial conditions minimizing using slsqp method. assume because sequential least squares algorithm, when initialized @ critical point ( start_pos1 ) returns without checking second derivative conditions. looked through docs , didn't see anything, though--can tell what's going on? from scipy import optimize import numpy np def simplex(x): return 1 - sum(x) def sphere_min(x): return sum(x[i]**2 in range(len(x)))**.5 def sphere_max(x): return -sphere_min(x) if __name__ == "__main__": dimensions = 3 start_pos1 = np.ones(dimensions) * 1.0/dimensions start_pos2 = [2*float(i+1)/(dimensions*(dimensions+1)) in range(dimensions)] raw_start_pos = np.random.uniform(0, 1, dimensions) start_pos3 = raw_start_pos/raw_start_pos.sum() bnds = tuple((0, 1) in range(dimensions)) cons = ({'type': 'eq', 'fun': simplex}) start_

javascript - How do you do some jQuery inside a ruby if/else loop in a Rails html.erb file? -

i have button present in html, default hidden css #comments_button{ display: none; } . i want button appear if notice has comments. in _notice.html.erb: <%= button_tag "comments", id: "comments_button" %> <span>comments</span> <% end %> <% if notice.comments.any? %> *** jquery $("#comments_button").show(); *** <% end %> how call jquery inside ruby if/else loop? please note, button should present in html can't this: <% if notice.comments.any? %> <%= button_tag "comments", id: "comments_button" %> <span>comments</span> <% end %> <% end %> you can insert script tag in erbs, e.g. following should work <%= button_tag "comments", id: "comments_button" %> <span>comments</span> <% end %> <% if notice.comments.any? %> <script> $("#comments_button").show();

mysql - FireDac error 314 - but DLLs are in program directory -

i getting when trying access mysql database : [firedac][phys][mysql]-314. cannot load vendor library [libmysql.dll or libmysqlld.dll] this did not happen (unchanged) code, however, have upgraded windows 10 , had reinstall delphi xe8, system configuration matter. in order try solve problem, copied both of files c:\windows\sysytem32. when did not seem work, copied them \win32\debug, generated .exe resides. i imagine doing rather stupid, can't see what. the proper solution place driver file (eg., libmysql.dll ) in application's folder, or place installation location in fddrivers.ini file: [mysql] vendor=<folder>\libmysql.dll (recent versions of documentation seem use vendorlib instead of vendor in ini file.) see rad studio documentation topics configuring drivers (firedac) , connect mysql server (firedac) more information.

mysql - PHP Upload CSV to update database records but exclude duplicate -

i'm trying figure out best way this. have database around 500 records/rows in mysql , need update daily. problem file upload excel file (i need convert csv before upload?). need upload records don't exist yet in current mysql database. unique field named "memberid". what best way achieve this? if insert each rows (so can check first if record/row should inserted database) 1 one using loop, slow process uploading 500 records? i'm new php vba programming , know how insert records 1 @ time. suggestions appreciated. you've got 3 options: replace ( recommended you're using database that's updated daily - you'll never know, if old records didn't change last update): replace db_name (id,value) values (1,1),(1,2),(1,3),(1,4) it affect rows. on duplicate key update (that's you've been searching for, update whatever want or leave row 'as is'): insert db_name (id,value) values (1,1) on duplicate key update id=

c# - No overload for method `HideToast' takes `0' arguments -

my question parameter put in when using nstimer? tried hasn't worked. v.alltouchevents += delegate { hidetoast();}; nstimer.createscheduledtimer (thesettings.durationseconds, hidetoast); void hidetoast (nstimer tr) { uiview.beginanimations (""); view.alpha = 0; uiview.commitanimations (); } the error is: no overload method 'hidetoast' takes '0' arguments you can assign event v.alltouchevents += hidetoast; i hope i've got point. edit if hidetoast signature diffrent alltouchevents need after typing v.alltouchevents += press tab , let create proper method (event handler )for you. in case creates method private v_alltouchevents(object sender, system.eventargs e) { ... } inside generated method should put desired code. good luck.

How to map SQL collation setting to a Java comparator? -

is there way translate database's collation setting (e.g. sql_latin1_general_cp1_ci_as ) java comparator implementation can apply same ordering database does, using in java code? is there existing library provides mapping? i ended doing following: query current database's collation setting. next, parse description of collator sub-components such "case-insensitive" or "accent-sensitive". next, construct comparator corresponding these rules enjoy! /** * returns comparator associated database's default collation. * <p> * beware! <a href="http://stackoverflow.com/a/361059/14731">some databases</a> sort unicode strings differently * non-unicode strings, same collation setting. * <p> * @param unicode true if string being sorted unicode, false otherwise * @return comparator associated database's default collation * @throws databaseexception if unexpected database error occurs */ public co

animation - Android - Animate a View's entrance -

how can animate way view first appears (transitions) onto screen? know how build animation, i'm wondering how make animation run view first drawn onto screen. appreciate , help! edit: view in question textview or imageview. you can set layout attribute android:animatelayoutchanges="true" in parent layout, actions changing child view visibility visible gone animated. or if need type of animation - create animation , use in correct time (for example when screen created, or action cause view appearing happened).

docusignapi - How do you create a Developer account for DocuSign? -

i brand new using docusign api. company has issued me docusign account , believe set developer. going through introductory documentation, see says create or log dev sandbox. i've tried following: log demo.docusign.net existing work account. fails saying there no such account, though can log account on www.docusign.net. log demo.docusign.net newly-created personal account. fails saying there no such account, though can log account on www.docusign.net. select "sign up" on demo.docusign.net. brings me new-account page. can create account there works www.docusign.net, not on demo.docusign.net. log in demo.docusign.net using google account. fails error "social id not linked docusign membership." so, do? goal set sandbox, ideally work account, can experiment , debug without affecting production data. how set such sandbox? or, on wrong track? not need such sandbox development? sandbox accounts separate production account. here sign link:

Tablesorter filter-onlyAvail -

i use tablesorter (mottie's fork v2.23.0) gem jquery-tablesorter-rails i have table use classes filter-select filter-onlyavail dropdown of available options in column. recently added jeditable column adds script tag cells (and maybe embed value in span) this: <td> <span class="editable" data-id="15" data-name="user[route]" title="click edit..">1</span> <script type="text/javascript"> ...script jeditable.... </script> </td> the result select filter dropdown shows variants of values including script contents. i tried using filter_selectsource filter-match class added, contents of filter common (like 1,2 99 etc) lots of false hits in script. any pointers on how ditch contents of script tags both in select population , in search results? i ended using data-text="value" on element want use filter , sorting. in case tag. this not, howev

python - Adding to the value of a key in a dictionary -

i trying make markov chain in python. currently, when have text such "would could" , "would like" key of tuple ('would', 'you') 'could' overwritten become ('would', 'you') 'like' iterate through text file. i trying add each new value key value key. i.e. key ('would', 'you') want value show ('would, 'you'): 'could', 'like' here code: def make_chains(corpus): """takes input text string , returns dictionary of markov chains.""" dict = {} line in corpus: line = line.replace(',', "") words = line.split() words_copy = words word in range(0, len(words_copy)): #print words[word], words[word + 1] if dict[(words[word], words[word + 1])] in dict: dict.update(words[word+2]) dict[(words[word], words[word + 1])] = words[word + 2]

Azure Cloud Service stops saving to table storage when storage is accessed in visual studio server explorer -

i working on azure cloud service has 2 different worker roles saving entities azure table storage. when run solution locally (both in debug , release mode) works perfectly, when deploy solution (either in debug or release) azure cloud production environment writes correct data , works well; after open storage account in server explorer in visual studio review saved, cloud service worker roles stop saving new data tables. does accessing azure storage account server explorer window in visual studio freeze storage account when azure cloud service running against it? no, that's not possible. please provide more description how worker role "stop saving new data table"? did encountered failures? if so, what's detailed error message? or did make no progress while writing table entities?

azureservicebus - Async Monitoring Azure Service Bus With Worker Role -

i have worker role monitoring azure service bus can potentially receive thousands of messages @ peak times. realize can use cloud service create multiple instances of worker role (competing consumers), , scale way, each worker instance asynchronously handle multiple messages well. so question in this; in client.onmessage handler, can call async function goes off on thread, , onmessage resumes reading next message? ideally, happen defined number of times. for example: client.onmessage((receivedmessage) => { try { await processcurrentmessage(receivedmessage); // launch asynchronously x times } catch(exception ex) { receivedmessage.abandon(); //handle error } }); public async void processcurrentmessage(brokeredmessage receivedmessage) { // properties message , stuff

c# - Auto detect the type of reference property of a given class object -

given class this public class employee { public employee() { children = new list<child>(); } public virtual string firstname { get; set; } public virtual string lastname { get; set; } public virtual employeecard employeecard { get; set; } public virtual ilist<child> children { get; protected set; } } if have object of above class, how determine if employeecard property object or list of object @ run time? possible? check see if type of property implements ienumerable : bool iscollection = typeof(employee).getproperty("employeecard") .propertytype .getinterface("ienumerable") != null; this should work generic , non-generic collection types, including ilist<t>

"Trying to get property of non-object" in SOAP PHP - not sure why this error is occuring -

hope guys can me... still new @ php , struggling display parts of object/array set of results. getting following result $results soap webservice: `object(stdclass)[9] public 'summary' => object(stdclass)[2] public 'id' => string '1096408402' (length=10) public 'ikey' => string '1440010962' (length=10) public 'address' => object(stdclass)[4] public 'forename' => string 'test' (length=4) public 'surname' => string 'tester' (length=6) public 'dob' => string '0000-00-00' (length=10) public 'telephone' => string 'unavailable' (length=11) public 'occupants' => array (size=3) 0 => object(stdclass)[12] ... 1 => object(stdclass)[13] ... 2 => object(stdclass)[14] ... 3 =>

javascript - Latest recpatcha for node.js -

how use latest captcha google node.js ?! i know how use this (explained here ), don't know how use latest captcha on server side of node.js. only on client side: adding this(client-side): <script src='https://www.google.com/recaptcha/api.js'></script> <div class="g-recaptcha" data-sitekey="public_key"></div> adding on server side, write: if users send form integrated recaptcha, receive among other things, string containing name "g-recaptcha-response". if want find out if google has verified user in question, send post request following parameters: url: https://www.google.com/recaptcha/api/siteverify secret (needed) ... response (required) value of 'g-recaptcha-response' remoteip ip address of end user on recaptcha documentation website find more information , advanced configurations. the problem here is, don't know how securely node.js , way not find "g-recaptcha-respo

jQuery Bootgrid Not Working Properly -

i use help. have jquery bootgrid on page using ajax. while data loads , grid rendered. none of features seem work including search box, sorting, refresh, etc. likewise getting no javascript errors. i referencing following jquery.bootgrid.min.css jquery.bootgrid.min.js jquery.bootgrid.fa.min.js my code pretty basic html <table id="jobgrid" class="table table-condensed table-hover table-striped"> <thead> <tr> <th data-column-id="jobnumber" data-identifier="true" data-type="string">job number</th> <th data-column-id="jobname" data-type="string">job name</th> <th data-column-id="jobstate" data-type="string">request state</th> <th data-column-id="jobstatus" data-type="string">status</th> <th data-column-id="jobrequestor&q

java - Different null comparison? -

what it's difference between 2 codes?: code 1 in first code have variable in put directly null. string prove = null; toast.maketext(getapplicationcontext(), prove, toast.length_long).show(); if(prove == null) { toast.maketext(getapplicationcontext(), "correct", toast.length_long).show(); } else { toast.maketext(getapplicationcontext(), "incorrect", toast.length_long).show(); } result 1 null correct code 2 in second code have class named car get , set methods method have return string return null. public class car { private int idcar; private string name; public car(){}; public car(int idcar, string name) { this.idcar = idcar; this.name = name; } //here rest of , set methods public string getname() { return name; } } and in mainactivity.java have arraylist of cars : arraylist<car> cars = new arraylist<car>(); that use on customadapter, follows

html - Why is chrome rendering this CSS in such a way -

i trying create circle icon in css. however, when page first rendered circle looks inverted egg , covers border around slightly. (zoom in browser see issue in more details) the tricky part is, if open dev tools , change value related it's position(width, height, whatever), snap normal , become circle. https://jsfiddle.net/2yjashje/ <div class="round-egg"> </div> .round-egg { font-size: 14px; background: white; color: #8dc641; border-radius: 10px; cursor: help; border-bottom: none !important; border: 4px solid #8dc641; width: 20px; height: 20px; text-align: center; } what going on here? i put letter "i" in own span , increased margin top vertically centre it. circle, modified border-radius property, , removed border-bottom: none; property well. assuming want circle, need bottom border. https://jsfiddle.net/2yjashje/3/ <div class="round-egg"> <span class="

elixir - 'Task could not be found' for custom mix task -

i have task thing in lib/mix/tasks/thing.exs the code is: defmodule mix.tasks.thing use mix.task def run(_) io.puts "hello world" end end when run mix thing or mix thing the task thing not found or the task thing not found i've tried running mix compile beforehand, didn't help. i tried putting code this question directly mix.exs, shown in question. still couldn't run task. mix tasks need compiled. if rename lib/mix/tasks/thing.exs lib/mix/tasks/thing.ex should work. you can read more scripted mode (.exs) at: http://elixir-lang.org/getting-started/modules.html#scripted-mode

swift - "expected expression in container literal" in a while loop XCODE -

i have problem code when try use import foundation import webkit let beaches: [string: beach] = [ /* mate asher */ var = 25 while <= 30 { = + 1 string! let urlpath = ("http://web.com/a.php?id=" + + "&get=name") let url: nsurl = nsurl(string: urlpath)! let session = nsurlsession.sharedsession() let task = session.datataskwithurl(url, completionhandler: {data, response, error -> void in}) let urlpath2 = ("http://web.com/a.php?id=" + + "&get=area") let url2: nsurl = nsurl(string: urlpath2)! let session2 = nsurlsession.sharedsession() let task2 = session.datataskwithurl(url2, completionhandler: {data2, response, error -> void in}) let urlpath3 = ("web.com/a.php?id=" + + "&get=longi") let url3: nsurl = nsurl(string: urlpath3)! let session3 = nsurlsession.sharedsession() let task3 = session.datataskwithurl(url3, completionhandler: {data3, response, error -> void in}) "a": beach(ti

c++ - Why is initialization of a constant dependent type in a template parameter list disallowed by the standard? -

in answer post " (partially) specializing non-type template parameter of dependent type ", states: the type of template parameter corresponding specialized non-type argument shall not dependent on parameter of specialization. [ example: template <class t, t t> struct c {}; template <class t> struct c<t, 1>; // error template< int x, int (*array_ptr)[x] > class {}; int array[5]; template< int x > class a<x,&array> { }; // error —end example ] my question why restriction here? there @ least 1 use case find restriction interferes writing clean code. e.g. template <typename t, t*> struct test; template <typename t> struct test<t, nullptr> // or struct test<t, (t*)nullptr> { }; template <typename r, typename...args, r(*fn)(args...)> struct test<r(args...), fn> { }; though i'm unsure if there other cases stating constant based on type problem beyond not making sense. a