Posts

Showing posts from February, 2012

How to find duplicates values in list Python -

How to find duplicates values in list Python - i wondering how can know if when user inputs value, value exists in list. for example; lis = ['foo', 'boo', 'hoo'] user inputs: 'boo' now question how can tell user value exists within list. use in operator: >>> lis = ['foo', 'boo', 'hoo'] >>> 'boo' in lis true >>> 'zoo' in lis false you can utilize lis.index homecoming index of element. >>> lis.index('boo') 1 if element not found, raise valueerror : >>> lis.index('zoo') traceback (most recent phone call last): file "<stdin>", line 1, in <module> valueerror: 'zoo' not in list update as nick t commented, if don't care order of items, can utilize set : >>> lis = {'foo', 'boo', 'hoo'} # set literal == set(['foo', 'boo', &

jquery - Each Function to Select Current page in Infinite Scroll -

jquery - Each Function to Select Current page in Infinite Scroll - i've set in little bit of jquery site loads , appends next page when near bottom of current page. want observe user on page can modify url history.pushstate(). each page wrapped in 'load-part' class. var load_number; var start_offset; var end_offset; // run function on each page $('.load-part').each(function() { // page number load_number = parseint($(this).attr('id').replace("load-part-","")); // true top offset of page start_offset = $(this).children().first().offset().top; // true bottom offset of page end_offset = $(this).children().last().offset().top + window_height; // if window between limits - i.e. on page if (start_offset <= $(window).scrolltop() < end_offset) { // update url current page number history.pushstate(null, null, load_number) } }); the problem i'm getting if statement

android - magnetic field sensor in Moto 360 not sending updates -

android - magnetic field sensor in Moto 360 not sending updates - i wonder if others have experienced well. when attaching sensor.type_magnetic_field sensor on moto 360 (android wear), i'm not getting updates. the next code works: sensormanager sm = (sensormanager) this.getsystemservice(context.sensor_service); sensor magnetic = sm.getdefaultsensor(sensor.type_magnetic_field); log.i("wear", "magnetic: " + magnetic); with output: i/wear (17471): magnetic: {sensor name="compass sensor", vendor="motorola", version=1, type=2, maxrange=4900.0, resolution=0.15, power=0.45, mindelay=40000} but after registering listener sensor, no events ever fired. other sensors (like accelerometer , gyro) work fine. can seek shaking device bit , see if compass readings show up. can seek move area (with less magnetic interference) .. , maybe figure eights calibrate device. android android-wear moto-360

IDLE restarts when some of rpy2 modules are imported -

IDLE restarts when some of rpy2 modules are imported - i quite novice both python , r, apologize in advance if asking extremely obvious or stupid. i downloaded rpy2-2.4.4.win-amd64-py3.4.exe http://www.lfd.uci.edu/~gohlke/pythonlibs , installed rpy2. when attempted import rpy2.tests idle restarted. same happens bundle content except rinterface , rlike. i don't if it's relevant , beforehand tried installing rpy2 pip , easy_install kept giving me errors ("typeerror: startswitch first arg must bytes, not str" , "typeerror: 'permissionerror' object not subscriptable" respectively). python 3.4 r 3.1.1 thank you >>> import rpy2 import rpy2.interactive ================================ restart ================================ import rpy2.ipython ================================ restart ================================ import rpy2.rinterface import rpy2.rlike

Is there any way to put HTML in the label of this jQuery seating plan plugin? -

