Posts

Showing posts from April, 2012

parallel processing - Scattered indices in MPI -

i'm trying divide array between processors such each 1 takes points different parts in array. example, if a = {1, 2, 3, 4, 5, 6, 7, 8} and i'm using 2 processors, want p 1 handle {1, 3, 5, 7} , , p 2 handle {2, 4, 6, 8} . when scaling large numbers of points (millions) , processors (128), tricky. in previous versions of function, gave p 1 first chunk of points, p 2 next chunk, , on (which easy mpi_gatherv ). is there way use mpi_gatherv make work, or way use mpi_send , mpi_receive achieve it? trouble mpi_gatherv while can specify indices processors send to, still puts of p 1 before p 2 before p 3 etc.

memory management - Powershell Script Consuming more ram on 2k12r2 than on 2k8r2 -

i migrating script below 2k8r2 server 2k12r2 server. runs fine on 2k8 box 2gb of ram. when run on 2k12 box, consumes on 8gb. tips or ideas on causing this? import-module activedirectory start-transcript -path ./bbbbxfer.log -append $dn = "ldap://ldapserver/dc=bbbb,dc=pvt" $username = "uid=ldapuser,cn=service accounts,cn=config" $password = "ldappassword" $auth = [system.directoryservices.authenticationtypes]::none $de = new-object system.directoryservices.directoryentry($dn,$username,$password,$auth) $array = @() $header = 'bbbbcn' + "`t" $header += 'bbbbcompanyid' + "`t" $header += 'bbbbcompanyname' + "`t" $header += 'bbbbeffectivestartdate' + "`t" $header += 'bbbbempexemptstatus' + "`t" $header += 'bbbbemprehiredate' + "`t" $header += 'bbbbgivenname' + "`t" $header += 'bbbbinitials' + "`t" $header += &

Does jQuery have any "find or fail loudly" methods? -

consider following jquery code: $('.child').closest('.parent').find('.sibling').hide(); at every step, if nothing found, jquery fail silently (for example, if there no .parent ). sometimes makes sense, means code nothing , have troubleshoot why. i'd option like: $('.child').closest!('.parent')... meaning "fail loudly if don't find this". (bonus if enabled when developing.) is there in jquery? there's none, make easily: object.keys($.fn).foreach(function(k){ var f = $.fn[k]; if (typeof f !=='function') return; $.fn['_'+k] = function(){ var o = f.apply(this, arguments); if (o && 'length' in o && !o.length) throw "loud"; return o; } }) $("body")._find("unexisting"); // throws loud alternatively, replace existing functions when in debug mode: if (debug_mode) { // let's more cautious explicit list time

xsl fo - Gradient background for PDF -

Image
is there way add pdf gradient background using fo? background image well, doesn't matter. add page, not body region. certainly. on create svg image matches want gradient. example, using linear gradient yellow red, left right. <svg xmlns="http://www.w3.org/2000/svg" version="1.0" height="1in" width="8.5in"> <defs> <lineargradient id="grad1" x1="0%" y1="0%" x2="100%" y2="0%"> <stop offset="0%" style="stop-color:rgb(255,255,0);stop-opacity:1" /> <stop offset="100%" style="stop-color:rgb(255,0,0);stop-opacity:1" /> </lineargradient> </defs> <rect width="8.5in" height="1in" fill="url(#grad1)" /> </svg> then, insert background image region-before of page , set extent of page full height of page: <fo:root

html - bootstrap carousel images overflowing the right hand grid col -

Image
i want keep carousel , nav bar in middle 75% of screen laid screen out grid. cant recreate on fiddle if put local you'll see; screenshot: see 'block 4' on top of pic, thats col starts <div class="col-sm-3">col1 </div> <div class="col-xs-12 col-sm-6"> carousel goes here </div> <div class="col-sm-3">col3 </div> the problem images overflow onto 3rd col, how can carousel stay in middle cell/col? full code below <body> <!--rows , cols structure --> <div class="row"> <div class="col-sm-3">block1 </div> <div class="col-xs-12 col-sm-6"> <!--carouselstart--> <div class="container page-content"> <div class="hero row"> <div id="carousel-example-generic" class="carousel slide&qu

windows - Perl oneliner: print first lines into file -

i want print first 10 lines of huge file new file. oneliner can print lines on monitor: > perl -ne "print if $. < 10" in.csv i tried this: > perl -ne "print if $. < 10" in.csv >out.txt but create file out.txt without writing first lines it. wrong code? help windows 7 / strawberry perl update1: if send print result on monitor using: > perl -ne "print if $. <= 10" in.csv the program not stop, is, first ten lines output on monitor not end with: > i have stop program using ctrl+c. using simple csv-file ikegami (just rows) onliner works. assume there within csv-file. update 2: original onliner: > perl -ne "print if $. <= 10" in.csv >out.txt works. have wait seconds. csv-file 2 gb large. onliner: > perl -pe "exit if $. > 10" in.csv >out.txt gives result immediately. conclusion: first onliner goes through rows, second exit after 10 rows. sorry bother

