Posts

Showing posts from April, 2013

javascript - Remove Cookies In Jquery on logout button -

javascript - Remove Cookies In Jquery on logout button - hi trying create code clear cookies in jquery onclick of logout button didn't solution function logout() { document.cookie = 'visit=; expires='+new date(0).toutcstring() +'; path=/finalvertozz/'; window.location='../login.html'; } cookies details name: visit content: 09850227123455130 domain: localhost path: /finalvertozz send for: kind of connection accessible script: yes created: saturday, oct 4, 2014 11:25:45 expires: when browsing session ends from reference of question , reply @russ cam how set/unset cookie jquery? utilize function reuse function createcookie(name, value, days) { var expires; if (days) { var date = new date(); date.settime(date.gettime() + (days * 24 * 60 * 60 * 1000)); expires = "; expires=" + date.togmtstring(); } else { expires = ""; } document.cookie = e...

android - Handler.postDelayed and orientaton change issues -

android - Handler.postDelayed and orientaton change issues - i facing unusual issue not able solve. thing is, have activity , after pressing button alter visibility of layouts. after using handler in order revert situation after 4 seconds, , set before. everything works expected except when alter device orientation, if alter device orientation during process, views not restored, not sure problem :s. here relevant code private view mloginformview; private view mloginstatusview; private boolean mlogginin = false; @override protected void oncreate(bundle savedinstancestate) { log.d(tag, "oncreate"); super.oncreate(savedinstancestate); setcontentview(r.layout.activity_login_layout); mloginformview = findviewbyid(r.id.login_form); mloginstatusview = findviewbyid(r.id.login_status); if (savedinstancestate == null) { mlogginin = false; } else { mlogginin = savedinstancestate.getboolean(getstring(r.string.user_log...

angularjs - $location.search being changed automatically, cannot manually set either -

angularjs - $location.search being changed automatically, cannot manually set either - edit: reset/typeerror due not specifying reloadonsearch: false in route. pagination trying redirect page default value ( 1 ), telling page load results in $timeout solved this. i'm having rather annoying error in angularjs @ moment. i'm trying & set specific search parameter: var searchparams = $location.search(); $scope.limit = searchparams.limit > 0 ? searchparams.limit : 10; $scope.currentpage = searchparams.page > 0 ? searchparams.page : 1; this gets parameter fine, if load page parameters except defaults there (10 , 1), automatically reload (triggering controller twice) using defaults. additionally, when set search query myself: $scope.changepage = function() { $location.search('page', $scope.currentpage); getusers(); }; it causing next typeerror: cannot read property 'add' of undefined error: typ...

highlight - code disappears when highlighting in eclipse -

highlight - code disappears when highlighting in eclipse - i have simple problem in eclipse not figure out how prepare it. when highlight piece of code (in c++, or in fortran, in other language) code disappears. can't see code until unhighlight it. anyone has clue source of problem be. thanks, i think because color scheme has problem, highlighting same font color , background color. can seek reset font color scheme. eclipse highlight

Android studio - should the entire .idea directory be in git ignore? -

Android studio - should the entire .idea directory be in git ignore? - i saw lot of examples .gitignore files androidstudio, have .idea in them, , don't. is there reason not add together entire .idea dir .gitignore? if should not ignored, there specific files within .idea (such .iml) should in .gitignore? you can take @ page : link intellij doc project configuration files a particular line interesting : the .idea directory contains set of configuration files (.xml). each file contains portion of configuration info pertaining functional area reflected in name of file, example, compiler.xml, encodings.xml, modules.xml. almost of files contain info core project itself, such names , locations of component modules, compiler settings, etc. thus, these files may (and should) kept under version control. however, hate create project ide-dependant (i working on project made netbeans , hurts utilize eclipse becomes standard of company). so, reply ...

r - Mapping variables to hexagon size and color with hex_bin -

r - Mapping variables to hexagon size and color with hex_bin - so, found this code how map variable hexagon size while ago , tried modify utilize purpose of drawing basketball shot charts. know there have been other threads this one, none i've read in past answered question. first 1 help i'm stuck 1 little problem: let's have info frame 4 variables, x, y, value (of points shot has; in basketball it's either 2 or 3, depending on how far basket take shot), , outcome (1 shot made, 0 shot missed), on 250 observations. 250 shots x , y coordinates, value , outcome. example: x y value outcome 1 169.7650 -316.5726 3 0 2 75.0775 -182.3126 2 0 3 94.0150 -147.4050 2 1 4 109.1650 -138.0068 2 0 5 87.7025 -146.0624 2 1 # dput below: structure(list(x = c(169.765, 75.0775, 94.015, 109.165, 87.7025), y = c(-316.5726, -182.3126, -147.405, -138.0068, -146.0624), value = c(3l, 2l, 2l, 2l, 2l), outcome = c(0l, 0l, 1l, 0l, ...

android - Making a tutorial (coach mark) overlay. Need help moving a view based on the position of another -

android - Making a tutorial (coach mark) overlay. Need help moving a view based on the position of another - hello trying create coach mark on lay tutorial. main.java public class main extends activity { private button button1; private int x; @override public void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_help_overlay); button1 = (button)findviewbyid(r.id.button1); x = button1.gettop(); showoverlay(); } private void showoverlay(){ this.setrequestedorientation(activityinfo.screen_orientation_portrait); final dialog dialog = new dialog(this, 0); dialog.getwindow().setbackgrounddrawable(new colordrawable(android.graphics.color.transparent)); dialog.getwindow().setlayout(viewgroup.layoutparams.match_parent, viewgroup.layoutparams.match_parent); dialog.requestwindowfeature(window.feature_no_title); ...

ajax - jquery read text from html, multiple classes -

ajax - jquery read text from html, multiple classes - i have 5 different name div's, has different id. first div once, sec divs 1-5 times , other 3 div's, never know how many more 10 times in whole body. and need read them through jquery (loop) way save every so-called line line jquery repeat process until have been read , saved. , every time 5 div's the third-, fourth-, 5th div, same amount, with code 1 div info. var kuupaev = ""; $('.page .sub').each(function(){ kuupaev = $(this).text(); $.ajax({ url: 'save.php', type: 'post', data: {kuupaev:kuupaev}, success: function (data) { callback(data); } }); }); maybe can help me. big give thanks you sorry bad english... edit: figured out.. <script> for(var index = 0; index < $(".page_channel").nextuntil(".page_channel...

css - Set transparent background in an html page -

css - Set transparent background in an html page - what need advice or thought solve issue, want set trasparent background such 20 11 theme of wordpress: i've found isn't practice write css in html tag set background image of webpage using html/css <html> vs <body>, in illustration i'm trying html <html> <head><title>opacity</title><link rel="stylesheet" href="style.css"></head> <body> test </body> </html> css html{ width:100% background-color:rgb(0,0,0,0.1); /*red greenish bluish opacity */ } body{ max-width:300px; /* min-width:500px; */ background-color: red; } the problem total reddish page, despite of fact tried set width , maximum width body in css. ideas? your problem height of body 0. try this: html{ width:100%; background: rgba(200,0,0,0.1); min-height: 100%; } body{ background:green; width: 40%; ...

c++ - Qt: Custom QGraphicsItem not showing when boundingRect() center is out of view -

c++ - Qt: Custom QGraphicsItem not showing when boundingRect() center is out of view - i'm making diagram (fluxogram) programme , days i'm stuck issue: i have custom qgraphicsscene expands horizontally whenever place item it's rightmost area. problem custom arrows (they inherit qgraphicspathitem ) disappear scene whenever it's boundingrect() center scrolled off view. everytime scene expands, both it's scenerect() , view's scenerect() updated well. i've: set ui->graphicsview->setviewportupdatemode(qgraphicsview::fullviewportupdate) the item flags qgraphicsitem::itemignorestransformations , qgraphicsitem::itemsendsgeometrychanges , setactive(true) on item well, , everytime add together arrow scene phone call update(scenerect()) method. still, everytime scroll view, arrow's boundingrect() center moves away view, arrow disappears. if scroll , boundingrect() center enters view, arrow appears again. can give me tip of might mi...

c++ - When I convert VS2003 project to VS2008, There was some errors(C2440, C2664) -

c++ - When I convert VS2003 project to VS2008, There was some errors(C2440, C2664) - i converted visual studio(vs) 2003 project vs2008. , tried build converted vs2008 project. when build project on vs2008, vs2008 printed errors below. how remove errors........? t.t error 1 error c2440: 'initializing': can not convert 'atl :: atl module registerwndclass infoparamw :: lpcstr' (lead) in 'lpcwstr'. c: \ programme files (x86) \ microsoft visual studio 9.0 \ vc \ atlmfc \ include \ atlwin.h 4573 error 2 error c2440: '=': can not convert 'lpcwstr' (lead) in 'atl :: atlmoduleregisterwndclassinfoparamw :: pcxstr'. c: \ programme files (x86) \ microsoft visual studio 9.0 \ vc \ atlmfc \ include \ atlwin.h 4590 error 3 error c2664: 'atl :: atlmoduleregisterwndclassinfoparamw :: getclassinfoexa': can not convert 'atl :: atlmoduleregisterwndclassinfoparamw :: pcxstr' (lead) in (a) 'lpcwstr' parameter 2. c: \ prog...

php - validate URL by FILTER_VALIDATE_URL -

php - validate URL by FILTER_VALIDATE_URL - i validating url filter_validate_url function. $url_1 = "http://example.com"; $url_2 = "http://http://example.com"; if (filter_var($url_1, filter_validate_url)) { echo "url valid"; } else { echo "url invalid"; } it's giving me valid url message in $url_1 , $url_2 . shouldn't that. sec url not valid. what's right way solve issue? thanks. as per docs on validation filters, filter_validate_url validate url rfc 2396 standards. there's been give-and-take on examples still pass filter_validate_url filter. this means can utilize filter some validation, can't depend on solely if need 100% valid url conditions still satisfy rfc, plus valid url still homecoming 404 . your best approach test valid url test url after validating as per answer php validation

core data - ios save Image Offline -

core data - ios save Image Offline - i have application receive images webservices , show them in list illustration film theatre schedule my question : possible store images in core info or else can show them when user not connected net ? yes can. // save image disk nsstring *documentarypath = [nssearchpathfordirectoriesindomains(nsdocumentdirectory, nsuserdomainmask, yes) objectatindex:0]; nsstring *filepath = [nsstring stringwithformat:@"%@/image.png",documentarypath]; nsdata *data = [nsdata datawithdata:uiimagepngrepresentation(your_image)]; [data writetofile:filepath atomically:yes]; // retrieve image - (nsdata *) imagedata { nsstring *docdir = [nssearchpathfordirectoriesindomains(nsdocumentdirectory, nsuserdomainmask, yes) objectatindex:0]; nsstring *pngfilepath = [nsstring stringwithformat:@"%@/image.png",docdir]; nsdata *dataimage = [nsdata datawithcontentsoffile:pngfilepath]; homecoming dataimage; ...

java - Where come from this header date in response? (spring-saml2 with Tomcat) -

java - Where come from this header date in response? (spring-saml2 with Tomcat) - i'm using spring-security-saml2 api found connections. it worked while lately experienced troubles date in response header. when filter org.springframework.security.saml.samlprocessingfilter called (url -> /saml/sso/alias/defaultalias ), response contains header date , date sometimes 2 hours late. hence error etat http 401 - authentication failed : response issue time either old or date in future, skew 60, time 2014-10-22t08:25:55.967z (tested @ 10h25) i've not thought how date retrieved , why behaviour happens periodically. i'm looking clue. thanks. what time-zone in? 2014-10-22t08:25:55.967z in utc, 2 hr difference between local time explained beingness in gmt+2 (e.g. french republic summer time). my guess clock between idp , sp not correctly synchronized, , time difference between creation of response object (2014-10-22t08:25:55.967z) , time on sp machine goes...

angularjs - Protractor switchTo -

angularjs - Protractor switchTo - i have angularjs app containing iframe display page allowing log website. trying set value in fields contained in iframe can't find elements using locator. here test : describe("harvest", function() { beforeeach(function () { browser.get('http://localhost:8110/'); expect(browser.getcurrenturl()).tomatch('_*#/login$'); element(by.model('user.username')).sendkeys('sam'); element(by.model('user.password')).sendkeys('pass'); element(by.id('bt_signin')).click(); }); aftereach(function () { browser.executescript('window.sessionstorage.clear();'); }); describe('a user', function () { beforeeach(function () { browser.get('http://localhost:8110/'); }); it('should able obtain access token harvest', function () { expect(browser.getcurrenturl()).tomatch('_*#/home$'); //display , close window element(by.id('bt...

c - How to print Bytes in order in a endian-portable way? -

c - How to print Bytes in order in a endian-portable way? - i used simple function extensively in multi-threaded program: char *serial2string(char *serial) { static char str[length * 2 + 1]; sprintf(str, "%08x%08x", ntohl(*(uint32_t *)(&serial[0])), ntohl(*(uint32_t *)(&serial[length / 2]))); homecoming str; } i phone call different thread context, , static variable not protected against concurrency. bug happen sooner or later... created function simplify code needed, created concurrency issue. looking way either: have function concurrent-safe. holding mutex work. create code uglier/heavier already. have macro or one-liner doing same thing simple plenty copy/paste everywhere need it. inlining works believe there better way. in other words, how can print length bytes in order portable way (from endianness point of view) in thread-safe way? edit phone call straight in printf statement: printf("error...

windows phone 8 - How to crop an image to 9 pieces -

windows phone 8 - How to crop an image to 9 pieces - i have image , 9 little images. crop image 9 pieces , show them on 9 little images. utilize windows phone 8. have me ? thank you sourcebitmap writeablebitmap for example, lets have xaml (where bigimage image want crop) class="lang-xaml prettyprint-override"> <scrollviewer> <stackpanel> <image x:name="bigimage" source="/assets/alignmentgrid.png"></image> <image x:name="cropimage1"></image> </stackpanel> </scrollviewer> then in code behind class="lang-c# prettyprint-override"> using system.windows.media.imaging; // using writeablebitmapex private void phoneapplicationpage_loaded(object sender, routedeventargs e) { // create writeablebitmap bigimage source writeablebitmap wb = new writeablebitmap((bitmapsource)this.bigimage.source); // ...

c - Old gcc compiler on matlab -

c - Old gcc compiler on matlab - i using matlab on linux mint. have c programme want used mex command follows: mex /home/.../binary.c -output binary_m but next error warning: using gcc version "4.8.1-10ubuntu9)". version supported mex "4.4.6". list of supported compilers see: http://www.mathworks.com/support/compilers/current_release/ /home/.../binary.c:43:19: fatal error: binary.h: no such file or directory #include "binary.h" ^ compilation terminated. mex: compile of ' "/home/.../binary.c"' failed. i think have downgrade gcc compiler on matlab don't know how. any help appreciate it. regards this has nil warning regarding compiler version; don't pay attending that, fine. might have had problems trying compile c++11 sources, depending on matlab version, compiler version , mex command flags, not case. here problem: c programme binary.c contai...

html - Divs being pushed down when windows is made smaller -

html - Divs being pushed down when windows is made smaller - pretty new html , css , i'm having problem described in title. nav pushing downwards div id main. nav{ width:120px; float:left; margin:0px 5px 0px 5px; #main{ display:inline-block; padding: 1em; float:left; position:relative; min-width: 900px; any help appreciated, cheers. edit: hi guys, maybe should explain better. on page there nav left , div right of it. when windows width made smaller div right beingness pushed below nav instead of remain , it's content beingness displayed off screen. you have explicitly told element behave that. when set min-width , width in pixels, telling elements remain same size no matter happens. remove min-width , set width percentage value 1% instead of 50px this: class="snippet-code-css lang-css prettyprint-override"> nav { width: 50%; background: red; height: 50px; float:left; } #main { display: inline-block; height:...

c++ - Copying std::unique_ptr's value via dereferencing -

c++ - Copying std::unique_ptr's value via dereferencing - i wrote next code seek re-create value of unique_ptr object structure. #include <iostream> #include <memory> using namespace std; struct s { s(int x = 0, int y = 0):x(x), y(y){} // s(const s&) {} // s& operator=(const s&) { homecoming *this; } int x; int y; std::unique_ptr<s> ptr; }; int main() { s s; s.ptr = std::unique_ptr<s>(new s(1, 4)); s p = *s.ptr; // re-create pointer's value homecoming 0; } it pops errors in visual c++ 2012: intellisense: no suitable user-defined conversion "s" "s" exists intellisense: no operator "=" matches these operands operand types are: std::unique_ptr> = std::unique_ptr> error c2248: 'std::unique_ptr<_ty>::unique_ptr' : cannot access private fellow member declared in class 'std::unique_ptr<_ty>' unless uncommen...

javascript - Change table row color on hover (jQuery or CSS) -

javascript - Change table row color on hover (jQuery or CSS) - my problems got 'highlighted' (meaning they've got own background color highlight them) cells in table won't alter background color when utilize code alter color of entire row when mouse hoovering on them. hoovering on row changes background color of cells aren't highlighted. how prepare entire row changes background color? i've got html table: class="snippet-code-js lang-js prettyprint-override"> $(window).load(function() { $('#infotable tr').hover(function() { $(this).addclass('hover'); }, function() { $(this).removeclass('hover'); }); }); class="snippet-code-css lang-css prettyprint-override"> #infotable td { padding:0.7em; border:#969696 1px solid; } .highlight { background:#daffd6; } .hover { background:yellow; } class="snippet-code-html lang-html prettyprint-override...

php - FOSRestBundle - POST went fine, but when use PUT/PATCH $request is null -

php - FOSRestBundle - POST went fine, but when use PUT/PATCH $request is null - i next tutorial http://welcometothebundle.com/symfony2-rest-api-the-best-way-part-3/ , i've added new entity, author. using get, post , delete goes expected, when using set or patch result: [{"message":"an exception occurred while executing 'insert author (id, name, password) values (?, ?, ?)' params [16, null, null]: \n\nsqlstate[23502]: not null violation: (...) this header receive: allow →get, put, patch, delete cache-control →no-cache connection →keep-alive content-type →application/json date →tue, 28 oct 2014 14:30:10 gmt server →nginx/1.1.19 transfer-encoding →chunked x-debug-token →6d899c x-debug-token-link →/api/_profiler/6d899c x-powered-by →php/5.4.33-2+deb.sury.org~precise+1 this php code public function putauthoraction(request $request, $id) { seek { if (!($author = $this->container->get('acme_blog.author.handler')-...

websocket-rails connection initialization - dispatcher.state stuck on "connecting" -

websocket-rails connection initialization - dispatcher.state stuck on "connecting" - i trying set basic websocket client ror app. i've used websocket-rails gem matter. i've set simple eventmap mapping. config/events.rb: websocketrails::eventmap.describe namespace :tasks subscribe :create, :to => taskcontroller, :with_method => :create end end and simple controller: app/controller/task_controller.rb: class taskcontroller < websocketrails::basecontroller def create puts "in task create" send_message :create_success, task, :namespace => :tasks end end and initialization client side: $(function() { var task = { name: 'start taking advantage of websockets', completed: false } var dispatcher = new websocketrails('localhost:3000/websocket'); dispatcher.on_open = function(data) { alert("on_open"); console.log('connection has been established: '...

xml - DOS Batch: extract from string -

xml - DOS Batch: extract from string - i need extract strings included between xml tags. why code below not working ? shell window opens , closes downwards immediatly, despite 'pause' instruction. @echo off set var="<aaa>e086263-t1999</aaa>" f/ "delims=>< tokens=2" %%a in (%var%) echo %%a pause many help ! xml batch-file text-extraction

android - How do I retrieve Intent Extras within a Service started by an AlarmManager schedule? -

android - How do I retrieve Intent Extras within a Service started by an AlarmManager schedule? - public void oncreate() { super.oncreate(); int idfunc = getapplicationcontext().getsharedpreferences(spref_name,context.mode_private).getint("idfunc", 0); string seckey = getapplicationcontext().getsharedpreferences(spref_name,context.mode_private).getstring("chave", null); intent intent = new intent(getapplicationcontext(), serviceenviaclientes.class); bundle bundle = new bundle(); bundle.putstring("seckey", seckey); bundle.putint("idfunc", idfunc); intent.putextras(bundle); pendingintent pintent = pendingintent.getservice(getapplicationcontext(), 0, intent, 0); alarmmanager alarm = (alarmmanager)getsystemservice(context.alarm_service); alarm.setrepeating(alarmmanager.rtc_wakeup, calendar.getinstance().gettimeinmillis(), 10*60000, pintent); initimageloader(this); } i'm trying pass extras p...

perl - LWP::UserAgent and login credentials -

perl - LWP::UserAgent and login credentials - i'm trying set credentials lwp::useragent, i'm not able log in. $username , $passwd correct. don't understand should set in 3rd argument (according dos $realm , here authentication ). here snippet: my $browser = lwp::useragent->new(agent => 'mozilla/5.0 (windows; u; windows nt 5.1; en-us; rv:1.8.0.5) gecko/20060719 firefox/31.2.0', $browser->credentials("domain.com:80", "authentication",$username, $passwd); $response=$browser->get("http://domain.com/page"); print $response->content; i corrected realm @thissuitisblacknot suggested: close browser , reopen it. navigate http://domain.com/page. if site using basic authentication, should popup says username , password beingness requested http://domain.com. site says: "foo bar". in case, foo bar realm. then able login, pages empty. have added cookie: $browser->cookie_jar({ file => ...

android - Moto360 addview with black bar on bottom -

android - Moto360 addview with black bar on bottom - everyone. seek attach total screen view moto360. however, when works on lg/samsung square devices. left black out bar on bottom, same size of original black bar on bottom. bug or what? ever found happened? here's code: displaymetrics metrics = getapplicationcontext().getresources().getdisplaymetrics(); float width = metrics.widthpixels; float height = metrics.heightpixels; log.d(tag, "width: " + width + " height:" + height); // attatch view windows windowmanager.layoutparams wmparams = new windowmanager.layoutparams(); wmparams.type = layoutparams.type_system_error; wmparams.format = pixelformat.rgba_8888; wmparams.flags = layoutparams.flag_not_touchable | layoutparams.flag_not_focusable | layoutparams.type_system_overlay; wmparams.gravity = gravity.top | gravity.top; wmparams.x = 0; wmparams.y = 0; wmparams.width = me...

mysql - how to combine tables with 1 to many relationship into 1 line of record -

mysql - how to combine tables with 1 to many relationship into 1 line of record - i need combine 2 tables 1 many relationship using union no success. i've been trying utilize code select a.equipmentid, a.codename, a.name, a.labelid, a.acquisitiondate, a.description tbl_equipmentmst a.partofid = '57' union select first 1 b.warrantyid, b.startdate, b.enddate tbl_equipwarranty b inner bring together tbl_equipmentmst c on b.equipmentid=c.equipmentid c.partofid = '57' , b.servicetype='service' order b.warrantyid desc union select first 1 d.warrantyid, d.startdate, d.enddate tbl_equipwarranty d inner bring together tbl_equipmentmst e on d.equipmentid=e.equipmentid e.partofid = '57' , d.servicetype='product' order d.warrantyid desc can help me how produce expected output in image. using firebird database. if have solution in mysql kindly tell me , sick seek find counterpart in firebird. the secret bring together on tbl_equ...

objective c - SKShapeNode Positioning -

objective c - SKShapeNode Positioning - i'm poking around spritekit , encountered weirdness i.e i'm adding rectangular skshapenode that should fullscreen on iphone override func didmovetoview(view: skview) { allow _box = skshapenode(rectofsize: self.frame.size) _box.strokecolor = skcolor.bluecolor() _box.fillcolor = skcolor.bluecolor() _box.position = cgpointmake(200, 200) _box.name = "box" self.addchild(_box) allow _player = skshapenode(circleofradius: 50) _player.position = cgpoint(x:cgrectgetmidx(self.frame), y:cgrectgetmidy(self.frame)) _player.fillcolor = skcolor.redcolor() _player.strokecolor = skcolor.redcolor() _player.name = "player" _player.physicsbody = skphysicsbody(circleofradius: 50) _player.physicsbody?.dynamic = true _player.physicsbody?.allowsrotation = false self.addchild(_player) allow _ground = sksha...

javascript - CSS transition not working on Firefox -

javascript - CSS transition not working on Firefox - i have div #im1 initial position left:-300px; when button .abtme_link clicked javascript changes it's position 443px; it's working on every other browser firefox; i've seen other posts on matter can't seem create work; 1 of thread concluded css transition doesn't work on firefox, if that's case; there workaround? #im1{ width:400px; position:absolute; left:-300px; transition:all .9s ease .5s; -webkit-transition:all .9s ease .5s; -moz-transition:all .9s ease .5s; -o-transition:all .9s ease .5s; -ms-transition:all .9s ease .5s; } $('.abtme_link').click(function() { $('#im1').css('left','443px'); }); ok i've found solution, i've added delay function in js , it's working fine. don't know why or how it's working. settimeout(function(){ $('.im1').css('left','443px'...

javascript - how to define nested routes + ember not rendering template for nested route -

javascript - how to define nested routes + ember not rendering template for nested route - i have rails 4 + emberjs application. trying create nested routes in ember. refering 'nested routes' section http://emberjs.com/guides/routing/defining-your-routes/. defiend routes post work fine routes 'comments' dont work. current ember routes as: app.router.map -> @resource 'posts', -> @route 'edit', path: '/:id/edit' @route 'show', path: '/:id' @resource "comments", path: '/:post_id/comments' , -> @route "new" i have commentsnewroute file as: app.commentsnewroute = ember.route.extend model: (params) -> post: @store.find 'post', params.post_id and have template comments.handlebars containing {{outlet}} , comments/...

c++ - convert array sting into char -

c++ - convert array sting into char - i have taken txt file , place line line array of string. trying split string can save word word in separate array. kindly tell me how shell convert array of string char. for illustration string line[15]; // line[0] has : there before // line[1] has : after char * pch; char *c = line.c_str(); // string char (i getting error here. body know?) pch = strtok (c," "); while (pch != null) { printf ("%s\n",pch); pch = strtok (null, " "); } error: c2228: left of '.c_str' must have class/struct/union string line[15]; array of strings. when have line.c_str(); line pointer string , not string itself. pointer doesn't have .c_str() method , that's why compiler complaining. (pointers don't have methods , hence compiler tells left hand side of look must class/struct/union type). prepare want index array string. can like: line[0].c_str(); additional...

Reading and outputting integers from a file in C -

Reading and outputting integers from a file in C - i created file content: '12 7 -14 3 -8 10' i want output numbers of type integer. after compiling , running program, first number '12' here's code: #include <stdio.h> main(){ file *f; int x; f=fopen("c:\\users\\emachines\\desktop\\ind\\in.txt", "r"); fscanf(f, "%d", &x); printf("numbers: %d", x); fclose(f); } what doing wrong? you scan one integer file using fscanf , print it.you need loop integers. fscanf returns number of input items matched , assigned.in case, fscanf returns 1 on successful scanning. read integers file until fscanf returns 0 this: #include <stdio.h> int main() // utilize int main { file *f; int x; f=fopen("c:\\users\\emachines\\desktop\\ind\\in.txt", "r"); if(f==null) //if file failed open { printf("opening file failed.exiting..."); ...

mysql - Slick query with multiple joins, group by and having -

mysql - Slick query with multiple joins, group by and having - i'm new scala , slick. i'm trying understand way should create queries slick. i've got far have been able create simple queries struggle combinding selects, joins, grouping bys etc. i'm in middle of converting virtual bookshelf (meade php) scala, play , slick. this query want accomplish: list authors (limit 5), whom have @ to the lowest degree 3 books in bookshelf. select a.id, a.firstname, a.lastname, count(b.id) amount book b left bring together book_author ba on b.id = ba.book_id left bring together author on a.id = ba.author_id grouping a.id having amount >= 3 order amount desc limit 5 apparently next code have managed create required joins: (for(b <- books; <- authors; ba <- bookauthors; if b.id === ba.bookid && a.id === ba.authorid) yield (a.id, b.id)).run i'm lost on how apply select, groupby , having code a...

Akka actor response caching -

Akka actor response caching - i'm using akka on 1 of projects , need state of actor, way i'm doing follows. a rest request comes in @get @produces(array(mediatype.application_json)) def get() = { seek { await.result((getscanningactor ? workinfo), 5.second).asinstanceof[scanrequest] } catch{ case ex: timeoutexception => { requesttimedout() } } } on actor respond current work state case workinfo => sender ! currentwork for reason first time phone call function right value, on next requests same value received on first call i'm using dcevm if makes difference. akka

html - How to convert mouse position into css 3d transformed element position -

html - How to convert mouse position into css 3d transformed element position - as shown in jsfiddle, when move mouse on 3d transformed div, tried convert mouse position css 3d transformed element space. which means, reddish spot should display @ exact position of mouse. however, div html element doesn't have method getscreenctm or gettransformtoelement or matrixtransform can used transform point. know how accomplish that? http://jsfiddle.net/9cv2y0dp/ var tel = $('#transformed')[0]; var box = $('#box')[0]; tel.style.transform = 'translate3d(100px,100px,0px) rotatey(45deg)'; var rect = tel.getboundingclientrect(); $('#transformed').bind('mousedown', function(e){ var evt = e || event; var x = evt.clientx; var y = evt.clienty; $('#cursor')[0].style.left = (x - rect.left) + 'px'; $('#cursor')[0].style.top = (y - rect.top) + 'px'; box.innerhtml = (x - rect.left) + '...

maven - How to make Java serviceLoader of a external library work -

maven - How to make Java serviceLoader of a external library work - i'm working on plugin 3rd party software quite undocumented. plugin i'm using external lib (.jar) managed maven , later on executed on tomcat server. working great till updated latest release of library, using java.util.serviceloader in order load concrete implementation of interface. when build, project has bundle construction on tomcat server: mypluginpackage.jar | ---meta-inf ---lib | --- theexternallibusingserviceloader.jar | ---meta-inf | ---services | --- full.path.to.thefactoryinterface ---external.lib.path | --- thefactoryinterface.class --- theconreteclass.class --- myplugincore.jar | ---meta-inf --- my.plugin.path | --- myclassusingtheexternallib.class as can see, external library has right services entry necessary serviceloader find concrete of interface wi...

c# - how to get the column index of the gridview -

c# - how to get the column index of the gridview - i have 2 image buttons in gridview used selection. populate textboxes. need when click imagebutton "edit" should populate textboxes gridview , when imagebutton "delete" pressed same , disbale textboxes too. point not getting logic of how column indexes programmatically. help me out condition. issue c# code. here snippet have tried: protected void gridview1_selectedindexchanged(object sender, eventargs e) { var row = gridview1.selectedrow; if (condition) { _propertytitle.text = row.cells[1].text; _address.text = row.cells[2].text; } else { _propertytitle.text = row.cells[1].text; _propertytitle.enabled = false; _address.text = row.cells[2].text; _address.enabled = false; } } } it not clear question trying achieve.but ...

javascript - Detect manually vs programmatic change in checkbox state ExtJS 4.1 -

javascript - Detect manually vs programmatic change in checkbox state ExtJS 4.1 - i'm using checkbox component on extjs 4.1 application. set event on alter event , logic if checkbox checked or unchecked. problem have that, change event fires automatically on page load event if user has not checked checkbox manually. does know how can observe if checkbox value (checked or unchecked) has been alter user or how prevent alter event firing automatically on page load? thanks in advance help you can utilize dirtychange event you can check checkbox.isdirty() parameter class="snippet-code-js lang-js prettyprint-override"> //function called on alter event onchange: function() { if (checkbox.isdirty() { //do something(option 1) } else { //do nothing(option 2) } } javascript extjs extjs4.1

jquery - Php Cookie Ignored -

jquery - Php Cookie Ignored - i have module should using php create cookie if doesn't exist. if doesn't confirm cookie's existence creates , implements js file, shows overlay. otherwise function should end. problem, js loads on every refresh though shouldn't. please help, highly appreciate it, give thanks you. cookie php <?php /** * @file * checks cookie, non-existent: creates cookies + implements js, else * removes specfic content */ /* * implements hook_preprocess_page(). */ function cookie_check_preprocess_page($hook, &$variables) { // check cookie if (!isset($_cookie['firsttime'])) { // set variables setcookie $name = 'firsttime'; $value = 'no'; // 6 months $expire = time()+(15768000); // directory $path = '/~wolfden/'; $domain = 'hitechwolf.com'; // create cookie s...

grails - Run only integration tests on a Maven exec -

grails - Run only integration tests on a Maven exec - i want run integration tests using grails-maven-plugin. setup profile run exec command such: <profile> <id>run-tests</id> <build> <plugins> <plugin> <groupid>org.grails</groupid> <artifactid>grails-maven-plugin</artifactid> <version>${grails.version}</version> <executions> <execution> <id>grails-integration-tests</id> <phase>integration-test</phase> <goals> <goal>exec</goal> </goals> <configuration> <command>test-app</command> ...

sql - SqlCacheDependency multiple / bulk updates -

sql - SqlCacheDependency multiple / bulk updates - i'm trying understand how sqlcachedependency works in mass update situation. understand how set , if create 1 row alter in database cache becomes invalid. my question if mass update on table has 100 rows update mytable set col = 1 question do 100 invalidate notifications, or smart plenty know info changed , 1 notification sent, invalidates info once? i'm using similar this:example my concern if invalidates on , on 1 time again hitting database 100 times fresh info , have think of alternative strategy. regards dotnetshadow sql asp.net sql-server

database - How to dynamically create an auto increment primary key for item id in iOS? -

database - How to dynamically create an auto increment primary key for item id in iOS? - i have database storing list of items. want give id each of these items , fetch / update details of item db. i have used appcoda's sqlite db manager , doing in mvvm way. so, how maintain track of item id or auto increment id everytime? tried include id variable in viewdidload, but, gets reinitialized everytime app loads. primary key cant unique. how resolve issue? thanks you can utilize nsuserdefaults keys, never gets destroyed until app uninstalled, suppose have id 'int itemid = 1' can save in nsuserdefaults so, [[nsuserdefaults standarduserdefaults] setvalue:[nsnumber numberwithint:itemid] forkey:@"id"]; [[nsuserdefaults standarduserdefaults] synchronize]; every time need write these 2 lines when want update id's count. fetch value userdefauts int itemid = [[[nsuserdefaults standarduserdefaults]valueforkey:@"id"]intvalue]; ...

principalcontext - GetMembers(true) don't list all users of membergroup -

principalcontext - GetMembers(true) don't list all users of membergroup - at first here code: principalcontext ctx = new principalcontext(contexttype.domain, "domain"); groupprincipal gpx = groupprincipal.findbyidentity(ctx, identitytype.name, "otheradmingroup"); list<string> members = new list<string>(); foreach(principal fellow member in gpx.getmembers(true)) { members.add(member.samaccountname.tolower()); } gpxadmins.dispose(); ctx.dispose(); homecoming members; the fellow member of "otheradmingroup" "domain admins" group, contains 6 ad-users. after executing code above, returned list contains first 4 members of "domain admins" i've found problem. the getmembers() method don't find users have grouping there primary group. principalcontext groupprincipal

android - Get X and y Coordinates of child view of relative layout pinch zoom? -

android - Get X and y Coordinates of child view of relative layout pinch zoom? - // here xml <com.example.zoomrelative.zoomablerelativelayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:id="@+id/rlcontainer" android:layout_width="match_parent" android:layout_height="match_parent" tools:context="com.example.zoomrelative.mainactivity$placeholderfragment" > <imageview android:id="@+id/image" android:layout_width="wrap_content" android:contentdescription="@string/app_name" android:layout_height="wrap_content" android:layout_centerinparent="true" android:background="@drawable/ic_launcher" /> </com.example.zoomrelative.zoomablerelativelayout> // jav...

java - mediaPlayer doesn't play -

java - mediaPlayer doesn't play - i trying build splash screen music in background, music doesn't play. here code: bundle com.example.thebasicseries; import android.support.v7.app.actionbaractivity; import android.content.intent; import android.media.mediaplayer; import android.os.bundle; import android.view.menu; import android.view.menuitem; public class mainactivity extends actionbaractivity { mediaplayer logomusic; @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.splash); logomusic = mediaplayer.create(mainactivity.this,r.raw.techno ); thread logotimer = new thread(){ public void run(){ try{ sleep(5000); intent menuintent = new intent("com.example.thebasicseries.menu"); startactivity(menuintent); } grab (interruptedexception ...

uml - What's the difference between a centralized and a distributed sequence diagram? -

uml - What's the difference between a centralized and a distributed sequence diagram? - i'm new uml , have crossed path sequence diagram, , realized there's 2 types: distributed , centralized. can explain me differences? centralized control, 1 participant doing of processing , other participants there supply data. example: distributed control, in processing split among many participants, each 1 doing little bit of algorithm example: both styles have strengths , weaknesses. people, particularly new objects, more used centralized control. in many ways, it’s simpler, processing in 1 place; distributed control, in contrast, have sensation of chasing around objects, trying find program. despite this, object bigots prefer distributed control. 1 of main goals of design localize effects of change. info , behavior accesses info alter together. putting info , behavior uses in 1 place first rule of object-oriented design. furthermore, distributing co...

python - How to get 100% in my coverage tests for a model? -

python - How to get 100% in my coverage tests for a model? - i have installed coverage on django project. output is: name stmts miss cover ---------------------------------------------------------------- test.apps.testapp.models.company 15 5 67% 2, 19-25 ------------------------------------------------------------ i have tested can think of model, 5 missed referring to? here model: class company(models.model): """ describes company within system. """ name = models.charfield(max_length=60) address_line1 = models.charfield(max_length=120) address_line2 = models.charfield(max_length=120, null=true, blank=true) address_city = models.charfield(max_length=120) address_county = models.charfield(max_length=120, null=true, blank=true) address_country = models.charfield(max_length=4, choices=country_choices, default="us") address_postc...

Closing element tags in php -

Closing element tags in php - i have started larn php books , have come across don't understand. in book never close html tags right practice or should closed? here illustration of books content: <?php $cars = array('dodge'=>'viper','chevrolet'=>'camaro','ford'=>'mustang'); echo '<dl><dt>original element order:<dd>'; foreach($cars $key => $value){ echo '&bull;', $key.' '.$value; } ?> could tell me if right , mutual practice? thanks some old books :). need closed. need echo </dd></dt></dl> after foreach loop. php

multithreading - Visual Studio: How to breakpoint at a yet-unknown location? -

multithreading - Visual Studio: How to breakpoint at a yet-unknown location? - i'm working on rather complex, multithreaded app not owned 1 person. out of many messageboxes correct, there's @ to the lowest degree 1 needs different message. can through ui, have no thought in code. if pause debugger @ point, goes application.run(...) method phone call , phone call stack empty. how can tell messagebox is? can have break close messagebox , take me code did it? or perhaps pause threads , allow me see 1 close messagebox.show(...) looks right? i'm using vs2008. this code has lot of messageboxes varying patterns. utilize messagebox.show(...) while others utilize owner.invoke(new messageboxshowdelegate(messagebox.show),...). few include message directly; either passthrough exception message or strings database. i'm 1 in long string of people have modified code without much internal documentation, there's no overall construction can see. ...

relational database - How to relate tables in Mysql -

relational database - How to relate tables in Mysql - i making music download website. in there 3 tables named song_tbl, artist_tbl, album_tbl. song_tbl artist_tbl album_tbl every song has artist. problem songs have more 1 artist (example: song2 may have 2 artist=petersn , artist 3). how can manage that. give thanks help. you need have table song_artist_tbl links songs artists. should have 2 columns: song_id , artist_id, , if song 2 linked artists 2 , 3, have : song_artist_tbl song_id artist_id 2 2 2 3 then can remove artist_id column song_tbl table mysql relational-database

css - Radio Select with Image but Hide Radio Button and use image to select -

css - Radio Select with Image but Hide Radio Button and use image to select - using opencart version 2.0.0 within product.tpl page there foreach alternative loop contains this <?php if ($option['type'] == 'image') { ?> <div class="form-group<?php echo ($option['required'] ? ' required' : ''); ?>"> <label class="control-label"><?php echo $option['name']; ?></label> <div id="input-option<?php echo $option['product_option_id']; ?>"> <?php foreach ($option['product_option_value'] $option_value) { ?> <div class="radio"> <label> <input type="radio" name="option[<?php echo $option['product_option_id']; ?>]" value="<?php echo $option_value['product_option_value_id...

Php showing html tags in browser -

Php showing html tags in browser - php not encoding html tags , instead of printing html tags in browser. <!doctype html public "-//w3c//dtd xhtml 1.0 strict//en" "http://www.w3.org/tr/xhtml1/dtd/xhtml1-strict.dtd"> <html lang="en" xml:lang="en" xmlns="http://www.w3.org/1999/xhtml" xmlns:fb="http://www.facebook.com/2008/fbml" xmlns:og="http://ogp.me/ns#"> <head> <title></title> <meta charset="utf-8"> <meta http-equiv="x-ua-compatible" content="ie=edge,chrome=1"> <meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport"> <meta name="apple-mobile-web-app-capable" content="yes" /> <link href="https://sds.com//sdsd/index.php?storename=all&insertedid=100&references=externalsite&fbrefresh=20140820083315" rel="canonical...

c# - RadioButtonList and TextBox not updating in FormView -

c# - RadioButtonList and TextBox not updating in FormView - i have asp.net 4.0 formview bound sqldatasource, using sql server 2008. opens in edit mode default, , binding , updating working fine until today when added 1 more radiobuttonlist , textbox it. new radiobuttonlist , textbox display info correctly, when update, info doesn't added database. else still works before. i'm sure i'm doing dumb, i'm under time crunch , don't see it. love post html, in code blocks, every time seek submit question, error message ("an error has occurred). so, here's can tell you: there more 1 radiobuttonlist on page, , more 1 textbox. radiobuttonlists , textboxes on page before today work fine. display info database, , save info database. new radiobuttonlist different in has onselectedindexchanged event, causes new textbox value change. new textbox uses formatting display date mm/dd/yyyy, unlike other textboxes display info straight database. other that, can...