Is there any way to put HTML in the label of this jQuery seating plan plugin? - i playing around this jquery seating chart plugin. can set label in set in either map this: map: [ 'aa[,this label entry]aaaaaaaaaa', 'aaaaaaaaaaaa', or "getlabel()" function this: getlabel : function (character, row, column) { homecoming character + " label"; } but wanted see if there ability homecoming html label opposed raw text? (i tried sticking in html table in either approach above , neither seems work. looking @ comments in plugin see this: * allowed characters in labels are: 0-9, a-z, a-z, _, ' ' (space) but seems obvious basic thing want set html label doing shoving div. in re-create of jquery-seat-charts 1.1.0 (either total or minified version), find .text(fn.settings.label) replace .html(fn.settings.label) html returned function naming.getlabel honoured. jquery html

Cannot print out integer in MIPS Assembly program -

Cannot print out integer in MIPS Assembly program - i using qtspim mips simulator , having hard time figuring out how print out integer user input. far, code is: .data prompt: .asciiz "please come in integer: " .text main: li $v0, 4 la $a0, prompt syscall li $v0, 5 move $s0, $v0 syscall li $v0, 5 move $s1, $v0 syscall li $v0, 5 move $s2, $v0 syscall jal order3 li $v0, 1 move $a0, $s0 syscall li $v0, 10 syscall swap: move $t0, $a0 move $a0, $a1 move $a1, $t0 jr $ra swap1: move $t0, $a1 move $a1, $a2 move $a2, $t0 jr $ra order3: bgt $a0, $a1, swap bgt $a1, $a2, swap1 bgt $a0, $a1, swap jr $ra every time seek print out first integer, prints out 5, shouldn't. not know why happening. if point out flaw in code great. thanks. you're trying utilize result of syscall before syscall has been performed: li $v0, 5 move $s0, $v0 syscall that should be: li $v0, 5 syscall move $s0, $v0 same other 2 read_int syscalls. then there

Java Servlet usage -

Java Servlet usage - i have many java stand lone applications running on multiple clients computer systems @ “any given time”. these java stand lone applications shall interface resin 3.x server install app on hdd or upload study info server-side db... also, @ “any given time”, end user may interface resin 3.x server via web page designed purchase application or web page dynamically view application report... my objective maintain these client-server interface simple possible. far, in design, have not used jsp or jpa or java beans... i have specified set of “servlet commands” [17] designed accomplish above client - server interfaces. simple ‘get’ , ‘put’ commands / 3 server-side db’s... i have designed 3 “session” servlets [db_servlet, application_servlet, html_servlet] , allocated 17 “servlet commands” accordingly... the “session” servlets shall utilize ‘servlet.init’ method found exclusive session. exclusive session shall destroyed 1 time app or html objective

asp.net mvc 4 - dynamically change style for html helper in mvc4 -

asp.net mvc 4 - dynamically change style for html helper in mvc4 - how can alter style of html helper dynamically because in doing language alter font sizes diferent each , every language , how can alter styles dynamically @html.labelfor(u => u.username) @html.textboxfor(u => u.username) @html.validationmessagefor(u => u.username) @html.labelfor(u => u.username) @html.textboxfor(u => u.password) @html.validationmessagefor(u => u.password) thanks in advance i think looking this: @html.labelfor(u => u.username, new {@class = "my-class"}); ... <style> .some-language {font: 1em;} .another-language {font: 2em;} </style> <script> ("#somebutton").click(function(){ $(".my-class").addclass("some-language"); }) ... </script> asp.net-mvc-4

python - Aptana Studio 3 (build 3.6.0.201407100658) how to change font colors (pydev) -

python - Aptana Studio 3 (build 3.6.0.201407100658) how to change font colors (pydev) - i new programming , started using aptana studio 3 python development. updated application , syntax coloring dark normal variables can't see typing. how alter this? before updating latest build didn't have problem. unfortunately don't know build running before updating... :( python aptana

Spring Boot Maven Plugin not creating executable jar -

Spring Boot Maven Plugin not creating executable jar - my pom below. executable jar not beingness create when run "mvn clean package". however, when remove dependencymanagement element , add together spring boot parent pom, works. what missing? <?xml version="1.0" encoding="utf-8"?> http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 <groupid>com.example</groupid> <artifactid>sample-boot</artifactid> <version>0.0.1-snapshot</version> <dependencymanagement> <dependencies> <dependency> <!-- import dependency management spring boot --> <groupid>org.springframework.boot</groupid> <artifactid>spring-boot-dependencies</artifactid> <version>1.2.0.m2</version> <type>pom</type> <scope>import</scope> </dependency>

windows - TeamCity is taking forever to start -

windows - TeamCity is taking forever to start - teamcity has been hanging for long time (over 3 hours), there anyway restart team city wonder if there file locked somewhere. go services (start -> run -> services.msc) , restart teamcity service. had happen me yesterday , had stop teamcity process task manager before start service. windows teamcity

extjs - Trying to get class/id value on tabbed Panel tab section -

extjs - Trying to get class/id value on tabbed Panel tab section - for test automation purposes, need class/id value on tab bit (whatever phone call it..) in tabbed pane. i have tried next aaa,bbb,ccc , ddd, , none of these appear in class in dom level. var panel1 = ext.create('ext.panel.panel'); panel1.cls = 'aaa' panel1.itemcls = 'bbbb' var panel2 = ext.create('ext.panel.panel'); ext.create('ext.tab.panel', { cls:'ccc', itemcls:'ddd', renderto: document.body, items: [panel1,panel2] } ); i know somehow possible. have idea?? http://jsfiddle.net/gqulg/9/ ok figured out. need set tabconfig object on panel or container goes within tabbed panel. var panel1 = ext.create('ext.panel.panel'); panel1.tabconfig = { cls: 'mytab' }; the tabconfig object holds cls (class values) populate tabs on top. extjs extjs4.2

matlab - Azimuth and Elevation from one moving object to another, relative to first object's orientation -

matlab - Azimuth and Elevation from one moving object to another, relative to first object's orientation - i have 2 moving objects position , orientation info (euler angles, quaternions) relative eci coordinate frame. calculate az/el i'm guessing "body frame" of first object. have attempted convert both objects body frame through rotation matrices (x-y-z , z-y-x rotation sequence) , calculate target vector az/el way have not had success. i've tried body frame positions , calculate body axis/angles , convert eulers (relative body frame). i'm never sure how coordinate scheme axes i'm supposedly creating aligned along object. i have found couple other questions answered quaternion solutions may best path take, quaternion background weak @ best , fail see how computations given result in target vector. any advice much appreciated , i'm happy share progress/experiences going forward. get current neh transform matrix moving object

BigQuery: Why does Table Range Decorators return wrong result sometimes? -

BigQuery: Why does Table Range Decorators return wrong result sometimes? - i've been using table range decorators feature daily since may in order query info lastly 7 days in of tables. since 2 weeks, i've noticed info missing when utilize feature. example, if query results lastly 7 days (by adding "@-604800000--1" table), info missing opposed if query on whole table (without table decorator). i wonder explain , if there prepare coming address this? if can help bigquery team, i've noticed when using table decorators info missing oct 16th between around 16:00 , 20:00 utc time. for bigquery team here 2 jobs ids info missing: job_-xtl4pliyhnjq5wemnssvqdmd6u , job_9asnxqq_swjcd1emmiq6smppxlq and 1 job id info correct(without decorators): job_qbcrwygbqv0bzdhreqevrlyh-mm this known issue table decorators containing time range. due bug in bigquery, possible time ranges omit info should included within time range. we're work

Android receipt/zigzag drawable/layout -

Android receipt/zigzag drawable/layout - i'm in need of creating receipt layout in android. thought simple, rectangle layout zigzag bottom edge. the best result drawable/layout fixed zigzag size (meaning, fixed half-triangle size), multiply amount of triangles according shape's actual width, in real time. clip maybe, have clipped triangles if necessary. here illustration (edit: i'm referring bottom zigzag line) : i have no solid thought of how create it. thought of 9 patch, seems unfitting. thought of list-layer drawable horizontal offsets maybe.. maybe possible create 9 patch separate scale sections, maintain zigzag's aspect ratio... ok. edit - answer using @luksprog 's comment, recreated wanted. here code: image (note height corresponds source image size): <imageview android:id="@+id/zigzag_bottom" android:layout_width="match_parent" android:layout_height="12dp" a

android - How to make content fill all the screen? -

android - How to make content fill all the screen? - how create content fill screen regardless of screen size? images below. want left image, not right: if utilize relativelayout can alter container linearlayout , set layout_weight children: <linearlayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical"> <textview android:layout_width="wrap_content" android:layout_height="0dp" android:layout_weight="1" android:text="text 1"/> <textview android:layout_width="wrap_content" android:layout_height="0dp" android:layout_weight="1" android:text="text 2"/> </linearlayout> an

regex - Create Password Verification Function Oracle 10g -

regex - Create Password Verification Function Oracle 10g - how possible create function in oracle check password? the password should contain: at to the lowest degree 1 upper case at to the lowest degree 1 lower case at to the lowest degree 1 digit at to the lowest degree 8 characters long doesn't contain 3 consecutive letters of user name so far, reached following: create or replace function dd_pwd_fun(username varchar2, password varchar2) homecoming boolean pwd_str varchar2 user_name begin pwd_str = password; user_name=username; if length(pwd_str) < 8 homecoming false; end if; if regexp_like(:pwd_str, '^.*[a-z].*$') -- little letter -z , regexp_like(:pwd_str, '^.*[a-z].*$') -- capital letters , regexp_like(:pwd_str, '^.*[0-9].*$') -- numbers this first time working regular expressions , need help finding out solution lastly requirement , want know if i'm on right track oracle provides function compiled unde

neural network - Algorithm for cross selling -like amazon people who bought this -

neural network - Algorithm for cross selling -like amazon people who bought this - new , long time since i've done programming or forums .... however, getting under skin. i've been looking around @ algorithms used amazon etc on recommendations create around products have affinity ones people have selected - works well. here wondering.... a - why limited affinity? there never situation product exclusive of original selection , perhaps parallel not product might create sense? b - why neural network not create sense? not work provide link or end few product have low weighting , hence perpetuates non selection? thanks views. james question a: not need limit affinity. however, need "package up" other pertinent info in way can nowadays algorithm. should read on "association rules", "frequent itemsets" & recommender algorithms. of these algorithms analyze transaction info , larn rules {peanuts, hot dogs} = {beer}.

android - Correctly handling fragment interactions from an Async-Task -

android - Correctly handling fragment interactions from an Async-Task - i trying refactor fragment-heavy code safer async tasks had noticed occasional crashes. improve educated after searches i've noticed main problem accessing activity or fragment variables within async task itself. i separating each async task single classes, implement interface callbacks fragment or activity called them. example: public class loginfragment extends fragment implements requestforgotpassword { ... //on forgot password click new asyncforgotpassword(loginfragment.this, memail).execute(); ... @override public void onforgotpasswordresult(result result) { if(isadded()) { if (result == result.success) toast.maketext(getactivity(), "an email has been sent business relationship assist in recovering password", toast.length_long).show(); else toast.maketext(getactivity(), "we don't have record of registered email, sorry! please

sql - Insert into Java DB Compound Key with Prepared Statement Gives Error -

sql - Insert into Java DB Compound Key with Prepared Statement Gives Error - i have 2 tables in java db, alumnus , certificate many-to-many relationship between them. introduced 3rd table , alumnus_has_certificate maintain one-to-many relationship between 2 tables , new 3rd table. 3rd has compound key made of primary keys of original tables. problem unable insert info 1 duplicate key 3rd table using prepared statement. note : 3rd table has compound key. below sql code tables. create table alumnus ( alumnus_id int not null primary key generated identity (start 1 , increment 1), alumnus_no int unique, first_name varchar (45) , last_name varchar (45) , other_name varchar (100), residential_address varchar (300), mailing_address varchar (300), email varchar (120) , telephone varchar (25), employeed boolean not null default false, job_title varchar (200), employer_name varchar(120), employer_address varchar (300) ); create table certificate ( cert

python - setup.icloud.com two-step verification -

python - setup.icloud.com two-step verification - i'm playing around iloot, open source app let's download icloud backups , wondering how possible implement 2 factor authentication it. i have 2fa enabled on business relationship , on first request this: first request: auth = "basic %s" % base64.b64encode("%s:%s" % (login, password)) authenticateresponse = plist_request("setup.icloud.com", "post", "/setup/authenticate/$apple_id$", "", {"authorization": auth}) plist_request normal python (request) function request url , returns parsed xml. first response (in xml format): <?xml version="1.0" encoding="utf-8" standalone="yes"?> <!doctype plist public "-//apple//dtd plist 1.0//en" "http://www.apple.com/dtds/propertylist-1.0.dtd"> <plist version="1.0"> <dict> <key>protocolversion</key>

ios - QuickType (Predictive Keyboard) not working with Subclass UITextInputBase and UIKeyInput -

ios - QuickType (Predictive Keyboard) not working with Subclass UITextInputBase and UIKeyInput - in application have made subclass uitextinputbase , methods have written same in screen shot. here issue in textfield if take word quicktype without write letter manually, method - (void)replacerange:(uitextrange *)range withtext:(nsstring *)text is calling , can text there whatever user has selected quicktype. problem but suppose if have type 't', quick type give me suggestion "the" word. if take "the" word quicktype. above method not calling , m not getting text user has selected quick type. can 1 please suggest if m missing or can in other method of these subclass? want these text without delegate methods of uitextfield. thanks. ios objective-c ios8 uikeyboard quicktypebar

How to send email in regional language use codeigniter -

How to send email in regional language use codeigniter - i want send email in our regional language utilize codeigntier. i'm using next script sending email $this->load->library('email'); $this->email->set_newline("\r\n"); /* reason needed */ $this->email->from('no-reply@domainname.com', 'test'); $this->email->to($email); $this->email->subject('registration completed successfully'); $this->email->message('welcome message'); if($this->email->send()) { echo 'success'; } else { echo 'sorry, mail service not send'; } thanks lot in advance. to utilize different languages in codeigniter, can these 2 things : 1) create language changer in website 2) store user preference in session, , @ e-mail creation, load corresponding language file $this->lang->load('my_email_file&

java - else without if when trying to create register system -

java - else without if when trying to create register system - when trying run next code, produces else without if error. public void registerstudent(int register) { { if (register >= 100) system.out.println("the maximum number of students allowed on course of study 100."); } else { register = register + 1; system.out.println("you have been registered on course."); } } you have { @ origin of method, , forgot { after if condition. change { if (register >= 100) system.out.println("the maximum number of students allowed on course of study 100."); } to if (register >= 100) { system.out.println("the maximum number of students allowed on course of study 100."); } your current if status enclosed in own block, , separated else clause. java if-statement

javascript - How to build week data in calendar for my case? -

javascript - How to build week data in calendar for my case? - i trying build calendar modal app using angular. have model this i have no problem building year month not sure how setup week has other day. example, first week of oct has 28,29,30 in first week. //code build day var month = 9; // hardcoded demo. var montha = []; (var m = 0; m <= 3; m ++) { var weeks = []; totalday = new date(year, month + m + 1, 0).getdate() //build days (var = 0; <= totalday; i++) { //setting weeks if (i % 7 == 0) { weeks.push([]); } weeks[weeks.length-1].push(i); } var monthobj = { month : (month + m), weeks:weeks } montha.push(monthobj); } the above code produce montha: [ { month: '10', weeks: [ [1,2,3,4,5,6,7], [8,9,10,11,12,13,1

canvas - How to get path of Bezier curves with coordinates of decimal value -

canvas - How to get path of Bezier curves with coordinates of decimal value - i need path of vector shape transformed bezier curves. have 512x512 px canvas 350x350 px letter "r" in middle. need export somehow coordinates of points of bezier curves. so have canvas coordinates 0,0 511,511 , shape in it. but, when save *.svg in path illustration (m 256.124 373.811 l-85.544 -46.3289 c -21.8516,33.0922 -34.017,54.9238). i understand svg coordinate scheme differs carthesian system. real numbers close wanted decimal numbers why there negative numbers? but need coordinates of pixels in decimal format , range 0,0 511,511. illustration (m 256 377 c 23 532 123 43 123 352) is there way path that? i decoded path in .svg coreldraw. firstly, corel , graphic editors have carthesian coordinate scheme (point [0,0] in bottom-left corner). on other hand, svg has different scheme start point in top-left corner. this, when have canvas size 512x512 px , place mouse on it,

github pages - How can I create a directory for each category under _posts in Jekyll? -

github pages - How can I create a directory for each category under _posts in Jekyll? - i trying have such construction in jekyll site: _posts php 2014-10-31-this-is-a-test.md ruby 2014-12-01-some-other-test.md i posts in php directory in php category, , posts in ruby in ruby category. here _config.yml file: defaults: - scope: path: "" type: "posts" values: layout: post comments: true share: true - scope: path: "_posts/php" type: "posts" values: category: php - scope: path: "_posts/ruby" type: "posts" values: category: ruby however, doesn't work. ideas? path: "php" or path: "ruby" sets category. note: any category set in front end matter replace 1 in default config. jekyll github-pages

optimizing django code model -

optimizing django code model - i want optimizing code. think best solution utilize method pre_save , not override save method. function delete old image when in editing upload new image def delete_old_image(sender, instance): try: obj = sender.objects.get(id=instance.id) except sender.doesnotexist: pass else: if not obj.image == instance.image: try: os.remove(obj.image.path) except: pass under code of model class service(models.model): title= models.charfield(max_length=170) slug = models.slugfield(max_length=200, blank=true, unique=true, editable=false) def save(self, *args, **kwargs): self.slug = slugify(self.title) super(service, self).save(*args, **kwargs) class portfoglio(models.model): title= models.charfield(max_length=170, unique=true) slug = models.slugfield(max_length=200, blank=true, unique=true, editable=fa

javascript - How does one parse an object with points (.) included in the keys to an multi leveled object? -

javascript - How does one parse an object with points (.) included in the keys to an multi leveled object? - this question has reply here: convert javascript string in dot notation object reference 14 answers how 1 parse object points (.) included in keys multi leveled object? example: { "data.firstname": "john", "data.lastname": "doe", "data.email": "example@example.org" } expected result: { data: { firstname: "john", lastname: "doe", email: "example@example.org" } } ps: can find collections in mongodb's find query, couldn't find how it, hence question. you like: var info = { "data.firstname": "john", "data.lastname": "doe", "data.email": &quo

meteorite - How can I fix "tunneling socket could not be established" error for all my meteor commands -

meteorite - How can I fix "tunneling socket could not be established" error for all my meteor commands - up until few days in meteor long errors popping , making me nervous. unable understand whats happening. i looked terminal history , found next command suspicious since there mentions of cordova in errors: meteor configure-android meteor install-sdk android here sample of when run meteor create testapp meteor create testapp /home/rohan/.meteor/packages/meteor-tool/.1.0.35.klvi4f++os.linux.x86_64+web.browser+web.cordova/meteor-tool-os.linux.x86_64/dev_bundle/lib/node_modules/fibers/future.js:206 throw(ex); ^ error: tunneling socket not established, cause=140547247318912:error:140770fc:ssl routines:ssl23_get_server_hello:unknown protocol:../deps/openssl/openssl/ssl/s23_clnt.c:787: @ object.future.wait (/home/rohan/.meteor/packages/meteor-tool/.1.0.35.klvi4f++os.linux.x86_64+we

java - HQL- Select new constructor with boolean parameters -

java - HQL- Select new constructor with boolean parameters - i'm trying phone call testresultdto constructor boolean parameter maintain geting error testresultdto : public class testresultdto extends abstractdto { private boolean test; private boolean locked; public testresultdto() { super(); } public testresultdto(boolean locked, boolean test) { super(); this.test = test; this.locked = locked; } the query: select new com.xxx.model.dto.widgets.results.testresultdto(p.islocked, if((p.playerstatus = 'standard'), false, true)) player p p.id = 1 the error: java.lang.nullpointerexception @ org.hibernate.internal.util.reflecthelper.getconstructor(reflecthelper.java:355) is there way pass boolean parameter hard coded ('true')?? the query may :- select new com.xxx.model.dto.widgets.results.testresultdto(p.islocked, case when p.playerstatus = 'standard' false else true end) play

java - Caching Data with OKHttp -

java - Caching Data with OKHttp - i'm trying cache info okhttp's native cache; problem don't have command on server side data, , response header cache-control coming "no-cache" value. is there anyway intercept request add together in header cache info that's coming using okhttp? (i'd cache specific requests if possible). thank you! best regards, christopher steven okhttp doesn't offer mechanism defeat cache-control: no-cache . okhttp end validating response server, if server says stored response still response body won't need retransmitted. we've got feature request outstanding wants this, though it's hard because may mean single request yields multiple responses. java caching okhttp

openstreetmap - mod_tile rendere is not working with apache on openSUSE -

openstreetmap - mod_tile rendere is not working with apache on openSUSE - i want run tile server i configured next link when seek access http://myserver.domain/osm_tiles/0/0/0.png i'm getting response object not found! when see apache log says socket file missing tile_state: determined state of default 0 0 0 on store 7f05ba987d70: tile size: -1, expired: 1 created: 0 [thu nov 06 16:15:59.396965 2014] [tile:debug] [pid 6334] ./src/mod_tile.c(166): [client 192.168.1.180:52068] connecting renderd on unix socket /var/run/renderd/renderd.sock [thu nov 06 16:15:59.397003 2014] [tile:warn] [pid 6334] [client 192.168.1.180:52068] socket connect failed for: /var/run/renderd/renderd.sock reason: no such file or directory [thu nov 06 16:15:59.397007 2014] [tile:notice] [pid 6334] [client 192.168.1.180:52068] failed connect renderer [thu nov 06 16:15:59.397010 2014] [tile:debug] [pid 6334] ./src/mod_tile.c(960): [client 192.168.1.180:52068] tile_storage_hook: missing tile not

javascript - Splitting JSON data into two separate arrays -

javascript - Splitting JSON data into two separate arrays - i'm trying take json url , process of info 2 separate arrays. first array on info begins "output_no_match", , sec array identically formatted , begins "avalanche_with_match". i'm stuck on how info 2 separate arrays process (and set graph). thanks help! [{"date":"2014-12-01t00:00:00-06:00" "id":null "balance":915047.12 "interest":710669475.15 "interest_paid":10199.29 "ending_principal_balance":915047.12 "ending_interest_balance":710659275.86 "payment_due":10199.29} suppose have file located @ http://your-host.com/sampledata.json containing json info : {"output_no_match": [{ "date": "2014-12-01t00:00:00-06:00", "id": null, "balance": 915047.12, "interest": 710669475.15, "interest_paid": 10199.29

android - Service connecting to Firebase a bad idea? -

android - Service connecting to Firebase a bad idea? - i building android app requires real time updates. server firebase. firebase meant receive updated info when user connected server. impressed firebase far, concern receiving new info when app not active. not want seek these ideas find out bad idea, short on time. looking suggestions , advice. a service (example). worried battery consumption , going on connection limit if users connected. an alarmmanager run sync every x hours. worried not getting updates enough. using gcm force notification send tickle. worried paying service. any other suggestions or possible issues missed? time! edit i found this thread. still unsure. maybe service not bad idea, per james tamplin (suspect firebase dev) you want utilize gcm in these situations. firebase works fine background service, leaves socket open, it's going utilize quite bit of power. powerfulness usage fine when user actively engaged app (the screen uses

javascript - What's the difference between dir/* , dir/**, dir/**/* , dir/**/*.* in globbing? -

javascript - What's the difference between dir/* , dir/**, dir/**/* , dir/**/*.* in globbing? - imagine next directory structure: web/ sub1/ 1.js 3.js when utilize 'del' node module delete file or directory, behavior of dir/* , dir/**, dir/**/*, dir/**/*.* different. web/* del([' web/* ', '!web/sub1/1.js']) -> under web/ removed, web/sub1/1.js removed well del([' web/* ', '!web/3.js']}) -> under web/ removed except 3.js keeped web/** del([' web/** ', '!web/sub1/1.js']), del([' web/** ', '!web/3.js']) -> result of 2 forms same, web/ removed web/**/* del([' web/**/* ', '!web/sub1/1.js']) -> under web/ removed del([' web/**/* ', '!web/3.js']}) -> under web/ removed except 3.js keeped web/**/*.* del([' web/**/*.* ', '!web/sub1/1.js']) -> files under web/ removed except web/sub/1.js , directory co

c# - Remote Require HTTPS MVC 5 -

c# - Remote Require HTTPS MVC 5 - i have next attribute create sure remote site page opens in https mode. public class remoterequirehttpsattribute : requirehttpsattribute { public override void onauthorization(authorizationcontext filtercontext) { if (filtercontext == null) { throw new argumentexception("filter context"); } if (filtercontext != null && filtercontext.httpcontext != null) { if (filtercontext.httpcontext.request.islocal) { return; } else { string val = configurationmanager.appsettings["requiressl"].trim(); bool requiressl = bool.parse(val); if (!requiressl) { return; } } } base.o

c - What kind of parameter should I be passing to my merge function in Bottom Up Merge Sort? -

c - What kind of parameter should I be passing to my merge function in Bottom Up Merge Sort? - i have c code question , bit confused how set parameters in it. q) using c code finish mergesort function shown below, function must implemented iteratively. can assume existence of merge function next header , phone call it(you not have write merge function). so far given this: void merge(int arr[], int start, int mid, int end); void mergesort(int arr[], int len) { // write code here } here progress did research , found out iterative way of doing merge sort called bottom merge sort.: void mergesort(int arr[], int len) { int windows; (windows = 1; windows < len; windows = 2* windows) { int i; (i = 0; < len; i+ 2*windows) { // not sure pass remaining parameters. merge(arr, i, ??, ??)); } } } what have envisioned combine adjacent elements each time 1, 2, 4, 8, 16 ect ect(according yo

sql - PostgreSQL select all from one table and join count from table relation -

sql - PostgreSQL select all from one table and join count from table relation - i have 2 tables, post_categories , posts . i'm trying select * post_categories; , homecoming temporary column count each time post category used on post. posts | id | name | post_category_id | | 1 | test | 1 | | 2 | nest | 1 | | 3 | vest | 2 | | 4 | zest | 3 | post categories | id | name | | 1 | cat_1 | | 2 | cat_2 | | 3 | cat_3 | basically, i'm trying without subqueries , joins instead. this, in real psql . select * post_categories some-type-of-join posts, count(*) resulting in this, ideally. | id | name | count | | 1 | cat_1 | 2 | | 2 | cat_2 | 1 | | 3 | cat_3 | 1 | your help appreciated :d you can utilize derived table contains counts per post_category_id , left bring together post_categories table select p.*, coalesce(t1.p_count,0) post_categories p left bring togethe

c# - Check if a winform application lost focus to a different application -

c# - Check if a winform application lost focus to a different application - i have application many kid forms, , when switch different application, of forms still remain on top (i using form.topmost property). i looking solution, , found partial answers here: how observe when application loses focus? c# form activated , deactivate events but both didn't work me. form.deactivate event fired when main form loses focus kid form. want check if application lost focus different application, can hide kid forms. thanks edit: switched form.topmost show(owner), @hans passant. c# winforms show-hide

SAPUI5: SAP NetWeaver User Interface Services -

SAPUI5: SAP NetWeaver User Interface Services - good morning, i'm using eclipe , tomcat develop , test sapui5 mobile application speaks sap odata service. after development fase application installed on sap server. i'm trying utilize user interface services (sap.ui2) access user information. my problem seems api not prepared called/used application not deploy on sap server. calls see beingness made relative calls , because of resources not found. heres total sample: <!doctype html> <html> <head> <meta http-equiv="x-ua-compatible" content="ie=edge"> <meta http-equiv='content-type' content='text/html;charset=utf-8'/> <script src="<my-sap-server>/sap/public/bc/ui2/services/sap/ui2/srvc/error.js"></script> <script src="<my-sap-server>/sap/public/bc/ui2/services/sap/ui2/srvc/utils.js"></script> <

linux - What is the purpose of NetworkManager service in RHEL 6? -

linux - What is the purpose of NetworkManager service in RHEL 6? - could please explain exact purpose of networkmanager service in rhel 6? please explain happens if service stopped or started. networkmanager service replacement of network service. provides more advantage uses network service, e.g. monitoring of network interfaces, automatic network detection , configuration, editing network scripts many (also graphical) tools , more. if stop service, network configuration done networkmanager won't work , have configure netowrk in way, e.g. network service. if start networkmanager again, previous configuration work fine again. linux

javascript - Why does appear in this stack trace? -

javascript - Why does <anonymous> appear in this stack trace? - why <anonymous> appear in stack trace? every object , function in script has name, anonymous it? the script: function weallhavenames(cb) { cb(); } weallhavenames(function ihaveaname(){ var x = y.a; }); the stack trace: weallhavenames(function ihaveaname(){ var x = y.a; }); ^ referenceerror: y not defined @ ihaveaname (/users/trindaz/code/scratchpad/funcs.js:5:47) @ weallhavenames (/users/trindaz/code/scratchpad/funcs.js:2:3) @ object.<anonymous> (/users/trindaz/code/scratchpad/funcs.js:5:1) @ module._compile (module.js:456:26) @ object.module._extensions..js (module.js:474:10) @ module.load (module.js:356:32) @ function.module._load (module.js:312:12) @ function.module.runmain (module.js:497:10) @ startup (node.js:119:16) @ node.js:906:3 javascript

java - How to link feature and step definition in cucumber -

java - How to link feature and step definition in cucumber - i'm new cucumber java , had problem in initial stages: i'm not using maven project reason. created simple java project in eclipse. i have features under "src/dummy/pkg/features", , implementation "stepdef.java" under "src/dummy/pkg/features/implementation" i have written step definitions given, when, , then, when run features file, unable recognize implementation. how link features step definitions? create class yourclass , below , run junit test. @runwith(cucumber.class) @cucumberoptions( monochrome = true, features = "src/dummy/pkg/features/", format = { "pretty","html: cucumber-html-reports", "json: cucumber-html-reports/cucumber.json" }, glue = "your_step_definition_location_package" ) public class yourclass {

javascript - Responsive image lightbox -

javascript - Responsive image lightbox - i trying create responsive photogalery. i've solved responsive thumbnails (they load right image according screen size , devicepixelratio). want responsive lightbox them. hope there must suitable library... the main problem how load right image size. example, on 480*320 mobile phone, pointless load 2mpx images. however, on 17" screen, want. i hope simple, haven't found suitable lightbox library. well, lightboxing html solution, seems supported. magnifier popup supports it, seems aimed different purposes , can't create working photogallery. javascript css responsive-design lightbox

java - Determining whether string complies with ANTLR4 grammar -

java - Determining whether string complies with ANTLR4 grammar - how can test string against grammar see whether it's valid (i.e. no errors found, , no error recovery necessary)? i've tried this a custom error strategy i'm still getting messages like line 1:2 token recognition error at: 'x' on console. need either way ensure errors result in exceptions, or way validate input doesn't rely on exceptions. edit: seeing lexer error, not parser error. need update lexer ensure lexer incapable of failing match input character adding next lastly rule of lexer. pass erroneous character on parser handling (reporting, recovery, etc.). err_char : . ; in add-on this, need perform general steps below apply configuring parser simple string recognition. you need 2 things work properly: first, disable default error reporting mechanism(s). parser.removeerrorlisteners(); second, disable default error recovery mechanism(s). parser.seterr

javascript - how do you execute a function on the returned value of another function? -

javascript - how do you execute a function on the returned value of another function? - in next code professional javascript web developers, author says should array of length 10 value of 10 in each position. however, getting array of functions--not values. why that? function createfunctions(){ var result = new array(); (var = 0; < 10; i++){ result[i] = function(){ homecoming i; }; } homecoming result; // } console.log(createfunctions()); and here console readout: [function (){return i;}, function (){return i;}, function (){return i;}, function (){return i;}, function (){return i;}, function (){return i;}, function (){return i;}, function (){return i;}, function (){return i;}, function (){return i;}] edit: tried prepare next code, still getting same console readout: function createfunctions(){ var result = new array(); (var i=0; < 10; i++){ result[i] = function(num){ homecoming function(){ homecoming num; }; }

php - mysqli prepared statements buffered data vs unbuffered data Performance? -

php - mysqli prepared statements buffered data vs unbuffered data Performance? - how much % performance increased or decreased on using buffered info vs unbuffered data in mysql using mysqli prepared statements., 1. buffered data. e.g. $query = "select name, countrycode city order id desc limit 150,5"; if ($stmt = mysqli_prepare($link, $query)) { /* execute statement */ mysqli_stmt_execute($stmt); /* bind result variables */ mysqli_stmt_bind_result($stmt, $row['name'], $row['countrycode']); /* store result */ mysqli_stmt_store_result($stmt); /* fetch values */ while (mysqli_stmt_fetch($stmt)) { echo $row['name'].'-'. $row['countrycode']; } /* free result */ mysqli_stmt_free_result($stmt); /* close statement */ mysqli_stmt_close($stmt); } /* close connection */ mysqli_close($link); 2.