c# - No connection could be made because the target machine actively refused it - when connecting to Azure DocumentDB -

i have been developing proof of concept application using asp.net mvc , .net 4.5, connecting documentdb on microsoft azure. although, able connect documentdb database through unit tests read , write data, not being able same through asp.net mvc application. consistently getting message "no connection made because target machine actively refused it...". worth mentioning application being run in corporate network. can point me in right direction please? seems missing obvious here. maybe connection policy, can choose between gateway , direct mode or possibility choose between tcp/https can affect problem. more information here: http://azure.microsoft.com/blog/2015/01/20/performance-tips-for-azure-documentdb-part-1-2/

ios - Segue between scenes without initializing scene -

i new swift , having immense trouble multi-scene spritekit situation. let me give background: my game attempting have 3 screens; intro, upgrade scene, , play scene. intro scene either initializes upgrade scene or initialized play scene per users touch (there 2 buttons on intro screen, choose either play or go upgrade scene). upgrade screen can press variety of buttons change variables effecting sprites speed, texture, , variety of other stuff. when finished there button user can press initialize play scene. when sprite touches node in play scene, intro screen initializes again. the tricky part have been working on trying upgrade screen have effect on play screen without declaring of variables global (this worked first play, upon trying press on screen again got massive amount of exc , sigabrt errors, bad memory access). for example: upgradescene: class upgradescene: skscene, skphysicscontactdelegate { var groundspeed = 5.0 var hero = skspritenode(imagenamed:&qu

axapta - DimensionAttributeSetStorage by DefaultDimension -

i need create dimensionattributesetstorage items defaultdimension field ( custtable.defaultdimension example). how can this? on form use dimensiondefaultingcontroller . also see implementing account , financial dimensions framework ax2012 white paper ( http://download.microsoft.com/download/4/e/3/4e36b655-568e-4d4a-b161-152b28baaf30/implementing_the_account_and_financial_dimensions_framework_ax2012.pdf ). if need create default dimension code can use dmfdimensionhelper::generatedefaultdimension method. sample: dmfdatasourceproperties sourceproperties; sourceproperties.chartofaccountsdelimiter = dimensionledgeraccountdelimiter::hyphen; sourceproperties.dimensionattribute = "dim1-dim2"; // dimension codes x.defaultdimension = dmfdimensionhelper::generatedefaultdimension("001-abc", sourceproperties, "");

java - Where to put maven generated webapp artifacts? -

i'm using swagger maven plugin generate swagger.json file. want available static resource in webapp (src/main/webapp). in example on github page configure this. <swaggerdirectory>generated/swagger-ui</swaggerdirectory> i can't see how useful it's not in webapp folder. guess you'd have manually copy somewhere useful what's point in maven if it's not automated. i've configured in project. <swaggerdirectory>${basedir}/src/main/webapp/swagger</swaggerdirectory> this allows me access file both during development (as eclipse project) , when deployed (as built war file). the question whether it's ok pop generated artifacts in usual src/main folder? i have generated code jaxb goes generated-sources folder in target folder. added source folder in eclipse , maven knows add these classes build. i want check haven't comitted maven faux pas dumping generated code in src/main/webapp. know i'll have gitignore file.

python - Compile cython module works in 32bits but not in 64 bits [Windows] -

i have cython module (using numpy) compiles , works in 32 bits doing following thing: c:\python27_x86\scripts\cython.exe orderc.pyx c:\mingw\bin\gcc.exe -mdll -o -wall -ic:\python27_x86\lib\site-packages\numpy\core\include -ic:\python27_x86\include -ic:\python27_x86\pc -c orderc.c -o orderc.o c:\mingw\bin\gcc.exe -shared -s orderc.o -lc:\python27_x86\libs -lc:\python27_x86\pcbuild -lpython27 -lmsvcr90 -o orderc.pyd but not working when trying compile equivalent in 64 bits: c:\python27\scripts\cython.exe orderc.pyx c:\mingw\bin\gcc.exe -mdll -o -wall -ic:\python27\lib\site-packages\numpy\core\include -ic:\python27\include -ic:\python27\pc -c orderc.c -o orderc.o c:\mingw\bin\gcc.exe -shared -s orderc.o -lc:\python27\libs -lc:\python27\pcbuild -lpython27 -lmsvcr90 -o orderc.pyd actually, third line fails , gives lof of errors: orderc.o:orderc.c:(.text+0x43f2c): undefined reference `_imp__pyexc_typeerror' ... orderc.o:orderc.c:(.text+0x603a9): undefined reference `_imp__

r - Overlaying jittered points on boxplot conditioned by a factor using ggplot2 -

Image
i making boxplot conditioned factor similar example: p <- ggplot(mtcars, aes(factor(cyl), mpg)) p + geom_boxplot(aes(fill = factor(am))) there few points in data set, , i'd express visually overlaying data points. want overlay points colored same factor "am" try this: p + geom_boxplot(aes(fill = factor(am))) + geom_jitter(aes(colour = factor(am))) the points colored factor "am" not spaced lay on box plots associated with. rather mix , cover both. know how condition geom_jitter points associate factor "am"? welcome so! here's attempt. it's bit clumsy, job. trick map x dummy variable manually constructed offset. i'm adding fill scale highlight point positioning. mtcars$cylpt <- as.numeric(factor(mtcars$cyl)) + ifelse(mtcars$am == 0, -0.2, 0.2) ggplot(mtcars, aes(factor(cyl), mpg)) + geom_boxplot(aes(fill = factor(am))) + geom_point(aes(x = cylpt, colour = factor(am)), position = "jitter") + sc

c - How can I move a int from xmm register to eax register? -

i have call assembly method calculate addition of 2 integers, using sse, c. the simple c code is: #include <stdio.h> #include <stdlib.h> extern int add(int a, int b); int main(){ int a=5; int b=2; int n = add(a,b); printf("%d\n",n); return 0; } while nasm code is: section .bss risultato resd 1 section .text global add add: ;----------------------------------------------- ; start point of function ;----------------------------------------------- push ebp ; salva il base pointer mov ebp, esp ; il base pointer punta al record di attivazione corrente push ebx ; salva registri da preservare push esi push edi ;----------------------------------------------- ; add implementation ;----------------------------------------------- movss xmm0, [ebp+8] movss xmm1, [ebp+12] addss xmm1, xmm0 movss [risultato], xmm1 mov eax, [risultato] ;------

how to implement a callback function in UFT vbscript -

i've tried search online couldn't find answer need. here's task , requirement. have 2 function, first 1 checks condition , returns true , false. 2nd 1 starts timer , checks results of 1st function periodically , exit when return value becomes true. here's 2 funcitons ' 1st 1 checks if item exists in javalist public function existinjavalist(byref javalist, byval itemname) dim itemcount, i, ret ret = false itemcount = javalist.getroproperty("items count") i=0 itemcount -1 if javalist.getitem(i) = itemname ret = true exit end if next existinjavalist = ret end function ' 2nd 1 checks condition every 10 seconds , if condition true, ' returns true. otherwise, times out after 120 seconds , returns false. function waitforcondition(byval condition) dim starttime, existflag, accumulatetime starttime = timer() existflag = true until cbool(condition) wait(1

ios - Save UIPickerView selection to NSUserDefaults swift -

i trying save user's selection uipickerview nsuserdefaults. have found answers in obj-c not swift. here uipickerview code: func numberofcomponentsinpickerview(pickerview: uipickerview) -> int { return 1 } func pickerview(pickerview: uipickerview, numberofrowsincomponent component: int) -> int { return pickerdata.count } func pickerview(pickerview: uipickerview, titleforrow row: int, forcomponent component: int) -> string! { return pickerdata[row] } func pickerview(pickerview: uipickerview, didselectrow row: int, incomponent component: int) { race = pickerdata[row] } and when press save button, supposed save selected nsuserdefaults. here saving code: @ibaction func save(sender: anyobject) { var defaults: nsuserdefaults = nsuserdefaults.standarduserdefaults() defaults.setobject(race, forkey: "race") } when try display text on label, shows blank: override func viewdidload(

socialengine - Struggling with nginx.conf rewrites -

trying nginx on jelastic play nice nice socialengine. there's myriad of forum posts , other documentation i've hit brick wall. unmodified nginx.conf #user nobody; worker_processes 1; error_log /var/log/nginx/error.log; #error_log logs/error.log notice; #error_log logs/error.log info; #pid logs/nginx.pid; events { worker_connections 1024; } http { server_tokens off; include mime.types; default_type application/octet-stream; log_format main '$http_x_forwarded_for - $remote_user [$time_local] "$request" ' '$status $body_bytes_sent "$http_referer" ' '"$http_user_agent" "$http_x_forwarded_for"'; access_log /var/log/nginx/access.log main; sendfile on; #tcp_nopush on; #keepalive_timeout 0; keepalive_timeout 65; #gzip on; # websocket support #upstream websocket { #

ios - How to restart an app when resumes from multi-tasking -

Image
so app relies on internet connection , every time app opened home screen checks using reachability , allows user continue or tells them connected. issue when app resumed multitasking, skips initial view controller , goes straight were. there way in swift app refresh or restart when resumed multi-tasking? thanks edit when using code: let storyboard = uistoryboard(name: "mainstoryboard", bundle: nil) self.window.rootviewcontroller = mainstoryboard.instantiateinitialviewcontroller() i expected declaration error. you can set root view controller , restart main vc. assuming using storyboard: (self referring appdelegate) swift: let storyboard = uistoryboard(name: "mystoryboardname", bundle: nil) self.window.rootviewcontroller = storyboard.instantiateinitialviewcontroller() objective-c: self.window.rootviewcontroller = [[uistoryboard storyboardwithname:@"mystoryboardname" bundle:nil] instantiateinitialviewcontroller];

Performance evaluation of various methods to Iterate through a list in java -

this question has answer here: java8 lambda performance vs public functions 1 answer i have created integer list containing 10 numbers in java.i sum of numbers in list.for have used 4 methods iterate through list , return sum.the code same given below. public static void main(string[] args) { list<integer> numbers=arrays.aslist(1,5,10,25,30,17,3,9,11,26); //using simple loop finding sum of numbers in list system.out.println(sumofnumbersusingsimpleforloop(numbers)); //using listiterator interface finding sum of numbers in list system.out.println(sumofnumbersusingiterableinterface(numbers)); //using enhanced loop finding sum of numbers in list system.out.println(sumofnumbersusingenhancedforloop(numbers)); //using lambda expression finding sum of numbers in list system.out.println(sumofnumbersusinglambdaexpression(numbers

c - Redefine value from enum -

i have code defined in 3rd party library i'm using: typedef enum { state_initial = 0, state_load = 1, state_read = 2, state_finish = 3 } state_t; i re-define value of state_finish. however, don't want mess library, , @ same time can't way in code: #undef state_finish #define state_finish 2 is there way? first of all, #undef not have effect. works on names have been #define d. should leave out. second, #define state_finish 2 have effect seem want. must sure used in cases header #include d. otherwise, value used in program state_finish inconsistent. must #define after #include . if before, substitution in header file, change enum definition incorrect typedef enum { state_initial = 0, state_load = 1, state_read = 2, 2 = 3 /* or state_read = 3, other variant; wrong */ } state_t; now combining these warnings order: can't guaranteed right. if re- #define after #include , maybe code inside header fi

java - Is there a mistake in this illustration? -

Image
in chapter 14.2, page 620, in "big java" (international 4th edition), cay horstmann, shown how implement linked list. add method of listiterator looks this: public void add(object element) { if(position == null) { addfirst(element); position = first; } else { node newnode = new node(); newnode.data = element; newnode.next = position.next; position.next = newnode; position = newnode; } previous = position; } the corresponding illustration looks 1 added below. first 1 before "newnode" has been added, , second 1 after. can tell me if there mistake in second picture. shouldn't fields "previous" , "position" point same object after call "add(object element)"? top picture before , bottom 1 after insertion. the way see code seems wrong , previous should have been

asp.net - using Eval of ASP Listview as an inline CSS value -

my code : <asp:listview id="lst1" runat="server"> <itemtemplate> <div style="width:<%#eval("rating")%>%"> </div> </itemtemplate> </asp:listview> it works great, in visualstudio editor it's considered invalid. there way make valid? i know can create whole ' style="width:xxx%" ' in eval i'm looking way. <div style='<%# eval("rating", "width:{0}%") %>'></div> it make accepted editor, don't know else though.

Objective-c to Swift conversion -

- (nsdata *)formencodedparameters:(nsdictionary *)parameters { nsarray *pairs = [parameters.allkeys mappedarraywithblock:^id(id obj) { return [nsstring stringwithformat:@"%@=%@", [obj stringbyaddingpercentescapesusingencoding:nsutf8stringencoding], [parameters[obj] stringbyaddingpercentescapesusingencoding:nsutf8stringencoding]]; }]; nsstring *formbody = [pairs componentsjoinedbystring:@"&"]; return [formbody datausingencoding:nsutf8stringencoding]; } what best way convert method swift? below link objective-c swift code "converter". matches syntax , replaces thinks appropriate.... still.... have kind of thing yourself. learn how code in swift , convert yourself. in mean time (for educational reasons) can try converter: http://objectivec2swift.net/#/about

Wordpress hacked: added site.xml and /good directory -

i'm working on wordpress website which's been hacked. @ first saw site.xml file , /good directory placed nthe root directory of website. site.xml contains these header strings: <urlset xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xsi:schemalocation="http://www.sitemaps.org/schemas/sitemap/0.9 http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd"><url> <loc>http://www.casadellavita.com/good/ray-ban-outlet-nj.html</loc> <lastmod>2015-06-01t08:10:43+02:00</lastmod> <changefreq>monthly</changefreq> <priority>1.0</priority> </url> and huge list of these elements like: <url> <loc>http://www.thehackedwebsite.com/good/ray-ban-3404-sale.html</loc> <lastmod>2015-06-01t08:10:43+02:00</lastmod> <changefreq>monthly</changefreq> <priority>1.0</prior

entity framework - How do you include existing migrations into a VS 2013 project? -

i excluded migrations project in visual studio , want add them back.. noticed there 3 files per migration... 2 .cs , 1 . resx ... when add them , compile, try , run migrations via update-database error: could not find resources appropriate specified culture or neutral culture. make sure "..." correctly embedded or linked assembly "..." @ compile time, or satellite assemblies required loadable , signed. i selected of files , changed properties embedded resource

security - fallback for limitting web application access to certain ip addresses -

we develop web application. there user login , user area customers of company. , there agent/office login , area employees of company manage user account handling , on. the office agent has login username , password. but additionally, security reasons, limit agent/office login , area specific ip addresses (as seen in other applications). but have "fallback" situations where, example, web developer of application needs access office area , has not 1 of special ip addresses. until had not many ideas. we thought of providing access when there special user-agent string hash value. has implemented such security mechanisms , can inform me it? thanks alot in advance

robotframework - how to execute test case simultaneously in robot framework -

i have written test case , kept in 1 folder how execute test case 1 one continue. test case test case 1: demo.text test case 2: d.text you can provide common tag testcases , can run testcase using tag. hope helps.

matrix - Creating relational matrices with R -

my dataframe consists of projects different individuals took part in it, year in projects carried out. how can create, each year, nxn relational matrix (n being number of individuals) counts number of collaborations between individuals. consider following example reproduces desired structure: # example dataframe set.seed(1) tp=cbind(paste(rep("project",10),1:10,sep=""),sample(2005:2010,10,replace=t)) tp=tp[sample(1:10,50,t),] id=sample(paste(rep("id",10),1:10,sep=""),50,t) df=as.data.frame(cbind(tp,id));rm(tp,id) names(df)=c("project","year","id") df=df[order(df$project,df$id),] df[1:10,] # project year id # project1 2006 id1 # project1 2006 id3 # project1 2006 id5 # project1 2006 id5 # project4 2006 id3 # project4 2006 id4 # project5 2006 id3 # project5 2006 id4 # project6 2008 id2 # project6 2008 id3 as example, relational matrix year 2006 this id1 id2 id3 id4 id5 id1 0 0 1 0 1 id2 0

objective c - iOS UIScrollView scrolling detection -

Image
i'm developing kind of uitextview copy customizations. need implement selection cursors (see screenshot of original uitextview below) as discovered debug view hierarchy apple developers draw these dots on separate window avoid clipping, , when uiscrollview starts dragging move these dots inside uitextview , when stops dragging move separate window. problem approach how can detect when of textview superview 's uiscrollview , start/end scrolling? setting delegate each of uiscrollview -type superviews looks bad , bring lot of headache, cause need manage several delegates if needed (and detect there change). ideas? /* in viewdidload or ever create uitextview call :[self checkparentviewoftextview:textfield]; */ -(void)checkparentviewoftextview:(uitextview*)txv { if ([txv.superview iskindofclass:[uiscrollview class]]) { // check if superview if uiscrollview uiscrollview *superscroll =(uiscrollview*) txv.superview; superscroll.delegate = s

c# - Excel Import Data Parse Error Of Internationaly Formatted Numbers -

i'm importing excel file , want add values database. in database there type decimal(18, 5) , want add value 0.00204 column in database. variable in model class of type decimal , i'm trying code: convert.todecimal(items[7]); but error input if not correct format. items of type object[]. how parse value decimal? all others work fine: product.packsize = convert.toint32(items[3]); product.leadtime = convert.tostring(items[4]); product.generalaccessorycategoryid = convert.toint32(items[5]); product.company = convert.tostring(items[6]); product.weight = convert.todecimal(items[7]); check possible error conditions may exist @ stage once safe, extract string: decimal result; if ((items!= null) && (items.any()) && (items[7] != null) && (decimal.tryparse(items[7].tostring(), out result)) product.weight = result; after couple of comments , in

Error handling in shell script -

i have following shell script. throws following error if there no file exist in folder. so, how handle script doesn't stop executing? error: mv: cannot stat `*': no such file or directory script: for file in * fl=$(basename "$file") flname="${fl%%.*}" gunzip "$file" mv "$flname" "$flname-nxdweb2" tar -zcf "$flname-nxdweb2".tar.gz "$flname-nxdweb2" rm "$flname-nxdweb2" done; if shell bash , can allow * expand null string: shopt -s nullglob before loop. btw, might want explicitly specify uncompressed filename produce, in case logic doesn't agree gunzip 's (which won't, if there's more 1 dot in name, or file ends .tgz or .taz ): gunzip -c "$file" >"$flname" (you need remove original in case, though) you can avoid need move, too: flname="${fl

android - cordova file transfer error code 1 for languages other than english in ios -

i got error code 1 (file not found) while downloading file name consists of characters other english cordova file transfer in ios. works fine android. my file name " 1-contrôle réseaux désenfumage ". any on highly appreciated

Dygraph display X-axis at the top of the figure -

i want x-axis @ top of figure along axislabels , y-axis invisible described below.how can done ? 1 2 3 4 +-----+-------+-------+------+ | | | | | | there's no simple way move x-axis top without mucking plugins/axes.js . to hide y-axis, can use drawaxis option : g = new dygraph(div, data, { axes: { y: { drawaxis: false } } });

.htaccess - use htaccess to redirect a range of urls which have parameters -

i had email subscription updates on site, i've temporarily disabled. i'm seeing hits site related subscription. urls long first several characters same. i've been trying redirect these (at least time being) single page explanatory text. i've tried several things far, haven't been able syntax correct. btw, had change question because couldn't figure out how satisfy "quality standards". edited add: incoming urls are: exampledomain.com/?wysija-page=1... i want every incoming url matches format - no matter replaces "..." - go to: exampledomain.com/subscriptions it's wordpress site. insert rule below rewriteegine line in wp .htaccess: rewritecond %{query_string} (^|&)wysija-page=1 [nc] rewriterule ^ /subscriptions? [l,r=302]

database - Does Datical (Enterprise version of liquibase) support more than 2000 tables generateChangeLog? -

i have more 2000 tables in existing database. want generatechangelog tables structure , data. have tried using liquibase command failed tables. possible in datical (enterprise version of liquibase) gui or command ? liquibase command: liquibase --driver=com.mysql.jdbc.driver --classpath=mysql-connector-java-commercial-5.0.8-bin.jar --changelogfile=d:\newliquibse\xml\xyz.xml --url="jdbc:mysql://localhost:4928/mydbname?zerodatetimebehavior=converttonull" --username=xyz --password=xyz --difftypes="tables, columns, views, primarykeys, indexes, foreignkeys, sequences, data" generatechangelog i using liquibase 3.3.5 version. any appreciated.

scala - How to install older version of sbt? -

i facing "unresolved dependencies" problem custom dependencies latest version of sbt(0.13.8) i want install older version of sbt, have command can install older version of sbt ? you can define sbt version writing 1 need in /project/build.properties it like: sbt.version=x.xx.x

vb.net - Serial read value does not change -

i trying read serial data arduino sending keeps giving me on , on first string receives if change arduino output. why give me first value , not update? module module1 sub main() dim com4 io.ports.serialport = nothing com4 = my.computer.ports.openserialport("com4") dim incoming string incoming = com4.readline() console.writeline(incoming) threading.thread.sleep(250) loop end sub end module it be, depending on arduino sketch, sends same data out time, filling receive buffer, gets read time in loop. try using events dim withevents com4 serialport....... sub datareceivedhandler (sender object, e eventargs) handles com4.datareceived dim incoming string = com4.readline console.writeline(incoming) end sub

c# - Entity Framework code first: How to ignore classes -

this similar questions here , here , old , have no answers. let's have following classes: class haircutstyle { public int id { get; set; } public string name { get; set; } } class customerhaircutpreference { public int id { get; set; } public customer customer { get; set; } public haircutstyle haircutstyle { get; set; } } let's haircutstyle data stored in table in database (i paul mitchell himself). want use haircutstyle class poco class - use in code represent hair cut styles, don't need read/write information in database. (assume have separate service layer can populate data these classes other database.) how can tell ef not create haircutstyle table in current db context? @ same time, want store value in customerhaircutpreference table reference haircutstyle data stored elsewhere. "virtual" foreign key of sorts, isn't constrained actual database fk constraint. there 3 things ensure: make sure not expose dbset<hai

java - ArrayList on XML Random -

i app randomly picks items xml arraylist. found answer question covers do. problem code adapted question (randomly picks colours). in situation, instead of colours, want randomly pick images. my xml far: <resources> <string-array name="colours"> <item>r.mipmap.blue</item> <item>r.mipmap.green</item> <item>r.mipmap.red</item> </string-array> </resources> basically, images coloured circles. if tell me how adapt java instead of randomly picking colours, picking images, i'm hears ;) be patient me please, i'm noob programmer. i want same thing have used integer-array drawable id , set imageview go this link

node.js - nodejs python-shell error on raspberry pi -

i'm working on nodejs on raspberry pi, base on python's basic code suppose run working on pi: import rpi.gpio gpio gpio.setmode(gpio.board) gpio.setup(7, gpio.out) gpio.output(7, true) but when tried on python shell package run python script above. throws error: error: process exited code 2 @ childprocess. (/home/pi/desktop/social_feed/node_modules/python-shell/index.js:82:23) @ childprocess.emit (events.js:110:17) @ process.childprocess._handle.onexit (child_process.js:1067:12) the javascript run python-shell is: var pythonshell = require('..'); pythonshell.run('anythingcodes.py', function (err) { if (err) throw err; console.log('finished'); }); does tested using python-shell run python script on raspberry pi's gpio ?

postfix mta - send Mail with javamail and posfix -

i setup postfix in os ubuntu 12.04 , want use sending mail javamail doesn't work . error i'm getting is: exception in thread "main" java.lang.runtimeexception: javax.mail.messagingexception: unknown smtp host: ns303047.xxxxxxx.eu; so main.cf : # see /usr/share/postfix/main.cf.dist commented, more complete version # debian specific: specifying file name cause first # line of file used name. debian default # /etc/mailname. #myorigin = /etc/mailname smtpd_banner = $myhostname esmtp $mail_name (ubuntu) biff = no # appending .domain mua's job. append_dot_mydomain = no # uncomment next line generate "delayed mail" warnings #delay_warning_time = 4h readme_directory = no # sasl parameters # --------------------------------- # use dovecot authenticate. smtpd_sasl_type = dovecot # referring /var/spool/postfix/private/auth smtpd_sasl_path = private/auth smtpd_sasl_auth_enable = yes broken_sasl_auth_clients = yes smtpd_sasl_security_options = no

Using logical bitwise operators to convert ASCII to binary -

how and, or, not or xor used convert 7-bit ascii code numeric character 7-bit pure binary representation of number? code and 1111 2 you have take 4 lowest significant bits of ascii code. please note single ascii character can represent digits 0 9 4 output bits enough represent resulting number.

javascript - Not able to post data angular ng-resource -

i want persist data using post method throught angular ngresource. have written below code process. but, when try persist error coming. js code angular.module('app').factory("testservice", function($resource) { return{ addcount: $resource('/save/count',{method:'post',params:{ date: '@date', count: '@count'}} ) }; }); //controller code $scope.add = function(){ testservice.addcount().get({ date: new date(formatteddate).tostring("mm/dd/yyyy"), count: count},function(response){ console.log('success') });}; as click add() html getting below error. typeerror: cannot read property 'get' of undefined kindly,provide suggestion overcome issue restful services should on per entity basis. route should /count or api/count depends on how set api endpoints. then when use $resource , point @ endpoint , let $resource handle p

python - Send email django from any host -

i have read plenty of links sending emails through django. i've tried of them don't work. tried sending email through python shell , '1'. - settings should use email work, i'm willing use mail server? - using gmail read causes problems, if i'm going use hotmail example need specify email password in settings.xml? - how debug problem? this pure python code sending emails using smtp lib from threading import thread import requests import time import smtplib def email_sender(input_message, email_to, client): ''' function send email ''' = email_to gmail_user = 'email of sender account' gmail_pwd = 'password of sender account' smtpserver = smtplib.smtp("smtp.gmail.com",587) smtpserver.ehlo() smtpserver.starttls() smtpserver.ehlo smtpserver.login(gmail_user, gmail_pwd) header = 'to:' + + '\n' + 'from: ' + gmail_user + '\n' + 'su

c# - Dynamic Lambda Expressions -

i have front-end user can enter build string using buttons insert operators / operands , items want filter. the purpose of function filter down list, used calculate quantity depending on number of items can take. this string passed controller need use string query database using entity framework. have been looking @ dynamic lambda , linq solve not able need, when comes grouping of elements. typically string might follows (( mod1 = 1 ) or ( mod2 = 1 ) or ( mod3 = 1) , modhigh = 1) i open change solution if there better way of doing so, had in mind following, more user friendly. again modelling in controller take doing, i'm not sure begin at. intuitive interface composing boolean logic edit currently working following, based upon tutorial here /// <summary> /// allows live updating of view show stores /// going effected rule. /// </summary> /// <param name="filterstring">customisable query view</param> ///

iText - How to replace a character with a dynamic checkbox in a pdf -

i'm using itext working on pdf documents. have pdf document non-dynamic checkboxes (they made character "□", unicode \u25a1); need replace checkboxes dynamic checkboxes of itext. it's possible? need because pdf document receive not made me , contains character. help, , sorry not-perfect english

java - Failed to execute goal com.atlassian.maven.plugins:maven-amps-dispatcher-plugin -

i try set helloworld plugin jira , exception: failed execute goal com.atlassian.maven.plugins:maven-amps-dispatcher-plugin:4.0:run (default-cli) on project helloworld: unable execute mojo: unsupportedoperationexception..... my environements: jira - sdk-installer-4.0 java 1.6_0.32 maven 3.0.5(copy conf folder sdk-installer-4.0 , paste maven 3.0.5) i clean .m2 local repository turn off windows defende try set project use commands atlas-clean atlas-mvn eclipse:eclipse atlas-compile atlas-debug but not result. have idea? thanks lot

python - Pyro4 RPC blocking -

i doing development on high performance numeric calculations system posts results web server. use flask on seperate process serve web page keep interactive , use websockets send data js plotter. calculations split using multiprocessing performance reasons. we using pyro4 parameters updated in calculations server. however, if number of updates per second gets high on our pyro4 settings object starts blocking , makes impossible update parameters until restart server. proxy calls made inside of async websocket callback. we not getting tracebacks, nor exceptions makes debugging tricky. there other people have lot of experience pyro in context? pyro daemon init code: pyro4.config.servertype = "multiplex" daemon = pyro4.daemon() ns = pyro4.locatens() settings = cg.settings(web_opt, src_opt, rec_opt, det_opt) uri = daemon.register(settings) ns.register("cg.settings", uri) daemon.requestloop() settings class: class settings(object): def __init__(self, web_o

asp.net web api - How to use the same route with different parameter types? -

i have api controller 2 different actions take different parameter types. // get: users/sample%40email.com [route("users/{emailaddress}")] public ihttpactionresult getuser(string emailaddress) // get: users/1d8f6b90-9bd9-4cdd-babb-372242ad9960 [route("users/{reference}")] public ihttpactionresult getuserbyreference(guid reference) problem multiple actions found matching when make request either. looking @ other answers thought needed setup routes in webapiconfig so... config.routes.maphttproute( name: "apiemail", routetemplate: "api/{controller}/{action}/{email}" ); config.routes.maphttproute( name: "apireference", routetemplate: "api/{controller}/{action}/{reference}" ); what need each action called based on parameter type pass in? i'm new web.api additional explanation text appreciated.

Temporary remove in jQuery -

<div class="stuff"> <span class="to_hide"> blah </span> <span id="permanent"> glue </span> </div> i want grab $(".stuff").text() , don't #tmp 's text this works fine $(".to_hide").remove() but don't want removal action have effect on page itself. if remove or detach, need know elements have been (assume many .to_hide nodes) how can use .text() while ignoring .to_hide one easy way use clone var text = $(".stuff").clone().find('.to_hide').remove().end().text(); console.log(text) <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script> <div class="stuff"> <span class="to_hide"> blah </span> <span id="permanent"> glue </span> </div> you can - if have complex systems , text nodes direct descendants of stuff

unix - Telnet Host in a single line without password -

how telnet host port in script not have give login name , password manually. for example telnet host 2000 login: password: i want use in shell script, how can avoid user login , password or how pass in single line? you appear talking ibm tivoli netcool/impact or router product (clarification should have been provided in question). the rsh , rlogin programs designed work in manner, using .rhosts file. while (including telnet) have been replaced ssh , still usable. telnet-oriented products (such router) document accept either type of connection. telnet , rlogin not synonymous - can read more here: difference between rlogin , telnet as noted in comments, question former (netcool/impact), , not accept rlogin connect. (from other comments), might try using expect . if have administrative rights (or cooperative administrator), there rpms expect , dependencies on perlz.org: expect tcl

githooks - Git post-receive hook for push-to-deploy only works with master -

i have remote bare git repository created following: @server:~$ mkdir -p /home/myuser/domain.git && chmod 770 /home/myuser/domain.git && cd /home/myuser/domain.git && git init --bare with post-receive hook: @server:~$ nano hooks/post-receive the hook script is: #!/bin/sh git --work-tree=/var/www/domain --git-dir=/home/myuser/domain.git checkout -f it has permission execute: @server:~$ chmod +x hooks/post-receive however, changes website when push master branch. why? remote head master , if push branch. by default, checkout master branch. you need specify branch checkout, depending on branch has been pushed , received. here example of hook specific branch checkout : #!/bin/bash while read oldrev newrev ref branch=`echo $ref | cut -d/ -f3` git_work_tree=/path/to/local/checkout git checkout -f $branch done be sure not push multiple branches @ same time , or last branch checked out.

codeblocks - Different answers on different platforms for c++ -

hi ran code on codechef's ide , on codeblocks. got answer different answers: 1001 codeblock 818(correct one) codechef ide. please help!. code snipplet : http://pastie.org/10223010 #include <iostream> #include <string> #include<sstream> #include<cmath> using namespace std; int palin(int n); int main() { int i,t; int n; cin>>t; for(i=0;i<t;i++){ cin>>n; palin(n); while(1){ n++; if(palin(n)==1){ cout<<n<<endl; break; } } } return 0; } int palin(int n){ int len=0; int m=0; int dum=n; while(n!=0){ n=n/10; len++; } n=dum; while(n!=0){ m=m+((pow(10,(len-1)))*(n%10)); n=n/10; len--; } if(dum==m) return 1; else return 0; } problem statement : http://www.codechef.com/problems/palin/ don't use pow() function use float arithmetic , gives wrong answer integer variables

java - Why is android HttpURLConnection not sending back FIN? -

Image
from android app wanted post data server , response back, process send , request. since continuous communication until no more response process, prefer go httpurlconnection http.keepalive = true . and attempt reuse socket successful, problems facing are: i trying initiate close client (android app), since if termination starts server server goes time_wait state. , don't want server go state preferred client initiate termination. unfortunately find no suitable way httpurlconnection after hours of searching gave on doing above attempt , went initiating close server based on keepalivetimeout , when server sends fin , client responds ack , because of connection held on fin_wait_2 in server , close_wait in agent. source code: private httpstatus communicatewithmdmserver(string httpurl, string datatosend, boolean keepalive) { httpstatus status = new httpstatus(http_status_failure); try { initializeconnection(httpurl,keepalive); postdatatoconn