Posts

Showing posts from 2015

ios - Not getting any movement from sprite in Sprite Kit -

ios - Not getting any movement from sprite in Sprite Kit - i trying move sprite node downwards every time touch in area. code have , log showing touches register. doing wrong , there easier way accomplish this? -(void)update:(cftimeinterval)currenttime { cgpoint currentlocation = [currenttouch locationinview:currenttouch.view]; if (currentlocation.y > 500) { cgfloat newy = _bg.position.y - 25; _bg.position = cgpointmake(_bg.position.x, newy); nslog(@"touchtouch"); } try this: -(void)touchesbegan:(nsset *)touches withevent:(uievent *)event { (uitouch *touch in touches) { cgpoint currentlocation = [touch locationinnode:self]; if (currentlocation.y > 500) { cgfloat newy = _bg.position.y - 25; _bg.position = cgpointmake(_bg.position.x, newy); nslog(@"touchtouch"); } } } you can utilize skaction have motion animated: skaction *movedown = [skaction movetoy:newy duration:1]; [_bg runac

model view controller - MVC Rails Planning -

model view controller - MVC Rails Planning - i'm starting rails , i'm building app stores films info, user can watch film , give grade on web application. i have coded cinema model, controller , views. now, have 2 questions: should need create model , controller grading? in case, should create or should wait , create first users model , controller? yes, on model , controller grades. that'd feasible way maintain track of who's graded what. it's create first, i'd start users, since grades depend on both films , users. ruby-on-rails model-view-controller

c++ - How to decouple SDL_Texture from SDL_Renderer? -

c++ - How to decouple SDL_Texture from SDL_Renderer? - i have sprite class uses sdl_texture on sdl_surface in lieu of perfomance. class looks this: class sprite { public: ... private: sdl_texture *m_texture; sdl_rect m_blitrect; int m_x; int m_y; }; now problem when creating sdl_texture need sdl_renderer object sdl_surface create it. this: sdl_texture *texture = sdl_createtexturefromsurface(renderer, surface); the sdl surface can created , disposed of while creating texture however, problem is, want able have rendering object isn't global. want decoupled framework , don't know how accomplish in instance. first thought create renderer class , have constructor argument cannot happen complicate things downwards road , cannot option. there other ways decouple two? if want decouple texture renderer , surface parameter, think best best delay phone call sdl_createtexturefromsurface until these argum

php - Wordpress Define Variable Plugin -

php - Wordpress Define Variable Plugin - i'm attempting create plugin site in wordpress both practice , execution. in plugin variety of files. want define plugin directory constant use: define('custom_editing__url', plugin_dir_url(__file__)); when include: //folders define('widgets', custom_editing__url . 'widgets/'); require_once(widgets . 'widgets.php'); i'm able file widgets.php , when phone call within of file: echo custom_editing__url; i custom_editing__url. want http://www.example.com/widgets/widget.php can explain i'm missing? edit: more info problem @ hand. right have figured out widgets.php not accepting defined variables. example... calling file able create widget using format of: class foo_widget extends wp_widget { // content } but widgets.php file cannot resolve find wp_widget. so answer. don't have actual documentation explain it. copied of elements akismet plugin work way ne

java - After Generating webdriver code ,how and where to modify code -

java - After Generating webdriver code ,how and where to modify code - i newbie selenium test cases, uncertainty roam between generated web driver code(java ;j-unit) , how run code changes in code , found errors in project before may know want made alter in code ,what generated already. for eaxmple : i recorded login form page, generated java/junit 4/webdriver code verify link button selenium ide , import bundle eclipse... i add together features or changes in login form , purpously forget maintain link button using selenium test generated before java/junit 4/webdriver code , want print o/p as"link button not found" bundle web; //import java.util.regex.pattern; import java.util.concurrent.timeunit; import org.junit.*; import static org.junit.assert.*; //import static org.hamcrest.corematchers.*; import org.openqa.selenium.*; import org.openqa.selenium.firefox.firefoxdriver; //import org.openqa.selenium.support.ui.select; public class webdriver {

objective c - AFHTTPRequestOperationManager with HTTP and HTTPS base url -

objective c - AFHTTPRequestOperationManager with HTTP and HTTPS base url - i wondering best alternative (architecture) situation have same api on http , https. there way back upwards http , https requests in same afhttprequestoperationmanager or should have 2 subclasses, 1 http requests , sec https requests? i sense changing baseurl dynamically not best solution you can hold 2 afhttpclient* objects. 1 http , other secure https. here illustration based on requester class. -- requester.h --- #import "foundation/foundation.h" #import "afnetworking.h" typedef enum { multiparttypeimagejpeg, multiparttypeimagepng, multiparttypevideoquicktime } multiparttype; typedef enum { httpmethodget, httpmethodpost, httpmethodput, httpmethoddelete } httpmethod; typedef void (^requestcallback)(nserror *error, nsinteger statuscode, id json); @interface requester : nsobject /** * singleton */ + (instancetype)sharedinstance;

java - How to improve Jaxb unmarshaller performance -

java - How to improve Jaxb unmarshaller performance - i want marshal , unmarshal below: want unmarshal xml <keyname>value</keyname> hashmap class a{ private string name; private list<b> list; } class b{ private map <string, string> map; } xml: <a> <name>name</name> <blist> <b> <key>value</key> <key>value</key> </b> </blist> </a> i want unmarshal xml class a. using @xmlanyelement . when unmarshal @ big size xml blist.size=100000 , performance not ideal. should improve performance? this xml snippet according description: <doc> <data> <somekey>somevalue</somekey> <otherkey>othervalue</otherkey> </data> </doc> this class data's type: import java.util.arraylist; import java.util.list; import javax.xml.bind.annotation.xmlaccesstype; import ja

lotusscript - No "Script Area" in Lotus Notes Agent editor -

lotusscript - No "Script Area" in Lotus Notes Agent editor - i need functionality described here: determining folder contains document in lotus notes without using lotusscript folderreferences property it says: "and next code in script area". there's no script area. there's tree containing "document selection", "(options)", "declarations", "initialize", , , "terminate". you can come in code body of initialize method. create sure maintain code automatically appears when select initialize , come in code in middle sub initialize dim session new notessession dim db notesdatabase dim doc notesdocument dim doc2 notesdocument dim view notesview dim noteid1 string dim noteid2 string dim item notesitem dim collection notesdocumentcollection set db=session.currentdatabase set collection=db.unprocesseddocuments set doc=collection.getfirstdocument

java - How to set the JAVA_HOME in Mavericks 10.9? -

java - How to set the JAVA_HOME in Mavericks 10.9? - i checked java installed on system.if come in whereis java shows me the /usr/bin/java i want set java_home , gave path /library/java/javavirtualmachines/jdk1.7.0_09.jdk/contents/home won't work. if come in $java_home returns nothing. if come in command /usr/libexec/java_home -v 1.7 shows me result /library/java/javavirtualmachines/jdk1.7.0_09.jdk/contents/home but while setting local workspace won't work says `/library/java/javavirtualmachines/jdk1.7.0_09.jdk/contents/home` not valid `java_home` how can resolve issue? environment variables such stored in bash , users utilize configuration files set parameters bash environments. for illustration in home directory have 1 or both of .bashrc or .bash_profile file. 1) open file vi ~/.bash_profile 2) add together next line file #default java 1.6 export java_home=`/usr/libexec/java_home -v 1.6` this set $java_home variable

