Posts

Showing posts from July, 2013

java - Create new object vs setting its variables inside a function -

i have rectangle class , constructor sets every variable (x, y, width, height) specific value. after rectangle being created, if want change of values. that, more efficient have function rect.set(newx, newy, newwidth, newheight); or call constructor r1 = new rectangle(newx, newy, newwidth, newheight); on again ? (since won't referencing older rectangle anymore) public rectangle (int x, int y, int width, int height) { this.x = x; this.y = y; this.width = width; this.height = height; } public void set (int x, int y, int width, int height) { this.x = x; this.y = y; this.width = width; this.height = height; } i imagine creating new rectangle create garbage, should worse. true ? or java somehow optimize ? this rather old question. highly dependent on task. of course, creating object has overhead comparing mutating existent object, in cases negligible. overall creating new objects preferable way design point of view. hotspot jvm ...

php - Magento Session file storage needing refresh -

i've moved stores new server doesn't support memcache, i've fallen writing file system. when user visiting first time , puts item in cart nothing happens, redirects them cart page states no items added. next time user tries adding product cart visible needing refresh in order see it. same happens removing item cart, mini cart reflect in real time. seems issue write process not completing before being read? the var/sessions folder has 0777 purpose of testing. is common issue? have following file storage <session_save><![cdata[files]]></session_save> <session_cache_limiter><![cdata[]]></session_cache_limiter> when using memcache looked like <session_save><![cdata[memcache]]></session_save> <session_save_path><![cdata[unix:///var/tmp/memcached.sess.newdomain.co.nz_sessions.sock?persistent=1&weight=2&timeout=10&retry_interval=10]]></session_save_path> <session_cache_limite...

ios - New iTunes Connect in-app purchase doesn't appear in SKProductsResponse -

i've added new in-app purchase item existing application. purchase available next release of app. product appears have been created correctly , status "ready submit". unfortunately new product doesn't show in skproductsresponse data. i've checked "response.invalidproductidentifiers" , empty. i'm app's bundle id correct because i'm seeing other in-app purchases (just not new one). any ideas why behavior occur? are trying in production or sandbox? in production not appear in skproductsresponse until reviewed believe

osx - OS X / cocoa - How get event on lock screen session -

#import "appdelegate.h" @interface appdelegate () @property (weak) iboutlet nswindow *jj; @end @implementation appdelegate @synthesize jj; - (void)applicationdidfinishlaunching:(nsnotification *)anotification { // insert code here initialize application [nsevent addlocalmonitorforeventsmatchingmask:nseventmaskswipe | nseventmaskbegingesture | nseventmaskgesture | nseventmaskendgesture handler:^(nsevent *event) { nslog(@"local"); return event; }]; [nsevent addglobalmonitorforeventsmatchingmask:nseventmaskswipe | nseventmaskbegingesture | nseventmaskgesture | nseventmaskendgesture handler:^(nsevent *event) { nslog(@"global"); }]; nsdistributednotificationcenter* center; center = [nsdistributednotificationcenter defaultcenter]; [center addobserver:self selector:@selector(a) name:@"com.apple.screenislocked" object:nil]; nswindow* = [[nsapplication sharedapplication] wind...

javascript - Button redirecting to a different page -

jsfiddle link html <body> <div class="mainwrapper"> <div class="newwrapper"> <form id="newform" method="post" action="new.php"> <div class="textboxcontainer"> <input id="question" type="text" name="question" placeholder="question..." /><br /><br /> <input type="text" name="ans1text" placeholder="answer 1..." value=""/><br /> <input type="text" name="ans2text" placeholder="answer 2..." value=""/><br /> <input type="text" name="ans3text" placeholder="answer 3..." value=""/><br /> <input type="text" name="ans4text" placeh...

ios - Ionic statubar color not working -

i'm trying change font color white in statusbar ios, without success. i have set in app.js: if (window.statusbar) { // statusbar.styledefault(); statusbar.style(1); } but not work. ideas? these no such function style() available on statusbar object. these available on ngcordova version of plugin : $cordovastatusbar.style(1); , here link ngcordova wrapper of plugin. plus still if not want use wrapper need add <preference name="statusbarstyle" value="lightcontent" /> in config.xml . available values default, lightcontent, blacktranslucent, blackopaque.

php - I get this Error again n again -

this question has answer here: parse error: syntax error, unexpected end of file there no error [closed] 3 answers parse error: syntax error, unexpected end of file in c:\xampp\htdocs\ad10.php on line 22 <?php $c=mysql_connect("localhost","root","") or die("connection error"); mysql_select_db("staff") or die("database error"); $q=mysql_query("select * teachers"); echo "<table border=1> <th>number</th> <th>name</th> <th>shift</th> <th>class</th> <th>update</th> <th>remove</th>"; while($row=mysql_fetch_array($q)) { ?> <tr> <td><? echo $row['name'];?></td> <td><? echo $row['shift'];?></td> <td><? echo $row[...

java - Is possible a ActorRef change without I receive a DeadLetter message? -

i need keep actorref determinated time. while keep "watching" actorref. is possible, reason, actorref turns invalid, without receive "deadletter" ? sorry, if question seens strange. think impossible, looking documentation question not clear me. i think right - seems documentation vague on this. however, consider this: akka not provide delivery guarantees messaging. that's core of akka philosophy. consider case using remote death watch. if remote actor terminated , terminated message sent on network might not message, or might arrive delayed. in case have stale actorref you'll able discover problems when send message if subscribe "dead letters". same applies if watch on actor locally , sort of jvm error - there chance won't receive terminated message or fail process , lost. to account can build recovery , retries on top of akka. so in short there rare situations possible. correct question ask how application recover...

r - Plotting RDA (vegan) in ggplot -

Image
i'm still new r, trying learn how use library vegan, can plot in r normal plot function. problem arises when want plot data in ggplot. know have extract right data list i've created, , how? dataset i've been practicing on can downloaded here https://drive.google.com/file/d/0b1pqgov60aoudvr3dvzbx1vkahc/view?usp=sharing code i've been using data transformed this: library(vegan) library(dplyr) library(ggplot2) library(grid) data <- read.csv(file = "people.csv", header = t, sep = ",", dec = ".", check.names = f, na.strings=c("na", "-", "?")) data2 <- data[,-1] rownames(data2) <- data[,1] data2 <- scale(data2, center = t, scale = apply(data2, 2, sd)) data2.pca <- rda(data2) which gives me list can plot using basic "plot" , "biplot" function, @ loss how plot both pca , biplot in ggplot. color data points group, e.g. sex. great. there ggbiplot(...) function in pack...

objective c - Adding photos from photo album into an app to display in a tableView - IOS -

i'm working on app allow me select photos photo album copy app viewing them in tableview. have view has add button , view button. when add button pressed uiimagepickercontroller displays showing me photos. once select photo copy photo local app. once view button pressed tableview loaded showing of photos copied previously. i'm stuck @ portion @ moment. actual copying , storing of image future viewing. any suggestions on how accomplish this? how creating plist , add file there? thanks in advance! t if want save images uiimagepickercontroller app, best way using document directory folder, save images document folder. below post codes save image , retreive them. -(void) saveimagenamed :(nsstring *) imagename andimage :(uiimage *) image{ nsdata *pngdata = uiimagepngrepresentation(image); nsarray *paths = nssearchpathfordirectoriesindomains(nsdocumentdirectory, nsuserdomainmask, yes); nsstring *documentspath = [paths objectatindex:...

python - How do you add the Kivy directories so Sublime Text can compile using Kivy language? -

i've tried work , nothing worked. tried installing of binary directories kivy didn't work. there simple way allow sublime text understand kivy language. i using windows 10 python 2.7.10. you can follow instructions in following site: https://github.com/ivlevdenis/kivylng on windows: cd %appdata%/sublime text 3/packages/ git clone https://github.com/ivlevdenis/kivylng.git "kivy language"

android - Align and wrap imagebuttons in linearlayout -

Image
i have linearlayout has imagebuttons aligned horizontally, @ bottom of parent layout. exactly, want like: this how doing it: <linearlayout android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_gravity="end|bottom" android:background="@color/dim_foreground_disabled_material_dark" android:orientation="horizontal"> <imagebutton android:id="@+id/new_1" android:background="@drawable/_dashboard_1" android:layout_width="wrap_content" android:layout_height="wrap_content"/> <imagebutton android:id="@+id/new_2" android:background="@drawable/_dashboard_2" android:layout_width="wrap_content" android:layout_height="wrap_content"/> <imagebutton ...

jquery - How to pass parameters to php using get JSON -

i have json_data.php file , want pass parameter function inside switch statement using getjson . <?php require_once "db.php"; $db = new db(); if(isset($_get['method'])) { switch (($_get['method'])) { case 'getuserids': echo json_encode($db -> getuserids()); exit(); case 'getuser': echo json_encode($db -> getuser($userid) { exit(); // other cases go here case 'getcertcategories': echo json_encode($db -> getcertcategories()); exit(); case 'get default: break; } } how pass parameter can pass $userid getuser function? the second argument $.getjson object containing query parameters. $.getjson('json_data.php', { method: 'getuserids' }, function(response) { ... }); $.getjson('json_data.php', { method: 'getuser', userid: 'joe' }, fu...

python - How can I get only specified fields back from Eventbrite API -

i working on python script pull of live events eventbrite , export attendees first , last name, date of birth , e-mail address. however, being new both python , eventbrite api struggling how fields need directly api. so far have managed list of events looking using 1 of code examples provided eventbrite, , have managed participant list event using event id sourced eventbrite api . i have included code have pulled far: from eventbrite import eventbrite # token hard coded in eventbrite = eventbrite('mytoken') my_id = eventbrite.get_user()['id'] event_response = eventbrite.event_search(**{'user.id': my_id}) # event id hard coded in @ moment want iterate # once have list of event id's attendees_response = eventbrite.get_event_attendees("eventid") print("event") print(event_response) # debugging purposes print("attendees") print(attendees_response) the part struggling work out how specify want event id returned (t...

javascript - chart js legend template -

i'm trying make custom templates legends in chart js. after looking @ examples familiar syntax 1 thing need know how values data passed in when making chart. have template currently, "<% var segment_sum = 0;%>" + "<% (var = 0; < data.length; i++) { segment_sum += data[i].value; }%>" + "<ul><% (var i=0; i<segments.length; i++){%>" + "<li>" + "<span style=\"color:<%=segments[i].fillcolor%>\" class=\"legend-num\">" + "<%= math.round(data[i].value / segment_sum * 100) %>" + "</span>" + "<span class=\"legend-percent\">" + "%" + "</span>" + "<span class=\"legend-divider\">" + ...

jquery - Table columns have incorrect sizes in a popup -

my aim implement fixed header on table thead , tbody scrollable. my html code: <div class="scroll1" id="style-3"> <div id="empmasterformmappingdetails"> <div class="col-lg-12 wmpfrmacc"> <table id="abc" border="1" style="width:100%;" > <thead> <tr> <th>a</th> <th>b</th> <th>c</th> <th>can view can view can view</th> <th>can insert</th> <th>can delete</th> </tr> </thead> <tbody id="tbodymasterformmapping"></tbody...

c++ - gdb reports Segmentation fault - how to know where? -

i'm running program under gdb, debuging information , without optimizations. gdb reports: program received signal sigsegv, segmentation fault. [switching thread 0x7fffeffff700 (lwp 8875)] 0x0000001000000001 in ?? () from message not understand problem happened. possible extract stacktrace / problem file , line number? to point code segmentation fault has happened, should use backtrace (bt) command. there wide range of commands available inside gdb should explored make debug code efficiently possible. e.g. record code flow , replay in reverse. explore data types have breakpoints etc.

c# - How to Load next form in MDIparent's panel on clicking button on current loaded form -

i have mdiparent1 form having panel1, form1 having button form1btnnextform , form2 having button form2btnprevform. when mdiparent1 loading, form1 added controls of panel1. want remove form1 , add form2 in controls of panel1 when clicking button form1btnnextform on form1. after adding form2 if button form2btnprevform on form2 clicked form2 removed , form1 again added controls of panel1. //code mdiparent1 public partial class mdiparent1 : form { public mdiparent1() { initializecomponent(); } private void mdiparent1_load(object sender, eventargs e) { form1 f1 = new form1(); f1.toplevel = false; f1.dock = dockstyle.fill; panel1.controls.add(f1); f1.show(); } } //code form1 public partial class form1 : form { public form1() { initializecomponent(); } private void form1btnnextform_click(object sender, eventargs e) { } } //code form2 public partial class form2 : form { pu...

ssh - password prompt keep on coming on the console -

i wrote below command, copy id_dsa.pub file other server part of auto login feature. every time below message coming on console: spawn scp -o stricthostkeychecking=no /opt/mgtservices/.ssh/id_dsa.pub root@12.43.22.47:/root/.ssh/id_dsa.pub password: password: below script wrote this: function sshkeygenerate() { if ! [ -f $home/.ssh/id_dsa.pub ] ;then expect -c" spawn ssh-keygen -t dsa -f $home/.ssh/id_dsa expect y/n { send y\r ; exp_continue } expect passphrase): { send \r ; exp_continue}expect again: { send \r ; exp_continue} spawn chmod 700 $home/.ssh && chmod 700 $home/.ssh/* exit " fi expect -c"spawn scp -o stricthostkeychecking=no $home/.ssh/id_dsa.pub root"@"12.43.22.47:/root/.ssh/id_dsa.pub expect *assword: { send $rootpwd\r }expect yes/no { send yes\r ; exp_continue } spawn ssh -o stricthostkeychecking=no root"@"12.43.22.47 \"chmod 755...

javascript - body.scrollTop is not working in firefox and IE When inside Blogger -

here javascript. working in chrome not working in firefox , ie when inside blogger if (document.body.scrolltop > 5) { var header = document.getelementsbyclassname("header")[0]; header.classname = "header down" } and have trie it if (document.getelementsbytagname('body')[0].scrolltop > 5) { var header = document.getelementsbyclassname("header")[0]; header.classname = "header down" } please tell how work in firefox , ie. please javascript , no j query. i've had @ website javascript , can see in ie , firefox, document.body.scrolltop 0. see document.body.scrolltop 0 in ie when scrolling . therefore, down never added header div. need use combination of document.body.scrolltop or document.documentelement.scrolltop depending on browser in use.

ssl - Logstash-forwarder says certificate signed by unknown authority when using a self-signed certificate with SubjectAltName -

i'm trying connect logstash logstash-forwarder. communication base on ssl generate self-signed certificate follows this . got error message on logstash-forwarder side: failed tls handshake 9.21.61.19 x509: certificate signed unknown authority (possibly because of "x509: invalid signature: parent certificate cannot sign kind of certificate" while trying verify candidate authority certificate "*.*.*.*.*") if generate certificate without subject alt name, work. worked certificate can generated by: openssl req -x509 -batch -nodes -newkey rsa:2048 -keyout lumberjack.key -out lumberjack.crt -subj /cn=*.*.*.*.* but i'm hoping generate certificate can used in different kinds of host. want generate ssl certificate cn=*.*.*.*.*, alt names include *, *.*, *.*.* etc. is there suggestion on how can overcome ssl error? or better way make logstash-forwarder can work in variety of environments? turns out, when removed keyusage = digitals...

mpi - My sleep problems and sleep -

i have code supposed wait input data file, distribute data on cluster, wait processing finish, remove input file , sleep until new input file provided application. problem call "usleep" of few milliseconds makes program go sleep 10-20 seconds. see mpirun using high amount of cpu time during sleep. know usleep requested time isn't says is, think there more it. wrong code (this being first code in mpi). here relevant code: mpi_init(&argc, &argv); mpi_comm_rank(mpi_comm_world, &myid); mpi_comm_size(mpi_comm_world, &numprocs); bool newfile; while (listeningmode) { while (!newfile) { inputfile.open(inputfname.c_str(),ios::binary); if (inputfile.is_open()) { newfile = true; } else { usleep(1000); } } mpi_barrier(mpi_comm_world); // distribute data , processing here .... // , @ end if(myid == rootprocess) remove(inputfname.c_str()); newfile = false; mpi_barrier(mpi_comm_world); } // while !new...

version control - SVN folders from repository -

in our team use svn , after deleted project solution, cannot delete of it's folders. when click commit on solution shows up: http://i.stack.imgur.com/k2rga.jpg when try commit missing files error: http://i.imgur.com/tzzyznb.jpg how should resolve problem? tried go repo-prowser , delete there, not allowed. perform svn revert operation, remove scheduled addition (which deleted in meantime). after svn revert done - perform svn commit publish changes repository.

javascript - AngularJS Error: [$rootScope:infdig] 10 $digest() iterations reached -

i have 2 functions in angularjs controller file: function1(param1, param2) { var relevantobjects = []; // work return relevantobjects; } function2(relevantobjects) { var containedtimerangeobjectarray = []; // work return containedtimerangeobjectarray; } the angularjs code in html looks this: <span ng-repeat="containedtimerangeobject in vm.function2(vm.function1(param1, param2))"> {{containedtimerangeobject.type}} {{containedtimerangeobject.percentage}} </span> the problem model not become stable because in function2() new array generated @ every invocation , function1() invoced because model has chanced , on (thats guess) my question how solve problem? use function1() without function 2 way: <span ng-repeat="containedtimerangeobject in vm.function1(param1, param2)"> {{containedtimerangeobject. ...}} {{containedtimerangeobject...

java - how to notify to another thread about a file being modified -

i new java multithreading programming. know can done thread communication don't know how proceed. don't know how 1 thread notify if changes done in file. problem mentioned below. i have comma separated file in lines written. want 2 threads started main thread. csv file might appended externally/manually. 1 of thread notify second thread if changes done in csv file , second thread read file concurrently line line , perform task. thanks. you can use java.nio.file.watchservice purpose. refer tutorial from link :- the watch service api designed applications need notified file change events. suited application, editor or ide, potentially has many open files , needs ensure files synchronized file system. suited application server watches directory, perhaps waiting .jsp or .jar files drop, in order deploy them.

c# - Why does IIS return empty responses? -

Image
i published angularjs/webapi project using file system publish local iis application , can open website in browser. unfortunately, no resources such images, css etc. can loaded. when try reach file located in sub folder still receive http 200 server, body empty. can remember i´ve had issue few years can´t remember why happens. request get http://localhost/content/images/common/logotype.png http/1.1 host: xx.xxx.xx.xxx connection: keep-alive cache-control: max-age=0 accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8 upgrade-insecure-requests: 1 user-agent: mozilla/5.0 (windows nt 6.3; wow64) applewebkit/537.36 (khtml, gecko) chrome/44.0.2403.130 safari/537.36 accept-encoding: gzip, deflate, sdch accept-language: en-us,en;q=0.8,sv;q=0.6 response http/1.1 200 ok server: microsoft-iis/8.5 x-powered-by: asp.net date: tue, 25 aug 2015 07:56:12 gmt content-length: 0 as can see, there no body @ image exists in folder , can open filesystem. guess i...

delphi - How to know that user selected some row in DBGrid? -

i have dbgrid , button "delete" outside dbgrid. how can determine, user selected string in dbgrid? because if form opens , no strings selected in dbgrid, , user clicked button "delete" - need show him alert box "no strings selected! select string want delete." you need @ dbgrid1.selectedrows procedure tform24.button1click(sender: tobject); var bookmarklist: tbookmarklist; bookmark: tbookmark; i: integer; begin bookmarklist := dbgrid1.selectedrows; if bookmarklist.count = 0 showmessage('no strings selected! select string want delete') else begin := 0 bookmarklist.count - 1 begin clientdataset1.gotobookmark(bookmarklist[i]); clientdataset1.delete; end; end; end;

eclipse - mongoDB: java.lang.IncompatibleClassChangeError: Implementing class -

Image
i trying write little test-programm different databases. mongodb 1 of them , worked fine until last friday, though didn't change in java code of mongodb class. system: use ubuntu 14.04 vm package mongo-org. version of mongo 3.0.5. i run mariadb, postgresql , cassandra on vm. client, have windows 7 , eclipse. the connection , test work fine other 3 databases. and can run "mongo" client on ubuntu well. but when try out java test of mongodb, keep getting error: exception in thread "main" java.lang.incompatibleclasschangeerror: implementing class @ java.lang.classloader.defineclass1(native method) @ java.lang.classloader.defineclass(unknown source) @ java.security.secureclassloader.defineclass(unknown source) @ java.net.urlclassloader.defineclass(unknown source) @ java.net.urlclassloader.access$100(unknown source) @ java.net.urlclassloader$1.run(unknown source) @ java.net.urlclassloader$1.run(unknown source) @ java.sec...

javascript - Why can't I register a dropzone.js callback in my "ready" function? -

i have spent few days working dropzone.js first time. i have made following configuration make translation swedish , create callback (dropzonefinished) when drop : $(function () { if (currentculture == "sv-se") { dropzone.options.dropzoneform = { dictdefaultmessage: "släpp dokument här som ska laddas upp.", dictfallbackmessage: "din webbläsare har inte stöd för att ladda upp dokument genom att dra och släppa.", dictfallbacktext: "använd följande formulär för att ladda upp dokument på gammalt sätt.", dictfiletoobig: "dokumentet är för stor ({{filesize}}mib). maximal dokumentstorlek: {{maxfilesize}}mib.", dictinvalidfiletype: "du kan inte ladda upp dokument av denna typ.", dictresponseerror: "servern svarar med felkod {{statuscode}}.", dictcancelupload: "avbryt dokumentuppladdningen", dictcancel...

Batch Date Time breaks before 10am Windows 8 -

good day - able assist me below query. desired result need directory 25-08-2015-10-15 (dd/mm/yy-hh:mm) before 10 directory 8-22(hh-mm) after 10 writes :25-08-2015-10-15 (dd-mm-yy-hh-mm) below batch file: set dd=%date:~0,2% set mm=%date:~3,2% set yy=%date:~8,2% set yyyy=%date:~6,4% set hh=%time:~0,2% set mm=%time:~3,2% mkdir \makereport\%folderdate% set folderdate=%date:~0,2%-%date:~3,2%-%date:~6,4%-%time:~0,2%-%time:~3,2% mkdir \makereport\%folderdate% rem copy file date/time copy \makereport\*.csv \makereport\%folderdate%\ cd %folderdate% rem 7z.exe location path = c:\batch 7z retail.zip *.csv -pretailpass@ rem subject line email mkdir \makereport\%folderdate%\retail_%folderdate% cd.. del *.csv i have tried add: if "%time:~0,1%" == " " (set folderdate=0%time:~1,1%) else set folderdate=%time:~0,2% echo folderdate=%date:~6%%date:~3,2%%date:~0,2%_%folderdate%%time:~3,2% but must doing wrong. add lower line - think should fix issue spa...

php - Wordpress delete_attachment hook doesn't work -

i'm developing plugin uses xml file store attachments picked media gallery. need synch media gallery , xml file when attachment deleted media library, "delete_attachment" hook fits me. but...it doesn't fire. tried simpliest function doesn't work: function onwpdelete( $targetid ){ wp_die('deleted attachment ' . $targetid); }//onwpdelete add_action('delete_attachment', 'onwpdelete'); it's stored in functions.php file on plugin directory works sure because there other functions in there. thank you!

netbeans - how to apply mousemotion listener on a single cube using JOGL -

i had created 3d cube in jogl using netbeans , want perform mouse drag event on single object using mousemotion listener interface mouse drag event occured when adding other object in canvas , rotation of cube , other object performs simultaneously want rotate cube using mouse drag event so, please suggest me solution problem thank you box2.java package box2; import com.sun.opengl.util.animator; import java.awt.dimension; import java.awt.frame; import java.awt.event.mouseevent; import java.awt.event.mouselistener; import java.awt.event.mousemotionlistener; import java.awt.event.windowadapter; import java.awt.event.windowevent; import javax.media.opengl.gl; import javax.media.opengl.glautodrawable; import javax.media.opengl.glcanvas; import javax.media.opengl.gleventlistener; import javax.media.opengl.glu.glu; public class box2 implements gleventlistener, mouselistener, ...

python - Twisted exception when using ReturnValue -

i`ve got exception when using returnvalue in function @inlinecallbacks def my_func(id): yield somefunc(id) @inlinecallbacks def somefunc(id): somevar = yield func(id) returnvalue(somevar) returnvalue(somevar) file "/usr/lib64/python2.7/site-packages/twisted/internet/defer.py", line 1105, in returnvalue raise _defgen_return(val) twisted.internet.defer._defgen_return: the function works fine, raises exception. how can avoid exception? need return value function. returnvalue uses exception trick return value/s. normal, exception not cause error. detail: @inlinecallback decorator looks like def decorator(...) try: .... (func call & other logics) except exception myexcept: return myexcept.values

sql server - DateAdd( on parameter -

Image
hello i'm writing report based on weekly sales, i've attained current figure correctly , works @firstdayofweek , @lastdayofweek parameters , im trying replicate previous week, know previous week -7 days behind when run in clause , firstdayofweek = dateadd(day,-7,'2014/06/02') , lastdayofweek = dateadd(day,-7,'2014/06/08') it works , figure pre quantity , correct but when parameter and dateadd(day,-7,w.firstdayofweek) in ( select item datawarehouse.dbo.ufnsplit(@firstdayofweek, ',') ) , dateadd(day,-7,w.lastdayofweek) in ( select item datawarehouse.dbo.ufnsplit(@lastdayofweek, ',') ) i column headers nothing anywhere. ideas? here code using execute stored proc: exec weeklysalesandusw @bd=n'798664', @cgno=n'47', @scgno=n'01,02,03,04,05,06,07,08', @productclass=n'1', @‌​productcode=n'1108', @r...

excel - Split very long number into six digit groups in separate cells -

423922479012375513457178457180550138521841520952496604498873488994376453521835559200448165554637498872457131510199376418546010374080492305457150455175473104455027541303457131512688454657473104448381453997477124499977406669541303375513490137467744460072532000492113454659402360422309528706455229453997375287375205404307422865375288528497547685445471533317543758522100377090491889524347364876492562454713532610477571550018492113476326403571354101377662432466457108540287544990374720522661431462550028539028434388489113495000402360404307522832548659490117548659552057542216534207470720492312510199527500457153477572402360402360465549408089494011431462376045490117556002541123552297548234406669461755451161469724374720521319436774354059490137376689417359354101440752422184427367490117402385457142549852372653523624522660405547376669462845376702489113521319523982458016550018456997376702552488552072549167490137454828376703457143457180547386442315457134552057376661376660432264371695552057526624457128...

regex - Find if the sentence does not contains specific words -

i have regular expression find if sentence s contains specific words my query is: (?=.*hello)(?=.*hi)(?=.*hey).* but want check if sentence not contains words i have tried: (?=.*((?!hello).))(?=.*((?!hi).))(?=.*((?!hey).)).* but not works how should build query? example: this query should return true when sentence is: hi, how you? and must return false when sentence is: hi hello hey .. thanks in advance, if problem match string if 3 words/patterns don't appear in string together, here simpler solution problem: ^(?!(?=.*hello)(?=.*hi)(?=.*hey)).* or alternative solution (by de morgan's law): ^(?:(?!.*hello)|(?!.*hi)|(?!.*hey)).* ( not(a , b , c) equivalent not(a) or not(b) or not (c) ) note scans pattern many times number of words checked, , again runs permutation problem if want check whether k out of n words appear in string.

ios - How to keep always first cell of tableview on top of its tableview during scroll tableview -

i want keep first cell on top of tableview when scroll. any appreciable.thanks in advance... here how create header view uitableview - (uiview *)tableview:(uitableview *)tableview viewforheaderinsection:(nsinteger) section { uiview *sectionheaderview = [[uiview alloc] initwithframe: cgrectmake(0, 0,tableview.frame.size.width, 40.0)]; // customize per design return sectionheaderview; } now return height of - (cgfloat)tableview:(uitableview *)tableview heightforrowatindexpath:(nsindexpath *)indexpath { //return desirable height return 40; } hope helps you.

javascript - Title of each image in jQuery -

i making slideshow site. images need background images, , need image title quote on top of image. problem shows title of first background-image on images. somehow need title of individual images. var $sliderimages = $('.slideshow .field-name-field-image-carousel img'); var $sliderimagestitle = $sliderimages.attr('title'); $sliderimages.each(function(i, elem) { // create divs var img = $(elem); var div = $("<div class='sliderimage' />").css({ background: "url(" + img.attr("src") + ") no-repeat", }).append("<figcaption><span>" + $sliderimagestitle + "</span></figcaption>"); img.replacewith(div); // replace images divs }); $('.sliderimage').wrap("<figure />"); // start wrapping rendered images $('.slidesh...

cordova - Convert Phonegap Project to IBM Worklight Project -

i have designed phonegap app using jquery mobile. iam having complete project phonegap+jquerymobile. now iam learning ibm worklight, need convert project ibm worklight project. what steps have follow? cant straight forward? provide steps project in ibm worklight.. you may select upgrade straight mobilefirst platform 7.1 introduced support cordova applications, meaning upgrade path more minimal. see more here: https://developer.ibm.com/mobilefirstplatform/documentation/getting-started-7-1/foundation/hello-world/integrating-mfpf-sdk-in-cordova-applications/ you need copy web resources new app , all. remains same, added value of beng alternatively, worklight/mobilefirst platform classic hybrid apps come bundled cordova, basic step take copy on web resources (html, js, css) hybrid project generated using mobilefirst studio. install mobilefirst studio plug-in eclipse. create new hybrid project , application , add required environment ("platforms" in co...

ubuntu - Error connecting to download server on install Appcelerator Studio -

Image
this same error posted here: https://community.appcelerator.com/topic/3021/installing-on-ubuntu-14-04 i installed: oracle-jdk6 nodejs , nodejs-legacy using appcelerator x64 on ubuntu 14.04 (specs in attatchment) also ran: sudo apt-get install libjpeg62 libwebkitgtk-1.0-0 echo 'export mozilla_five_home=/usr/lib/mozilla' >> ~/.bashrc and tried: sudo apt-get install ia32-libs didn't work , instead used this: sudo -i cd /etc/apt/sources.list.d echo "deb http://old-releases.ubuntu.com/ubuntu/ raring main restricted universe multiverse" >ia32-libs-raring.list apt-get update apt-get install ia32-libs which found here: how install ia32-libs in ubuntu 14.04 lts (trusty tahr) thank you linux systems require gtk windowing system, node.js, , jdk installed before running studio. make compatible link https://platform.appcelerator.com/#/product/cli http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-213315...

Trouble mounting external disk for hadoop pod in kubernetes cluster -

background : have kubernetes cluster has spark cluster (with driver outside cluster) , hadoop pod. mounted folder path of hadoop pod 1 of external disk. issue : i'm getting below exception when spark cluster tries create checkpointing folder in hdfs. java.io.eofexception: end of file exception between local host is: "jfgubq745vn2ym-tg1isslukll1u3/10.92.0.135"; destination host is: "dev-dev-hadoop":9000; : java.io.eofexception; more details see: http://wiki.apache.org/hadoop/eofexception @ sun.reflect.nativeconstructoraccessorimpl.newinstance0(native method) @ sun.reflect.nativeconstructoraccessorimpl.newinstance(nativeconstructoraccessorimpl.java:57) @ sun.reflect.delegatingconstructoraccessorimpl.newinstance(delegatingconstructoraccessorimpl.java:45) @ java.lang.reflect.constructor.newinstance(constructor.java:526) @ org.apache.hadoop.net.netutils.wrapwithmessage(netutils.java:791) @ org.apache.hadoop.net.netutils.wrapexception(netutils.java:764) ...

c# - Overflow exception is throwing- even the value exceeds the limit -

why following code gives output -2 instead throwing overflow exception ? long x = long.maxvalue; long y = long.maxvalue + x; the actual behaviour depends on project settings, unchecked etc. ensure overflow exception use checked , e.g. checked { long x = long.maxvalue; long y = long.maxvalue + x; }

PHP, is it possible to use an anonymous function in array to get certain value? -

$arr = array( 'key1' => 1, 'key2' => 'value2', 'key3' => function() { if (someconditionsomewhere) { return 3; } else { return 'value3'; } }, ); let's @ example above. love in php. create array, type determinant values there myself , dynamic value pass function. know can pass anonymous function arrays since 5.3. not interested in function alone rather returns. if later: $arr[key3] want either 3 or 'value3' depending there. not function itself. is possible in php? you can check if it's function , use it if(is_callable($arr["key3"])) $value = $arr["key3"](); //it's function lets add () else $value = $arr["key3"]; //it's not function echo $value; or in shorter syntax $value = is_callable($arr["key3"]) ? $arr["key3"]() : $arr["key3"];

android - build/core/droiddoc.mk:158 Too many words (5411). Stop -

i try run make update-api but git error target static jar: android-support-v7-mediarouter-jellybean-mr1 (out/target/common/obj/java_libraries/android-support-v7-mediarouter-jellybean-mr1_intermediates/javalib.jar) target java: android-support-v7-mediarouter-jellybean-mr2 (out/target/common/obj/java_libraries/android-support-v7-mediarouter-jellybean-mr2_intermediates/classes) copying: out/target/common/obj/java_libraries/android-support-v7-mediarouter-jellybean-mr2_intermediates/classes-jarjar.jar copying: out/target/common/obj/java_libraries/android-support-v7-mediarouter-jellybean-mr2_intermediates/emma_out/lib/classes-jarjar.jar copying: out/target/common/obj/java_libraries/android-support-v7-mediarouter-jellybean-mr2_intermediates/classes.jar target static jar: android-support-v7-mediarouter-jellybean-mr2 (out/target/common/obj/java_libraries/android-support-v7-mediarouter-jellybean-mr2_intermediates/javalib.jar) target java: android-support-v7-medi...

selenium - Ignore all tests from specflow using [BeforeTestRun] hook -

my project has 2 default configurations (debug , release) , custom 1 called uitest. when uitest config selected changes ioc use in memory verson of database perfect ui tests. i using nunit , resharper run tests , run ui tests when uitest configuration active. i decided go [beforetestrun] hook achieve cant ignore tests. throwing exception prevent tests running show fail, prefer have them show pending or ignored. possible? [beforetestrun] public static void beforetests() { #if !uitest throw new exception("abort!"); #endif } addendum if change this: [beforetestrun] public static void beforetests() { #if !uitest assert.ignore(); #endif } then each of scenarios show ignored feature fail. the beforetestrun hook method runs once, before run starts. if want skip whole testrun, can use environment.exit(); exit run. in mstest tests show not run, not sure how nunit or resharper handles this...

json - depth = 1 doesn't work properly and it's saves Null in ManyToManyField and ForeignKey fields in Django Rest Framework -

after adding depth = 1 doesn't work properly => models.py file class state(models.model): state_name = models.charfield(max_length = 30, unique=true) def __unicode__(self): return str(self.state_name) class city(models.model): state = models.foreignkey(state, related_name='state_city') city_name = models.charfield(max_length = 30) def __unicode__(self): return str(self.city_name) class meta: ordering = ('city_name',) unique_together = ('state', 'city_name',) class snippet(models.model): created = models.datetimefield(auto_now_add=true) title = models.charfield(max_length=100, blank=true, default='') code = models.textfield() linenos = models.booleanfield(default=false) owner = models.foreignkey('auth.user', related_name='snippets') state = models.foreignkey(state,blank=true,null=true) city = models.manytomanyfield(city) => ...

javascript - React components routing do not detect localstorage changes after routing -

i built login component , when user put data , press button, localstorage store jwtoken. during routing component validated authoriziation function, easy (if user has role, return component otherwise return component shows "not authorized"). the problem when user has been logged , login component event moves user next component, appears not authorizedcomponent, strange thing when referesh browser f5 key, correct , authorized component appears. import react 'react'; import { route, browserrouter, switch } 'react-router-dom'; import login './components/login/login'; import storeselection './components/stores/storeselection'; import authhandler './security/auth'; const routerhandler = () => ( <browserrouter > <switch> <route exact path="/login" component={ login }></route> <route exact path="/store-selection" component={ authhandler(storesel...

.htaccess - 301 redirect phpbb2 to xenforo -

could please me .htaccess settings? need redirect old forum urls (phpbb2) new xenforo urls. example old: www.myforum.de/ftopic7469.html new: www.myforum.de/threads/werbelinks-hier-im-forum.7469/ same forums: old: www.myforum.de/forum61.html new: www.myforum.de/forums/wuensche-und-feedback.61/ thanks help! try following: rewriteengine on rewriterule ^ftopic([0-9]+)\.html$ /threads/$1 [r,l] rewriterule ^forum([0-9]+)\.html$ /forums/$1 [r,l] note doesn't take care of slug, but, per https://stackoverflow.com/questions/34473844/nginx-redirect-rewrite-vbulletin-urls-with-slug-to-xenforo-slug-optional/38166902#38166902 , slug part isn't mandatory, so, don't have worry it.

.net - C#, How to simply change order of class members -

hi have class derived class . : public class customer { public string date{ get; set; } public string installationno{ get; set; } public string serialno { get; set; } } then have created class named customer_u derived customer public class customer_u:customer { public string bill{ get; set; } } i have simple question. have google many time no answer. have list filled data like: list<customer_u> customer= new list<customer_u>() create excel using list. in excel colum order : bill --- date --- installtionno --- serialno. idont want order. want "bill" member last columns . how set order of member when createin class derived class there no defined order in clr class; implementation inspecting metadata of class determine how class interpreted. for example, excel library using reflection inspect class pass , reflection makes no guarantees order in things processed. other impleme...