Posts

Showing posts from September, 2014

How to improve the performance of c# program -

i trying to extract sdf file geodatabase.as new sdf file created ,the memory usage program increases.to overcome issue have tried reaseing connection sdf file , tried release resources using gc.collect() method still problem persist. /// <summary> /// feature data geodatabase file /// </summary> /// <param name="dictionaryproperty"> schema of table </param> /// <param name="table">table connection of gdb file</param> /// <param name="sdffilepath">sdf file path</param> static void getfeaturedata(dictionary<string, property> dictionaryproperty, table table, string sdffilepath) { int filecount = 1; ; list<property> propertylist = new list<property>(); ienumerable<string> propertycoll = dictionaryproperty.select(i => i.value).where(i => i.datatype == "oid").tolist().select(i => i.propertyname); string propertyname = null; foreach (string item in

html - full-screen fit images in two columns -

i'm beginner , tried make 1 page myself, however, result not good. try explain need: full-screen page 2 images, 1 image cover 50% of horizontal space of browser window, , second image on right side covering rest of page. need both images responsive , keep 100% height. when window resized, left , right sides of both images cropped. similar this: http://www.gt3themes.com/website-templates/soho/striped_landing.html is difficult make? tried follow guides on web, result images stretched , not cropped. maybe wrong , need create 2 columns , put images inside? appreciate help. my current code is: .photo{ size: 100%; position: relative; overflow: hidden; } .photo img{ max-width: 50%; height: 100%; } the site linked more or less did this: http://jsfiddle.net/xnln6s5o/ html <div id="container"> <div id="left" class="halfwidthcontainer"> <div id="left-image" class="image"&

ruby on rails - Syntax Error in application.yml File -