.net - Syntax for Entity Framework .Include() -

.net - Syntax for Entity Framework .Include() - i going crazy trying handle on linq include. my main file "application" has guid key of "id" can't figure out syntax without error. public static guid? applicationidget(string papplicationname) { homecoming brunoentities.set<appapplication>().include("id").firstordefault(p => p.loweredname == papplicationname.tolower()).id; //return brunoentities.appapplications.include(a => a.id).firstordefault(p => p.loweredname == papplicationname.tolower()).id; //return brunoentities.appapplications.include("id").firstordefault(p => p.loweredname == papplicationname.tolower()).id; } include want ef load in related entities. don't need normal properties of entity requesting. if want have ef fetch columns database, select function allow command that .net linq entity-framework

python - How can I close the active window but still run the rest of the execution statements in the function? -

python - How can I close the active window but still run the rest of the execution statements in the function? - i have function needs work between 2 different windows. starts off working in 1 active window. want work window until call self.close(true) this close active window, far understand it, terminates more execution statements have within function. execution statements after close phone call (and still in same function) ones want applied newly active window. how can accomplish this? there other close can call? the usual way go have main wxpython programme (i.e. main window). when phone call long running process, can hide main window calling frame's hide() method. when long running process finishes, can re-show main window or instantiate secondary frame , show while keeping main window hidden. secondary frame can show output long running process. another approach hide main frame during long running process , when process finishes, update main frame ,

Scala compilation into machine code -

