Posts

Showing posts from April, 2015

Android Change textView text from another method/class -

after click on button1, layout , class gets called. want change text of textview out of class 2 results in app crash java.lang.nullpointerexception important parts of class 1 public static textview a; protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_main); [button stuff in class 1] setcontentview(r.layout.raten); final textview = (textview) findviewbyid(r.id.a); //the textview wanna chage max = 10; easy easy = new easy(); // other class easy.e(); [now method in class 1 should change text] public static void tx(int i) { a.settext("adsfasdf"); } [important parts of class 2 ("easy")] public void e(){ system.out.println("called class easy"); int max = mainactivity.max; system.out.println(max); (int i= 0; i<max; i++){ syste

plot - How can I remove the strange white margin around my .png (plotted with r, ggplot)? -

Image
i save plots ggplot .png. background has black, there allways small white margin (only top, down left; not right). how can remove margin? thank you! here code library(ggplot2) require(grid) dat <- data.frame("xvar"=runif(500, 1, 10), "yvar"=runif(500, 1, 10)) n <- 1 for(i in 1:n){ png(file=paste("green", i, ".png", sep=""), width=400, height=400) x <- sample(500, 50) <- ggplot(data=dat[x,], aes(x=xvar, y=yvar))+ geom_point(col="green", size=3,shape=15)+ theme(panel.background=element_rect(fill="black"), panel.grid.minor=element_blank(), panel.grid.major=element_blank(), axis.text.x=element_blank(), axis.text.y= element_blank(), axis.title.x=element_blank(), axis.title.y=element_blank(), axis.ticks=element_blank(), plot.background=element_rect(fill="black"), panel.margin = unit(c(0,0,0,0), "cm"), plot.margin = unit(c(0,0,0,0), "

asp.net - IIS Rewrite root folder to different subfolders -

i'm setting folder structure inside application looks such: c:\inetpub\wwwroot\contoso\public c:\inetpub\wwwroot\contoso\secured i wanting map following urls folder structures: http://www.contoso.com/login -> \public\login.aspx http://www.contoso.com/myaccount -> \secured\myaccount.aspx http://www.contoso.com/(css|images|js)/ * -> \public(css|images|js)* (not represented in below rules) i have application request routing version 2 installed on server. thought process build few rewrite rules mapping me such these ... <rewrite> <rules> <rule name="rewrite pub page aspx" stopprocessing="false"> <match url="^([a-z0-9/]+)$" ignorecase="true" /> <conditions> <add input="public\{request_filename}.aspx" matchtype="isfile" ignorecase="true" /> </conditions> <action type=

unix - No rule to make target in Maefile -

i'm learning write makefiles. made own simple 1 try , test, every time run make, get: make: *** no rule make target `/%.cpp', needed `obj'. stop. i googled. i'm pretty sure typed correctly, , folders set way should be. here makefile: cc = g++ ld = g++ name = app obj_dir = obj src_dir = src cc_flags = -std=c++0x all: $(name) $(name): $(obj_dir)/%.o $(ld) $(obj_dir)/%.o -o $@ $(obj_dir)/%.o: $(src_dir)/%.cpp $(cc) $< -o $@ $(cc_flags) clean: rm $(name) $(obj_dir) -rf what problem? the line: $(name): $(obj_dir)/%.o is not correct. not pattern rule (because target doesn't contain pattern character, % ) , it's interpreted explicit rule, saying app depends on actual file named obj/%.o doesn't exist, , make doesn't know how build (because there's no file src/%.cpp ). you need change to: $(name): $(obj_dir)/foo.o ... or whatever object files have.

c# - Entity Framework - Linq to query where value in a list -

Image
i'm using entity framework on .net 3.5 , can't life of me figure out how write linq traverse following design: basically trying figure out if user has permission (entityaction) specific entitytype. users , roles maintained in active directory - system can lookup find role/groups user belongs. let's assume have following data: entitytype entitytypeid: 1 name: entity one user userid: 1 accountname: andez role roleid: 1 accountname: myrole entityaction entityactionid: 1 name: something roleentityactionassociation (association between role , entityaction) entityactionid: 1 roleid: 1 i storing group names user (from active directory) in list: list<string> groupnames = new list<string>(); question however trying piece linq find out whether user (or 1 of roles assigned in list groupnames) associated particular entityaction given entitytype. // reference user user user = context.users.where(x => x.account

javascript - Clear form inputs and keep placeholder -

i know using jquery tool $('.mydiv input').each(function () { $(this).val(""); }); clears form can me suggestions how keep placeholders of input? right placeholders appears after focus on @ least 1 input. jquery function clear() { $('.mydiv input').each(function () { $(this).val(""); x=1; }); $('.mydiv input').first().focus(); } working demo http://jsfiddle.net/s8vpg/2/

grouping - Highcharts Grouped Data In Subgroup -

Image
is possible achieve this? need draw graph , it's based on categories. each category have subcategory , aggregator. this column bar chart , must draw this. look. exaplanation: agg 1 , 2 fixed categories in xaxis. cat 1, cat 2, cat... dynamic on it. data column bars in specified cat group. i dunno if graph can handle want , if possible. know how draw simple graphs , don't found example this. i've tried stacks don't got want or used wrong. there not built in way achieve in highcharts. one thing can spoof it, using multiple x axes, making use of axis offset property, , setting different categories and/or tickpositions on different axes. there feature request can add votes and/or comments here: http://highcharts.uservoice.com/forums/55896-general/suggestions/2230615-grouped-x-axis relevant thread old forum: http://highslide.com/forum/viewtopic.php?f=9&t=16011

c# - Extension methods and type inference -

i'm trying make fluent interface lots of generics , descriptors extend base descriptors. i've put in github repo because pasting of code here make unreadable. after having read eric lippert's post type constraints ( http://blogs.msdn.com/b/ericlippert/archive/2009/12/10/constraints-are-not-part-of-the-signature.aspx ) , reading no type inference generic extension method understood subject little bit better, still got questions. suppose have classes allow fluent calls: var giraffe = new giraffe(); new zookeeper<giraffe>() .name("jaap") .feedanimal(giraffe); var reptile = new reptile(); new experiencedzookeeper<reptile>() .name("martijn") .feedanimal(reptile) .cureanimal(reptile); the classes this: public class zookeeper<t> t : animal { internal string name; internal list<t> animalsfed = new list<t>(); // method needs fluent public zookeeper<t> name(string name)

c# - performing .net postback on jquery ui tab selection -

i have set of tabs on web form using jqueryui tabs. when click on tab, want data on tab load (only when click on tab). don't want load tab data on initial page load. i have used linkbutton on tab, when click on tab, button click event should fire , cause post back. not happen. my question is. jqueryui tab pluggin disable default action of link in tab? noticed if don't use anchor link of sort in tab li element tab not rendered properly, jquery requires anchor render. how can data load when tab selected? http://jqueryui.com/tabs/#ajax content via ajax in right hand menu then can like ajaxpostback.ashx?page=page1 and returning intended content code example javascript <script type="text/javascript"> $(function () { $("#tabs").tabs(); }); html <div id="tabs"> <ul> <li><a href="#tabs-1">preloaded</a></li> <li><a href="handler1.ashx?page=

Does Automapper preserve mapped list item order? -

i not find information on list item mapping order in automapper's documentation or unit tests. if try map new list<int>() { 1, 2, 3, 4 } list<int> , can sure new list have items { 1, 2, 3, 4 } in same order? automapper's unit tests regarding lists check if new list contains items , have no assumptions regarding item order.

glob - Perl - A way to get only the first (.txt) filename from another directory without loading them all? -

i have directory holds ~5000 2,400 sized .txt files. i want 1 filename directory; order not matter. the file processed , deleted. this not scripts working directory. the intention is: to open file, read it, do stuff, unlink , then loop next file. my crude attempt not check .txt files , has ~5000 filenames 1 filename. possibly calling many modules? the verify_empty sub intended validate there directory , there files in but, attempts failing so, here seeking assistance. #!/usr/bin/perl -w use strict; use warnings; use cgi; use cgi ':standard'; print cgi::header(); use cgi::carp qw(fatalstobrowser warningstobrowser); ### use vars qw(@files $thefile $pathtofile); $listfolder = cgi::param('openthisfolder'); get_file($listfolder); ### sub get_file{ $listfolder = shift; unless (verify_empty($listfolder)) { opendir(dir,$listfolder); @files = grep { $_ ne '.' && $_ ne '..' } readdir(dir); closedir(dir); forea

c# - Change visibility of GridView Items using binding -

how can change gridviewitems visibility using property binding? i can't create observablecollection filter 1 using itemssource . tried use gridview.itemcontainerstyle change gridviewitem style seems not work binding (although works if set value collapsed). <gridview.itemcontainerstyle> <style targettype="gridviewitem"> <setter property="visibility" value="{binding isvisible, converter={staticresource booleantovisibilityconverter}}" /> </style> </gridview.itemcontainerstyle> i tried use datatemplateselector . can hide items binding there gaps on gridview because itemcontainer still there , does not collapse . i need gridview items collapsed , not hidden. edit: why want rid of filtered observablecollections ? i trying mirror 2 gridviews , 1 listview same itemssource , selecteditem both binded viewmodel properties items , current . without filters works expect without selectionchan

python - Multiple insert statements failing postgresql / psycopg2 -

i'm using scrapy scrape webpage add postgres database. first insert statements works fine, , can select items database. second 1 seems insert data fields blank date | count ---------------------------+------- 04/2013 | 03/2013 | 02/2013 | here code: #database init self.conn = psycopg2.connect("dbname='dataproject' user='xxxx' host='localhost' password='xxxxxx'") self.cursor = self.conn.cursor() #csv files self.datavisitemcsv = csv.writer(open('datavistable.csv', 'wb')) self.datavisitemcsv.writerow(['dates', 'counts']) def process_item(self, item, spider): self.datavisitemcsv.writerow([item['dates'], item['counts']]) date_list = item['dates'] count_list = item['counts'] s in date_list: self.cursor.execute('insert ufo_info(date) val

tcl - How to join without losing special characters? -

i have following string: "name\r {} {} {} {} {} other_name other_name {} {} -600.0 {} {} 860.0 {} {} -" (i.e. string special character: \r ). when join line lose special charecters. suppose: set name "name\r {} {} {} {} {} other_name other_name {} {} -600.0 {} {} 860.0 {} {} -" set name [join $name] now name losing special characters(at least \r ). how resolve this? i tried few things , came this: set name {name\r {} {} {} {} {} other_name other_name {} {} -600.0 {} {} 860.0 {} {} -} # braces prevent substitution of \r regsub -all {\\r} $name {\\\r} name # substitution using regexp substitute \r \\r set name [join $name] # returns: "name\r other_name other_name -600.0 860.0 -" or in case there might more characters might want escape, use more general: regsub -all {\\} $name {\\\\} name instead.

Adding a hit counter to Desktop Intelligence/Xi 3/Business Objects webpage? -

for company making report in xi3/desktop intelligence pulls data via free hand sql , makes html file displaying data, updating every 20mins. want incorporate hit counter show number of times report being viewed. i found couple basic templates online. tried copying , pasting them cell, output html page displayed full html (unrendered browser). decent @ writing own html, not understand how stick own html code in dynamically updating report in xi3. moreover, doubt (for legality reasons) company okay me using free hit counter template find online, considering seem reference third party website actual "counting." ideas of best way implement/learn how create visitor counter? thanks. you can include html in deski report. in cell contains html, click format cell; on "number" tab, there checkbox "read html". make sure that's checked off. note won't see rendered html within deski, display when viewed in infoview.

asp.net mvc - The controller for path '/Home' was not found or does not implement IController -

i've searched internet high , low , checked answered questions same title , cannot figure 1 out. i return redirecttoaction("index", "home") action method in authentication controller , receive following exception: server error in '/' application. controller path '/home' not found or not implement icontroller. description: unhandled exception occurred during execution of current web request. please review stack trace more information error , originated in code. exception details: system.web.httpexception: controller path '/home' not found or not implement icontroller. source error: unhandled exception generated during execution of current web request. information regarding origin , location of exception can identified using exception stack trace below. stack trace: [httpexception (0x80004005): controller path '/home' not found or not implement icontroller.] system.web.mvc.defaultcontrollerfactory.getcontrollerins

php - Find highest max() of mixed array -

ive got array outputted db array ( [0] => array ( [name] => fernando alonso [time1] => 3.25 [time2] => 3.25 [time3] => 3.5 ) [1] => array ( [name] => jenson button [time1] => 34 [time2] => 41 [time3] => 41 ) ) what want each driver output name , fastest time somthing fernando alsonso, time3 - 3.5 jenson button, time2, time3 - 41 i playing around using max() having trouble getting work having trouble first element string, rather int / num, any idea how write function ? okay here go, right try max() function get_highest_time($driver) { // first find highest time $highest_time = max($driver['time1'], $driver['time2'], $driver['time3']); // find of array keys match time $times = array_keys($dri

java - save string list to a file since you compare it -

i saving file double list (mydata) data user enters , string list (dates_strings) current date. the user enters data , pressing 'save' button , save data , currents date. so , user may enter "1" , press save (1, 08/05/13) enter "2" , press save (2, 08/05/13). because user may enter data during day (same date) don't want save many instances of date.i want save user data in date. i tried sth like: (int i=1;i<mydata.size();i++){ bw.write(mydata.get(i)+","); while (!(dates_strings.get(i).equals(dates_strings.get(i-1)))) bw.write(dates_strings.get(i)+"\n"); } but saves last entered data. i saving as: file sdcard = environment.getexternalstoragedirectory(); file directory = new file (sdcard, "myfiles"); directory.mkdirs(); file file = new file(directory, filename); fileoutputstrea

python - pylab plot showing asymptotes -

Image
how can remove asymptote? import numpy np e = 1.26 beta = .705 * np.pi rph = 7000 re = 6378 def r(nuh): return rph * (1 + e) / (1 + e * np.cos(nuh + beta)) theta = np.linspace(-np.pi, np.pi, 50000) fig2 = pylab.figure() ax2 = fig2.add_subplot(111) ax2.plot(r(theta) * np.cos(theta), r(theta) * np.sin(theta)) ax2.plot(rph * np.cos(theta), rph * np.sin(theta), 'r') # adding earth earth2 = pylab.circle((0, 0), radius = re, color = 'b') ax2.add_patch(earth2) pylab.xlim((-50000, 100000)) pylab.ylim((-50000, 100000)) pylab.show() as can see here , setting divergent points np.nan cause them not plotted. in problem, r(theta) diverges. define r , theta in usual way, then, want set extrema of r(theta) np.nan . to this, make array first, change extrema np.nan : rt = r(theta) ext = [np.argmin(rt), np.argmax(rt)] rt[ext] = np.nan now, sure plot modified rt array not original fun

web services - Umbraco Accelerator successfully deployed but wont connect -

i have download umbraco accelerator try azure based cms , running, have managed change configuration file , command prompt log upon running .bat files not generate errors. i have created storage , azure database , hosted service when @ hosted service there no way me connect connect button has been disabled. has else went through setup , if have encoutnered issue? url displayed in azure http://appname.cloudapp.net/umbraco/default.aspx not work which umbraco version deploying? afaik accelerator deprecated, wrong if you're doing in particular, or haven't heard of (could lots!) web/hosted services. i've deployed umbraco 4-6 cms through webmatrix 2-3 azure website relative ease. didn't need hosted service/cloudapp. is url not generic placeholder, have domain registered point @ it? y'know, more type, more realise have shaky grasp of you're talking about. sure need cloudapp, azure website not do?

osx - Why are the first 4 bytes of 64-bit addresses printed as 0x00000001? -

i'm looking @ disassembly of x86_64 code apple's otool . here's sample of disassembly, outputted otool : 0000000100055de4 movq $0x00000000,%rax only last 4 bytes in offset, 00055de4 , represent file address of instruction. can open hex editor , navigate 0x55de4 , movq instruction there. however, noticed gdb works when include 8 bytes in address, including mysterious 1 . break *0x0000000100055de4 works expected, while break *0x00055de4 never triggers. every 64-bit binary have analyzed otool shows pattern. doesn't apply 32-bit addresses. so, if 0x55de4 actual address, why otool , gdb use 0x0000000100055de4 ? __pagezero, first load command in 64 bit mach-o binary, specifies segment size of 0x100000000 in virtual memory. $ otool -lv binary command 0 cmd lc_segment_64 cmdsize 72 segname __pagezero vmaddr 0x0000000000000000 vmsize 0x0000000100000000 when break *0x00055de4 breakpoint ends in segment of zeros, expl

Javascript, Mysqli, and PHP Looping -

i working on site, , having create php loop javascript in it. possible? here snippet of code need looped. <? while($calendar = mysqli_fetch_array($client_get_calendar)) { ?> { title: '<? echo $calendar['event_title'] ?>', start: new date(<? echo date("y", strtotime($calendar['date_start'])) ?>, <? echo date("m", strtotime($calendar['date_start'])) ?>, <? echo date("d", strtotime($calendar['date_start'])) ?>), end: new date(<? echo date("y", strtotime($calendar['date_end'])) ?>, <? echo date("m", strtotime($calendar['date_end'])) ?>, <? echo date("d", strtotime($calendar['date_end'])) ?>), classname: '<? echo $calendar['importance'] ?>' }, <? } ?> will work trying accomplish? gives me error, don't know wrong code. help! you appear building json output javascript obj

Moodle bulk user CSV import -

i'm trying use csv bulk import users username, firstname, lastname, email, idnumber, auth, country, city, institution, course1 a@b.ac.uk, a, z, a@b.ac.uk, a, ldap, gb, london, b, b-a-sta the auth entry drops out saying, ldap auth plugin not supported here but other entries seem fine , user gets added. can't seem find documentation on adding auth types, how specify ldap? here use cas auth , similar message, users added normally. don't know if bug...

Setting password for android app using lock screen patterns -

i want set password application require @ time of execution. want should lock screen patterns, possible? if yes please me out find helpful material design lock screen have absolutely no idea how start it. i've read touch event of developer.android.com don't how proceed further. this should you: https://code.google.com/p/android-lockpattern/source/browse/src/group/pals/android/lib/ui/lockpattern/widget/lockpatternutils.java?r=7470bc287cba61198430e3d8aff32196bb5824a0 please, give information whether works or not. :)

session - PHP $_SESSION Error - Headers already sent -

this question has answer here: cannot send session cookie - headers sent [duplicate] 5 answers i trying learn php , keep running php errors. here link site http://projects.jeremyohmann.com/homework . possible take @ code see did wrong? think error somewhere in head.php in login.php. user keeps getting logged out right after page refresh assuming has php session. the exact errors getting are: warning: session_start() [function.session-start]: cannot send session cookie - headers sent (output started @ /home/jeremyohmann/www/projects/homework/head.php:2) in /home/jeremyohmann/www/projects/homework/classes/login.php on line 30 warning: session_start() [function.session-start]: cannot send session cache limiter - headers sent (output started @ /home/jeremyohmann/www/projects/homework/head.php:2) in /home/jeremyohmann/www/projects/homework/classes/login.php on line

Javascript Scope: code block vs a code block with a self executing function cacoon -

i'm trying wrap head around scope issue. take 2 examples: a) var sels = ['.a', '.b', '.c']; while ( (var sel = fieldsets.shift()) !== undefined ) { (function(sel) { $(sel).click(function() { console.log(sel); }); })(sel); } in example, when 1 of referenced elements clicked, output .a , .b , or .c . b) var sels = ['.a', '.b', '.c']; while ( (var sel = fieldsets.shift()) !== undefined ) { $(sel).click(function() { console.log(sel); }); } in example, click result undefined . i'm misunderstanding how scope applied in these 2 examples, because see it, when .click called in either case, sel no longer exists @ all. what difference in way scope applied between these 2 cases? the key in statement of yours: ... because see it, when .click called in either case, sel no longer exists @ all. in language c, true. not javascript! when function instanti

uninitialized constant Store rails routing error -

i have store controller , items controller, want each item appear under store/ store/items/id, routes file is; match 'store'=> 'store#index' namespace :store resources :items, only: [:show] end when link item on store page correct url e.g 'store/items/1' when follow link error actioncontroller::routingerror @ /store/items/1 uninitialized constant store i don't know why i'm getting error... namespace rolls module , name prefix , path prefix . but in case, don't have module named store . controller instead. is, looking store::itemscontroller . use instead: scope '/store' resources :items, only: [:show] end this give path such item_path , uri /store/items/1

error in awk of shell script -

i getting below error ith code.what missing in it? goal print 13.0.5.8 in $version #!/bin/ksh file="abc_def_app_13.0.5.8" if echo "$file" | grep -e "abc_def_app"; echo "version found: $file" version1=(echo $file | awk -f_ '{print $nf}' | cut -d. -f1-3) version2=(echo $file | awk -f_ '{print $nf}' | cut -d. -f4-) echo $version1 echo $version2 version=$version$version2 echo $version else echo "version not found" fi please find below error: ./version.sh: line 7: syntax error near unexpected token `|' ./version.sh: line 7: ` version1=(echo $file | awk -f_ '{print $nf}' | cut -d. -f1-3)' ./version.sh: line 9: syntax error near unexpected token `|' ./version.sh: line 9: ` version2=(echo $file | awk -f_ '{print $nf}' | cut -d. -f4-)' ./version.sh: line 18: syntax error near unexpected token `else' it can don

ios - Will Apple reject my App if I change the color of the MFMailComposeViewController? -

can please answer following question: has app ever been rejected apple changing color of mfmailcomposeviewcontroller? thanks in advance! if changed color using appearance property ( uiappearance ) apple won't reject app. note: have app in appstore had mfmessagecomposeviewcontroller custom color.

c# - Simple Syntax for Declaring properties with a starting value -

well far, shortest code i've seen declare property can set inside class i've seen is: public t property {get; private set;} but if want declare starting value (which not default value type), how it?? actually i'm doing this: public t property {get; private set;} private void initialize() {property = value; } another option is: private t _property = value; public property {get {return _property;}} but i'm wondering if can write 1 code line only, because i'll writing many of properties, , don't want have duplicate line each. nope. auto-properties always default default value. your best bet set them in constructor, or else not use auto-property. public t property {get; private set;} public myclass() { property = value; }

openssl - X509* certificate serialization and deserialization in C -

i have certificate in 509* format , want serialize char buffer , later desserialize in other recover certificate 509* again. i doing serialize: int size_cert = 0; unsigned char* data; bio* bio = bio_new(bio_s_mem()); pem_write_bio_x509(bio,certificate); size_cert = bio_get_mem_data(bio, &data); bio_free(bio); where data should have certificate data! to reconstruct x509* certificate data buffer doing this: bio* bio; x509* cert; bio = bio_new(bio_s_mem()); bio_puts(bio, data); cert = pem_read_bio_x509(bio, null, null, null); where cert should certificate. not working properly, can 1 give me example this? i have done below code, 1 load certificate bio using bio_read_filename 2 convert x509 using pem_read_bio_x509_aux 3 convert unsigned char* using i2d_x509 4 reconstruct x509 unsigned char* using d2i_x509 int main() { x509 *x509,*x509ser; bio *certbio = bio_new(bio_s_file()); char * path =

java - Cannot find class [org.springframework.orm.hibernate3.annotation.AnnotationSessionFactory] for bean with name 'sessionFactory' -

i created project in spring using maven dependencies getting above mentioned error. changed version of hibernate dependency stil nt resolved here code: pom.xml <?xml version="1.0" encoding="utf-8"?> <project xmlns="http://maven.apache.org/pom/4.0.0" xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xsi:schemalocation="http://maven.apache.org/pom/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> <modelversion>4.0.0</modelversion> <groupid>com.shr</groupid> <artifactid>apps</artifactid> <name>springjdbcproject</name> <packaging>war</packaging> <version>1.0.0-build-snapshot</version> <properties> <java-version>1.6</java-version> <org.springframework-version>3.1.1.release</org.springframework-version> <org.aspectj-version>1.6.10</org.aspectj-version> <org.slf4j-version>1.6.6</org.s

Detect Design Time in JavaFX -

is there way detect design time in javafx2 works in scenebuilder? similar with: java.beans.beans.isdesigntime() for swing? developing custom control should displayed in scenebuilder. of codes in trigger classnotfoundexception. don't want add needed library, instead want bypass code trigger exception. [update] i'll tell going accomplish. extends input control components (textfield, combobox etc) , add propertyname attribute. created form extends panel scan input controls in , assign value them based on propertname. value taken pojo set form. use apache commons beanutls assign value input controls, need provide classpath bean utils jar. if activate feature automatically, can't use form in scenebuilder. because form detect input control in , assignment need library. decided deactivate feature, , provide method programmer activate it. not want, guess have no choice. there no such thing design time javafx controls. instead control code needs follow coupl

neo4j - No way to use in cypher the term case insensitivity = ~ (? i), when I'm using parameter? -

i tried way did not work. params.put("name", g ); final queryresult<map<string,object>> result = engine.query("match a:conceito --> b:livro a.nome =~'(?i){name}' return b.autor, b.titulo, b.edicao", params); //executa query this error: exception in thread "main" org.neo4j.rest.graphdb.restresultexception: expected valid query body "match a:conceito --> b:livro a.nome =~'(?i){name}' return b.autor, b.titulo, b.edicao" ^ @ the query runs if remove expression ~ (?i) excuse english because i'm brazil. works me, see: http://console.neo4j.org/r/tutchx start n=node:node_auto_index(name='neo') n.name =~ '(?i)neo' return n as use parameter, have pass in whole regexp (including flag) param value: params.put("name", "(?i)"+g ); final queryresult<map<string,object>> result = engine.quer

sql server 2008 - Extracting xml tag value for a given subtag-field combination -

the bzloans table has column named lnxml contains xml data/ table has loanid column loanid stored. sample data shown below in lnxml field in row loanid = 12345: <loans> <schedule> <pid>4</pid> <amt>2100<damt> </schedule> <schedule> <pid>5</pid> <amt>1000</amt> </schedule> </loans> the root tag loans , below schedule tag multiple subtags i lookng query return value in amt tag when pid tag value , loanid value specified. for example when pid specified 5 , loanid 12345, query should return, pid, loanid, amt 5.12345.1000 thanks in advance help. declare @loanid int = 12345 declare @pid int = 5 select @pid pid, @loanid loanid, l.x.value('.', 'int') amt bzloans b cross apply b.lnxml.nodes('/loans/schedule[pid = sql:variable("@pid")]/amt') l(x) b.loanid = @loanid

javascript - Post form to web2py function using ajax -

the server written in web2py, , hosted on google app engine. can visit index.html entering domain.com/index , can send form entering domain.com/register "register" function defined default.py however, in html, send form server , response, use ajax has cross domain issues. use "register" url, , not work. help? $("#signup").click(function() { $.ajax({ type: "post", url: "register", data: $("#formsignup").serialize(), // serializes form's elements. success: function(data) { alert(data); } }); return false; // avoid execute actual submit of form. }); by typing domain.com/register, can totally trigger function. problem here? , form sent domain.com... in browser appears htt[://domain.com/?email=ada@ad.com&password=adsa its possible register looking instead of post try changing type in ajax $("#signup").click(function() { $.ajax({

Counting number of columns in text file with Python -

i have 2 text files composed of spaced-separated columns. these excerpts of these 2 files: filea 1 1742.420 -0.410 20.1530 0.4190 1.7080 0.5940 2 1872.060 0.070 21.4710 0.2950 0.0670 0.3380 3 1918.150 0.150 18.9220 0.0490 1.4240 0.1150 4 1265.760 0.170 19.0850 0.0720 1.3330 0.1450 5 308.880 0.220 20.5020 0.1570 0.0200 0.1720 .... fileb 1 1198.367 6.465 15.684 0.015 3.119 0.140 1 2 1451.023 6.722 17.896 0.031 0.171 0.041 1 3 1032.364 6.788 18.895 0.074 -0.084 0.088 1 4 984.509 7.342 19.938 0.171 0.043 0.322 1 5 1068.536 7.369 19.182 0.091 0.486 0.143 1 .... as can see filea has 7 columns , fileb has 8. code use count columns: import csv file = 'filename' reader = csv.reader(file) num_cols = 0 col in reader: num_cols = num_cols + 1 this little code correctly gives number of columns filea (7) not fileb (also gives 7) what's going on , how can fix it? if i'm c

formulas - Excel - If cell contains string or numbers, insert another string next to it? -

i'm wondering if it's possible in excel: let's have columns a, b, , c. column c contains numbers, example, 234 or 590 i want "apple" added column d if 234 appears in column c in cell left of it. want "orange" added column d if 590 appears in column c in cell left of it. if possible... i'm wondering if can take 1 step further: let's in tab in same spreadsheet, have column number , column string corresponding each number (ex: 234 = apple, 590 = orange, 300 = pear). there way me tell excel, "if number in cell in 1 spreadsheet matches number in cell in spreadsheet, insert string next cell in other spreadsheet current spreadsheet next cell containing same number." that might sound confusing... here example: spreadsheet 1 has 3 columns formatted this: 3/5 | apple | 500 3/7 | pear | 200 3/9 | banana | 100 spreadsheet 2 has following columns: 500 | super cool 250 | cool 200 | cool 150 | little cool 100 | warm i w

CSS menu starts from center and continues to the right -

Image
i have following css menu, starts middle , continues on right. meaning cream color bar continues on end of page. tried searching, wasn't able find solution, perhaps not possible? html got: <header> <nav class="splash-menu"> <ul class="splash-nav"> <li class="why-splash">why us</li> <li class="dealer-splash">dealer login</li> </ul> <div class="clearfix"></div> </nav> </header> the css: .splash-nav{ list-style: none; margin: 0; padding: 0; background: #0b3543; } .splash-nav li{ float: left; height: 60px; } .splash-menu{ float:left; width:100%; overflow:hidden; position:relative; } .splash-menu ul { clear:left; float:left; list-