i running command rail s , displays following error: /home/user/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/settingslogic-2.0.9/lib/settingslogic.rb:189:in `missing_key': missing setting 'mail_from' in /home/user/myapp/my_app/config/application.yml (settingslogic::missingsetting) what wrong in application.yml? my config/application.yml defaults: &defaults site_name: site host: site url: site resque: server: 127.0.0.1:6379 namespace: resque_namespace smtp: domain: domain login: login password: secret server: host port: 25 mail_from: mail@example.com robokassa: login: login test_mode: false pass1: secret pass2: secret token: secret avisosms: login: login service_id: 666 hash: secret sdpays: md5: secret project_id: 666 edit_delay: 5 contest_id: 1 aws: ses: access_key_id: secret secre

python - How can i use a function with "variable" constants in scipy.optimize? -

how can use "variable" constants in scipy.optimize functions? trying create iterative optimisation algorithm, updates parameters in objective function after each optimisation run. to use simple example of want do: from scipy import optimize opt def f(x, r): return r * (x[0]**2 + x[1]**3) r = 0.1 # initial r value y = [] y.append([2,2]) # initial point in range(0,10): y.append(opt.fmin(f, y[i])) # how can include 'r' in line?? r = some_function_to_update_r(r) any appreciated edit: re-declare objective function each time optimise? make loop instead? for in range(0,10): def f_temp(x_temp): return f(x_temp,r) y.append(opt.fmin(f_temp, y[i])) r = some_function_to_update_r(r) or there better way? fmin supports optional args argument, representing tuple of additional arguments passed function you're trying optimize: y.append(opt.fmin(f, y[i], args=(r,))) this explained in documentation fmin ; should habi

android - Get specific json object by ID using GSON -

i trying develop skills in json parsing. have found have implement kind of json parsing library example gson. have json example here . , code using values json: private class postfetcher extends asynctask<void, void, string> { private static final string tag = "postfetcher"; public static final string server_url = "http://kylewbanks.com/rest/posts"; @override protected string doinbackground(void... params) { try { //create http client httpclient client = new defaulthttpclient(); httppost post = new httppost(server_url); //perform request , check status code httpresponse response = client.execute(post); statusline statusline = response.getstatusline(); if(statusline.getstatuscode() == 200) { httpentity entity = response.getentity(); inputstream content = entity.getcontent(); try {

access paypal response in ruby on rails 4 -

i have abort abort(response.payment_info.inspect) and response [#<paypal::payment::response::info:0x007f25f62a8410 @ack="success", @currency_code="usd", @error_code="0", @order_time="2015-07-01t13:30:54z", @payment_status="completed", @payment_type="instant", @pending_reason="none", @protection_eligibility="ineligible", @protection_eligibility_type="none", @reason_code="none", @receipt_id=nil, @secure_merchant_account_id="xpn8gak2pgvcq", @transaction_id="63h82632fa7502700", @transaction_type="expresscheckout", @request_id=nil, @seller_id=nil, @exchange_rate=nil, @amount=#<paypal::payment::common::amount:0x007f25f629f400 @total=5, @item=0, @fee=0.5, @handing=0, @insurance=0, @ship_disc=0, @shipping=0, @tax=0, @gross=0, @net=0>>] how can transaction_id or other variables amount? please me out this. thanks i have found. can this

Excel VBA Object Defined Error -

i getting object defined error below code. any idea doing wrong? thanks sub loop_test2() dim integer dim j integer dim countall integer dim countxl integer activesheet.range("a1").activate countall = activesheet.range("a35") msgbox countall j = 1 countall = 1 this error occurs: countxl = cells(i, j).value continued: msgbox countxl = 1 countxl + 2 cells(i + 2, j) = "row " & & " col " & j next next j end sub i think incorrect assignment. i'm not familiar correct syntax. error details: "run time error 1004. application defined or object defined error before edit question, forget initial i .so set value i . in future, may use option explicit @ top of sub make sure declare variable before using it. so case, need set i=1 , , please declare variables long instead of integer. may refer here find out reason why use lon

JSP scriptlet expression not evaluated in AUI tag attribute -

this simple, i'm unable simple variable display task. i getting 1 dynamic value i'm assigning 1 variable. if try print variable value printing shown below, <%=columnname%> but when try assign same value in tag attribute, value not updated tag name. code shared below. <aui:input name="preferences--<%=columnname%>--" type="checkbox"/> issue:assume variable value 'screenname'. if print value <%=columnname%> printing value "screenname" on ui. bhen use same variable in name attribute showing value <%=columnname%> instead "screenname". note: preferable format name attribute prefix "preferences--" , suffix "--". please correct syntax , suggest me print variable value in tag attribute it seems cannot use mixed strings having string , scriptlet inside aui tags. http://www.liferay.com/community/forums/-/message_boards/message/16694386 can try below <% stri

MySQL, how to query among intervalls? -

its want for i cycle. table: amount value 1 1 4 10 9 11 14 12 and want 10 asking amount 5 . so, "test" results be: 1 => 1 2 => 1 3 => 1 4 => 10 5 => 10 6 => 10 7 => 10 8 => 10 9 => 11 10 => 11 11 => 11 12 => 11 13 => 11 14 => 12 but amount = 5 wont work. how set intervals? is want? select t.value table t t.amount <= 5 order t.amount desc limit 1;

How to create a dynamic textarea showing value of input slider using jQuery/Javascript? -

suppose there input[type=range] . use jquery (or javascript) dynamically create textbox show value of input when being changed. textbox floating below input slider knob/arrow/dot. also, after value change completed, textbox should automatically hidden/removed. how go it? this pretty simple var ismousedown = false; $('#slider').mousedown(function(e){ ismousedown = true; $('#val').show().css({left:e.clientx,top:$(this).offset().top + $(this).height()}).val(this.value); }) .mousemove(function(e){ if(ismousedown){ $('#val').show().css({left:e.clientx,top:$(this).offset().top + $(this).height()}).val(this.value); } }) .mouseup(function(){ ismousedown = false; $('#val').hide(); }); #val{ position:absolute; display:none; width:20px; } <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script> <input id="slider&quo

imagemagick - Optimization of in memory load time of image -

i using imagemagick utility resize images. before download image s3 , keep in memory reduce time. still when print time taken image s3 , time load image in memory comes out 300-400 ms , 500-900ms . question time image s3 depands on region download image. time load image in memory taking 500-900ms . there way can optimize ? string accesskey = "access_key"; string secretkey = "secret_key"; amazons3 client = amazon.awsclientfactory.createamazons3client( accesskey, secretkey ); getobjectrequest request = new getobjectrequest { bucketname = "buckey_name", key = keyname }; stopwatch sw = new stopwatch(); sw.start(); var response = client.getobject(request); sw.stop(); console.writeline("time image : " +

sharding - MongoDB shard key as (ObjectId, ObjectId, RandomKey). Unbalanced collections -

i trying shard collection approximately 6m documents. following details sharded cluster mongod version 2.6.7, 2 shards, 40 % writes, 60% reads. my database has collection events around 6m documents. normal document looks below: { _id : objectid, sector_id : objectid, subsector_id: objectid, . . . many event specific fields go here . . created_at: date, updated_at: date, uid : 16digitrandomkey } each sector has multiple (1,2, ..100) subsectors , each subsector has multiple events. there 10000 such sectors, 30000 subsectors , 6m events. numbers keep growing. the normal read query includes sector_id, subsector_id. every write operation includes sector_id, subsector_id, uid (randomly generated unique key) , rest of data. i tried/considered following shard keys , results described below: a. _id:hashed --> not provide query isolation, reason: _id not passed read query. b. secto

java - how to determine Parent Class for my javafx vbox -

i novice javafx, , working on javafx application. error got unable fetch child node fxml file, fxml file this <children> <vbox fx:id="sidemenuvbox" alignment="top_center" maxheight="1.7976931348623157e308" maxwidth="1.7976931348623157e308" minheight="600.0" minwidth="125.0"> <children> <button fx:id="headingbutton" maxwidth="1.7976931348623157e308" onaction="#helpbuttononaction" text="masters" /> <button fx:id="opencompanybutton" maxwidth="1.7976931348623157e308" onaction="#opencompanybuttononaction" text="open company" textalignment="center" wraptext="true" /> <button fx:id="newcompanybutton" maxwidth="1.7976931348623157e308" onaction="#newcompanybuttononaction" text="new company" textalignment="center

ruby on rails - Facing issue NoMethodError (undefined method `include' for "56":String): -