Scala compilation into machine code - how compile scala machine code ? is llvm (http://en.wikipedia.org/wiki/llvm) plausible ? update: such compilation create code run faster in target machine ? https://greedy.github.io/scala-llvm/ geoff reedy working on it. hth scala compilation llvm

duplication - Removing duplicate rows from a SQL query -

duplication - Removing duplicate rows from a SQL query - i have problem writing sql query. have 2 tables: question , candidat_test_answer, formatted follows. question: (id_question) (id_catgorie) | 1 |1 | 2 |1 | 4 |1 candidat_test_answer: id_question || id_answer || id_test || id_candidat || date | 1 || 2 || 17 || 1 ||2014-06-01 | 1 || 3 || 17 || 1 ||2014-06-01 | 2 || 1 || 17 || 1 ||2014-06-01 | 2 || 2 || 17 || 1 ||2014-06-01 | 1 || 2 || 17 || 2 ||2014-06-01 i want display records without duplication in results. id_question || id_test || id_candidat || date | 1 || 17 || 1 ||2014-06-01 | 2 || 17 || 1 ||2014-06-01 here have tried far: select * question q , candidat_test_reponse ctr q.id_qt=ctr.id_qt , ctr.i

mysql - Weird PHP "Fatal error: Cannot redeclare" Error -

mysql - Weird PHP "Fatal error: Cannot redeclare" Error - my script returning next error... fatal error: cannot redeclare connecttodatabase() (previously declared in /var/www/api/connecttodatabase.php:4) in /var/www/api/connecttodatabase.php on line 6 and next connecttodatabase.php file... <?php function connecttodatabase() { $con = @mysqli_connect("localhost", "name", "password", "database"); homecoming $con; } ?> i don't understand error because line 6 closed curly bracket (}) i think error means thinks declared function connecttodatabase() in different spots didn't. as others have said in comments, because have included connecttodatabase.php twice in code, , defining function twice. don't hung why it's line 6; line 2 more helpful, line 6 function definition ends, , arguably is when function defined. have "one day" whole year calendar on idiosyn

javascript - Foreman, from the Heroku Toolbelt, exits with Error: write EINVAL every time -

javascript - Foreman, from the Heroku Toolbelt, exits with Error: write EINVAL every time - following heroku's getting started tutorial has been much more frustrating expected be. have right config problem, , can solved in less 10 clicks, don't know clicks , it's driving me wall. foreman won't start. have no experience ruby, or heroku, or foreman, , barely experience web programming, have absolutely no thought what's happening here. here's error message get, running windows 7 64 bit: c:\users\___________\hello_world_basics>foreman start 09:40:17 web.1 | started pid 2408 09:40:18 web.1 | listening on 5000 09:40:18 web.1 | 09:40:18 web.1 | error: write einval 09:40:18 web.1 | @ errnoexception (net.js:904:11) 09:40:18 web.1 | @ socket._write (net.js:645:26) 09:40:18 web.1 | @ dowrite (_stream_writable.js:226:10) 09:40:18 web.1 | @ writeorbuffer (_stream_writable.js:216:5) 09:40:18 web.1 | @ socket.writable.write (_stream_w

php - Deploying to Elastic Beanstalk - can't find directories -

php - Deploying to Elastic Beanstalk - can't find directories - i pushing deploys new beanstalk app , trying run commands .config file: // .ebextensions/composer.config commands: 01wtf: command: cd /var/app && ls 02wtf: command: cd /var/app/current && ls 01wtf returns . .. /current /support 02wtf returns . .. i trying run commands on /var/app/ondeck (like blog posts , answers say) i can't find on disk! doing wrong? the problem .config file specifying commands: . i should have been using container_commands (docs: http://docs.aws.amazon.com/elasticbeanstalk/latest/dg/customize-containers-ec2.html#customize-containers-format-container_commands) my commands running before deployment phase; so, ondeck has

javascript - Printing a page: Content only on 2nd Page? -

javascript - Printing a page: Content only on 2nd Page? - i need print web content (html/css). 1 of things need print stuff (page number, title of doc) on every page first. is there way create div (or other element) appear on pages >=2? i not have manual page-breaks jquery may used the css @page directive :first apply css first page of html print i give illustration #header , #footer might hep you @media print { @page { /* styles every page other first page */ #header { position: fixed; display: block; top: 0; } #footer { position: fixed; display: block; bottom: 0; } } @page :first { /* override styles first page */ #header { display: none; } #footer { display: none; } } } javascript jquery html css printing

c++ - How to manage escape sequences? -

c++ - How to manage escape sequences? - i'm trying write protocol much simple possible create 2 processes talk through socket. i'd separate command commands raw data. how can this? mean, if sockets carry bytes stream, how can protocol, example, distinguish escape sequence "esc stx" numbers sequence 2734? i've searched bit, not plenty suppose, since i've not yet found how solve problem. thanks in advance. establish message protocol. for example: +---------+-----------+----------+ | command | payload | checksum | | 2 bytes | 252 bytes | 2 bytes | +---------+-----------+----------+ the payload can contain pattern because payload fixed size. for variable length message, message length should added: +---------+----------------+-----------+----------+ | command | message length | payload | checksum | | 2 bytes | 2 bytes | ? bytes | 2 bytes | +---------+----------------+-----------+----------+ the len

java - A loop that works before but not after -

java - A loop that works before but not after - i have problem strange. have same code 3 buttons works first , not others. how possible? there can explain me? much. can click buttons (b , c) ones , not twice. what's going on? in first case (button a) works show 1 card , not two. @suppresslint("recycle") public class gameactivity extends activity { protected view buttona; protected view buttonb; protected view buttonc; protected view buttond; final int randomint1 = 0; final int randomint2 = 0; int = 0; int b = 0; int c = 0; int d = 0; int e = 0; @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_game); findviewbyid(r.id.a); resources res = getresources(); string[] stringdeck = getresources().getstringarray(r.array.stringdeck); int[] deckdraw = getresources().getintarray(r.array.deckdraw); final hashmap<string

c++ - Convert Warning to Error -

c++ - Convert Warning to Error - in windows, vc++ has nifty alternative /we convert specific warning error. every warning emitted vc++ has warning number illustration warning c4265: 'cfoo' : class has virtual functions, destructor not virtual so easy identify number , add together compiler alternative using /we switch /we4265 i checked g++ documentation , found similar (i believe), -werror=, documentation mentions make specified warning error. but question is, given compiler warning /yada/yada/src/inc/module.h:580: warning: 'struct ifoo' has virtual functions non-virtual destructor how convert error using -werror compiler option? that sentence in manual continues, answer: the specifier warning appended; illustration -werror=switch turns warnings controlled -wswitch errors. switch takes negative form, used negate -werror specific warnings; illustration -wno-error=switch makes -wswitch warnings not errors, when -werror

sql - Missing comma error in insert statement -

sql - Missing comma error in insert statement - insert service (customer_id,service_id,cost number) values ('cust001',100,'80'); when seek insert service details in sql showing missing comma error. please help me verify , correct. the problem in cost number column. spaces not supported. insert service (customer_id,service_id,cost number) values ('cust001',100,'80'); ^^^^^^^^^^^ some fixes include: removing number making column cost . placing brackets or ticks around column depending on platform: sql server [cost number] . mysql `cost number` . if using ms access or perhaps oracle, might trying cast number in case want cast value, not column. sql oracle insert

linux - passing a function as parameter to a remote server via ssh command -

linux - passing a function as parameter to a remote server via ssh command - i wondering if possible pass whole function parameter remote server long list of action on remote server , homecoming command flow local server. in shell/bash script. for example: something below: test_abc() { # function perform long list of commands performed on remote server command 1; command 2; . .. command n; few echo commands; } ssh user@remote_server test_abc; i not sure possible in shell scripting. please allow me know. obviously, remote scheme have no way of understanding in local environment. "test_abc" have command known on "remote_server". ssh user@remote_server "$(cat <<- _eof_ ((command-list)) _eof_ )" that, or quote body of "test_abc", may require fiddling quoting correct. linux bash shell unix ssh

java runtime error NoClassDefFoundError -

java runtime error NoClassDefFoundError - guy. have question java runtime linking erorr: seek compile jasperreport illustration code in centos. my set up: /opt/jasperreports-5.6.0 /opt/apache-ant-1.9.4 /opt/commons-logging-1.1.3/commons-logging-1.1.3.jar and errors: ~/test/1 localhost $ create run javac -cp "/opt/jasperreports-5.6.0/dist/jasperreports-5.6.0.jar:." jasperreportcompile.java java -cp "/opt/commons-logging-1.1.3/commons-logging-1.1.3.jar:"/opt/jasperreports-5.6.0/dist /jasperreports-5.6.0.jar:."" jasperreportcompile compiling study design ... exception in thread "main" java.lang.noclassdeffounderror: org/apache/commons/logging/logfactory @ net.sf.jasperreports.engine.util.jrloader.<clinit>(jrloader.java:81) @ net.sf.jasperreports.engine.jrpropertiesutil.loadproperties(jrpropertiesutil.java:99) @ net.sf.jasperreports.engine.defaultjasperreportscontext.initproperties(defaultjasperreportscontext

java - Spring + JAXB - Unmarshal XML with the same element root -

java - Spring + JAXB - Unmarshal XML with the same element root - i using resttemplate phone call 2 different rest apis homecoming next xml: <response><user>...</user></response> <response><client>...</client></response> in application have 2 classes: @xmlrootelement(name = "response") class userresponse {...} @xmlrootelement(name = "response") class clientresponse {...} i don't have command on apis, can't modify response xml. how can work 2 different responses , same root element? thanks. you instead have 1 response class contain user , client class, elements contained in response root element instead. that: @xmlrootelement(name = "response") @xmlaccessortype(xmlaccesstype.field) class response { @xmlelement(required = false) private user user; @xmlelement(required = false) private client client; } class user { } class client { } java xml s

Downloading an android app directly from .apk file -

Downloading an android app directly from .apk file - i wondering can create .apk file download without putting on play store? looking couple of friends test app created dont want release on play store yet? have tried find different ways pretty much of them saying have set on play store , can straight download app url. thankyou help. definitely yes. can done. send on apk file. when click it, inquire necessary permissions , upon user clicking accept, app installed. but, "install unknown sources" options should enabled in mobile security settings. android apk

sql - Table driven nested function calls -

sql - Table driven nested function calls - i'm looking way apply arbitrary number of nested replace calls on column. ideally pattern , replace values come configuration table, e.g.: ╔═════════╦═════════╗ ║ pattern ║ replace ║ ╠═════════╬═════════╣ ║ -jan- ║ /01/ ║ ║ -feb- ║ /02/ ║ ║ -mar- ║ /03/ ║ ║ -apr- ║ /04/ ║ ║ -may- ║ /05/ ║ ║ etc. ║ ║ ╚═════════╩═════════╝ the question same this one, reply given works when assigning result of 1 input value @ time - i'd homecoming entire resultset. i thinking recursive cte might work.. sample data ╔═══════════════╦══════════════╗ ║ input ║ output ║ ╠═══════════════╬══════════════╣ ║ datadata-jan- ║ datadata/01/ ║ ║ -apr--may- ║ /04//05/ ║ ║ -mar-testing ║ /03/testing ║ ╚═══════════════╩══════════════╝ take solution in link mentioned, , set in function: create table replacement(replacethis varchar(10), withthis varchar(10)) insert replacement va

android - Unable to change the package name in eclipse -

android - Unable to change the package name in eclipse - i trying update bundle name of application unfortunately got error.any reason why occurred ?.i renamed using android tool->rename application package try that: close layout files in editor , restart eclipse. [http://stackoverflow.com/questions/10301171/theme-preview-fails-in-eclipse][1] android eclipse

Redirect to url Using Google chrome Extension -

Redirect to url Using Google chrome Extension - i newly google chrome extention , have on button in extention , button want redirect site "www.example.com" have next code , redirection.i scared why not work me solve this question manifest.json { "name": "popup ", "manifest_version": 2, "version": "0.1", "description": "run process on page activated click in extension popup", "browser_action": { "default_icon": "icon.png", "default_popup": "popup.html" }, "permissions": [ "tabs", "http://*/*", "https://*/*" ] } popup.html <html> <head> <script src="popup.js"></script> <style type="text/css" media="screen"> body { min-width:250px; text-align: center; }

ajax - Angularjs $http "XML Parsing Error: no element found Location" error when expecting JSON results on GET -

ajax - Angularjs $http "XML Parsing Error: no element found Location" error when expecting JSON results on GET - when submit angularjs $http phone call receive xml parsing error. the $http phone call code snippet is: $http({ method: 'get', url: "myapp/api/items" + itemid }); the error is: xml parsing error: no element found location: moz-nullprincipal:{f191853f-5581-b049-b83f-5f4b69211adb} line number 1, column 1: the info beingness returned json. if set url in browser request submitted , response info comes in browser. i tried adding responsetype: 'json' (and responsetype: 'application/json' ) $http phone call no success. (i referenced usage section in angularjs http doc determine how configure call.) is there way can forcefulness response info recognize json avoid error? if using mozilla firefox, install firebug , seek inspect http in net panel or in console panel. in headers tab can

image - django vanilla views create instance with imagefield using CreateView -

image - django vanilla views create instance with imagefield using CreateView - i using django vanilla views (https://github.com/tomchristie/django-vanilla-views) edit model object (the model createview), model has imagefield. but on create not seem save image, maybe because not standard usage. the few things: for model imagefield using upload_to function save image specific dir the create done info not filled in user, using dispatch related object url before saving, in form_valid function, utilize form.save(commit=false) things before saving , afterwards save object the code: the function used upload_to def get_image_path_albumphoto(instance, filename): homecoming os.path.join('albums', slugify(str(instance.album)), filename) the model (at to the lowest degree important fields): class albumphoto(models.model): .... fields ... album = models.foreignkey(album, blank=false, null=false) image = models.imagefield(upload_to=get_image_pat

regex - How to ignore a specific sub-string from Splunk query -

regex - How to ignore a specific sub-string from Splunk query - need help generate appropriate spunk query. searching not come solution. currently, want ignore error alerts generated logs ev31=error; term. if utilize not ev31=error; in search query, removes results valid error terms. current query fail in case log contains both error , ev31=error; terms resulting in wrong results. can suggest illustration query, can ignore ev31=error; term altogether maintain logs error term. try including string want ignore in quotes, search might index=myindex not "ev31=error" regex splunk

xml - Auto post in 2 domains -

xml - Auto post in 2 domains - i need help how proceed project, have 2 domains www.english.com , www.spanish.com, both blogging websites i'm trying here is, when publish post in domain www.english.com, want post published on domain www.spanish.com automatically. what i'm thinking of doing here is: on publishing post on www.english.com, create xml it's meta values in xml, , run cron job publishing posts on www.spanish.com domain. is right way, can please tell me improve way or plugin this. thanks in advance this plugin might useful case. push-syndication for utilize case example, check this site. xml wordpress plugins cron feeds

python - How to save Multi-layered dictionary to csv -

python - How to save Multi-layered dictionary to csv - i have 3 layed dictionary need save in csv format. followed code in post. 2 rows info dumped in 1 row. how can separate info , write them separate cells. {'alpha': {'2010': {'216': 0.0, '217': 0.0, '218': 195.37308756510416}}} there other keys ( beta , omega ) @ same level alpha . i'd final product like: alpha,2010,216,0.0 alpha,2010,217,0.0 alpha,2010,218,195.37308756510416 ..... beta, ..... and preferably save in .csv file, text file too. this code have tried. with open('mycsvfile.csv', 'wb') f: w = csv.dictwriter(f, datadictionary.keys()) w.writeheader() w.writerow(datadictionary) thanks first, suggestion: if you're going post info you're processing, omit little representative sample - ain't nobody got time ready through numbers scrolling off border of screen. here's smaller sample of input:

ios - display value in UIlabel from CLLocation manager -

ios - display value in UIlabel from CLLocation manager - i have next code, going form backbone of gps app. i trying location (lat & long) , speed, , display value in label. here code: - (void)viewdidload { [super viewdidload]; // additional setup after loading view, typically nib. locationmanager = [[cllocationmanager alloc]init]; locationmanager.delegate=self; [locationmanager startupdatinglocation]; } - (void)didreceivememorywarning { [super didreceivememorywarning]; // dispose of resources can recreated. } - (void)locationmanager:(cllocationmanager *)manager didupdatetolocation:(cllocation *)newlocation fromlocation:(cllocation *)oldlocation { nslog(@"didupdatetolocation: %@", newlocation); cllocation *currentlocation = newlocation; if (currentlocation != nil) { longditute = [nsstring stringwithformat:@"%.8f", currentlocation.coordinate.longitude]; latitude = [nsstring stringwithf

html5 - Strange angular data binding in contenteditable element -

html5 - Strange angular data binding in contenteditable element - with markup: <body ng-app="app" ng-controller="ctrl"> <h1>type below in editable div</h1> <h3>use ng-bind:</3> <div class="editable" contenteditable=true obj="obj1" ng-bind="obj1.content"></div> <h3>content:</h3> <div>{{obj1.content}}</div> <h3>use interpolation</h3> <div class="editable" contenteditable=true obj="obj2">{{obj2.content}}</div> <h3>content:</h3> <div>{{obj2.content}}</div> </body> and little bit js: var app = angular.module('app', []); app.controller('ctrl', function($scope) { $scope.obj1 = { content: '' }; $scope.obj2 = { content: '' }; }); app.directive('contenteditable', function() { homecoming { scope: { obj: '

c++ - Stop QDrag manually -

c++ - Stop QDrag manually - i need stop qdrag when dragenterevent occurs. want release qdrag without releasing mouse button. i have tried send events qdrag no luck. qmouseevent* evt = new qmouseevent(qevent::mousebuttonrelease,event->pos() ,qt::leftbutton, qt::leftbutton, qt::nomodifier); qcoreapplication::sendevent(drag,evt); how accomplish this? update: release mouse when qdragevent occurs. qmouseevent* finishmoveevent = new qmouseevent (qevent::mousebuttonrelease, event->pos (), qt::leftbutton, qt::leftbutton, qt::nomodifier); qtabbar::mousereleaseevent(finishmoveevent); qapp->sendevent(parentwidget(),finishmoveevent); qapp->sendevent(drag,finishmoveevent); qapp->postevent(drag,finishmoveevent,qt::higheventpriority); i tried each of line in possible combinations. please help. how release qdrag during qdragenterevent. the drag not receive mouse events, widgets do. drag filters/intercepts events. need send relevant event target widget

c# - How do I find all XML elements whose value is in a list of values using LINQ -

c# - How do I find all XML elements whose value is in a list of values using LINQ - i need able find xml elements values can found in list of values grouping of xml elements. in other words homecoming of elements grouping value matches of elements grouping b. need accomplish using linq xml. here's code. returns null. how prepare it? ienumerable<xelement> myelements = e in groupa.elements("element") groupb.elements("element").tolist().contains(e) select e; i think want ienumerable<xelement> myelements = e in groupa.elements("element") groupb.elements("element").any(b => b.value == e.value) select e; c# .net linq-to-xml

spring boot - Passing environment values in application.properties -

spring boot - Passing environment values in application.properties - i new spring-boot , trying pass backend credentials environment values application.properties. to set environment values in tomcat , created setenv.bat , setenv.sh location: \apache-tomcat-7.0.53-windows-x64\apache-tomcat-7.0.53\bin set username="abc" set password="xyz" these environment values getting set , able print using @autowired private environment env; string username = env.getproperty("username"); string pwd = env.getproperty("password"); and trying access these values in application.properties like spring.datasource.username=${username} spring.datasource.password=${password} but not working. tried different way , mentioned environment variables name in setenv.bat set spring.datasource.username="abc" set spring.datasource.password="xyz" i hoping spring boot read these values env , pass info source not have mention

algorithm - Signal processing (in Java) -

algorithm - Signal processing (in Java) - i have sensor reading from, code in java, dont think issue language specific, more approach related. the sensor produces signal high , low pulses, heartbeat. however, "high" pulse not same level, nor "low". interested in relative difference. however, lone not enough, within single "session" high , low values may alter (think curved mid point) ive included image of 4 "types" of signals able handle. top left "ideal" i'm sure can handle that, other 3 sadly more mutual , less easy handle. my current approach has been average of data, , see how many times point crossed, tell me how many high , low pulses there were. i'd know if there simple way of detecting high , low pulse, without using averaging method. when stated wanted extract frequency of wave first thing thought of fourier transform; converts signal time domain frequency domain. given next sample wave: th

css - Add HTML(dropdown) in wordpress new page -

css - Add HTML(dropdown) in wordpress new page - how can convert wordpress new page. tried add together tru html didn't work. dropdown mest up. nil seems good. can help me out please? point me in wright direction. show me preview how can prepare problem. <html> <head> <meta content="text/html; charset=iso-8859-1" http-equiv="content-type"> <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"> <title>smoelenboek</title> <link rel="stylesheet" href="css/bootstrap-theme.css" type="text/css" media="screen" title="no title" charset="utf-8"> <link rel="stylesheet" href="css/default.css" /> <script type="text/javascript" src="js/jquery-1.4.2.min.js"></script> <script type="text/javascript" src="js/tablesorter.js"></scrip

ruby on rails - ActionView::MissingTemplate Error when trying to create new object -

ruby on rails - ActionView::MissingTemplate Error when trying to create new object - i hitting error "actionview::missingtemplate (missing template home/suites, application/suites {:locale=>[:en], :formats=>[:json], :handlers=>[:erb, :builder, :coffee, :haml, :rabl]}." when tried post (create new) suites (/suites.json). snippets of codes below. can advise me on how can resolve this? thanks! suitescontroller.rb def create @suite = suite.new @suite.text = params[:suite][:text] @suite.description = params[:suite][:description] @suite.remote_image_url = params[:suite][:image_url] if @suite.save render json: suite.standard_to_json(@suite) else render json: @suite.errors, status: :unprocessable_entity end end suites.rb class suite include mongoid::document include mongoid::timestamps field :text, type: string field :description, type: string field :image_url, type: string mount_uploader :image, imageuploader valida

arrays - Java: ArrayOutOfBoundsException -

arrays - Java: ArrayOutOfBoundsException - i have error when seek do data[i][1]=tmp[1]; or int > 0 in tmp[] . donne contains 5 parts separated :__: . if system.out.println(tmp[1]); print right thing , throw exception. here code: string[] donne=toserv.getdonneaccueil(); system.out.println(donne[0]); // données test object[][] info = new object[donne.length][6]; for(int i=0;i<donne.length;i++){ final int k; string[] tmp=donne[i].split(":__:"); /*system.out.println(tmp[0]); system.out.println(tmp[1]); system.out.println(tmp[2]); system.out.println(tmp[3]); */ data[i][0]=tmp[0]; data[i][1]=tmp[1]; data[i][2]="n"; data[i][3]=tmp[2]; data[i][4]=tmp[3]; the stack trace is: exception in thread "awt-eventqueue-0" java.lang.arrayindexoutofboundsexception: 1 @ vue_accueil.<init>(vue_accueil.java:60) @ menu$1.mouseclicked(menu.java:65) @ java.awt.awteventmulticaster.mousec

html - Applying gradient over background cover image -

html - Applying gradient over background cover image - i have next fiddle background image using cover (trying find best fit without distorting image). right want add together gradient on top of image , see similar questions this can not create work ( gradient does not show up ). is there way have: background-size: cover; background-position: center; background-image: url(pathtoimg); together gradient? thank kingking , chris hardie. comments understood doing wrong , how prepare it. so first problem url-image on top of gradient, hiding (thanks kingking). sec problem need gradient transparent (thanks chris). so here solution. if give me improve answer, happy take it. background-image: linear-gradient(to bottom, rgba(0,0,0,0), rgba(0,0,0,1)), url(imga.jpg); html css css3 gradient

When does Global Temporary table destroy in sql server? -

When does Global Temporary table destroy in sql server? - i confused usage of global temporary table. have created global temporary table //session 52 : creator session create table ##temp(i int) insert ##temp(i) values(1),(2),(3) select * ##temp //session 56 select * ##temp //session 57 : lastly session holds refference of ##temp select * ##temp now if close session 52, ##temp table destroys. i believe global temp table released in next cases it's explicitly removed sessions the creator session closed , there no other sessions referencing session. i confused sessions referencing session(creator session) mean ? from create table : global temporary tables automatically dropped when session created table ends , other tasks have stopped referencing them. association between task , table maintained life of single transact-sql statement. means global temporary table dropped @ completion of lastly transact-sql statement actively referencing

calling a function from a different context using javascript? -

calling a function from a different context using javascript? - im trying phone call function/method in javscript using oop style different context. for example: var someclass = function(){ this.init = function(){ var = "an interesting variable"; this.foo(something); //this works fine }, this.foo = function(bar){ alert(bar); } this.foo2 = function(){ this.foo(something); // deos not work/ not defined } }; var newclass = new someclass(); newclass.init(); newclass.foo2(); so want phone call this.foo() function within this.foo2() context, acting this.init() , im not sure makes sense, im new oop in javascript. your context right, you're trying access variable isn't defined in scope. variable something , declared var within init live within function. you need create fellow member of someclass : this.init = function() { this.something = 'an interesting variable'; this.f

javascript - Crypto-Js different output from mcrypt -

javascript - Crypto-Js different output from mcrypt - i have js script encrypts info 'blader'. if encrypt it returns output of js-script result uqnorevjcc2ycvy3uknjza== now, beingness reply base of operations comparison, wrote or rather searched equivalent script in php similar js script. confuses me logic fine , right reply different. on php script uses mcrypt, have result in mcrypt result hzfwfnkcamko6zjeyjbg4q== if notice, length same means logic/modification on code did correct. have said before copied script on posts here. here's js script think uses crypto-js function crypto_encrypt(text) { //this js var keybase64 = cryptojs.enc.base64.parse("itu2njnhi0toc2fmzexotq=="); var iv = cryptojs.enc.base64.parse('aaaaaaaaaaaaaaaaaaaaaa=='); var encrypted = cryptojs.aes.encrypt(cryptojs.enc.utf8.parse(text), keybase64, { keysize: 128 / 8,

c# - Why do I get, "Culture is not supported" and What, if Anything, Should I Do about it? -

c# - Why do I get, "Culture is not supported" and What, if Anything, Should I Do about it? - i have breakpoint on "return" line here: [httpget] [route("api/test/{id1}/{id2}")] public nrbqentity gettestmessage(string id1, string id2) { homecoming nrbqclient.gettestmessage(id1, id2); } although not crash app, when reach point, get, "exception:thrown: "culture not supported." (system.globalization.culturenotfoundexception) system.globalization.culturenotfoundexception thrown: "culture not supported."" which civilization trying supported, why not supported, , what, if anything, should back upwards culture? update answer sphanley: besides standing "new riders of barbeque," "skeleton" (for now) entity looks this: public class nrbqentity { public nrbqentity() { } public string value { get; set; } } update 2 answer anotheruser: this not code, i'm in process

hadoop - how to store hbase tables permanently on VM -

hadoop - how to store hbase tables permanently on VM - i doing simple stuff in hbase on vm using mass load . how how persist tables permanently in hbase. if restart vm tables gone so, have command store permanently . if start hbase in local mode (i.e., using file scheme , not hdfs), of info default saved in /tmp. linux systems wipe /tmp on reboot (i.e. turning vm on , off). there 3 ways of dealing this use hdfs store data change hbase-site.xml file point location other /tmp data never, ever, shutdown vm (seriously, don't this) the right property set, quoting hbase book: <property> <name>hbase.rootdir</name> <value>file:///directory/hbase</value> </property> where directory replaced whereever want store data hadoop hive hbase

javascript - Push object into local array from asynchronous callback function -

javascript - Push object into local array from asynchronous callback function - i utilize node.js on server , utilize redis key-store storing info characters. every connection has own character. want info characters(person, has name, age, profession, ...) characters array, can selectively send connected clients. var characters = []; (var id in connections) { redis_client.hgetall(id, function(err, result) { if (result) { characters.push(result); } }); } console.log(characters); i have read, due asynchronous vs synchronous problem, made global variable character. //global variables var character; //function code var characters = []; (var id in connections) { redis_client.hgetall(id, function(err, result) { character = result; }); if(character) { console.log(character); // returns right result // create re-create of character characters.push(json.parse(json.stringify(character)));

Where is the proper place to put Python virtual environments according to the Linux Filesystem Hierarchy Standard? -

Where is the proper place to put Python virtual environments according to the Linux Filesystem Hierarchy Standard? - as title asks, technically proper location store python virtual environments on linux operating systems according linux fhs? stated way allows clear answer: "technically correct" separate location of python virtual environment info files serving? note: this question differs closest, already-asked question find, virtual-environments contain libraries, binaries, header files, , scripts. as added complication, tend write code supports internet-accessible services. however, don't see substantially differentiating needs scenarios in consumers of service other processes on same server. i'm mentioning detail in case responses comments include "web dev"-esque content. for reference, using next documentation definition of linux fhs: http://www.pathname.com/fhs/pub/fhs-2.3.html i not believe popular virtualenv-wrapper script sugges