Posts

Showing posts from May, 2010

c# - AdDuplex interstital intitialization fails with unspecified error -

i developing game using monogame , c# windows 10 uwp. having problem when try use interstitial ads in game. make initialization call in app.xaml.cs : adduplex.adduplexclient.initialize("application-id-here"); the debugger not break on call itself, rather breaks after onlaunched event complete without specifying exception. i using latest version of adduplex sdk. tried using both vs2015 extension , nuget package. same result. know not monogame, because tried similar call in normal xaml app , got same result. is there doing wrong? i never able resolve issue, reformatted computer , able incorporate adduplex app. problem development environment , reinstalling components solved problem.

Python parsing to lower case and removing punctuation not functioning properly -

import string remove = dict.fromkeys(map(ord, '\n ' + string.punctuation)) open('data10.txt', 'r') f: line in f: word in line.split(): w = f.read().translate(remove) print(word.lower()) i have code here , reason, translate(remove) leaving amount of punctuation in parsed file. why reading whole file within loop? try this: import string remove = dict.fromkeys(map(ord, '\n ' + string.punctuation)) open('data10.txt', 'r') f: line in f: word in line.split(): word = word.translate(remove) print(word.lower()) this print our lower cased , stripped words, 1 per line. not sure if that's want.

javascript - ng-if in ng-repeat recreating elements on click events -

