Posts

Showing posts from January, 2015

javascript - kendo UI Uncaught TypeError: e.bind is not a function -

i using kendo mvvm , kendo observable extend object bind data ajax call. in object setting data property in ajax call after ajax call has succeeded. can data bind , show up. but, in console, error "uncaught typeerror: e.bind not function". have looked everywhere see if has experienced issue before or might know might triggers error, no luck... here of javascript code: (function (global) { kendo.data.observableobject.extend({ serviceplans : "", getserviceplans: function () { var = this; $.ajax({ url: 'services-data.json', type: 'get', datatype: 'json', error: function(response){ console.log('error') }, success: function(response){ that.set("serviceplans", response.splans); } }); } app.servicesplansdata = { viewmodel:

actionscript 3 - Custom Event Listener not working -

i new as3 , saw creation of custom events in as3 in tutorial , wanted incorporate in game. when did tutorial, seemed project. doesnt seem work new project. here code : package { import flash.display.movieclip; import flash.utils.timer; import flash.events.timerevent; public class fashionfrenzy extends movieclip { public var buyer_mc:buyer; public var buyers:array; public var gametimer:timer; public function fashionfrenzy() { gametimecontroller(); generatebuyers(); addeventlistener(reachmalldoorevent.check, onreachmalldoor); } public function gametimecontroller() { gametimer = new timer( 25 ); gametimer.start(); } public function generatebuyers() { buyers = new array ; buyer_mc = new buyer(533.2,0) ; addchild(buyer_mc); gametimer.addeventlistener( timerevent.timer, buyerenter ); if(buyer_mc.y==377.25) { dispatchevent( new reachmalldoorevent( reach

How do you access assets in a Pakyow app on heroku? -

problem: pakyow app deployed heroku , js , css sourced/linked in template head 404. i assume problem stemming heroku, rather not 1 aware of. far know, heroku allows static assets in public directory. anyway, looking helpful pointers pakyow users. the app (currently) @ http://pakyow-go.herokuapp.com , repo can found @ http://github.com/jphager2/pakyow-go . this unfortunate default config option in released version. around it, add production configuration block in app.rb : app.static = true the reason works way out of box in production cases don't want app serving static files. instead responsibility of http server. on heroku though, want app server serve static files unless host them cdn.

javascript - How come I cant add code after changing the css of button with jquery? -

function test() { //allows code here $("#h1").css("background-color", "yellow").replace("px", "") * 2; //denys code here } below im trying archieve: function test() { $("#h1").css("background-color", "yellow").replace("px", "") * 2; $("#h2").css("background-color", "black").replace("px", "") * 2; } any or input how deal highly appreciated, thanks! edit: got here border-left-width returns nan in jquery create code change $("#h1").css("background-color", "yellow").replace("px", "") * 2; $("#h2").css("background-color", "black").replace("px", "") * 2; to $("#h1").css("background-color", "yellow"); $("#h2").css("background-color", "black"); you repl

primary key - MySQL update an AUTO_INCREMENT pk to preserve row ordering -

i have table 3 columns: id , foreign_id , , tag . queries on table ordered first foreign_id , tag , want deprecate tag column in favor of more reliable , auto-generated id . in doing so, need preserve ordering data stored in tag column without keeping tag around. ordering makes sense within scope of foreign_id column. to solve problem, we've decided update id s within scope of each foreign_id such order of ids preserves tag order information. how 1 update auto_increment primary key column such gets assigned next value in counter without changing rest of row? alternatively, how 1 copy entire row (minus pk) new row , delete old row? select max(id) @maxid the_table; update the_table set id = id + @maxid; set @i := 0; update the_table set id = (@i := @i + 1) order foreign_id, tag; i not 100% positive work; don't kind of things update statements. alternatively, replace last update with: insert the_table(id, foreign_id, tag) select (@i := @i + 1) `new_i

c - Unnamed semaphore POSIX IPC -

i allocated shared memory segment of size of integer. the expected outcome on stdout should be: p: 1 c: 2 but instead is: c: 1 p: 2 why child process not being blocked until parent done , has unlocked shared memory segment? #include <stdio.h> #include <stdlib.h> #include <sys/types.h> #include <sys/ipc.h> #include <sys/shm.h> #include <sys/wait.h> #include <unistd.h> #include <semaphore.h> #define shmsegsize sizeof(int) int main(void){ pid_t pid; int shmid; int *shared_mem; /* initializing shared memory */ shmid = shmget(ipc_private, shmsegsize, ipc_creat | 0644); shared_mem = (int *)shmat(shmid, 0, 0); *shared_mem = 0; /* initializing semaphore */ sem_t sem; int pshared = 1; // !=0 processes, =0 threads int value = 1; // number of processes @ time sem_init(&sem, pshared, value); // initialize semaphore pid = fork(); if(pid>(pid_t)0){ // parent sem_wait(&

javascript - Save an array of objects in mongoDB and escape double quotes -

i trying save array of objects node mongodb . i use: _id: objectid(request.body.connectionid) }, { $set: { status: accepted, networks: connectedprofiles } but @ mongodb record get: "networks": "\"(\\n {\\n netowrk = twitter;\\n \\\"profile_name\\\" = primary;\\n }\\n)\"" any idea why escape quotes? thanks responses. fixed issue stringify request before sending node js, , after parse it. solved problem.

java - The type of hasStatusCode(int) is erroneous - Netbeans 8.0.2 -

i'm playing around rest driver api test restful service. from github example, have: response response = get( "http://www.example.com" ); assertthat(response, hasstatuscode(200)); // compilation error here! assertthat(response.asjson(), hasjsonpath("$.name", equalto("jeff"))); if place code inside method in test class strange compilation error netbeans. the error is: the type of hasstatuscode(int) erroneous (see comment (in code) above error shown. i couldn't info error , informations found question, here . i've restarted netbeans , compilation error never goes away. hope either netbeans bug or i've imported wrong class(es). here's class code: import com.github.restdriver.serverdriver.matchers; import static com.github.restdriver.serverdriver.restserverdriver.get; import static com.github.restdriver.serverdriver.restserverdriver.header; import com.github.restdriver.serverdriver.http.response.response; import org.ju

javascript - remove class from JQuery dialog -

using div... $("#savedialogsinglefeature").dialog({ width: "auto", height: "auto", minheight: "none", position: { my: "left"+ leftposofmessage + "% top+" + extraheadersize, at: "bottom", of: $("header") }, show: { effect: "slidedown" }, hide: true, closeonescape: true, buttons:[], dialogclass: "alert", }).parent().appendto("form:first"); //populate text of label $('#popuplabel').text(popupmessage); //remove titlebar $("#savedialogsinglefeature").siblings('div.ui-dialog-titlebar').remove(); i can remove titlebar, remove ui-widget-content class dialog. //neither of these work $("#savedialogsinglefeature").siblings('ui-widget-content').remove(); $('savedialogsinglefeature

Generic name for distinguishable pointers -

is possible use same generic name 2 pointers of different type? following of course doesn't work, should make clear mean: real(4), pointer :: s_p real(8), pointer :: d_p generic :: p => s_p,d_p for procdures these things can done interfaces defining destinguishable procedures module procedure , type bound procedures there exists generic type used similar given example. wonder if exists pointers too. i'd mention unlimited polymorphic pointers ( class(*) ) not want, since i'm trying generalize existing library double precision input, i'd have lot more work in implementing select type blocks defining 2 pointers everywhere. edit: it of course possible associate same pointer variables of different type/kind. examples: program test implicit none real(4),target :: real(8),target :: b class(*),pointer :: p a=2e0 b=3d0 p=>a call printer(p) a=a+4e0 call printer(p) p=>b call printer(p) associate (u=>a)

BST date string to javascript date -

how can convert bst date string javascript date object? the follwing code gives me error bst works other timezone var data='tue apr 28 16:15:22 bst 2015'; var date = new date(data); console.log(date) output invalid date var data='tue apr 28 16:15:22 bst 2015'; var date = new date(data); console.log(date) var data2='fri mar 27 11:53:50 gmt 2015' var date2 = new date(data2); console.log(date2) don't rely on date know timezone names don't mix date time ; year should before time, timezone should last thing putting these together var timezone_map = { 'bst': 'gmt+0100' }; function re_order(str) { var re = /^(\w+) (\w+) (\d\d) (\d\d:\d\d:\d\d) (\w+) (\d\d\d\d)$/; return str.replace(re, function ($0, day, month, date, time, zone, year) { return day + ' ' + month + ' ' + date + ' ' + year + ' ' + time + ' ' + (timezone_map[zone] || zone);

asp.net mvc - Web API return csv file -

i need csv file web api controller. can not "save as" dialog show up. text output shows on page. tried both, calling export jquery , plain old html controller: [system.web.http.httpget] public httpresponsemessage export() { stringbuilder sb = new stringbuilder(); ienumerable<customerdiscount> list = this.subscriberrepository.getsubscribers(); foreach (customerdiscount item in list) { sb.appendformat( "{0};{1};{2};", item.customername, item.customernumber, environment.newline); } memorystream stream = new memorystream(); streamwriter writer = new streamwriter(stream); writer.write(sb.tostring()); writer.flush(); stream.position = 0; httpresponsemessage result = new httpresponsemessage(httpstatuscode.ok); result.content = new streamcontent(stream); result.content.headers.contenttype = new mediatypeheadervalue("text/csv");

ImageMagick jpeg quality extremely low -

Image
i have following image 188_f.jpg : and following code: <?php $ss = "convert 188_f.jpg -quality 95% -set colorspace rgb -colorspace cmyk 188_f_cmyk.jpg 2>&1"; echo ">" . $ss . "<br />"; echo system($ss); ?> when run code, image output: which indeed in cmyk, when viewed @ 100% there significant loss in quality. (wasn't sure if se did conversions when uploading, uploaded above images via ftp can examine them directly if needed.) i tried moving quality argument around, , without percent sign, , looked through imagick guide, couldn't find explanation why quality goes down. output file has same number of pixels. edit: making no other changes script except changing colorspace options, here results: edit 2: tried multiple different profiles, using this: convert 188_f.jpg -quality 95% -profile profiles\\uncoatedfogra29.icc -colorspace cmyk 188_f_cmyk.jpg 2>& none of them got rid of pix

php - Selecting one distinct column, I.E Finetuning select query -

i use bellow query merge 1 (or possibly sevral tables , generated php script have written) on id's not same parts of id in first table part of second id thats why substring on it. in perfect world left join on id in both tables if there same they're not. select t0.id,t0.customername,t0.region,t0.country,t0.stoptime,t0.customerid,t1.id, t1.time (select distinct id,customername,region,country, stoptime,customerid [dbcust].[dbo].[_content]) t0 inner join (select distinct id, time [dbcust].[dbo].[_cpu]) t1 on substring(t1.id,charindex('_',t1.id,10)+1,(charindex('_',t1.id,15) - charindex('_',t1.id,10)-1))=substring(t0.id,charindex('_',t0.id,10)+1,(charindex('_',t0.id,15) - charindex('_',t0.id,10)-1)) order t1.time desc here alot of fields same except stoptime, see example bellow: stoptime time 2015-04-01 23:59:00.000 2015-04-18 23:00:01 2015-04-02 23:59:00.000 2015-04-18 23:00:01 2015

Cross Origin error in Firebase authentication -

some times cross origin error, while logging in using $firebaseauth : var loginobj = $firebaseauth(firebaseref); loginobj.$authwithpassword( { email: logindata.username, password: logindata.password }).then(function (user) { success(user); }, function (error) { failure(error); }); i receiving following error, while login. https://auth.firebase.com/v2/test-innit-7856/auth/password?&email=test@test.com&password=test&v=js-2.1.0&transport=json&suppress_status_codes=true failed load resource: server responded status of 504 (gateway time-out) (index):1 xmlhttprequest cannot load https://auth.firebase.com/v2/test-innit-7856/auth/password?&email=test@test.com&password=test&v=js-2.1.0&transport=json&suppress_status_codes=true . no 'access-control-allow-origin' header present on requested resource. origin ' https://test-innit-7856.firebaseapp.

Disable workspaces feature in Chrome developer tool? -

Image
steps reproduce problem: open dev tools select "sources" tab open javascript file in sources tab after short (1 2 second) delay, following message appears: "serving file system? add files workspace" dismiss message clicking "x" on right side refresh page after short delay, message appears again i don't want use workspaces feature, should able disable these constant, repetitive, annoying messages. ideally, there dev tool setting turn off workspace prompts. my chrome version: 42.0.2311.135 (64-bit) (google chrome date) you can disable message permanently clicking on "never show" shown in screenshot below. this developer tools opened in separate window. using latest chrome (v55 of now), have observed clicking "never show" permanently hides message in lot other earlier versions of chrome well. p.s.: had blur code belongs company working for.

javascript - Updated to cordova-android4.0.0..now getting error even when creating new projects -

Image
i updated cordova/phonegap project latest (cordova 5.0.0,) , i'm getting following error: even when create brand new cordova project using $ cordova create hello com.example.hello helloworld the error appears in new project well. i'm referencing following 1 time in project , if remove it, error disappear, events no longer work (i.e. ondeviceready, etc) <script type="text/javascript" charset="utf-8" src="cordova.js"></script> the error coming line 104 in cordova file, following: // file: src/cordova.js define("cordova", function(require, exports, module) { if ("cordova" in window) { throw new error("cordova defined"); }; another note: downgraded project android 3.7.1 , works fine any appreciated. please let me know if need more info

telnet - Checking if a port is open through the firewall, that has no listener service actually listening -

i have windows 2008 r2 server need listen on particular port (e.g. 1234) in order application upgrade work, application doesn't have listener service configured port 1234. our firewall managed third party, check in advance port 1234 has been opened before install update. possible? i know can telnet server on other listening ports, server has no application listening 1234 can't in fact, open. telnet results inconsistent when connecting ports apparently listening in netstat. is there can in powershell or vb instance, set listener port 1234 in advance of upgrade ensure go smoothly? many in advance. anything accepts traffic work. run other service on port 1234 , see if can connect that. use network sniffer wireshark on server , see if you're getting connection attempts port 1234. install netcat on server , tell listen port 1234 connect port on firewall. if connects, port open. (this same #1 without actual service.)

windows - Meaning of options in mingw-w64 installer -

in mingw-w64 online installer there several fields can select. cannot find documentation on this, , guesses i've made don't give me behaviour want. clearly lot of work has gone project seems pity uptake being held lack of basic documentation. the "version" , "architecture" fields self-explanatory other fields have trouble (values shown of current installer): threads , options posix , win32 exception , options dwarf , sjlj build revision , options 0 , 1 , 2 . the values chose on previous install win32 , seh , 1 (clearly options have changed since none wiser what's what). what pros , cons of each option, threading model , exception handling, , version "best"? the specific problems have encountered using x86_64-win32-seh-rev1 are: std::thread , std::condition_variable not supported when debugging (using code::blocks ide), if exception thrown not jump exception handler; selecting next line nothing 3 times , aborts ru

c# - Access preview frame from MediaCapture -

i grab preview frames displayed inside captureelement xaml element. source of captureelement set mediacapture object , use startpreview() method start displaying camera. access frames being shown without saving them img or video file. goal capture 10 fps preview , send each frame class accepts byte[] . i tried using capturephototostoragefileasync method not feasible option not want take 10 actual images / second. not want use screencapture stores captured video file. ideally not want store media files temporarily on phone. after looking @ msdn mediacapture , noticed there's method called getpreviewframeasync() method not exist inside windows phone 8.1. stumbled on example not understand how works. any suggestions on how approach appreciated. there sample on microsoft github page relevant, although target windows 10. may interested in migrating project functionality. getpreviewframe : sample capture preview frames opposed full-blown photos. once has pr

vba - How do I send a non-http hyperlink in an email message generated by Excel macros? -

i using excel macros send email, content kept in cells. need send non-http link looks this elodms:// followed id i'm assuming outlook doesn't know form of link , doesn't present clickable link when email sent, when inserting email address. is possible force outlook view hyperlink? , can done through vba excel macros? this how have done emails in excel before. email = "hello, <br><br>" & _ "this something:" & _ "<br><br> thank you." & _ "<br><br><br> <a href='elodms://12345'>click here</a>" outmail .to = "you@me.com" .cc = "" .bcc = "" .subject = "subject" .htmlbody = email .send end

c++ - Is it possible to alter the HTTP client timeout period (cpp-netlib)? -

i'm using cpp-netlib (v0.11.0) send http requests. i'd know if it's possible alter timeout period when sending http post request. i'm running unit tests, 1 of sends http request address there no server running. attempt pull information response times-out after 90s error "operation timed out". when constructor client class invoked, can pass options class can set timeout in. see the docs client class constructors (and scroll down bit) more specific information.

Unable to login using the valid credentials with spring security -

i have configured spring security in project each time i'm trying login correct credentials, unable login. console displaying mesage salt source not found. why trying find getid in userawareuserdetails? have separate user class 2015-04-30 10:44:03 debug connectionmanager:302 - transaction completed on session on_close connection release mode; sure close session release jdbc resources! 2015-04-30 10:44:03 debug usernamepasswordauthenticationfilter:346 - authentication request failed: org.springframework.security.authentication.authenticationserviceexception: unable find salt method on user object. class 'com.spring.security.userawareuserdetails' have method or getter named 'getid' ? 2015-04-30 10:44:03 debug usernamepasswordauthenticationfilter:347 - updated securitycontextholder contain null authentication 2015-04-30 10:44:03 debug usernamepasswordauthenticationfilter:348 - delegating authentication failure handler org.springframework.security.web.authe

c - Why is not these two return of bool equal? -

Image
these 2 return statements not seem equal , wonder why? bool isfound = false; return isfound; returns true no matter value of isfound. bool isfound = false; return isfound ? true: false; returns value of isfound in case false. i guess answer might isfound local variable , destroyed after function finished. the return type of function const bool const doesn't seem make difference. bool secventialsearch(int* arr, int size, int target, long* time){ struct timeval start, stop; bool isfound = false; long seconds, useconds; int* iter = arr; gettimeofday(&start, null); while (*iter != target && iter != &arr[size-1]) iter++; if (*iter == target ) isfound = true; gettimeofday(&stop, null); seconds = stop.tv_sec - start.tv_sec; useconds = stop.tv_usec - start.tv_usec; *time = ((seconds)*1000000 + useconds); return isfound; } returns true in following code in main if target not in array. altering isfound ? true: false; makes work properly.

osx ffmpeg avfoundation audio not in sync -

i'm trying record screen audio , video ffmpeg. have installed soundflower , setup correct audio devices. however, when using ffmpeg audio sped , not keep in sync video. ffmpeg -f avfoundation -i "1:0" -y out.avi i have tried following variations. ffmpeg -vsync 2 -f avfoundation -i "1:0" -framerate 30 -y out.avi ffmpeg -vsync 2 -f avfoundation -i "1:0" -frame_rate 30 -probesize 10m -y out.avi ffmpeg -async 1 -probesize 10m -f avfoundation -i "1:0" -r 15 -y out.avi ffmpeg -async 15 -f avfoundation -i "1:0" -r 15 -y out.avi i'm using ffmpeg version 2.6.2 installed via homebrew. if has free solution isn't ffmpeg works command line accept that. quicktime screen recording produces large file sizes it's not appropriate.

Using the offer object and categories on a schema.org model -

i'm working on using schema.org events database on site. don't sell anything, try able show kinds of events (concert, activities children, art exhibition, etc) of them free, of them not, , don't know, , don't have precise information on price(s). so, markup correct according google's testing tool, says should have offer object, , can't seem know how put it. in database, regarding prices have these fields : 'free', enumeration ['yes','no','not communicated'] 'tariff', optional free text field, price or price range, , general information prices, how it's cheaper young or old people. from saw, when it's free, can put offer price @ 0, when it's not don't have price, or may have it, written in own langage (not sorted list of numeric prices), i'm not talking when don't know if it's free or not. so first question : possible make schema.org offer little information ? my second problem

amazon web services - Can I use a S3 bucket object as a push notification (Polling object) without any issues? -

background : due quick development have our servers in php , implementing services pusher , socket.io not option. so, planning on using aws s3 bucket files , data content, update them , poll them , see if there new messages or not. would know how many requests/second can s3 file or s3 bucket handle ? you can make pretty many requests per second want, beware bill @ end of month charged per api call. further more, depending on region using there may no "read after write consistency", make application unreliable. bottom line: can it? yes. recommend it? considering use case: no.

c# - AutomationElement in flash -

i'm using automationelement-class find chat in flash application (bigbluebutton, http://demo.bigbluebutton.org , i'm testing there) in browser (firefox). seems work long no new messages appear. every time new message comes in, ui updates automationelement a) can't find chat or b) automationelement describes chat contains no messages. before new message arrives seems work. can access messages. my code far: private void getlastchatmessage(){ system.diagnostics.process[] p = system.diagnostics.process.getprocessesbyname("firefox"); automationelement au = automationelement.fromhandle(p[0].mainwindowhandle); propertycondition chatcond = new propertycondition(automationelement.nameproperty, "message box"); condition listcond = new propertycondition(automationelement.controltypeproperty, controltype.list); andcondition listachatcond = new andcondition(listcond, chatcond); automationelement chatarea = au.findfirst(treescope.

javascript - Restrict users report for particular routes using Embed API -

is possible restrict users view reports respect particular routes assigned application using embed api? ex : user-x should have privilege check traffic coming route www.dummy.com/test , not www.dummy.com/test1 , check users details related route create view includes allowed data , give user read permissions view. of course a) lot of work , b) rather limits possible number of users. for practical purpose answer "no, use serverside api , filtering there".

java - Maven assembly descriptor properties -

i want pack 2 or more similar distributions, difference path data set inside distributions. given example path: ${project.basedir}/src/config/dataset1 <?xml version="1.0" encoding="utf-8"?> <assembly xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2" xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xsi:schemalocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2 http://maven.apache.org/xsd/assembly-1.1.2.xsd"> <id>dataset1</id> <formats> <format>zip</format> </formats> <filesets> <fileset> <directory>${project.basedir}/src/config/dataset1/aaa</directory> <outputdirectory>conf/aaa</outputdirectory> </fileset> <fileset> <directory>${project.basedir}/src/config/dataset1/bbb

html - How to remove the extra white space at the bottom of the panels -

i have drop down menu system. drop down panels contains list menu , 3 images. #menu {width:1000px;margin:0px auto 0px auto} #menu #holder{ display: block; width: 100%; list-style:none;margin:0px;padding:0px; } #menu .menuaholder{margin:0;padding:0;display:inline-block;width:auto} #menu .menudropdown{z-index: 3;position:absolute;display:none;background-color:#ffffff;-moz-box-shadow: 0 0 6px #c4c4c4; -webkit-box-shadow: 0 0 6px #c4c4c4; box-shadow: 0 0 6px #c4c4c4;} #menu .menuaholder .full{padding:10px;width:980px;text-align:left;} #menu .menuitem{display:block;padding:5px;color:#000000;} #menu .menuitem:hover{background-color:#edf0f1;color:#b7b67e;} #menu .menuaholder:hover .menudropdown{display:table;} #menu a.item{ list-style-type: none; list-style-image: none; color: #999999; padding: 5px 6px 6px 6px; height: 15px; font-size: 12px; width: 100%; margin: 0px 0px 0px 0px; height: 30px; line-height: 30px; text-transform: uppercase; } .menudropdow

php - negative pattern matching to exclude certain files using glob -

i using glob images directory. however, of images in directory thumbnails identified "-m" before file extension , want exclude these file list. so, example there be: image-1.png image-1-m.png portrait.png portrait-m.png front-panel-cold.png front-panel-cold-m.png front-panel-warm.png front-panel-warm-m.png using foreach(glob($imdir."/*[!m].*") $img) { echo $img . "<br>\n"; } i can list files don't end m, excludes front-panel-warm.png. can't find way of escaping hyphen: glob($imdir."/*[!\-m].*") gives no results, glob($imdir."/*[!-m].*") gives same results [!m] , glob($imdir."/*[!--m].*") excludes files ending letter before n. i've tried using brace glob($imdir."/*[!{-m}].*", glob_brace) but doesn't seem work either. any ideas going wrong, or need use preg_match for? use exclude files ending -m foreach(glob($imdir."/*[!-]?[!m]?.

ios - SceneKit material being filled with random patterns, why? -

Image
i have simple touch detection method should change color of node being touched. override func touchesbegan(touches: set<nsobject>, withevent event: uievent) { super.touchesbegan(touches, withevent: event) let touch = touches.first as! uitouch let point = touch.locationinview(view) let options: [nsobject : anyobject] = [ scnhittestfirstfoundonlykey: nsnumber(bool: true), scnhittestsortresultskey: nsnumber(bool: true) ] if let results = sceneview.hittest(point, options: options) as? [scnhittestresult] { if let result = results.first { // red color material let material = scnmaterial() material.diffuse.contents = uicolor.redcolor() // assign node result.node.geometry?.firstmaterial = material } } } my node hierarchy contains 1 node made using custom scngeometry , 8 nodes regular scnbox geometry. let boxgeometry = scnbox(width: 1, height: 1, length:

java - pass Arraylist through intent -

i want pass taskitems arraylist<hashmap<string,string>> taskitems = new arraylist<hashmap<string, string>>(); through intent second activity arraylist<string> stringarr = new arraylist<string>(); stringarr.add(key_title); stringarr.add(key_info); stringarr.add(key_object); stringarr.add(key_location); arraylist<integer> intarr = new arraylist<integer>(); intarr.add(r.id.title); intarr.add(r.id.info); intarr.add(r.id.object); intarr.add(r.id.location); //neue oberfläche starten intent in = new intent(listviewactivity.this, listmenuitemactivity.class); in.putstringarraylistextra("stringadapter",stringarr); in.putintegerarraylistextra("intadapter",intarr); ------>in.putstringarraylistextra("taskitems",taskitems); startactivity(in); i've marked spot. how can pass arraylist through intent activity? hashmap extends se

c++ - The differences between initialize, define, declare a variable -

after reading question , know differences between declaration , definition. mean definition equals declaration plus initialization? declaration declaration, generally, refers introduction of new name in program. example, can declare new function describing it's "signature": void xyz(); or declare incomplete type: class klass; struct ztruct; and last not least, declare object: int x; it described, in c++ standard, @ §3.1/1 as: a declaration (clause 7) may introduce 1 or more names translation unit or redeclare names introduced previous declarations. definition a definition definition of declared name (or can both definition , declaration). example: int x; void xyz() {...} class klass {...}; struct ztruct {...}; enum { x, y, z }; specifically c++ standard defines it, @ §3.1/1, as: a declaration definition unless declares function without specifying function’s body (8.4), contains extern specifier (7.1.1) or linkage-specificatio

asp.net mvc - How to set Password and Username in web.config -

in mvc application use connection string set in web.config via private connectionstring string = configurationmanager.connectionstrings("dbcs").connectionstring and have no problems db connection. since need password , username log database hardcoded in web.config <connectionstrings> <add name="dbcs" connectionstring="server=win\sqlexpress;database=mydb; uid=myusername;password=mypassword" providername="system.data.sqlclient" /> </connectionstrings> i looking way send password , username userinterface config.web file first off thought configurationmanager class should provide property cannot find something. can explain me how this? you can save value in app settings: <appsettings> <add key="dbcs" value="data source=win\sqlexpress;initial catalog=mydb;user id={0};password={1}" /> </appsettings> and following: using system.data.sqlclient; public void dod

ibm mobilefirst - Server IP Change Screen not shown in Android Nexus 7 -

i have used mobilfirst 6.3 , using connectonstarup feature. when application can't connect server the dialog box appears 3 buttons there click details modify settings of server ip it works fine in tabs , mobile except google nexus 7(android 5.0). after click details screen application stucks , can't anything. the below tested using wl.client.connect() , because connectonstartup deprecated (no longer maintained , tested) , should no longer used. i cannot confirm this. i've created same scenario using nexus 7 (running android os 5.0.2). after application failed connect mfp server, tapped on details button. in app diagnostics screen can 2 things: reload in order try connect again copy details see in table tapping on reload button indeed reloads app (and again shows me dialog either close dialog, reload app or view app diagnostics table. copying details copies details , can paste them in email screen or other text editing window. both act

jquery - How can i display time in place of button? -

i want display time in place of button when button clicked button fadein , time show in place of button script not working button fadein , time didn't show in place of button , "time shown when refresh whole page not particular part refreshing ? foreach($leads $val):?> <tr><td class = 'account-name sort-value'> <span style='float:left;width:47%;'> <?php echo $val->first_name .' '. $val->last_name;?></span>&nbsp;&nbsp;&nbsp;&nbsp; <?php if($val->checkin_time != '') {?> <span class = 'dischktime' id = 'dischktime{<?php echo $val->lead_id;?>}' ><?php echo $val->checkin_time;?> </span> <?php } else {?> <span style='float:left;width:26%;'> <button id ='checkin{<?php echo $val->lead_id;?>}' class='btn btn-default' name='checkinbt' v

regex - Difficulty with a Regular Expression C# -

i have line text file , i'm trying create regular expression match. line of text. 2015-01-07 wed jan 07 11:03:43.390 text here.. my regular expression match follows: (?<date>(?<year>(?:\d{4}|\d{2})-(?<month>\d{1,2})-(?<day>\d{1,2})))\s(?<txtentry1>.*)\s(?<txtentry2>.*)\s(?<txtentry3>.*)\s(?<time>(?<hour>\d{2}):(?<minutes>\d{2}):(?<seconds>\d{2}):(?<milli>\d{0,3}))\s(?<txtentry4>.*)\s(?<txtentry5>.*)) it doesn't match. i'm not concerned 'worded' date wed jan 07 have left text entry, rather match yo dd/mm/yy. have been trying figure our no success. can see have gone wrong? there 2 problems regular expression there no pattern specified capture group month (now updated) you have used colon, instead of period separator between second , millisecond (?<seconds>\d{2}):(?<milli>\d{0,3}))

typo3 - Solr Indexing - Manipulating the search result -

i working typo3 solr extension , have doubts regarding solr result set manipulation. i have added special configuration indexing particular pages in page tree. ie pages starts label "expertise%" .i have managed added . , indexing working our trouble. achieve , want added parent page title search result.i.e this page tree |---- 1.00.100 (parent page) |--subpage 1 |--subpage 2 |--expertise |--test page` and in solr search result should be 1.00.100 - expertise is possible in typo3 solr. there hook or signalslot available implement this? tried ,but doesn't seems work me ? plugin.tx_solr.index.queue.expertise_offered = 1 plugin.tx_solr.index.queue.expertise_offered { table = pages additionalwhereclause = doktype = 1 , no_search = 0 , title '%expertise offered%' fields { title = title content = content parentpagetitle_strings = content parentpagetitle_strings {

outlook - height in Html email: td with image beside td with background-color -

Image
i built html document newsletter send outlook 2013. here html fiddle when try send outlook background color td crossing boundaries of top , bottom row. can know how solve problem? here prtscreen of problem: well first things first - sending email out of outlook going ruin code. outlook rewrites wordhtml. there no if, ands or buts it, going happen insert html new email. includes strip out media queries, responsive design gone. highly recommend using email client can send html emails (e.g. thunderbird) or esp (e.g. exact target, mail chimp) send out. now issue asking about. issue padding have on td. remove padding , fits. if want padding on left , right, use "padding-left" , "padding-right" only. recommend having bg run behind image if height of td increased due variance of rendering across email clients, makes border instead of mistake.

codec - Error is saving java.sql.Date in MongoDB -

not able save java.sql.date field using dbcollection.save() error : codecconfigurationexception: can't find codec class java.sql.date. while insert() method has constructor having dbencoder field. dbcollection.insert(list<? extends dbobject> documents, writeconcern awriteconcern, dbencoder dbencoder) but kind of constructor save() method. you need change date object java.sql.date java.util.date java.util.date newdate = new date(yoursqldate.gettime()); if don't know when did use java.sql.date in code, suggest should try check if there date variable update sql statement. you should not have problem if use mongo 2.x library, since mongo 3.x library, seems removed java.sql.date support.

powershell - cmdlet as input to another -

i have following powershell command replacing in file: (get-content c:\myfile.txt) | foreach-object { $_ -replace "date x", "date 2015.02.29" } | set-content c:\myfile.txt i want hardcoded date (2015.02.29) come cmdlet: (get-date -format yyyy.mm.dd) how inject this? just replace hardcoded value command: (get-content c:\myfile.txt) | foreach-object { $_ -replace "date x", "date $(get-date -format yyyy.mm.dd)" } | set-content c:\myfile.txt

CSS | Only apply styling to Internet Explorer -

currently testing website on internet explorer 10 , 11. currently have stylesheet has styling in should apply when visiter browsing website using internet explorer. tried use conditional comments not supported in internet explorer 10 , 11. i wondering if has dealt issue before , push me right direction. appreciated. here code ie10 , ie11. add class html tag. <!--[if !ie]><!--> <script> if (/*@cc_on!@*/false) { document.documentelement.classname+=' ie10'; } </script> <!--<![endif]--> <script> var ua = navigator.useragent, doc = document.documentelement; if((ua.match(/rv:11.0/i))){ doc.classname = doc.classname + " ie11"; } </script>

c# - How does SequenceEqual work in Reactive Extensions -

Image
i have hard time figure out how sequenceequal works in reactive extensions version 2.2.5 below code var subject1 = new subject<int>(); var subject2 = new subject<int>(); iobservable<bool> sequenceequal = subject1.sequenceequal(subject2); subject1.onnext(5); subject1.onnext(3); subject2.onnext(1); subject2.onnext(4); //this notified if 2 sequences completed sequenceequal.subscribe(b => console.writeline("two sequences equal ? {0}", b)); subject1.oncompleted(); subject2.oncompleted(); i expected output "two sequences equal? false" , result true contained different elements. i'm wondering why result that? sequenceequal do? with sequenceequals monitor point subscribe. subscribe before onnext calls , you'll false in subscription code or use replaysubjects.

c++ - Compound assignment operator overloading -

i have seen boost give possibility of doing: v*=c c i.e. double , v vector how make, exercise, overloading of *= correctly, works in same way of previous example (with double on right side)? how this? // in class t& operator *= (double d) { member *= d; return *this; } // outside of class t operator * (t v, double d) { v *= d; return v; }

ios - Swift and SecTrust -

i'm having troubles trying convert code i've found in apple documentation swift code. precise stuff tsl , certificates... https://developer.apple.com/library/mac/documentation/networkinginternet/conceptual/networkingtopics/articles/overridingsslchainvalidationcorrectly.html this original code in objective-c sectrustresulttype secresult = ksectrustresultinvalid; if (sectrustevaluate(trust, &secresult) != errsecsuccess) return; } and attempt... var secresult:sectrustresulttype = ksectrustresultinvalid // error 1 if (sectrustevaluate(trust, &secresult) != errsecsuccess) { // error 2 return; } error 1 is: 'int' not convertible 'sectrustresulttype' error 2 is: not find overload '!=' accepts supplied arguments now, see sectrustresulttype uint32 , ksectrustresultinvalid int ... header defined apple suppose should correct :p typealias sectrustresulttype = uint32 var ksectrustresultinvalid: int { } about second e

jquery - Bounce effect to sprite icon using easing1.3.js -

i try apply bounce vertical effect social nav icon using jquery easing i'm not familiar js , need help. html <ul class="social"> <li class="facebook"><a class="bounce" href="http://facebook.com"></a></li> <li class="twitter"><a class="bounce" href="http://twitter.com"></a></li> </ul> css ul.social li { float: left; height: 28px; width: 30px; display: inline-block; background: url("http://s14.postimg.org/ufud6x5n1/social.png") no-repeat; } ul.social li.facebook { background-position: 0 0; } ul.social li.twitter { background-position: -30px 0; } ul.social li.facebook a:hover { background-position: 0 -28px; } ul.social li.twitter a:hover { background-position: -30px -28px; } and here problem. js $(document).ready(function() { $('.bounce').hover( function() { $(this).animation(1000

objective c - IOS AdressBook Contacts Null Issue on real device -

i getting contacts addressbook , tested on simulator there no first or second name null issue. but when trying test on real device give me first or second name null issue on many rows. please me source code is - (void)getcontactswithaddressbook:(abaddressbookref )addressbook { contactlist = [[nsmutablearray alloc] init]; cfarrayref allpeople = abaddressbookcopyarrayofallpeople(addressbook); cfindex npeople = abaddressbookgetpersoncount(addressbook); (int i=0;i < npeople;i++) { nsmutabledictionary *dofperson=[nsmutabledictionary dictionary]; abrecordref ref = cfarraygetvalueatindex(allpeople,i); //for username , surname abmultivalueref phones =(__bridge abmultivalueref)((__bridge nsstring*)abrecordcopyvalue(ref, kabpersonphoneproperty)); cfstringref firstname, lastname; firstname = abrecordcopyvalue(ref, kabpersonfirstnameproperty); lastname = abrecordcopyvalue(ref, kabpersonlastnameproperty);

r - Plot Data by 1 second intervals efficently -

Image
so i've done (inefficiently), future reference i'd know if there's better way. what i'm doing plotting number of packets, , data sent every second in trace. code is: trace$sec = cut(trace$v1, breaks = seq(0, 1800, = 1), labels = 1:1800) packet_count_vec = numeric() data_trans_vec = numeric() (i in 0:1800 ) { print(i) bin = which(trace$sec == i) packet_count = 0 data_trans = 0 (j in bin) { packet_count = packet_count + 1 data_trans = data_trans + trace[j,]$v6 } packet_count_vec = c(packet_count_vec, packet_count) data_trans_vec = c(data_trans_vec, data_trans) } par(mfrow=c(2, 1)) plot(packet_count_vec, type = "l", xlab = "time (s)", ylab = "packets") title("time series of total packets") plot(data_trans_vec, type = "l", xlab = "time (s)", ylab = "bits") title("time series of data transferred") what use cut add bins second intervals data, each bin count numbe