Posts

Showing posts from February, 2013

xcode - Using custom SKNodes in spritekit scene editor -

Image
i want create level using custom subclasses of sknode. tried adding sknode scene editor , using "custom class" tab give class want did absolutely nothing. node still empty , nothing show when run simulator. also, make sure class works, added instance of scene programmatically see if shows , does. how add custom nodes scene through scene editor? here's custom class code: class player: skspritenode { required init?(coder adecoder: nscoder) { super.init(coder: adecoder) print("test") self.addchild(skspritenode(imagenamed: "player.png")) } } there 2 things need do: 1) when setting custom class have prefix class name app's name; my_app_name.myclass example, _ represents space. 2) sknode subclass needs implement required init?(coder adecoder: nscoder) . for example, in project called 'mygame': class mynode: skspritenode { // set after node has been initaliser init(coder:) v

svn - Eclipse pre-commit hook to execute arbitrary logic -

does eclipse support pre-commit checks executing logic in script or java class? specifically, need logic search source file println , todo , etc., statements before committing svn. if program, know i'm talking about... :-) public void submitorder(order order){ if(order.valid()){ println("hi!") orderprocessor.validatepayment(order) println("hi2") ... }else{ println("logging journal...") //todo remove later journal.log(invalid_order, order) println("after journal") println("really throwing exception now!") throw new invalidorderexception(order) } }

swift - enumerate is unavailable call the enumerate method on the sequence -

this question has answer here: swift 2.0 : 'enumerate' unavailable: call 'enumerate()' method on sequence 3 answers just downloaded xcode 7 beta, , come error on enumerate error: enumerate unavailable call enumerate method on sequence func layoutspecialkeysrow(row: [key], keywidth: cgfloat, gapwidth: cgfloat, leftsideratio: cgfloat, rightsideratio: cgfloat, micbuttonratio: cgfloat, islandscape: bool, frame: cgrect) -> [cgrect] { var frames = [cgrect]() var keysbeforespace = 0 var keysafterspace = 0 var reachedspace = false _k, key) in enumerate(row) { if key.type == key.keytype.space { reachedspace = true } else { if !reachedspace { keysbeforespace += 1 } else { keysafterspace += 1 } } }

c++ - Prevent winHTTP From Writing to STDOUT -

i've taken following code previous post: //variables dword dwsize = 0; dword dwdownloaded = 0; lpstr pszoutbuffer; std::vector <std::string> vfilecontent; bool bresults = false; hinternet hsession = null, hconnect = null, hrequest = null; // use winhttpopen obtain session handle. hsession = winhttpopen( l"winhttp example/1.0", winhttp_access_type_default_proxy, winhttp_no_proxy_name, winhttp_no_proxy_bypass, 0); // specify http server. if (hsession) hconnect = winhttpconnect( hsession, l"stackoverflow.com", internet_default_http_port, 0); // create http request handle. if (hconnect) hrequest = winhttpopenrequest( hconnect, l"get", l"/questions/ask/", null, winhttp_no_referer, null, null);

How to add processing PHP file for AJAX requests in Joomla -

i trying develop form in joomla. basic problem is: how can alter form select options depending on user has chosen before? need make several database requests, while user fills form. ajax, need processing php file. can tell me how in joomla, because jce file browser can't add any. thank you! assuming know how write "normal" joomla component retrieves data database , shows them in page, here's proposed solution. in example dynamically retrieve list of "products" selected "category". component: server part of ajax request let's use json exchange data in ajax call. within every joomla component, can create json view, creating file view.json.php alongside default view.html.php. view used when add "format=json" query string. so create these additional views use same model data, output them json string. json view simple, this: public function display() { $this->products = $this->getmodel()->getproducts

bash - sed -e "\$aDNS3=" won't save the DNS3= to the file -

sed -e "\$adns3=" <filedirectory> i'm trying add in line "dns3=" in end of file, after executing command in bash script, opens file , include dns3= last line did not save changes. there anyway save changes , not show changes made? you can use -i option. edit file in-place. from man sed : -i[suffix], --in-place[=suffix] edit files in place (makes backup if suffix supplied) using sed -e "\$adns3=" -i filename set dns3= last line of file.

javascript - What is this Class comparison doing? -

$('body').find('.grid-container > .parsys .parsys') i found in bit of code , i'm not sure comparing , why there 2 classes following greater symbol. trying find specific hierarchy? , if that's case why second class? in jquery ( or css) selector greater sign > not used comparison. means immediate child of element. also note leading dot means class selector not id. ids use # symbol. .class .selector {} #id .selector {}

node.js - Setting up a Stateless connection with NodeJS and Socket.IO -

after prototyping project using php , unity3d i've decided on building production version using cordova , nodejs. i'm using socket.io nodejs , having confusion connections. way had expected work out following procedure: the client connect server request the server respond request the connection closed however, seems connection likes stay open, , if connection closed, continuously attempts reconnect not looking for. i'm attempting establish single state of data transfer, similar happens when make web-request php file. the source code of project pretty boilerplate code: var application = require('express')(); var http = require('http').server(application); var server = require('socket.io')(http); http.listen(8080, function() { console.log('listening on *:8080'); }); server.on('connection', function(socket) { console.log('server: new connection has been received.'); server.on('disconnect',

node.js - How to Make a Call to Koa.js App Instance for Unit Tests -

i don't know how i'd term maybe 'static call koa router'? seem right wordage here i'm trying accomplish if talk technically? anyway, i'm using koa-router , i'm coding unit tests (not integration tests). not want invoke .listen() on koa app because of reason...it create http server makes test integration tests. instead in test want make straight call app object instance , call route , able return no results , check returned no results in response. how can that? can't find example , i've tried sorts of pseudo code attemps agains koa app object. if want test function koa-router routes perform unit test on function , leave routing out of it. to me sounds you've got file such app.js , contains code. can create router.js file put route bindings , services.js file can put application logic. so example app.js might like: var koa = require("koa"); var app = module.exports = koa(); var router = require('./router.j

forming a recursion function C++ programming -

a student can things bellow: a. homework in 2 days b. write poem in 2 days c. go on trip 2 days d. study exams 1 day e. play pc games 1 day a schedule of n days can completed combination of activities above. example 3 possible schedules 7 days are: homework, poem, homework, play poem, study, play, homework, study trip, trip, trip, study find recursive function t(n) represents number of possible schedules n days. i have 2 questions... firstly had write c++ program this.. #include<iostream> using namespace std; int count(int n) { if (n < 1) return 0; if (n == 2 || n == 1) return 1; return (3*(count(n-2))) + (2*(count(n-1))); } int main() { cout<<count(2); } for input 2 it's giving answer 1.. shouldn't 7? homework ; poem ; trip ; exams,pcgame ; pcgame,exams; pcgame,pcgame; exams,exams secondly, suppose consider pcgame, trip , trip,pcgame same combinations. how formulate recursive solution that? when n = 2 following if co

objective c - xCode archived application isn't starting threads -

my application consists of 2 windows. the first window main window. has nstextview , nsview. the second window preferences page. has nscolorwell change background color of nsview on main window via shared instance of class called maindata. when press build/run button in xcode, app works perfectly. functions should. when archive , export app, works excepts except background color change. when open app, background set should be, when change color colorwell, background doesn't update. the background updates color using thread call [self setneedsdisplay:yes] in method using performselectoronmainthread . i have no idea how troubleshoot because said, works when testing app. any ideas? update: found out reason isn't updating because threads aren't starting. still not sure why. ahhh! that frustrating... i found out while(true){} loops don't work in archived applications. if wants explain me why that, let me know. i hope answer helps peop

Self-updating graphs over time with Python and matplotlib -

i'm not familiar matplotlib in python. want achieve plot data on time using text file receives new data every period. the text file format following: data,time 1,2015-07-05 11:20:00 what have far: import matplotlib.pyplot plt import matplotlib.dates md import dateutil pulldata = open('sampletext.txt', 'r').read() dataarray = pulldata.split('\n') datestrings = [] plt_data = [] eachline in dataarray: if len(eachline)>1: y,x = eachline.split(',') plt_data.append(int(y)) datestrings.append(x) dates = [dateutil.parser.parse(s) s in datestrings] plt.subplots_adjust(bottom=0.2) plt.xticks( rotation=25 ) ax=plt.gca() ax.set_xticks(dates) xfmt = md.dateformatter('%m-%d %h:%m') ax.xaxis.set_major_formatter(xfmt) plt.plot(dates,plt_data, "o-") plt.show() this pretty through different tutorials/previous questions. as may see, code works plotting data on time, don't understand how can a

c# - Why is this code executed but ignored? -

in sharepoint page, on form submission, elements revert original state (if checkbox unchecked begin, checked user, reverts unchecked, etc.). fair enough. but want "save state" , return sorts of things way were. 1 thing in particular visibility of dropdownlist. if visible when "save" button selected, should return being visible after form submitted; 2 dropdownlists, of @ 1 visible @ given time, start off invisible or, more specifically, "slid up" so: $(window).load(function () { $('[id$=ddlpaytoindividual]').hide(); $('[id$=ddlpaytovendor]').hide(); }); in trying save visible state of dropdownlists, i've added bools: bool paymenttoanindividualdropdownchosen = false; bool paymenttoavendordropdownchosen = false; ...and assign them when save button selected: private void btnsave_click(object sender, eventargs e) { try { // note current state of elements, can restored after saving/submitting

sql - MySQL table reorder -

i have table like id - data 1 - ... 2 - ... 4 - ... 5 - ... 8 - ... 12 - ... the table long, thousands ids. @ ids, there "empty" numbers between of them. want reorder ids have no empty ones. table should like 1 - ... 2 - ... 3 - ... 4 - ... etc. how query like? i don't advocate re-numbering ids. id column should primary key table, , gaps don't make difference. if used foreign key references, messing database. but, can as: set @rn = 0; update `table` t set t.id = (@rn := @rn + 1) order t.id;

Scala calling super from a base class that extends a java class -

a scala class inherits jframe class class app extends jframe { public app { //how call super method super("hello world"); } } the correct syntax is: class app extends jframe("hello world") { // code }

jquery - Post the Content of the data variable to valid JSON format -

i trying send json data server ( https://exampleurl.com/example?data= ) setting content of data variable valid json following properties name , email , urls. you cannot send json data in url. need pass json data in request body. if using jquery, use following code: $.post( "test.php", { name: "john", time: "2pm" } );

qt - QMainWindow.saveState() / .restoreState() handle central widget incorrectly -

i'm struggling qmainwindow , qdockwidget s, seems messy area. i need simple thing: when application closed, arrangement of dockwidgets should saved, , when application opened, arrangement should restored. the problem savestate() / restorestate() methods deal strangely central widget. there several variants, , each has own problems: 1. central widget set to, say, qplaintextedit or qlabel when state restored, dockwidgets occupy horizontal space possible, thin central widget in middle of left , right dockwidgets. size , position of central widget kept vertically, horizontal boundaries between dockwidgets , central widget not saved. 2. central widget set null if explicitly call: this->setcentralwidget(null); then statesave() / staterestore() work: state saved , restored correctly, strange reason user unable dock widgets @ top or bottom. widgets can docked in 1 horizontal row, no matter how hard try dock @ top or bottom. 3. no central widget by "no ce

Using recursion to generate a list of X random numbers between 0 and 100, sorted from low to high in Python? -

i'm trying write program uses recursion generate list of x random numbers within range of 0 100, sorts them low high. code have written far: import random def multicaller(x): if x == 0: return "enter valid number" else: return random.randint(0, 100) + multicaller(x) multicaller.sort() return multicaller(x) this crashes, , i'm not sure go here. ideal output this. let's enter multicaller(4) : program ideally generate [3, 35, 45, 82] . if entered, multicaller(5) , [1, 2, 45, 56, 99] , , on. @ appreciated! to recursively achieve have said, need honor base case first i.e need return empty list when asked random number list length zero. if x not 0 need create list single random number , recursively call same function x-1 , concatenate them both, result in list x number of random numbers import random def multicaller(x): if x == 0: return [] else: return [random.randint(0,

php - ZF2 RESTful Controller Events Not Triggering -

should zf2's mvc events trigger same action , rest controllers? i'm writing , acl module attaches event onbootstrap. problem dispatch event not triggered when controller extends abstractrestfulcontroller, when extends abstractactioncontroller. know workarounds? //acl module.php public function onbootstrap(mvcevent $e){ $eventmanager = $e->getapplication()->geteventmanager(); $eventmanager->attach(mvcevent::event_dispatch, array($this, "checkauth"); } public function checkauth(mvcevent e){ //this method gets called when controller extends abstractactioncontroller }

objective c - SKShapeNode.Get Radius? -

is possible skshapenode 's radius value? the problem is, need create identical circle after user releases it, whilst removing first circle view. skshapenode *reticle = [skshapenode shapenodewithcircleofradius:60]; reticle.fillcolor = [uicolor colorwithred:0 green:0 blue:0 alpha:0.3]; reticle.strokecolor = [uicolor clearcolor]; reticle.position = cgpointmake(location.x - 50, location.y + 50); reticle.name = @"reticle"; reticle.userinteractionenabled = yes; [self addchild:reticle]; [reticle runaction:[skaction scaleto:0.7 duration:3] completion:^{ [reticle runaction:[skaction scaleto:0.1 duration:1]]; }]; then -(void)touchesended:(nsset *)touches withevent:(uievent *)event { .... sknode *node = [self childnodewithname:@"reticle"]; //take position of node, draw imprint /////////here need circle radius. [node removefromparent]; } how 1 take circle radius, can say skshapenode *imprint =

isabelle - Can't obtain variable -

i'm trying prove following simple theorem i've come with, that: a point on boundary iff small enough ball around point contains points both in s , out of s. below i've managed forward direction i'm stuck on backwards direction. using same approach fails on last step, goal close not quite there, , i'm not sure here: lemma frontier_ball: "x ∈ frontier s ⟷ (∃r>0. (∀δ>0. δ<r ⟶ ((ball x δ) ∩ s ≠ {} ∧ (ball x δ) ∩ -s ≠ {})))" (is "?lhs = ?rhs") proof { assume "?lhs" hence "x ∉ interior s ∧ x ∉ interior (-s)" (auto simp: frontier_def interior_complement) hence "∀δ>0. ((ball x δ) ∩ s ≠ {} ∧ (ball x δ) ∩ -s ≠ {})" (auto simp: mem_interior) have "?rhs" (simp add: orderings.no_top_class.gt_ex) } { assume "¬?lhs" hence "x ∈ interior s ∨ x ∈ interior (-s)" (auto simp: frontier_def interior_complement) hence "∃δ>0. ball x δ ∩ s

http - Just got a SSL certificate but there is still a insecure localhost image -

i got ssl certificate , went smoothly except there still 1 image loading insecurely on http://. it's localhost url , have no idea coming , how rid of it. url still loading on http, http://localhost/proiecte/git/kleo/wp-content/uploads/ . my website https://thenoteshack.com/ if want check error console. any advice on how can convert https or rid of it? have no clue is. the insecure reference in div id="rev_slider_1_1", value css property background-image:url. <div id="rev_slider_1_1_wrapper" class="rev_slider_wrapper fullscreen-container" style="padding:0px;"> <!-- start revolution slider 4.6.93 fullscreen mode --> <div id="rev_slider_1_1" class="rev_slider fullscreenbanner" style="display:none;background-image:url(http://localhost/proiecte/git/kleo/wp-content/uploads/);background-repeat:no-repeat;background-fit:cover;background-position:center top;"> <ul> <!--

Is it improper to use an ID as a CSS selector? -

this question has answer here: difference between id , class in css , when use [duplicate] 15 answers so use website liveweave.com test html, css, , javascript code i've written. has syntax checker, , whenever use id selector in css section, says improper use id selector. i have demonstrated in this weaver . right of line 3 in css window yellow icon, which, when hovered over, says improper use ids selector. under impression that purpose of being used selector single dom element, opposed classes, designed applied multiple dom elements. am wrong? improper use id selector? the other instance can think of id being used javascript document.getelementbyid() , , similar functions. proper use of id? note not asking difference between id , class, rather whether proper use id selector. using id efficient way of selecting dom node in both css , javascript.

c# - how generate a unique id for 2 objects -

i need generate identical ids 2 objects every loop. need make loop specifcally ids? there wont more 20 objects created @ time worrying collisions isn't big concern. nothing being saved database. i need generate matching uid productsid , id public class data { public int productsid { get; set; } public string sqft { get; set; } public string price { get; set; } } public class products { public int id { get; set; } public string product { get; set; } } public class legendmodel { public string color { get; set; } public string name { get; set; } public ilist<data> data { get; set; } public ilist<products> products { get; set; } } public class exportlegendcontroller : apicontroller { // post: api/exportlegend [httppost] public pdf post([frombody]list<legendmodel> legendmodel) { try { var subjectproperty = legendmodel[legendmodel.count - 1]; var xelelegend = new

PHP populate multi dimensional array using 2 methods and loop, 1 depending on the other -

i'm trying build first multidimensional array - understand ok using hardcoded values, trying fill array values getting me tied in knots. i've got 2 resultsets i'm using build array. i have method $hostnames returns 'hostnames' object $hostnames = $server_model->get_hostnames(); i have method $usernames returns 'users' of 'hostname' specified above. $usernames = $userlogons_model->get_users_by_hostname($hostname->hostname); first, i'm building array: $hostnames = array( $host => $hostname, $users => array( $key => $username ) ); then populating arrays: $hostnames = $server_model->get_hostnames_for_costs(); foreach ($hostnames $hostname) { $usernames = $userlogons_model->get_users_by_hostname($hostname); echo $hostname->hostname; foreach ($usernames $user){ echo $user->user

php - Using .htaccess to do product filtering on existing site -

in custom cms build i'm using following .htaccess file <ifmodule mod_rewrite.c> rewriteengine on rewritebase / rewriterule ^index\.php$ - [l] rewritecond %{request_filename} !-f rewritecond %{request_filename} !-d rewriterule . /index.php [l] </ifmodule> when user hits www.mysite.com script determines page load based on slug of page in database. working fine, want take 1 step further. right can www.mysite.com/products , serve me data products page. want add product filtering url. example: www.mysite.com/products/collection/summer-collection or www.mysite.com/products/mens-navy-blue-blazer-19285 or www.mysite.com/products/category/outer-wear i have product creation module generating unique product slug already, need able modify .htaccess working.

html - CSS Menu bar border -

i'm trying have these small left , right borders either side of text. here i'm trying make: http://imgur.com/xcznggj my problem borders not same height of surrounding div go same height of text. here screen shot: http://imgur.com/i2jjsam i have dried adding height: 30px li , ul not change anything. *{margin:0;} #header { width:100%; } #pre_header { width:100%; height:30px; background-color:#202020; } .pre_header_content { margin:0 auto; width:1040px; } #pre_header ul { list-style-type: none; margin: 0; padding: 0; line-height:30px; } #pre_header li { display: inline; border-right: .5px solid #414141; border-left: .5px solid #414141; } #pre_header { text-decoration:none; color:#fff; padding:6px 15px 6px 15px; } #pre_header a:hover { background-color:#4e4e4e; } <div id="header"> <div id="pre_header"> <div class="pre_header_content">

wordpress fullscreen responsive image map on homepage -

for purposes of visualization here need; within wordpress need homepage fullscreen (or almost) "image map" of united states responsive re-sizes phones tv's i need on homepage , nothing else, no logins, widgets etc. image map(hot spots each state). it sounds simple, hoping has come across theme or mod this. p.s. have image map , can deal responsive part, don’t know how use in wordpress full page. simply create custom page template (suppose template-home.php)and paste code have in file. start making dynamic replacing static html wordpress functions . can make header-home.php , footer-home.php , use: <?php get_header('home'); //rest of stuff here get_footer('home');?> in order make full screen use this technique .

ios - UITextField customization for how text is selected or inserted -

i'm planning work on small customization of uitextfield change ui/ux design features . i know uitextfield has inbuilt methods change border style, color, etc. if wish make lot of customization, can guide me how should begin? do need refer uitextfield parent class modify it? or have make custom ui object right scratch? edit: the customization plan on working how select/de-select or choose insertion point text in uitextfield. it sounds you're going want take advantage of fact uitextfield adopts uitextinput protocol. can subclassing uitextfield. alternatively, might sufficient needs set other class delegate of uitextfield - depends on whether uitextfielddelegate notifies sufficiently fine grain user in text field.

spring - Module classpath in IntelliJ Idea -

i have 2 projects, project depend on b project, these 2 project checkout svn,other people created them eclipse. use intellij idea, in web.xml: <servlet-class>org.springframework.web.servlet.dispatcherservlet</servlet-class> <init-param> <param-name>contextconfiglocation</param-name> <param-value>classpath:config/spring-servlet.xml;classpath:config/spring-mybatis.xml</param-value> </init-param> <load-on-startup>1</load-on-startup> the second classpath:config/spring-mybatis.xml in project b, idea can not find it. if open these 2 project in eclipse,eclipse can find it. how can solve problem? try following code in web.xml file: <init-param> <param-name>contextconfiglocation</param-name> <param-value> config/spring-servlet.xml config/spring-mybatis.xml </param-value> </init-param> you may need change

arrays - Javascript - Deep copy specific properties from one object to another new object -

suppose have source object can arbitrary javascript object, may have properties objects (or arrays or functions), nested level. i want perform deep copy of object new target object. want copy specific white-listed properties. these @ level in source object. up till i've been manually assigning white-listed properties in source object target object. doesn't seem elegant , nor reusable. can please give me guidance on implementing using more elegant , re-usable approach? this should looking for, including circular references. edit: keep in mind slower , slower objects lots of circular references inside! lookup see if reference has been seen simple scan. var util = require('util') var propertiestocopy = { 'a' : true, 'b' : true, 'c' : true, 'd' : true, 'e' : true, 'f' : true, 'p1': true, 'p2': true, 'g' : true }; var obj; obj = { p2 : {

Accessing a us-west-2 S3 bucket using Amazon Cognito and an IAM policy -

Image
amazon cognito available in 2 zones: us-east-1 , eu-west-1 have bucket in us-west-2 here iam policy have unauthenticated guests in cognito identity pool: { "version": "2012-10-17", "statement": [ { "effect": "allow", "action": [ "s3:putobject", "s3:putobjectacl" ], "resource": [ "arn:aws:s3:::vocal.test14/*" ] } ] } during uploading, i'm not able access s3 bucket stated here, should possible: what rule need add policy give cognito ability communicate bucket that's not in us-east ? someone asked more information, here is: i've created new bucket called vocal.west2 i've given bucket following cors properties: <?xml version="1.0" encoding="utf-8"?> <corsconfiguration xmlns="http://s

javascript - Prevent preflight OPTIONS when using sub domains -

given 2 sub domains: web.mysite.com , api.mysite.com currently making request web. api. results in preflight options request being made. wouldn't of issue if didn't add 600ms requests in china. i told setting document.domain = 'mysite.com'; in js resolve issue hasn't helped @ all. is possible / how can disable options request when sending different sub domain. solved using iframe technique seems facebook / twitter do. steps below: 1) set document.domain root domain. given url http://site.mysite.com/ set domain in javascript document.domain = 'mysite.com'; 2) setup iframe pulls html file api domain. <iframe id="receiver" src="http://api.mysite.com/receiver" style="position:absolute;left:-9999px"></iframe> this set positioned can't seen. 3) set html of receiver page set domain: <!doctype html><body><script>document.domain='mysite.net'</scrip

ember.js - Using this.store.query() in a computed property -

Image
i've build custom dropdown element , i'm trying use display couple of things: {{drop-down items=types selectionchanged="typechanged"}} {{drop-down items=meters selectionchanged="meterchanged"}} in controller i'm setting values follows: types: [ { value: "latest", name: "latest widget" }, { value: "max", name: "maximum widget" }, { value: "average", name: "average widget" }, ], meters: ember.computed(function() { var meters = this.store.query('meter', { account_id: 2 }); return meters; }), the values both appearing correctly: <select id="ember826" class="ember-view form-control"> <option value="">please select widget type...</option> <option value="latest">latest widget</option> ... </select> <select id="ember849" class="ember-view form-control"> <opt

javascript - How can I make a webpage move with the movement of an iframe? -

i have website needs contain iframe links external content left navbar. use 1 scroll bar (the 1 eyeframe preferred) control both iframe , left navigation bar. there way in javascript? like this $("#iframeid").scroll(function () { window.scroll($(this).scrollleft(), $(this).scrolltop()); }); only works content same origin though

visual studio - VS2013, C++: Unknown "thread X exited with code 0" -

i developing qt application on vs2013. 1 day turned attention fact qt runtime libs perform strange cpu consumptive actions. firstly, decided occurs in qt debug libs , turned debug configuration use qt release libs. still confused when observing in vs output window, @ middle of debugging application, such prints: the thread 0xxxxx has exited code 0 (0x0) . don't understand thread finished. how can detect thread hidden behind thread id = 0xxxxx once thread has finished? update (clarification) in question meant: 1. possible information thread id appeared in such vs print 2. know qt may execute in such hidden threads? different libraries may create worker threads various purposes. if want investigate further following in vs ide: debug -> break all. stop threads in process debug -> windows -> threads list of threads. by examining call stack of threads may idea of purpose.

javascript - How to collect all data attributes and push to an array -

i have series of table rows data attributes. collect value of these data attributes , add them array. how do this? <tr data-title-id="3706" role="row" class="odd"></tr> <tr data-title-id="3707" role="row" class="odd"></tr> or simplest method create array , fill in 1 step: var dataids = $("table tbody tr").map(function() { return $(this).data('title-id'); });

jsf - How to set yearRange on primefaces calendar without preset date? -

this works fine when display selection birthday set: <p:calendar id="german" value="#{listview.selected.birthday}" locale="de" yearrange="-100:+0" navigator="true" pattern="yyyy-mm-dd"> but when create new entry, works it's set yearrange="c-10:c+10" . i'm wondering yearrange="-100:+0" should not depend on selected date, on actual date. don't want set default date, without selecting date user won't save wrong birthday. how can fix this? (primefaces version: 5.2) ok, stupid of me - had file creation of new entries , forgot update that. guess have reuse more of code.

php - Re-ordering nodes in an xml via jquery ui drag and drop -

i hope can me here... i working on small piece of code allow me re-order nodes in xml file via jquery ui sortable interface. take following xml file: <root> <page1> <content> content 1 </content> </page1> <page2> <content> content 2 </content> </page2> <page3> <content> content 3 </content> </page3> </root> i have been able use php to build drag , drop interface based on number of nodes in xml file. trying achieve way of saving new order of xml files when data passed sortable interface. jquery ui, can ids required , able pass onto php. main issue how manipulate xml file following result: <root> <page1> <content> content 3 </content> </page1> <page2> <content> content 1 </content> </page2> <page3> <content

ios - Inconsistent Unicode Emoji Glyphs/Symbols -

Image
i've been trying make use of unicode symbols astrology in products both apple , ios. i'm getting inconsistent results, shown here: most of these coming out like, reason taurus symbol appearing 1 way on first line, following moon, , different way, emoji-like purple button, when follows mars. these results consistent different symbols , across apple hardware; here's screen capture phone showing same problem other signs - scorpio comes out right, libra , cancer buttons. the strings extremely straightforward; "moon taurus" in first image \u263d moon, \u2649 taurus, assembled [nsstring stringwithformat:@"%@%@", @"\u263d", @"\u2649"] . "mars taurus" image same, \u2642 mars. string formatting identical in different cells of osx table, , in ios attributedstring. any idea makes these symbols appear 1 way sometimes, , way other times? unicode uses variation sequences select between different renderings c

What's the little red arrow in VS Code? -

Image
see here, between line 15 , 16. indicate blank line? if so, why? it called "gutter indicator". it means line has been deleted previous version of file (based on git).

javascript - while loop in Number prototype extension calls function once, then errors undefined -

i'm trying extend js number prototype include ruby-esque ".times" method (the merits of pursuit issue time). here code: number.prototype.times = function(dothis) { val = +this; while (val > 0 ) { dothis(); val--; } } if try 5..times(console.log(1)); i following output: foo typeerror: undefined not function (evaluating 'dothis()') why loop work on first iteration , fail on second? (note: goal make number prototype extension such calling highly expressive, intuitive, , reads more natural language, ruby's .times method.) your number.prototype.times function written take function argument (which you're calling dothis() ). however, when calling times function, you're not passing function parameter, return value of console.log(1) undefined (which you're trying call function, resulting in undefined not function error). instead, pass function that's calling console.log(1) : 5..times(function()

regex - Generating Regular Expression Parsing -

i need convert 4 lines below single regular expression. piece_id="e00401007758725d" pieceid = e00401007758725d piece=e00401007758725d piece e00401007758725d i've tried following: [pp]iece[_]*?[ii]*[dd]* ?[=]* ?"?(?<pieceid>[a-z0-9]{16}"?) but output looks e00401007758725d" i followed regex link checking expression. if don't want capture " , move "? out of capture. [pp]iece[_]*?[ii]*[dd]* ?[=]* ?"?(?<pieceid>[a-z0-9]{16})"? tested that said, ending optional useless. also, have unneeded square brackets, , stars suboptimal. fixed: [pp]iece(?:_?[ii][dd])?\s*(?:=\s*)?"?(?<pieceid>[a-z0-9]{16}) tested

Print over Current Line in Python Shell -

Image
i'm trying make percentage text displays progress amount i'm trying avoid percentages printing out this: progress: 10% progress: 11% progress: 12% progress: 13% how can erase , write on current line? iv'e tried using \r , \b characters neither seems work. every single thing found before has been either python 2 or unix i'm not sure of problem (if 1 of them) because i'm not using either. know how can python 3 running windows 7? unworking code have currently, i've tried plenty of other things. print('progress: {}%'.format(solutions//possiblesolutions),flush=true,end="\r") edit: this not problem if i'm executing program command prompt don't think problem windows. tried updating python using (3.4.1) latest v3.4.3 , issue same. heres screenshot of problem: best can @ taking screenshot of issue. appears if each time move cursor farther left (passed 1 of progress:'s) gray area between text , cursor gets larger edit 2: p

.htaccess - htaccess not redirecting properly with rewrite rules -

i'm trying create simple htaccess file following: redirects http://domain.com http://www.domain.com allows '.php' extension dropped file names allows http://www.domain.com/page/var , http://www.domain.com/page/var/ seen http://www.domain.com/page?u=var rewrites http://www.domain.com/page?u=var http://www.domain.com/page/var this have far, doesn't seem working: indexignore .htaccess directoryindex index.php options -indexes rewriteengine on rewritecond %{request_filename} !-d rewritecond %{request_filename} !-f rewritecond %{http_host} !^www\. rewriterule (.*) http://www.%{http_host}%{request_uri} [r=301,l] rewriterule ^([^/.]+)/?$ $1.php rewriterule page1/(.*)/$ /page1?u=$1 rewriterule page1/(.*)$ /page1?u=$1 rewriterule page2/(.*)/$ /page2?t=$1 rewriterule page2/(.*)$ /page2?t=$1 errordocument 400 http://www.domain.com/error?e=400 errordocument 401 http://www.domain.com/error?e=401

json - How do I convert this curl command to Objective-C? -

i want data backend. should set request header authorization , use generate auth_token previous interaction backend. here curl curl -h 'authorization: token token="replace-with-token"' http://domain.com/books here code nsurl *url = [nsurl urlwithstring:@"http://domain.com/books"]; config = [nsurlsessionconfiguration defaultsessionconfiguration]; [config sethttpadditionalheaders:@{@"token":@"4959a0bc00a15e335fb6"}]; nsurlsession *session = [nsurlsession sessionwithconfiguration:config]; [[session datataskwithurl:url completionhandler:^(nsdata *data, nsurlresponse *response, nserror *error) { nslog(@"%@", [nsjsonserialization jsonobjectwithdata:data options:0 error:nil]); }] resume]; i not sure if implemented curl correctly. data,which received backend, null . 1 know reason? a curl header of 'authorization: token token="replace-with-token"' translate into: [co

java - Saving the values to the database without log in into the application -

i working on java/j2ee based web application have 1 module called leave management in when employee request leave manager approves or reject leave log in application,here log in application creates overhead user , trying implement feature manager can approve or reject his/her mail mail sent manager every time employee request leave based on parameters in url in link without log in application https://my.xyz.com//leave#leavereq#123#1545#state so question is possible achieve without log in application , saving values database , without breaching security. 2.if yes, how can implement this? yes could. pass in other parameters call token contain "random" string in database. each request doesn't require authentication should pass in token . check token in database if there request, if not, know do. if token consumed, either delete db (meaning each token one-time use only). edit : regarding whether correct manager approves/reject, that's difficult

jquery - Can I open and make a popup run javascript on parent/host page? -

Image
i'm developing sort of javascript sdk open popup of page of mine. can call javascript function , open pop page, on server. host , popup on different servers. when user things on page (on popup), need use functions on sdk on host. is possible kind of thing? or forbidden default because it's dangerous or attack or that? i think may possible using easyxdm .

ios - Add new contact view controller set up iphone -

hi trying learn how create simple app benefit set of apples add new contact view. ability add names , press button add more phone numbers. can point me in right direction. use bunch of table views? how have many different sections. sorry if easy thing create. new app development.

shell - How to execute python code from perl program and use output of python code -

i want execute python script perl code. want save python output array , data it. python script search in disk , locate files need. use output , play in next script. i wrote code use strict; use warnings; use getopt::long; $opt_section; $opt_content; $opt_ver; $opt_help = 0; &getoptions ( "help" => \$opt_help, "section:s" => \$opt_section, "content:s" => \$opt_content, "ver:s" => \$opt_ver, ); if ($opt_help) { print "usage: file.pl -section <section> -content <content> -ver <ver> \n "; exit;} ###################python script stats here ################ $py = `/home/priya/library/bin/find.py -filter test~${opt_section}_priya_${opt_ver}` ; print "output $py \n"; code executing python script , displaying output on terminal screen. not storing output $py. can please hep me direct output array or scalar? later want use every line of python output.

Meteor Reactive Session: Not Working (Why?) -

i'm having trouble reactive sessions in meteor.js. demo: meteor pad template.rows.helpers({ 'rows': function () { return session.get('rows'); // data set in session } }); template.count.events({ 'click .mdl-radio__button': function (e) { // target represents number of selected rows (1, 2, 5, or 10) var value = $(e.currenttarget).val(); session.set('limit', value); }, 'click #reset': function () { session.set('limit', 0); session.set('rows', null); }, 'click #run': function () { // should rows when run() pressed session.set('rows', currentitems); } }); users should able select new number of collections receive, controlled limit. however, keep getting following error: error: match error: failed match.oneof or match.optional validation any ideas why? can show me working meteorpad demo? i'm having trouble meteorpad. problem isn't sessi

css - Padding of Text Input in Internet Explorer 11 does not work as expected -

Image
in our web application have input fields, styled css. as can see in screenshot, styling works in firefox (info data taken firebug), works in google chrome. but in ie 11 same field has padding problem. word "test" not centered vertically. so far have tried without success: box-sizing: border-box line-height attribute overflow-visible attribute vertical-align thanks alot in advance edit: i included minimal css reset ( https://perishablepress.com/a-killer-collection-of-global-css-reset-styles/ ), did not change. i included screenshot ie developer tools. can see style definitions take effect on input field. see no conflicting other style definition. edit: i once again tried use "line-height" property. did not work me. problem this: the input field has have 34 pixels (22 input field (line-height) + 5x2 margin + 1x2 border). works in ff , google chrome. if explicitly set line-height 22px, not change in ie. if set line-height other value (26

javascript - Grab data from webpage excel vba with multiple innertext -

i trying grab data webpage , partialy successful. html , javascript knowledge not @ best. can grab data , populate in sheet, want seperate data more if possible. here's code: sub get_data_2() 'source code is: 'http://stackoverflow.com/questions/26613043/get-data-out-of-a-webpage-with-vba dim sht worksheet dim sku string dim rowcount long set sht = sheet8 set ie = createobject("internetexplorer.application") rowcount = 1 'this gives columns titel row numer 1. sht.range("a" & rowcount) = "sku" sht.range("b" & rowcount) = "own titel" sht.range("c" & rowcount) = "emo titel" sht.range("d" & rowcount) = "product info" sht.range("e" & rowcount) = "weight" sht.range("f" & rowcount) = "volum" sht.range("g" & rowcount) = "ean" sht.range("h" & rowcount) = "originalnumber"

mysql - Update and select count at the same time taken too much time -

i have mysql statement: update student_performance_cache spc set badges = (select count(ub.mb_no) user_badges ub ub.mb_no=spc.student_id) i got problems query taken time when data become larger. how can improve mysql statement , make faster?

javascript - Why nth-child to add style to alternate visible element not working? -

i working on adding style alternate visible elements . thought of using nth-child(2n+1) idea, apparently doesn't works!. boil down problem, below sample: html: <div class='hide find'>test</div> <div class='hide find'>test</div> <div class='find'>test</div> <div class='hide find'>test</div> <div class='find'>test</div> <div class='hide find'>test</div> <div class='hide find'>test</div> <div class='find'>test</div> <div class='hide find'>test</div> <div class='find'>test</div> css: .hide{ display:none; } .alternate{ background-color:grey; } jquery: $('.find:visible:nth-child(2n+1)').addclass('alternate'); //this not working! why? i not sure of reason of failure. although, did workaround on problem , created function, works, smooth , b

jboss - EXCEPTION_ACCESS_VIOLATION (0xc0000005) -

my jboss server fail jvm crash sometimes.this second time.the first time @ 2015/06/16,and second time @ 2015/07/02. here error report: # # fatal error has been detected java runtime environment: # # exception_access_violation (0xc0000005) @ pc=0x000000006d976a44, pid=5644, tid=1500 # # jre version: 6.0_26-b03 # java vm: java hotspot(tm) 64-bit server vm (20.1-b02 mixed mode windows-amd64 compressed oops) # problematic frame: # v [jvm.dll+0xe6a44] # # if submit bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp # --------------- t h r e d --------------- current thread (0x0000000002822800): gctaskthread [stack: 0x0000000000000000,0x0000000000000000] [id=1500] siginfo: exceptioncode=0xc0000005, reading address 0x0000000000000018 registers: rax=0x0000000000000002, rbx=0x000000068454e2a8, rcx=0x0000000000000003, rdx=0x0000000000000000 rsp=0x000000000947f4d0, rbp=0x000000210067006e, rsi=0x00000006a8da21a8, rdi=0x0000000029931748 r8 =0x00000000000000