i wanted replace anchor tag img when user clicked on it. sample code like <div ng-repeat="postpart in currentpost.parts "> <div ng-if = "!postpart.isclicked"> <img ng-src="{{imgurl}}" ng-click="iclicked(postpart)"/> </div> <div ng-if = "postpart.isclicked"> <a ng-href="{{postpart.description}}" ng-init="init()"></a> </div> </div> iclicked function make isclicked true. it worked 1 part. when there 2 parts showing 2 images. when click on first replaces 1 anchor element. but in case of 2nd image click replaces 2 anchor tags. how can able make it? there solution replace image element anchor in ng-repeat? may you. var app = angular.module("app",[]); app.controller("ctrl" , function($scope){ $scope.parts = [ {"description": "this test","isclick...

Issue in Sync with soft delete enabled in native iOS (Azure Mobile services) -

i using azure mobile services on ios platform , syncing service ( soft delete enabled), when delete records using device, _delete flag set true records in service database, when sync ios device, deleted records still present there . i have seen other questions on so, did not solve problem. any appreciated. edit : using enablesoftdelete:true domainmanager = new entitydomainmanager<tablename>(context, request, services, enablesoftdelete: true); a new column _deleted setting true after deleting device. to enable soft delete on .net backend, need pass parameter entitydomainmanager in controller initializemethod: domainmanager = new entitydomainmanager<todoitem>(context, request, services, enablesoftdelete: true); for more information, see using soft delete in mobile services .

css - How to make my live site responsive in typo3 templovoila 6.2 -

i have live website in server in typo3 templavoila version 6.2. wanna make responsive. how implement bootstrap in typo3? please me in concern. in advance!! funny question answer is: can find free template requirement google of typo3 cms read documentation of downloaded theme install if still facing problem simple :) hire me or developer.

httpresponse - How to detect http status code in angular 2 -

Image
i have loadsize() func in angular2 project , calls gettotalnumbercampaigns() in service , return observable. , subscribe observable result. this loadsize() loadsize() { this.campaignsservice.gettotalnumbercampaigns().subscribe(value => {//async call this.campaignsize = value; }, (err)=> {} ); } let's there error gettotalnumbercampaigns() , fire err=>{} in subscribe. question how know httpreponse status code is can direct user take different action (if connection failed(502), user should refresh. if access_token expiry(500), page should jump login page) this gettotalnumbercampaigns in service class gettotalnumbercampaigns(): observable<number> { return this.http.get(`${this.apiurl}/count`, { headers: this.headers }) .map<number>(res => <number>res.json()) } the returned error corresponds response itself, can use status attribute status code: loadsize() { this.campaignsservice.gettotal...

c# - File download and save locally windows phone -

i m saving image local folder windows phone application var localfolder = applicationdata.current.localfolder var photofile = localfolder.createfileasync(("mani"), creationcollisionoption.replaceexisting); i m saving file without extension while save locally security reason , avoid other apps view. when search google got api launch default apps file windows.system.launcher.launchfileasync(photofile); but local file dont have extension can't use api default application launch please guide me alternative solution this thanks,

Pick a specific level in the contour plot on matlab -

i have plot generated test of figuring out how contour plots work on matlab in general. i'm trying figure out if there way can plot 1 of lines not first line. they way matlab explains if do: contour(x,y,z,1); it plot 1 of lines it's first one, particular case want 3rd or 4th one. there way in matlab? contour(z,n) , contour(x,y,z,n) draw n contour lines, choosing levels automatically. not want! contour(z,v) , contour(x,y,z,v) draw contour line each level specified in vector v . use contour(z,[v v]) or contour(x,y,z,[v v]) draw contours single level v . suggesting levels of 3rd , 4th line 7 , 8 have write contour(x,y,z,[7 7]) plot 3rd line or contour(x,y,z,[7 8]) plot 3rd , 4th line.

PHP array from MySQL result has duplicate values due to subquery -

i've used mysql query array of results php. however, query uses subquery , can result in subquery value being shown twice in array incorrect. spent ages looking @ sql see if stop wasn't successful @ all. wonder if easier modify array rectify error. the array: array(436) { [0]=> array(8) { ["id"]=> string(2) "75" ["subtotal"]=> string(8) "168.0000" ["invoice_type"]=> string(1) "1" ["adjustment"]=> string(4) "0.00" ["totalcost"]=> string(8) "168.0000" } [1]=> array(8) { ["id"]=> string(2) "82" ["subtotal"]=> string(7) "84.0000" ["invoice_type"]=> string(1) "1" ["adjustment"]=> string(4) "0.00" ["totalcost"]=> string(7) "84.0000" } [2]=> ar...

ios - Waiting for multiple blocks to finish -

i have methods retrieve object information internet: - (void)downloadappinfo:(void(^)())success failure:(void(^)(nserror *error))failure; - (void)getavailablehosts:(void(^)())success failure:(void(^)(nserror *error))failure; - (void)getavailableservices:(void(^)())success failure:(void(^)(nserror *error))failure; - (void)getavailableactions:(void(^)())success failure:(void(^)(nserror *error))failure; the downloaded stuff gets stored in object properties, why success functions return nothing. now, want have 1 method this: - (void)synceverything:(void(^)())success failure:(void(^)(nserror *error))failure; which nothing else calling methods above, , returning after every single method has performed success or failure block. how can this? hint: aware cascading methods calls in each others success block work. neither 'clean' nor helpful when later implementations include furth...

c# - Insert SQL Dataset into Tab control in Windows Form -

i have simple sql compact database added project. reading "head first c#" , first program creates database contact info. book says drag data source onto form , create data controls in form automatically. i tried doing this, using tab control multiple tabs , when drag dataset onto form, erases tab control. want program able modify database 1 tab, have other tabs other things. any ideas on how insert dataset tab page? in order this, go data source explorer , right click on table name drag , drop form. choose copy , click on tab page want inside , paste inside using ctrl+v or right click on , choose paste. sorry, after playing around lot more, able inside tab.

Maven - a set-up query -

Image
given group of developers, each 1 has following requirements on respective (local)windows machines: through ides eclipse, sts etc., run spring, hibernate etc. projects quickly build, deploy , run, change if required, rebuild , redeploy(everything, preferably via ides) projects available on github there following constraints/objectives : the individual developer machines have restricted or no internet access the developers must take required jars single location store jars required across team whenever required, developer must able pull updated jars central location onto local environment , continue run projects seamlessly within ide, build github project , run (locally) attached image give clear idea of work environment i'm envisaging! i have started reading maven quite overwhelmed - how should proceed? as suggested sander verhagen in answer, should use repository proxy. nexus , artifactory famous one. here describe briefly steps need looking for:...

JavaScript Date NaN issue in IE? -

i facing problem while displaying date in ie, below json structure trying display instoredate , firstmarkdowndate dates in ui. working fine in ff , chrome facing issues while coming ie. in ie showing nan. "data":[ { "id": "123", "indate": [ 2012, 12, 17 ] } ] i using below date format function format date before displaying. formatdate: function(longdate) { var d = new date(longdate); return ('0' + (d.getmonth()+1)).slice(-2) + '/' + ('0' + (d.getdate())).slice(-2) + '/' + d.getfullyear(); } formatdate(data.indate); you're passing array date constructor cause of problems. arrays (as objects) stringified , parsed as-a-string when fed date constructor - yet ie not recognize format "2012,12,17" valid date while chrome does. instead, should pass 3 single values separately: var date = new date(longvalue[0], lo...

Python : creating an array from list with given indices -

i know ought simple, still stuck :-/ i have 2 equal-length arrays , b. there 3 equal-length lists al1, al2, al3 : have number pairs such (a[i],b[i])=(al1[j],al2[j]). have put these indices of , j in aindex , lindex respectively. want create array c (equal length of array a) containing numbers al3. see code: import numpy np list1 = [9,7,8,2,3,4,1,6,0,7,8] = np.asarray(al) list2 = [5,4,2,3,4,3,4,5,5,2,3] b = np.asarray(bl) al1 = [9,4,5,1,7] al2 = [5,3,6,4,5] al3 = [5,6,3,4,7] lindex = [0,5,6] aindex = [0,1,3] index = np.asarray(aindex) c = [] in range(0,len(list1)): if in aindex: com = al3[i] else: com = 'nan' c.append(com) what c = [5, 6, 'nan', 4, 'nan', 'nan', 'nan', 'nan', 'nan', 'nan', 'nan'] what want is c = [5, 'nan', 'nan', 'nan', 'nan', 6, 4, 'nan', 'nan', 'nan', 'nan'] please :-/ i must admit have n...

jquery - How to append all DIV starts with class and repeat this proc again? -

let me explain direct in code: i have: <dl class="ctx accordion"> <dt>headline<a>x</a></dt> <dd><!----></dd> </dl> <p class="ctx">lorem ipsum dolor sit amet, consetetur sadipscing elitr</p> <p class="ctx">lorem ipsum dolor sit amet, consetetur sadipscing elitr</p> <p class="ctx">lorem ipsum dolor sit amet, consetetur sadipscing elitr</p> <dl class="ctx accordion"> <dt>headline<a>x</a></dt> <dd><!----></dd> </dl> <p class="ctx">lorem ipsum dolor sit amet, consetetur sadipscing elitr</p> <dl class="ctx accordion"> <dt>headline<a>x</a></dt> <dd><!----></dd> </dl> <p class="ctx">lorem ipsum dolor sit amet, consetetur sadipscing elitr</p> <p class="ctx"...

python - Align matplotlib Text with colorbar -

Image
i'd align bottom edge of text() instance bottom edge of colorbar instance, it's not working way expected: i'm obtaining colorbar y position using cb.ax.get_position().ymin , , setting text object's y position so: cb = plt.colorbar(mappable, shrink=0.5) details = plt.text( 1., 1., "text", ha='right', va='bottom', size=5, color='#555555', transform=ax.transaxes, fontdict={ 'family': 'helvetica', 'size': 6}) details.set_y(cb.ax.get_position().ymin) i've tried altering va , 2 never aligned: using va=bottom middle of text appears aligned middle of colorbar; using va=center , text box ymin below (apparent) cb ymin. what's best way , set coordinates? how look, directly plot cb.ax : >>> x=linspace(-4,4) >>> y=linspace(-4,4) >>> g=meshgrid(x,y) >>> z=g[0]**2+5*g[1] >>> ctf=plt.contourf(x, y, z) >...

html - Adding tooltips to jQuery dynamically created elements -

i found helpful jsfiddle on adding tooltips jquery. how same results dynamically created elements? without plugins, if thtas possible. http://jsfiddle.net/uqty2/29/ depending on options user ticks, div display 1 of 3 coloured circles show importance of task. can add tooltip circles in manner such this? jquery(function() { jquery( '.veryimportant' ).tooltip(); }); you add tooltip how would, make sure calling .tooltip() after element has been added page. based on code, seems you're trying add immediately, , if element doesn't exist, never it. simple sample: <div id='test'>im div</div> $("#test").append("<span id='spantest'>hey</span>"); $("#spantest").tooltip(); //works fine, since element exists @ time of call

javascript - Raphaeljs: Why is paper.getFont() undefined? Cufon.replace() works -

i'm using raphaeljs , i'm trying paper.print() work in .js-file. i've cufonized font , imported .font.js file html-file. in html-file, cufon.replace('h1') works (since text tag in body use font) can't paper.print() work in .js file. according .font.js-file font family "champagne & limousines", i'm trying font calling paper.getfont('champagne & limousines') an alert shows result of getfont-call undefined. try print letters doing following: var letters = paper.print(100, 100, "stringstring", paper.getfont('champagne & limousines'), 40); this nothing. i've done other things in javascript file, know there's nothing wrong paper, nor including javascript file in html file. what doing wrong? please download latest version of raphael.that solved me.

java - How to create a JRuby app with GUI and package it? -

Image
i'm diving ruby's world , i'm loving it. right i'm trying develop simple application sort of gui , package can run in os (with jre installed). what i've found far: gui jrubyfx: it's great because allows me use javafx editor create , feel of app (and use generated fxml in project). problem is, can run examples >jruby can't package distribute. packaging wrabler, rawr, , jruby-jarify, of them gave me errors when trying make jar file (mostly files not found). so, right now, need direction (and examples if possible) best way make jruby app gui (usigng fxml if possible) , can package (in jar guess) , make run in computer jre installed. thank in advance! shoes (especially shoes 4) might fit requirements. runs on top of jruby (1.7+) , can make app package . however, not work on top of fxml. shoes uses own dsl: shoes.app { background white stack(margin: 8) { button "a bed of clams" button "a coalition of...

javascript - Angular directive to replace character from user input -

i want trim characters user input. want trim '%, *, ), ( ' if user give of character want show on search box in js want set model value without these restricted characters. something like: user input 'a&b' want set in scope 'ab' this question( angular.js - controller function filter invalid chars input not delete chars until valid char entered ) answers want without showing on user. in advance. use: <script> var user_input = "%this (is) string*"; var new_string = plainstring(user_input) alert(user_input); function plainstring() { var findit = [ '%', '*', ')', '(']; for(i=0; i<findit.length; i++) { user_input = user_input.replace(findit[i],''); } return; } </script> or can use <script> string.prototype.myreplace = function(find, replace) { var str = this; (var = 0; < find.length; i++) { str = str.replace(find[i],...

google api - Error status 409 while updating profile -

i'm stuck this: several thousand profiles keep failing on update. don't know what's wrong them. can take on these? a submitted profile/contact entry: <ns0:entry xmlns:ns0="http://www.w3.org/2005/atom" xmlns:ns1="http://schemas.google.com/g/2005" xmlns:ns2="http://www.w3.org/2007/app" xmlns:ns3="http://schemas.google.com/contact/2008" ns1:etag="&quot;whcgq08krct7i2a_&quot;"><ns0:category scheme="http://schemas.google.com/g/2005#kind" term="http://schemas.google.com/contact/2008#profile" /><ns0:id>http://www.google.com/m8/feeds/profiles/domain/<domain>/full/<username></ns0:id><ns1:name><ns1:familyname>xxxxxxxx xx xxxx xxxxxxx</ns1:familyname><ns1:fullname>xxxxxxx xxxxxxxx xx xxxx xxxxxxx</ns1:fullname><ns1:givenname>xxxxxxx</ns1:givenname></ns1:name><ns0:updated>2013-09-09t21:26:21.000z</ns0:update...

wordpress - Why do I get a 404 when I include wp-blog-header.php in a page that is the target of a POST action? -

i have form in wordpress blog uses php file action post when form submitted. php file outside normal wp context, want able read custom fields wp database, have included wp-blog-header.php in file explained here . however, include file, post fails 404. if remove include works fine. wp have sort of security mechanism prevents wp-blog-header.php being loaded on post? there way around this? the main goal pull value advanced custom fields field on particular page in wp site. if there way without including wp-blog-header.php i'm open suggestions. thanks if form posting field parameter of name , 404 result.

java - Spring CrudRepository findByInventoryIds(List<Long> inventoryIdList) - equivalent to IN clause -

in spring crudrepository, have support "in clause" field? ie similar following? findbyinventoryids(list<long> inventoryidlist) if such support not available, elegant options can considered? firing queries each id may not optimal. findbyinventoryidin(list<long> inventoryidlist) should trick. the http request parameter format so: yes ?id=1,2,3 no ?id=1&id=2&id=3 the complete list of jpa repository keywords can found in current documentation listing . shows isin equivalent – if prefer verb readability – , jpa supports notin , isnotin .

php - Variable does not change its value -

i have been trying analyze hours can't understand wrong code :( $d = 1; //i declare variable 1 $a = 0; while($d<$arraycount-2){ while ($a < 40){ $c = 0; $b = 0; while($c < $fc){ $finaloutput = $finaloutput.$database_returned_data[$d][$c].","; //but here, in loop $d 1 $c++; } while($b < 5){ $finaloutput = $finaloutput.$mydata[$a][$b].","; $b++; } $finaloutput = $finaloutput."--end--"; $a++; } $d++; //but increments successfully. hence, while loop terminates after meets criteria. } the variable $d 1 inside other loop increments outside loop. note there while statement inside while. there wrong? i'm using $d array: $finaloutput = $finaloutput.$database_returned_data[$d][$c].","; i noob poster. feel free ask more details :) you don't set $a here: while($d<$arraycount-2){ while ($a < 40){ so on every iteration besides first...

git - Just download content of remote branch , not the repository -

this question has answer here: using git latest revision 2 answers do have anyway download content of branch , , not repository. need branch build on server, interested in files not repository stuff. you should use --single-branch modifier git clone. supposing branch called my_branch $ git clone --single-branch --branch my_branch this download history branch. using --depth modifier, can recent revisions: $ git clone --depth 1 --single-branch --branch my_branch

javascript - C# tostring(radix) -

i have following line in javascript: c = number(string_1.charcodeat(i) ^ string_2.charcodeat(u)).tostring(16); i need rewrite in c#, got far: string c = (convert.tochar(string_1[i]) ^ convert.tochar(string_2[u])).tostring(16); i'm not able enter radix value in tostring method. suggestions how can this? thanks you can use convert.tostring write out value in different base: (note bases supported; 16 1 of them, see docs details.) int = 16; var str = convert.tostring(16, 16);

html - send only field boxes filled. if empty then do not send in email. php form to email -

i have simple form email in php. nice thing form in send php code not have write out fields name.for example, not have write this: $msg .= "$_post[contactname] contact name: contactname\n" in code, have write is: foreach ($_post $field=>$value) { $body .= "$field: $value\n"; the form working perfectly. sending this: contactname: name here businessname: business name here emailaddress: email@email.com email_confirmation: phonenumber: 714-555-5555 however, wish happen: if field left empty or web user not fill field box, form should not send field. example: web user decides not fill in contactname , or businessname. form should send format: emailaddress: email@email.com email_confirmation: phonenumber: 714-555-5555 noticed no mention of contactname: , businessname: please help! appreciate it. -michelle ha. here php send code: if email_confirmation field empty if(isset($_post['email_confirmation']) && $_post['e...

linux - How to pass parts of a command as variable bash? -

a="grep ssh | grep -v grep" ps -ef | $a | awk '{print $2}' how can make above work? have section need not pass grep term, possible pass more 1 grep term, meaning need pass "term1 | grep term2" variable. edit: another.anon.coward answer below worked me. thank sir! create function instead: a() { grep ssh | grep -v grep } ps -ef | | awk '{print $2}' the other solution use eval it's unsafe unless sanitized, , not recommended. a="grep ssh | grep -v grep" ps -ef | eval "$a" | awk '{print $2}'

mysql - update a row without sql triggers -

i have table called tasks , in tasks users complete. possible make task complete if other tasks user complete. know can sql triggers wanted know if there's more elegant way this. this includes making new task , therefore making final task incomplete

java - How to go from jinternalform to another jinternalform -

in java swing project i'm using jframe form named home. acully home page linked other jinternalframe forms. have made 1 jinternalform frame named invoice. , put button damageitem. when i'm click button want go jinternalform frame called stock. how can link that. made object of stock. stock st = new stock(); but still can't use method use in home call stock. like. . stock st = new stock(); jdesktoppane1.add(st); and changed jinternalframe's variable modifier "public" . but still can't use it. how can call 1 jinternalframe form another. i'm using netbeans 7.3 i not 100% sure question if you're trying achieve interact between 2 jinternalframes, should consider looking @ mvc pattern ( wikipedia link ) you have view, jframe owns 2 jinternalframes. these jinternalframes have view elements, jbuttons. invoke external controller each time 1 of these buttons invoked whichever action wish do. ideally, have model (logical entity) di...

javascript - Rails script tag syntax error? -

running rails app on new host , upgraded ruby v2.0.0 1.9.3, , i'm getting weird syntax error. looks this: completed 500 internal server error in 178ms actionview::template::error (/home/action/braindb/app/views/folders/_contents.html.erb:124: syntax error, unexpected keyword_ensure, expecting end-of-input): 121: 122: </script> app/views/folders/show.js.erb:1:in ` _app_views_folders_show_js_erb__1073772573694008441_69985052296980' app/controllers/folders_con...

javascript - Creating a note taking app using JQuery mobile and phone gap -

i have app i'm developing jq mobile , phonegap. within app, want include ' notes taking ' page , has following. make new notes , save them locally. recall them whenever need to, edit them , delete them i not find example follow, tried this: http://tutorialzine.com/2012/09/simple-note-taking-app-ajax/ but lost me @ index php , how implement that, tried example: http://miamicoder.com/2011/building-a-jquery-mobile-application-part-1/ but complex got lost in code. i'm beginner @ programming , javascript very poor , have no idea start , kind of code involved in making part of app. please help. thank you. your first site ( http://tutorialzine.com/2012/09/simple-note-taking-app-ajax/ ) not work examples embedding php html , not acceptable phonegap apps. your second site making way more complicated needs limited scope. not going give advice , places look. draw out want user interface , create html create load , save function in javascrip...

z index - How to fix the zIndex issue with jQuery Dialog UI -

i having small issue dialog ui. marked zindex value high number seems ignoring it. the following code $( "#number-add" ).dialog({ resizable: false, width: 500, modal: false, autoopen: false, stack: false, zindex: 9999, buttons: { "add contact": function(e) { var formdata = $('#number-add-form').serialize(); //submit record $.ajax({ type: 'post', url: 'ajax/handler-add-new-account-number.php', data: formdata, datatype: 'json', cache: false, timeout: 7000, success: function(data) { $('#responceaddnumber').removeclass().addclass((data.error === true) ? 'errorbox' : 'passbox').html(data.msg).fadein('fast'); ...

sql - Pick One Row per Unique ID from duplicate records -

in ms.access 2010, have similar query table 1 below displaying duplicate records. problem though have unique id's, 1 of field has different data other row since have combined 2 seperate tables in query. want display 1 row per id , eliminate other rows. doesn't matter row pick. see below: id - name - favcolor 1242 - john - blue 1242 - john - red 1378 - mary - green i want pick of the row same id. doesn't matter row pick long displaying 1 row per id matters. id - name - favcolor 1242 - john - red 1378 - mary - green use sql current query subquery , group by id , name . can retrieve minimum favcolor since want 1 , don't care which. select sub.id, sub.name, min(sub.favcolor) ( select id, [name], favcolor table1 union select id, [name], favcolor table2 ) sub group sub.id, sub.name; note name reserved word . bracket name or prefix table name or alias avoid confusing db engine.

Logic error possibly misunderstanding in java assignment -

i've been having numerous problems getting project work correctly i'm stuck on getting class work properly. whats suppose take current station radio class , pass along class. problem i'm trying select between , fm every time run it, displays station. don't understand why automatically gets set station. public class autoradiosystem { private radio selectedradio; private amradio radioam; private fmradio radiofm; private xmradio radioxm; //is correct place initialize these? radio amradio = new amradio(); radio fmradio = new fmradio(); public autoradiosystem() { //even making selected radio fm still produces values selectedradio = radiofm; } // problem lies , more. shouldn't return 0.0 without station being selected. public double getcurrentstation() { if (selectedradio == radioam) { return amradio.getcurrentstaion(); } else if (selectedradio == radiofm) { return fmradio.getcurrentstaion(); ...

java - Calculate a fitting text size -

i want calculate size font needs, text displayed in 1 line without clipping. example |-100px---here's text---100px-| i have dpi , there stuff. testing isn't way, using libgdx , text ist display button (scene2d ui). call bitmapfont.getbounds() . textbounds returns tell need. can try medium font, go or down based on how big or small bounds are. use method scale ui sizes old droid 1s new hd displays. http://libgdx.badlogicgames.com/nightlies/docs/api/com/badlogic/gdx/graphics/g2d/bitmapfont.html

ms access - INSERT INTO fails if inserting a variable with the value of Null -

the sql insert fail if variable inserting has value of null. the variable costlab variant data type. non-null value decimal. db.execute ("insert budget (wbsid, category, capture_date, budget_date, budget_type, month_value) " & _ "values ('" & wbsid & "', 'labor', #" & importdate & "#, #" & monthdate & "#, 'forecast', " & costlab & ");") i want insert null if code sets costlab returns null. if value returned want insert value. write if statement checks null insert "null" directly wanted know if there way without if statement insert nulls via variable. you use nz() when build insert statement. it's similar iif() approach, more concise. dim strinsert string strinsert = "insert budget (wbsid, category, capture_date, budget_date, budget_type, month_value) " & _ "values ('" & wbsid & "...

c# - Map Property to User Control -

i have usercontrol , have added property it. want property added properties window whenever usercontrol added form. this used add property image img; public image setimage { { return img; } set { img = value; } } this works fine problem whenever user wants call property, user have call class of user control like mycontrol ctrl = new mycontrol(); ctrl.image = image.fromfile("/*path image*/"); but change property controls have been added form need map usercontrol whenever user want call it, user call like mycontrol1.image = image.fromfile("/*path image*/"); or mycontrol2.image = image.fromfile("/*path image*/"); pls how acheive this? add [browsable(true)] tag (which in system.componentmodel namespace inside system.dll ) desired property of user control class: public class yourusercontrol { .... .... [browsable(true)] public image setimage { { return img; } set { img = value; }...

Error 80045C17 when trying to login at Azure to manage account -

everytime try login im azure account ( http://manage.windowsazure.com/ ), keep receiving same error 80045c17, , error message says nothing more ask try later. i tried every possible browser , same result comes everytime! i use same username log @ every microsoft service. i can't stop sites! how fix this? i able fix first signing in http://msdn.microsoft.com , go https://manage.windowsazure.com . using microsoft live login session anyway have log in microsoft. example login.live.com i think happened me because azure portal opened on machine same account. make sure sign out when end using azure portal. thanks, alex vezenkov

ios - Keep moving images bouncing within frame width and height -

i trying figure out how keep image within frame width , height. right wraps around. preferably create stays within frame , bounces around inside. -(void) movebutterfly { bfly.center = cgpointmake(bfly.center.x + bfly_vx, bfly.center.y + bfly_vy); if(bfly.center.x > framewidth) { bfly.center = cgpointmake(0, bfly.center.y + bfly_vy); } else if (bfly.center.x < 0) { bfly.center = cgpointmake(framewidth, bfly.center.y + bfly_vy); } if(bfly.center.y > frameheight) { bfly.center = cgpointmake(bfly.center.x + bfly_vx, 0); } else if (bfly.center.y < 0) { bfly.center = cgpointmake(bfly.center.x + bfly_vx, frameheight); } } -(void)movebutterfly{ static int dx = 1; static int dy = 1; if (bfly.frame.origin.x >= self.view.bounds.size.width - bfly.bounds.size.width) { dx = -dx; } if (bfly.frame.origin.y >= self.view.bounds.size.height - bfly.bounds.size....

In Apache Axis2/Rampart, while generating wsdl and validating policy, is Ws-security Policy 1.2 assertion <sp:NoPassword/> not handled completely? -

we implementing ws-security policy on our web services following framework/module/specification. apache axis2 1.6.2 apache rampart 1.6.2 ws-security policy 1.2(namespace: http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702 ) we facing following issues while creating/consuming service. axis2 wsdl generation logic ignores <sp:nopassword/> assertion. after debugging,i realized because of logic in org.apache.ws.secpolicy.model.usernametoken (rampart-policy-1.6.2.jar) expects <sp:wssusernametoken11 /> ( or <sp:wssusernametoken10 /> ) specified - again when specify that, <sp:nopassword/> created child element of <sp:wssusernametoken11 /> causing <sp:nopassword/> ignored on client (consumer) side. in implementation of org.apache.rampart.policybasedresultsvalidator/handlesupportingtokens method - nopassword scenario not considerd ; hence fails saying "org.apache.axis2.axisfault: usernametoken missing in request". o...

loops - How to repeat an input command if input is invalid in c++ -

i have write program calculates gpa several user inputs. i've gotten program correctly calculate gpa if inputs correct, however, program must have error checking i.e. if user inputs 5 when inputs needs 0,1,2,3, or 4. need able tell user input invalid , have program go step , allow them retry. the program cannot use arrays. #include <iostream> using namespace std; int main () { //defining variables used during code. float credithours; int lettergrade; float total; float totalcredits = 0; float totalpoints = 0; //asking input user cout<<"please enter grade class: 4 a, 3 b, 2 c, 1 d, 0 f, or '-1' when you're done inputting grades:\n"; cin >> lettergrade; // logic ensure valid letter grade input if ((lettergrade >= 4) && (lettergrade <= 0)) { cout << "please enter valid input (0, 1, 2, 3, or 4):\n"; cin >> lettergrade; } cout << "please enter credit hours entered grade: \n...

Large images in Crystal Reports 2008 - Memory Full -

i've got c# application targeting .net 4. application includes crystal reports reports can printed or previewed. code uses: crystaldecisions.crystalreports.engine.reportclass there report, created crystal 2008, dynamically fetches 1 or more images file system. i'm running problems when images large. for example: the report trying include 4 images (each on own page) the source images (.jpgs) 3.5 megs each when print or preview report, first 2 images appear, no more. if try again not see of images , message box (when previewing): crystal reports windows forms viewer memory full. not enough memory operation. my application using 600 megs @ point. if swap out large images smaller ones (about half meg each) i'm able view report without problems. if preview same report, big images, within crystal reports 2008 editor, works well. so there limit how many megs of image data can put report when using crystaldecisions.crystalreports.engin...

javascript - Double click run interval indefinitely -

i trying create animation using series of images. when clicks button iterate images interval & stops on condition current image number clearinterval . issue when clicks in series on buttons iteration becomes un-stoppable , runs indefinitely. clearinterval won't works then. i have created jsfiddle well. please me fix , let me know if not clear. in advance. you need call clearinterval before call setinterval again. otherwise overwriting interval id of first call , never clear it. alternatively, can keep track of whether or not interval still going , create new 1 if previous has finished. perhaps set loop -1 when call clearinterval , call setinterval if loop -1 .

Pervasive Control Center SQL INTO Error -

i getting error in pcc doesn't make lot of sense. have 2 statements inside user defined function same , 1 runs fine while other returning error: 'into': syntax error end , start parameters being passed function. the error being thrown on second statement select count(*) :divmodeltot1 "table1"."info" i.compldate <:end , (i.agree null or i.agree>:start) union select count(*) :divmodeltot2 "table2"."info" i.compldate <:end , (i.agree null or i.agree>:start); any or suggestions appreciate. thanks! select must first query in statement containing union. select count(*) :divmodeltot1 "table1"."info" i.compldate <:end , (i.agree null or i.agree>:start) union select count(*) "table2"."info" i.compldate <:end , (i.agree null or i.agree>:start);

MySQL how to specify string position with LOAD DATA INFILE -

i have ascii files static number of characters each line no delimiters. i'd use load data infile import table. example of file: usalalabama usararkansas usflflorida the structure table: country char(2) state char(2) name varchar(70) create table `states` ( `country` char(2) collate latin1_general_ci not null, `state` char(2) collate latin1_general_ci not null, `name` varchar(70) collate latin1_general_ci not null ) engine=myisam default charset=latin1_general_ci collate=latin1_general_ci; is possible specify start , end position each column? according the documentation , can load fixed format file without using temporary table. if fields terminated , fields enclosed values both empty (''), fixed-row (nondelimited) format used. fixed-row format, no delimit...

Java Graph (Structure) Deep copy -

well, have class (vertex), contains hashset in it; , @ point, need deep copy element; i wrote code, doesn't work; i'm working on bug several days , can't fix it... if has enough time read code , find it, i'll grateful. thank in advance. well, here function: public vertex getcopy(vertex copyfrom, vertex copyto, hashset<vertex> created){ copyto.setid(copyfrom.getid()); copyto.setcolor(copyfrom.getcolor()); copyto.setcount(copyfrom.getcount()); copyto.setdepth(copyfrom.getdepth()); copyto.setdistance(copyfrom.getdistance()); copyto.setheurist(copyfrom.getheurist()); copyto.setvisited(copyfrom.isvisited()); copyto.setpath(copyfrom.getpath()); created.add(copyto); hashset<vertex> copytoneighs = new hashset<vertex>(); hashset<vertex> copyfromneighs = new hashset<vertex>(); copyfromneighs.addall(copyfrom.getneighbours()); iterator<vertex> = copyfromneighs.iterator(); whil...

python - If, else statement output -

for in range(len(npa)): filename = '/lca_rcdist.php?npa1=503&nxx1=745&npa2=503&nxx2=' + npa[i] reply = urllib.request.urlopen(servername + filename) if reply.status != 200: print('error sending request', reply.status, reply.reason) else: data = reply.readlines() reply.close() line in data[:showlines]: cline = line.decode('utf-8') if '"ofrom">n<' in cline: print('nxx ,' + npa[i]) the following output nxx,269nxx,298nxx,300nxx , on, there way add if , else statement output not contain comma , nxx in front of first entry? example: 269nxx, 298nxx ? i'm new , still strugling if , else statements on scripts these. ifo on how change output using if, else statemnet appriciated. create list , use str.join() : result = [] # new in range(len(npa)): ... # blah, blah, same example, until if '"ofrom...

php - Fileupload.js + MySQL -

i'm kinda new in php javascript/jquery... i'm developing system must handle uploads. using fileupload.js works but... can't retrieve file info , store @ mysql name,extension,size,url ... when try got error message: syntaxerror: unexpected token < the code starts problems is: <?php $options = array( 'delete_type' => 'post', 'db_host' => 'localhost:3306', 'db_user' => 'root', 'db_pass' => '123456', 'db_name' => 'house', 'db_table' => 'midias' ); error_reporting(e_all | e_strict); require('uploadhandler.php'); class customuploadhandler extends uploadhandler { protected function initialize() { $this->db = new mysqli( $this->options['db_host'], $this->options['db_user'], $this->options['db_pass'], $this->options[...

Is it Possible to Add Multiple Frameworks to Xcode Project at Once? -

i feel there should easy way can't find it. whenever use parse.com framework ios project, have add @ least 10 different frameworks, , far can tell can add 1 @ time through linked frameworks , libraries options in xcode. any faster way this, besides creating template project? more specifically, issue if pick framework, search , hold cmd select multiple, searching erases selected frameworks (so have scroll through list). searching (as discovered) kills current selection. can cmd-click select multiple, if don't use search. it's annoying hell. similar "add file project" dialog forces click checkbox every single target manually (no "select targets"). one of annoying parts of xcode apple hasn't prioritized having enough user impact fix (since people add 1 framework, or have 1 or 2 targets other example).

C#/LINQ Quereying a class -

i'm using sam jenkin's deck of cards class . i'm trying query cards in suit. i'm getting error: cannot implicitly convert type 'system.collections.generic.ienumerable' 'system.collections.generic.ienumerable'. explicit conversion exists (are missing cast?) i've tried moving things around i'm not understanding error. please help? code is: var deck = new deck(); ienumerable<deck> deckquery = mycard in deck.cards mycard.suit == suit.club select mycard.cardnumber; my card class is: public class card : icard { public suit suit { get; set; } public cardnumber cardnumber { get; set; } } my enumerators are: public enum suit { club = 1, diamond = 2, heart = 3, spades = 4, } public enum cardnumber { ace = 1, 2 = 2, 3 = 3, 4 = 4, 5 = 5, 6 = 6, 7 = 7, 8 = 8, 9 = 9, ten = 10, jack = 11, queen = 12, king = 13, }...

javascript - bootstrap collapse, jquery active -

hi have made collapsible accordion menu bootstrap javascript plugin, menu works great know if possible use jquery active class keep menu opened @ current position when loading new page menu. learning javascript , therefore not sure how go doing this. this of html of menu: <div id="nav"> <div id="accordion"> <div class="heading"> <a class="accordion-toggle nav-main-item" data-toggle="collapse" data-parent="#accordion" href="#collapseone">about</a> </div><!--ends heading--> <div id="collapseone" class="collapse"> <ul> <li><a class="nav-sub-item" href="about.html">me</a></li> <li><a class="nav-sub-item" href="articles.html...

ruby on rails - How to upload CSV with Paperclip -

i have looked on other posts creating csv paperclip still bit lost on why isn't working. have method generates csv string (using csv.generate), , try save report in reports controller following method: def create(type) case type when "geo" csv_string = report.generate_geo_report end @report = report.new(type: type) @report.csv_file = stringio.new(csv_string) if @report.save puts @report.csv_file_file_name else @report.errors.full_messages.to_sentence end end however, upon execution, undefined method 'stringify_keys' "geo":string error. here report model: class report < activerecord::base attr_accessible :csv_file, :type has_attached_file :csv_file, paperclip_options.merge( :default_url => "//s3.amazonaws.com/production-recruittalk/media/avatar-placeholder.gif", :styles => { :"259x259" => "259x259^" }, :convert_options =...

java - Finding the computational complexity of nested loops -

i'm not sure if i'm doing these problems correctly need tell me if i'm wrong. ( = 0 ; < n ; ++ ) this n-0 = n assignment , it's o(g(n)) right? okay know, if want number of assignments , o(g(n)) in these questions: sum = 0; ( = 1 ; < n * n ; j ++) { ( j = 1 ; j <= n; j ++ ) { sum += j; } } what did was, sum=0 1 assignment , outer loop n^2 - 1 assignments , inner loop n-1 assignments , sum 1 assignment therefore, number of assignments 2+(n^3+1) gives o(g(n^3)) in nested loop : sum = 0; ( = 1 ; <= n; ++ ) { ( j = 1 ; j <= 100 ; j++) { ( k = 1 ; k <= n ; k ++ ) { sum += k; } } } what did , sum =0 1 assignment first loop 1-n assignments second loop 99 last loop 1-n , sum = 2 so got 3+(1+n^2) assignments give me o(g(n^2)) is there wrong did? your calculations correct. thing might - it's important whether it's o(g(n^2)) or o(g( 99 *n^2)). m...

ruby on rails - after_save callback: TypeError: Bid can't be coerced into Fixnum -

i have after_save callback in bid model, keep getting error: typeerror @ /items/11/bids bid can't coerced fixnum below bid model: class bid < activerecord::base belongs_to :user belongs_to :item validates :amount, presence: true validate :check_if_highest_bid after_save :bid_logic def check_if_highest_bid errors.add(:amount, "you must enter higher bid") unless self.item.price < self.amount end def bid_logic add_previous_bidders_bid update_items_current_price subtract_current_users_price end def add_previous_bidders_bid price = self.item.price bid = bid.find_by_amount(price) unless bid.nil? user = user.find(bid.user_id) user.budget += bid user.save end end def update_items_current_price self.item.price = self.amount self.item.save end def subtract_current_users_price user = user.find(self.user_id) user.budget -= self.amount user.save end end...