i facing issue while writing code def sim_state sim_employees = simemployee.find(params[:id].include(:employees)) respond_to |format| format.js { render :layout => false, :locals => { :sim_employees => sim_employee } } end end and in sim_states.js.erb $('#simstate').text('<%= sim_employee.employees.app_state%>'); so gives me error nomethoderror (undefined method `include' "56":string): when use includes gives undefined method `includes' please guide me how solve this. the reason simple params[:id] is return string value "56" , includes works activerecord::relation , not string. not able fire query ways. simemployee.find(params[:id]) this return again result , not relation. try using simemployee.where(id: params[:id]).includes(:employees).first this should you. ps : using includes 1 record same

Migrating LibGDX project to Android Studio -

i have bought new laptop higher configuration , in process of moving existing plain android , libgdx based android project new laptop. since google stopped support eclipse, planned move android studio in new laptop. i done migrating plain android projects android studio. not clear process migrating libgdx projects android studio. hence have following questions. do need use import plugin android studio ? do need create similar libgdx project , copy source files ? if create new project , copy source file old keystore work ? could please list me steps successful migration of libgdx project android studio ? thanks !

android - Web View running on other than UI thread -

i trying show flurry interstitial getting following message in debug screen , not receiving interstitial on screen. 07-14 15:55:31.390: w/webview(10588): java.lang.throwable: warning: webview method called on thread 'flurryagent'. webview methods must called on ui thread. future versions of webview may not support use on other threads. i have followed tutorial : android integration at present working on andengine. error replying put code in ui thread result same. here code displaying ads : protected void oncreate(bundle psavedinstancestate) { super.oncreate(psavedinstancestate); // configure flurry flurryagent.setlogenabled(false); // init flurry flurryagent.init(maingameactivity.this, my_flurry_apikey); mflurryadinterstitial = new flurryadinterstitial(maingameactivity.this, my_adspace_name); flurryadtargeting adtargeting = new flurryadtargeting(); // enable test mode interstitial ad unit adtargeting.se

javascript - How to add delay only when the function is called? -

i trying call function delay. window.setinterval(function(){ //$('.product-display').delay(3000).hide(); document.getelementbyid('product-list-display').style.display = "none"; },3000); the above code hides div after 3 seconds, above snippet called in show div function. need is, want invoke the above delay function when show div function called...right function executes every 3 secnds i.e using setinterval hiding. want hide after 3 seconds when show div called. how can this? can use jquery? function showdiv(city, imagesrc, timeout) { window.settimeout(function() { document.getelementbyid('city-order').innerhtml = ""; document.getelementbyid('order-product').innerhtml = ""; $('.product-display').addclass("zoomin"); document.getelementbyid('product-list-display').style.display = "block"; var order_placed_city = document.g

asp.net mvc - Computed Property not calculated when passing as parameter in $http.post in AngularJS -

i creating object in jquery contains computed properties. sending object web api service object defined class object. properties $scope variable set except computed variable appears null mean values not calculated when send part of $http.post method. please see code. jquery code $scope.estimationefforts = { //total no. of apps distribution totalappsdistributionnumbers: [ { description: "number of no issue apps", value: function () { return ($scope.total_no_apps * $scope.calculationasssumptions.expriencebasedassumptions[0].ratio) / 100 } }, { description: "number of apps vendor upgrade", value: function () { return ($scope.total_no_apps * $scope.calculationasssumptions.expriencebasedassumptions[1].ratio) / 100 } }, { description: "number of bespoke apps not requiring remediation",

Whether SIM card is available or not in windows phone universal project -

i'm creating winrt universal project mobile , tablet. i want check: in mobile application, sending sms text sms application this. var message = new chatmessage(); message.recipients.add("9999"); message.body = "r*" + voucherno + "*" + accountno + "*" + pin; await chatmessagemanager.showcomposesmsmessageasync(message); i want place check above whether user has inserted sim card or using mobile out sim card. app not crashing due not big issue if couldn't place check here (as have searched alot got nothing i'm assuming not possible right not in winrt check sim card availability), link of documentation/blog/so question regarding mentioned can't check sim card availability helpful. thanks. bool simavailable = false; var device = await chatmessagemanager.gettransportsasync(); if (device != null && device.count > 0) { foreach (var item in device) { if (item.transportfriendlyname != "

arrays - Output goes stray at START and at END of a java loop -

i writing code translating signals 1 form form. code works fails ends. input: string [] test = {"b","100","b","b","2","3","100","b","200","b","3","17","b","10" }; required output: b/101 b/1 b/106 b/201 b/21 b/11 got output: b/1 b/101 b/1 b/106 b/201 b/21 comparison of required output , got output first term b/1 not required in got output. b/11 missing @ end in required output. algorithm: "b" replaced "b/", , followed addition of numbers appearing in strings "2", "3","100" gives 105 , "1" added "b" hence 106 , final result becomes 'b/106'. i new comer java , programming. need required output. this code: public class signalconversion { public static void main(string args[]) { string [] test ={"b&

Convert Javascript code, that changes DOM element's background color, to JQuery -

i new in jquery , still learning. problem don't know how convert following javascript code jquery. javacript: document.getelementsbyclassname('p-bg')[0].style.backgroundcolor = '#'+this.color thanks in advance guys. by way full code: <input class="color" onchange="document.getelementsbyclassname('p-bg')[0].style.backgroundcolor = '#'+this.color"> thanks again $(".color") jquery class selector .change .change() form events .eq() .eq() filter elements .css() .css() manipulation $(".color").change(function(){ $(".p-bg").eq(0).css("background-color", $(this).css("color")); }) note document.getelementsbyclassname('p-bg')[0] in jquery equivalent $(".p-bg").eq(0) remember in jquery , dom must loaded start working, eg: $(document).ready(function(){ //you jquery code here... })

ios - The network connection was lost when calling PHP API -

var submitdic = nsmutabledictionary () submitdic.setobject (loginmerged, forkey: "module" ) submitdic.setobject (kedahe-tutorapp, forkey: "wskey" ) submitdic.setobject (112211, forkey: "passwd" ) submitdic.setobject (form04, forkey: "username" ) var request : nsmutableurlrequest = nsmutableurlrequest() request.url = nsurl(string: http://kedah-etutor.com/component/module/ws_function2.php) request.httpmethod = "post" request.httpbody = nsjsonserialization.datawithjsonobject(submitdic, options: nsjsonwritingoptions() , error: nil) println(nsjsonserialization.datawithjsonobject(submitdic, options: nsjsonwritingoptions() , error: nil)?.description) request.setvalue("application/json; charset=utf-8", forhttpheaderfield: "content-type") nsurlconnection.sendasynchronousrequest(request, queue: nsoperationqueue.mainqueue(), completionhandler:{ (response:nsurlresponse!, data

How can I transform a list of Strings into another form in Scala? -

i have list of strings take following form: 000000 011220 011220 033440 033440 000000 i'd transform these strings list of values represents each 2x2 block while preserving row information. irrelevant whether data representing each 2x2 block stored in list or tuple. example, 2x2 block representing upper left corner in 1 of following forms: (0, 0, 0, 1) list((0, 0), (0, 1)) list(0, 0, 0, 1) list(list(0, 0), list(0, 1)) the scala code below performs prescribed transformation, seems overly complex. can break of functionality separate functions, cannot see how code can converted simpler form for-comprehension. note: i've simplified list of values brevity. scala> val data = list("000000", "011220", "033440") data: list[string] = list(000000, 011220, 033440) scala> val values = (data map { _.tolist.sliding(2).tolist } sliding(2) map { _.transpose } map { _ map { _.flatten } }).tolist values: list[list[list[char]]] = list(l

c# - Array with literal strings -

i having string array initialized literal strings below: public static void main() { string[] values = new string[] { "cat", "dog", "mouse", "rat" }; } so have following structure on stack , heap: onstack: variable values holding reference array of string on heap. onheap: array of string referenced values on stack but content of each element of array on heap ? actual string literals ? references pointing string literals in intern pool ? edit: question pointed duplicate this question . case different in terms that another question in context how value type elements of array behave, showed question poser not clear how ref/val type objects allocated on stack/heap. in question clear how ref/val type elements allocated on stack or heap discussing special case when objects string literals. because has deal intern pool , gc. in particular case, considering microsoft .net clr (this important pos

javascript - Progress bar for Leaflet map -

how can show centered on map progress bar (with %) while waiting layer rendered on map? here code: <link rel="stylesheet" href="http://cdn.leafletjs.com/leaflet-0.7/leaflet.css" /> <script type='text/javascript' src="http://makinacorpus.github.io/leaflet.spin/leaflet.spin.js"></script> <script type='text/javascript' src="http://makinacorpus.github.io/leaflet.spin/spin.js/dist/spin.min.js"></script> </head> <body> <a href="#" onclick="showmap('http://{s}.tile.thunderforest.com/landscape/{z}/{x}/{y}.png')">tf.landscape</a>&nbsp;|<a href="#" onclick="showmap('http://{s}.tile.thunderforest.com/outdoors/{z}/{x}/{y}.png')">tf.outdoors</a> <div id="map" style="width: 640px; height: 480px"></div> <progress value="0" max="100"></progress> <

android - Xamarin - Radial Progress Component Issue -

Image
i 've been trying implement radialprogress component ( https://components.xamarin.com/view/radialprogress ) on app. managed on screen, , change progress colour can't find way change inner colour of circle. the radialprogressview object has backgroundtintmode field takes duffporter.mode whenever try set background tint mode app breaks message (message = "no method name='setbackgroundtintmode' signature='(landroid/graphics/porterduff$mode;)) is there way want? thanks! yes, can done. although not in straight-forward way or maintainable way. firstly, let's dig little radialprogressview 's drawing code (as exposed xamarin studio assembly browser): protected override void ondraw(canvas canvas) { // ... there's more stuff here, idea canvas.drawcircle(this.bgcx, this.bgcy, this.radius, this.bgcirclepaint); canvas.drawcircle(this.bgcx, this.bgcy, this.innerlineradius, this.bgborderpaint); canvas

php - Switching on mysqli over mysql -

i have mysql installed , want work on mysqli new database. does affect previous database in mysql if enable mysqli in phpmyadmin? mysqli -> mysql improved extension . the mysqli extension, or known, mysql improved extension, developed take advantage of new features found in mysql systems versions 4.1.3 , newer. mysqli extension included php versions 5 , later. you have change code have done using mysql . no need change database. mysqli methods use mysql database. this may help

go - syntax error: unexpected name, expecting semicolon or newline -

i don't understand why code has syntax error. package main import ( "fmt" "os/exec" "time" ) func ping(curl_out string) endtime int64 { try_curl := exec.command("curl", "localhost:8500/v1/catalog/nodes") try_curl_out := try_curl.output() try_curl_out == curl_out { try_curl := exec.command("curl", "localhost:8500/v1/catalog/nodes") try_curl_out := try_curl.output() } endtime := time.now().unix() return endtime } func main() { run_container := exec.command("docker", "run", "-p", "8400:8400", "-p", "8500:8500", "-p", "8600:53/udp", "-h", "node1", "progrium/consul", "-server", "-bootstrap") container_id, err := run_container.output() if err != nil { fmt.println(err) return } run_curl := exec.co

php - Laravel 5 route using server -

i installed laravel 5 on ftp server. fine, main page enable. have problem routes. link calling route calling controller returning view. my link : <div class="logo"><a href="{{ route('accueil') }}"><img src="images/logo.png" alt=""></a></div> my route : route::get('/', [ 'as' => 'accueil', 'uses' => 'controllertest@accueil']); my controller : class controllertest extends controller { public function accueil() { return view('accueil'); } } but when element, can see : href="http://xx.xxx.xx.xxxc:/test/public/index.php" instead of href="http://xx.xxx.xx.xxx/test/public/index.php" it seems laravel mixing server's ip , localhost. can't find what's wrong. searched online solution, have issue. there .htaccess file in /public folder <ifmodule mod_rewrite.c> <ifmodule mod_negotiati

How to add data into mysql using c# (edit table column on combo box selection ) -

i want add item in table in database in mysql based upon user has selected in items combobox. eg: if person chooses tea (this event should populate tea column in table) , fills quantity 2 want add 2 under column name tea in mysql table . i'm trying use update statement, gives error syntax not correct.the column filled in table changes if user chooses tea or coffee that's why have used "+this.items.text+" "update employee.transaction set department = ' " + this.department.text + " ', ' " + this.items.text + " ' = ' " + this.quantity.text + " ' , billno = ' " + this.bill_no_txt.text + "' billno = ' " + this.bill_no_txt.text + " ' ;"; i might see several points in query cause problems. lets go through it: set department = ' " + this.department.text + " ', please make sure enter right data database. in sql que

What is the purpose of the symlinks within the include and local directories in a python virtualenv? -

what purpose of symlinks automatically created within include , local in virtualenv? when run: virtualenv myvirtualenv it creates following directory structure , symlinks: myvirtualenv/ ├── bin ├── include │   └── python2.7 -> /usr/include/python2.7 ├── lib └── local ├── bin -> ../bin ├── include -> ../include └── lib -> ../lib why important virtual environment track /usr/include/python2.7 or have additional references own directories? ever different set here?

server - how to make a browser application,android application and ios application in a single stretch -

can suggest me how make hybrid app using ionic , backend mongodb , server node running node in server automatically stated ionic front end page , works fine in browser but while running ionic serve --lab not connecting server i implemented browser application using above while making .apk file not able connect server can 1 suggest solution this hi found solution done server using rest api , front end ionic connecting rest api

c - printing sheet to fill the square sheet with the stamps without any overlapping -

i have written following c program online course. seems working , giving relevant output, when submit program, told gives "wrong answer". #include <stdio.h> int main() { long int n; scanf(“%ld”,&n); if(n>1) { if(n%2||n%3) printf(“yes”); else printf(“no”); } else if(n==1) { printf(“no”); } return 0; } this program supposed do: ted (the popular talking bear) has been given job @ printing firm. looking @ previous employment record, firm watching strictly on work product. recently, has been assigned task print on square sheet of dimension nxn. may think of sheet containing n2 cells of dimension 1x1 each. since, ted lazy bear, somehow steals 2 stamps, horizontal printing stamp covers 1*2 block , vertical printing stamp covers 3*1 block. may use these 2 stamps in order , many times wants. sheets old, if sheet stamped twice @ cell, tear off. now, there shipment of s

Does IndexedDb have the equivalent of a transaction.completing event? -

is there way know when requests have finished before transaction commits? transaction.oncomplete event not allow additional logic run while still calling transaction.abort() . so, better way use equivalent of transaction.completing (i made up) fire after requests complete still allow transaction.abort() called. http://www.w3.org/tr/indexeddb/ in general, should considered practice. in common case simple syntax errors not leave database in inconsistent case. is there way know when requests have finished before transaction commits? yes have write code listens operations' success or error events. there no beforecommit event like. feel free make case inclusion on public-webapps . in common case simple syntax errors not leave database in inconsistent case. how can database inconsistent state? that's why error event exists , default causes transaction abort. see http://w3c.github.io/indexeddb/#dfn-fire-an-error-event .

ios - How to create popup using sprite kit on iphone? -

i beginner developing ios game using sprite kit. have 'pop-up' menu's display objects (skspritenodes) such daily rewards or settings/pause menu. settings pop-up example should able accessed on main home screen or during game. have 1 view controller , home scene , play scene 2 different skscenes. reusability (and clean project, learning) have these pop-ups own class, including handling touches. currently, have class settings pop-up returns sknode, , sknode contains several skspritenodes (the buttons/images correspond settings pop including enabling/disabling sound etc). however, have duplicate touches code in both home scene , play scene interact this. (i have, in each skscene's touchesbegan method, "if nodesettings !=nil", check name of skspritenode corresponds touch-location, call method in setting-pop-up class passing name of skspritenode clicked handle interactions pop-up). for own knowledge , solve problem, use class can handle touch logic on own (so

java - Text view displays Arabic characters as question marks "?????" -

Image
i'm working on android app displays textviews mixed arabic , english words; the app displays arabic text wrote inside java classes question marks ????? here screenshot: the code: if(tcat.equals("standardt_")){ serviceline="operations / خدمات عامة"; } tv.settext(serviceline); what have tried: decoding characters in android , no not same question , answers didn't help. how support arabic text in android? i'm using new version supports arabic , tried answer adding farsi class or using arabicutilities classes didn't work ether i tried encode string utf-8 try { serviceline= urlencoder.encode(serviceline, "utf-8");} catch(unsupportedencodingexception e){ e.printstacktrace(); } and didn't work! also tried using multiple fonts not single typeface solved problem. so i'm kind of stuck here, ideas? edit: after closed android studio , reopened

How to set a screen background image in Kivy -

i know how make color background can't seem find useful setting image background , grateful code. here .py file: from kivy.app import app kivy.uix.screenmanager import screenmanager, screen, fadetransition kivy.uix.boxlayout import boxlayout kivy.uix.floatlayout import floatlayout kivy.uix.gridlayout import gridlayout #from kivy.uix.label import label kivy.uix.button import button kivy.core.window import window kivy.core.image import image #from kivy.graphics import borderimage kivy.graphics import color, rectangle #from kivy.uix.image import asyncimage class startscreen(screen): pass class gamescreen(screen): pass class rootscreen(screenmanager): pass class mainapp(app): def build(self): return rootscreen() if __name__ == "__main__": mainapp().run() and .kv file: #:import fadetransition kivy.uix.screenmanager.fadetransition <rootscreen>: transition: fadetransition() startscreen: gamescreen: <startscre

javascript - Input type=date format in HTML -

i use input type=date below datetime screen in html. input date format mm/dd/yyyy wanna change dd/mm/yyyy . how can that? <input type="date" value="' + today + '" class="date" id="datepicker" style="width:30%" min="25-10-1900" max="25-10-2100" /> ps: use code below, doesn't work. (where should call function?) jquery(function ($) { $("#datepicker").mask("99/99/9999", { placeholder: "dd/mm/yyyy" }); });

web services - Systems architecture for small business ISP -

i'm programmer of pretty small isp in rural area around 2000 customers. have finished couple of semesters in university have couple of years of experience in field i'm uncertain of architectural decisions i'm making , hoping me pick right path. most of our internal apps created 8-10 years ago , severely outdated , have been given job replace systems. of basic underlying systems solid apps use manage our customers , connecting our internal systems are...lacking least. most of these applications created in php in day , using mysql databases. decided going create couple of rest apis using nodejs on top of these databases , create central app take care of connecting systems , making sure stay date 1 another. now question. i've been looking bit enterprise architecture , i've gathered going sort of micro service architecture seems solid plan. i've seen couple articles talking message buses , question if should instead set message bus, example apache activemq

design patterns - When to call Workflow in a Custom Java Application -

i have custom java application needs workflow create tasks , each task completed several folks(groups). need able show tasks open user when he/she logs custom java app. when user clicks on task , completes, should propagate next task , assign next group. want separate ui logic work flow logic. we not want use bpm solution come own ui , using workflow piece bpm not add value use bpm tool , expensive. questions: if buy separate workflow engine provides java api 1) should have logic of when call workflow engine ? if custom java app has logic call workflow engine then, defeats purpose of separating workflow logic. 2) custom java app call workflow engine @ every event , workflow reacts events ? thank shiva_r99 your workflow seems linear, should do. public class taskworkflow { iterator<task> tasks; // ... constructor, setters, getters, etc. public taskworkflow completetask() { // ... complete next task return this; } }

NGINX load balancer and deployments -

my website depends on server affinity. setup has 2 nodes (a , b) serving client request. just before deployment want nginx load balancer stop sending new requests node b request have affinity node b should send node b. is possible nginx? like @mikhailov told me in comments, current requests finished, although server removed configuration. here tactics: remove server (which under deployment) configuration reload nginx configuration when deployment has finished: add server configuration again reload nginx configuration

lucene - Search only delivers media items after Sitecore Update -

we updated our sitecore cms version 6.3 6.6 sp2. sitecore version has intranet module installed. working fine, lucene search doesn't seem work properly. there 2 indexes defined. 1 whole content tree , 1 media library. search delivers results media items (images, pdfs), no pages. tool luke i'm able indexes , see items there. not in search results on website anymore. i rebuilt search indexes using sitecore control panel, didn't help. as said, working fine on sitecore 6.3, not on updated 6.6 sp2. any idea problem? thanks in advance :) here blog post troubleshooting sitecore lucene search , indexing . in shortcut: check if items indexed correctly either using luke . check if matchall query return page items: searchmanager.getindex("your_index_name").createsearchcontext() .search(new matchalldocsquery(), int.maxvalue) .fetchresults(0, int.maxvalue).select(r => r.getobject<item>()) check included templates: <include

python - Pygame, screen only updates when exiting pygame window? -

i'm new pygame , needed because code not working properly. okay here's problem: want screen turn white when run remains black, when press exit, turns white second , closes. this happens when put picture (like player.png) appears second before exiting. don't know i'm doing wrong, please fix code , explain why happening? here code: import pygame pygame.init() screen = pygame.display.set_mode((640,480)) image = pygame.image.load('player.png') gameexit = false gameloop = true pygame.display.update() white = (255,255,255) while not gameexit: event in pygame.event.get(): if event.type == pygame.quit: gameexit = true event in pygame.event.get(): screen.fill(white) pygame.display.update() pygame.quit() quit() ps. don't errors python indentation sensitive. in code, call pygame.display.update() once main loop ends. also, paint background white in case there's event in event queue between 2