Posts

Showing posts from March, 2012

Is there a size limit on a CRX for a Chrome app that's installed manually? -

i'm distributing chrome app internally @ our company , due spec changes, need include 500mb of files. chrome allow installed? there size restriction? (this app, not extension) yes, there limit of 2 gb while answer being posted. here link ref. https://developer.chrome.com/webstore/faq#apps

d3.js: how to join data from more sources -

gs.csv (data1): id, name, x_value, y_value 1, fruits, 60, 60 2, vegetables, 70, 70 ... circles.csv (data2): id, name, value, cx_value, cy_value 1, fruits, apple, 10, 10 2, fruits, pear, 20, 20 3, fruits, strawberry, 30, 30 4, vegetables, carrot, 40, 40 5, vegetables, celery, 50, 50 ... i have 2 data files above. gs.csv (data1) contains data g elements , circles.csv (data2) contains data circles , need proper way join them , create following: <g class="groups" id="fruits" transform="translate(60,90)"> <circle class="some" id="apple" cx="10" cy="10"/> <circle class="some" id="pear" cx="20" cy="20"/> <circle class="some" id="strawberry" cx="30" cy="30"/> ... </g> <g class="groups" id="vegetables" transform="translate(70,70)"...

java - My program is terminated without scanning string -

this question has answer here: scanner skipping nextline() after using next(), nextint() or other nextfoo()? 12 answers when execute code program terminated without scanning string. double x, y; string s; scanner scan = new scanner(system.in); system.out.println("enter number: "); x = scan.nextdouble(); system.out.println("enter number 2: "); y = scan.nextdouble(); system.out.println("enter operater: x,+,/,-"); s = scan.nextline(); if(s.equals("x")) { system.out.print(x * y); } else if(s.equals("+")) { system.out.print(x + y); } else if(s.equals("/")) { system.out.print(x / y); } else if(s.equals("-")) { system.out.print(x - y); } scan.close(); my program ends before s = scan....

ElasticSearch : search and return nested type -

i pretty new elasticsearch , having trouble using nested mapping / query. i have following data structure added index : { "_id": "3", "_rev": "6-e9e1bc15b39e333bb4186de05ec1b167", "skucode": "test", "name": "dragon vol. 1", "pages": [ { "id": "1", "tags": [ { "name": "dragon" }, { "name": "japonese" } ] }, { "id": "2", "tags": [ { "name": "tagforanotherpage" } ] } ] } this index mapping defined bellow : { "metabook" : { "metabook" : { "properties" : { ...

textfield - iOS: NSNumberFormatter doesn't convert string back to NSNumber -

i using following nsnumberformatter add commas , symbol in currency value. self.currencyformatter = [nsnumberformatter new]; self.currencyformatter.numberstyle = nsnumberformattercurrencystyle; self.currencyformatter.currencysymbol = @"£"; self.currencyformatter.currencycode = @"gbp"; self.currencyformatter.roundingmode = nsnumberformatterroundhalfup; self.currencyformatter.maximumfractiondigits = 0; usage: self.principleamounttextfield.text = [self.currencyformatter stringfromnumber:[nsnumber numberwithinteger:100000]]; this displays £100,000 expected. if insert 2 more digits (text becomes £100,00096) in textfield , try convert string integer 0! following line returns 0. have no idea how deal issue. nslog(@"%d", [[self.currencyformatter numberfromstring:@"£100,00096"] integervalue]); fyi have custom inputview textfield allows numbers enter textfield. in did edit end format number , display comma. you need remove commas w...

html - getting text to sit on top of image -

i have grid of images 3x3. i'd able text sit above each image can't seem figure out how it. my css body{background-color:black;} ul#grid { list-style: none; width: 1180px; margin:0 auto; overflow:hidden; } #grid li { float: left; margin: 0 10px 70px 0px; display:inline; position:relative; } #grid li img { padding: 15px; margin: 0; width: 339px; height: 211px; position:relative; } the html <div class="portfolio"> <ul id="grid"> <li><a href="#"><img src="1.jpg"></a></li> <li><a href="#"><img src="2.jpg"></a></li> <li><a href="#"><img src="3.jpg"></a></li> <li><a href="#"><img src="4.jpg"></a></li> <li><a href="#"><img src="5.jpg"></a>...

javascript - Issue with setTimeOut and non-response script in IE8 -

i getting issue large amount of processing causing non-responsive script error in ie8 (and no, cannot make users use better browser). i read should possible split tasks , cede control browser in between different parts of validation. decided make simple example based on code found figure out breaking points are. real code doing lots of jquery validationengine processing. i tried use jsfiddle can't jsfiddle run in ie8. bummer. so, i'll have share inline here. when first load it, seems work fine. push button , both functions finish without problem. however, subsequent pushes causes unresponsive script error. i've played around number of loops in simulated work function. more 1.25 million loops , dies unresponsive script. shouldn't separate calls onclick start non-responsive counter anew? missing here? <html> <head> <script> var progress = null; var gobutton = null; window.onload = function() { progress = document.getelementbyi...

visual studio 2012 - TypeScript - not updating javascript after 0.9 install -

first did not have intellisense when using typescript. installed typescript 0.9 vs2012. now have intellisense javascript files no longer updates. i have checked typescript options "compile typescript on save". still, nothing compiles. ideas? my guess updated web esentials plugin newest version. web essentials no longer supports typescript compilation. have 2 options fix problem: revert earlier version of web essentials (2.7 or 2.6) update project file handle typescript compile see: https://typescript.codeplex.com/wikipage?title=compile-on-save and http://vswebessentials.com/changelog this may helpful: https://typescript.codeplex.com/discussions/454045

wcf - Service Oriented Architecture and evolving objects shared between applications -

Image
i'm begin writing suite of wcf services variety of business applications. soa immature begin , evolve strong middle-ware layer. unfortunately not have luxury of writing full set of services , re-factoring applications use them, iterative process done on time. question have around evolving (changing, adding, removing properties) business objects. for example: if have soa exposing service returns obj1. service being consumed app1, app2, app3. imagine object changed app1, don't want have update app2 , app3 changes made app1. if change add property work fine, not mapped happens when remove property? or change property string int? how manage change? thanks in advance help? ps: did little picture apparently need reputation of 10 have use imagination... the goal limit changes force clients have make immediately. may have make changes, under unavoidable circumstances multiple versions behind , phasing out altogether. non-breaking changes can be: adding opti...

python - the calculation conditions IF in dictionaray -

i don't understand calculation condition if if dictionary :- why when code dlist = [{'bilbo':'ian','frodo':'elijah'} , {'bilbo':'martin','thorin':'richard'}] k = 'bilbo' [ ks[k] if k in ks else 'not present' ks in dlist] but when wrote code [ ks[k] ks in dlist if k in ks else 'not present' ] i syntaxerror: invalid syntax [ks[k] if k in ks else 'not present' ks in dlist] implies [(ks[k] if k in ks else 'not present') ks in dlist] your proposal of [ ks[k] ks in dlist if k in ks else 'not present' ] cannot have parentheses placed implicitly in sensible way. here various ways of grouping syntax. none of them intended: [(ks[k] ks in dlist) if k in ks else 'not present'] [ks[k] ks in (dlist if k in ks else 'not present')] [ks[k] ks in dlist if k in ks]

php - magento onepage checkout, creating an error message and redirect -

i have hook in checkout process of magento, in observer: checkout_controller_onepage_save_shipping_method. observer action happens once user chooses shipping method in magento clicks "next" button save shipping method , continue through checkout process. i have written code may tell user (depending on various factors such shopping cart items , state being shipped to) may not proceed checkout process , must call store instead special shipping instructions. the regular redirect functions don't work inside onepage checkout because wrapped in ajax script, have tried following: mage::getsingleton('core/session')->adderror('the shipping required 1 of products attempting order..'); $response1 = $observer->getresponse(); $url = mage::geturl('checkout/cart'); $response1->setredirect($url); and mage::throwexception($this->__('the shipping required 1 of products attempting order requires special instructions, please call us....

excel vba - VBA-charts: how to read the formula from a chart Series -

how can read formula has been assigned of chart series properties? i.e. when have simple x-y scatter chart, can assign formula name property activechart.fullseriescollection(1).name = "=sheet2!$d$1" debug.print activechart.fullseriescollection(1).name ' not print =sheet2!$d$1, value in cell the problem is, when read later, returns value of formula, not formula itself. any ideas? fullseriescollection excel 2013 not have currently. however, following code displays series formula in excel 2010 , should, believe, work 2013: sub blah1() dim cht chartobject set cht = activesheet.chartobjects(1) msgbox cht.chart.seriescollection(1).formula end sub if chart not embedded chart following equivalent code (for chart sheet) works: sub blah2() dim cht chart set cht = activechart msgbox cht.seriescollection(1).formula end sub

Alternative to PHP eval? -

i have code returned script in variable. need execute php code nervous use eval function. here code generated in include file: /include.php: $preloadfields .= '$2 = new kooldatepicker("datepicker"); $2->id="field_2"; $2->scriptfolder = "/koolphp"; /main.php eval($preloadfields); even when try run using eval , error: parse error: syntax error, unexpected '2' (t_lnumber), expecting variable (t_variable) or '$' is there better / safer way accomplish this? thank in advance! just don't let include.php generate php code in variable. directly execute it. $2 = new kooldatepicker("datepicker"); $2->id="field_2"; $2->scriptfolder = "/koolphp"; if worried html being generated , outputted screen....

ember.js - How to check for dynamic route segment from view -

i have datepicker ui widget , i'm trying keep in sync routes. routes pretty straightforward: /months /months/jan-2013 /months/feb-2013 ... i'm having hard time updating datepicker if user starts out entering 1 of dynamic routes (e.g. /months/jan-2013 ). how can this? unfortunately, change date need use datepicker's api (i.e. can't use handlerbars helper , update html), think i'll need custom function in view. i've tried using observed properties, without success. here's solution came with: app.monthroute = ember.route.extend({ setupcontroller: function(controller, model) { controller.set('model', model); this.controllerfor('application').set('activemonth', model.get('id')); } }); now applicationcontroller knows 'selected month'. can use in datepicker view's init set date correctly: app.datepickerview = ember.view.extend({ didinsertelement: function() { ...

php - What is wrong about this SQL statement? -

Image
here containing php file: <?php session_start(); include("../includes/dbcxnfunction.inc"); $billid = $_post['billid']; $userid = $_session['userid']; $query = "if exists ( select * favoritebills userid = '$userid' , billid = '$billid' ) delete favoritebills userid = '$userid' , billid = '$billid' else insert favoritebills (userid,billid) values($userid,$billid) "; $result = mysqli_query(dbcxn('bill'),$query) or exit("couldn't execute query favorites"); if($result) { $request = "true"; } else { $request = "false"; } echo $request; ?> the query is: "if exists ( select * favoritebills userid = '$userid' , billid = '$billid' ) delete favoritebills userid = '$userid' , billid = '$billid' else insert fa...

django - Tastypie - Multiform post with foreign fields -

i'm trying post multiform tastypie. the django model is: class message(models.model): recipient = models.foreignkey(user, null=true, related_name='recipient') the tastypie resource: class messageresource(multipartresource, baseresource): recipient = fields.toonefield(userresource, 'recipient',full=true) part of form data: post /api/message/ http/1.1 host: 127.0.0.1:8286 content-type: multipart/form-data; boundary=boundary+0xabcdefgboundary accept: application/json content-length: 6462 accept-language: en;q=1, fr;q=0.9, de;q=0.8, ja;q=0.7, nl;q=0.6, it;q=0.5 accept-encoding: gzip, deflate connection: keep-alive user-agent: c/1.0 (iphone simulator; ios 6.1; scale/1.00) --boundary+0xabcdefgboundary content-disposition: form-data; name="fetched" 0 --boundary+0xabcdefgboundary content-disposition: form-data; name="recipient[id]" 2 --boundary+0xabcdefgboundary content-disposition: form-data; name="recipient[username]...

delphi - How to send http post with socket connection -

i want send http post command server socket connection. how can indy? by way, http ? , socket ? idhttp socket? idhttp not socket, it´s vcl component implements http client. it´s indeed used send http commands web server, post want perform. http: http://en.wikipedia.org/wiki/hypertext_transfer_protocol socket: http://en.wikipedia.org/wiki/network_socket post example: http post indy

nservicebus4 - NServiceBus 4 configuration error using .XmlSerializer() -

using nsb 4 configuration: configure.with() .defaultbuilder() .xmlserializer() gives error warning 'nservicebus.configurexmlserializer.xmlserializer(nservicebus.configure, string, bool)' obsolete: 'please use 'configure.serialization.xml()' instead. treated error version '5.0'. removed in version '6.0'.' how should configure.serialization.xml() used? use configure.serialization.xml() anywhere before configure.with()... block. or don't. xml default, don't need block @ unless want use 1 of overloads set specific setting. these new settings taking place of fluent config goal of making configuration order-agnostic , introducing sensible defaults self-hosting becomes lot easier. at point in future, you'll able use configure.createbus() if want defaults!

SharePoint 2010 REST API JQUery Insert, Update, Delete -

can explain or point me link samples of doing update, delete using jquery sharepoint 2010 rest api? i have insert working , of course queries since msdn documentation explains , every tutorial on net explains queries wondering if ever inserts, updates, deletes data instead of samples , tutorials on querying? yes know can use csom want learn how done via jquery , sharepoint rest? also want use merge updating. here's working insert code: function insertmilestone() { var milestoneslisturl = "/_vti_bin/listdata.svc/milestones"; var milestone = {}; milestone.title = "testing rest"; var entry = json.stringify(milestone); $.ajax({ type: "post", url: milestoneslisturl, data: entry, contenttype: "application/json; charset=utf-8", error: function (xhr) { ...

Update QSQLTableModel in QT C++ -

i created 1 dialog used bindvalues in sql database, , can save every new record sucessfully. problem i've got dialog qsqltablemodel shows information database. every time make new record must close program , run again see changes in showinformationdialog() . know way such don't need close program update information in showinformationdialog() ? you can use select() method of qsqltablemodel class repopulate model data database. bound views updated automatically. suggest connecting signal wherever update data in database (i.e. dialog updating sql database) custom slot in showinformationdialog() calls select() of qsqltablemodel object. assume have qmainwindow object parent of both dialogues best place establish connection. also since showinformationdialog() 's model used viewing data consider using qsqlquerymodel . if used setquery() method should used instead of select() otherwise (the connection of signal showinformationdialog() 's slot) same. ...

java - Could not create an object using constructor -

there interface public interface rtriangle { int getapexx1(); int getapexy1(); int getapexx2(); int getapexy2(); int getapexx3(); int getapexy3(); } and class implement interface public class righttriangle implements rtriangle{ private point a; private point b; private point c; public righttriangle (int x1, int y1, int x2, int y2, int x3, int y3){ this.a.x=x1; this.a.y=y1; this.b.x=x1; this.b.y=y1; this.c.x=x1; this.c.y=y1; } public int getapexx1(){ return a.x; } public int getapexy1(){ return a.y; } public int getapexx2() { return b.x; } public int getapexy2(){ return b.y; } public int getapexx3(){ return c.x; } public int getapexy3(){ return c.y; } } also there class uses class: public class rtriangleprovider { public static rtriangle getrtriangle(){ try{ rt...

mysql - MY SQL QUERY DATA ARRANGING -

let's have mysql query results in following lines . col1data col2data1 col3data col4data col1data col2data2 col3data col4data col1data col2data3 col3data col4data note data in columns bar second 1 same . question : there way via query have results in form col1data col3data col4data col2data1 col2data2 col2data3 putting different data on same line ? if want records col2 combined single delimited string, can group table using mysql's group_concat() function: select col1, col3, col4, group_concat(col2) my_table group col1, col3, col4 see on sqlfiddle .

How Do I Open an SQLite3 Table in Ruby That is Read from an S3 Object -

so trying read sqlite3 database have stored on s3. i can fetch , read file , raw innards like: puts dbdata ????????etable1t#sample texttabl#sample text1 in#sample textvarc#sample text #sample text #sample text #sample text => nil but if try create sqlite3 object in ruby out of this, not have table. i'd this: db = sqlite3::database.open(dbdata) so can query object. lost here, know how create sqlite3 db files contents, not file itself? i'd try , avoid downloading file each time script runs. you need content of database use it. so, what's problem downloading it? there no way around it.

python - Turning certain characters of lists into strings -

i'm working on second assignment school , new programming. covering lists in python , i'm having little trouble. we're making go fish game using lists, , need convert of characters list or new string. preferably string since need concatenate string. we have list of lists representing cards each player, looking phands[0] = [ac,4c,2h,jd,ad] , , need turn "a 4 2 j a" def mycards (phands,player_number): card_list = [] in range(len(phands[0])): card_list = card_list + (phands[0][i][0]) return card_list it causing errors of not being able concatenate str list, , i'm not familiar join function. appreciated!! thank much! use card_list.append(phands[0][i][0]) . + works in context when elements on both sides lists. do: card_list = card_list + [phands[0][i][0]] however, wasteful (1) allocates new temporary list object, , (2) returns new list object instead of modifying existing one.

wmi - How do I escape comma in WMIC inside like string -

i wish able run query following: wmic path win32_service "displayname 'foobarservice % (x, y)'" * but, doesn't work because of comma inside string. error "invalid verb." tried escaping backslash, , tried escaping using brackets underscores meant escaped, , both resulted in "invalid verb." error. as less-than-ideal workaround, can replace commas underscores, , works, underscore match single character rather comma, i'd rather find way escape commas. is there way escape comma in example? one way have found include comma in like clause place entire where expression in parentheses. unfortunately, found means cannot include close paren in string @ same time (but open paren okay). experimented /trace:on option see going on under covers little bit , helped me find couple things program accepts: here example got work comma, apparently cannot contain close paren: c:\> wmic /trace:on path win32_service (description '...

Workflow Design - Going from Development to Testing to Production Databases -

i've been trying wrap head around few days now. solutions come little complicated. red flag i'm going in wrong direction. anyway i'm trying come solid, hands off, work flow going dev prod test server in between. currently project i'm working on hasn't been launched , not have prod server. all of developers work locally. changes devs make committed repo , integrated dev environment. have dev server , test server. the dev , test server databases being handled hand, , launch going problem. this how propose launch make copy of test server. copy becomes prod. create master-slave relationship between prod , test data remains consistent. launch site. every night take data test , give ability refresh database recent data. developers make changes schema, gets tested, added repo, , goes dev. the current data , current schema gets merged in dev verify schema doesn't break anything. ready launch new version, bring test. once changes tested , ready l...

aggregation framework - Matching on compound _id fields in MongoDB aggregate -

i'm mongodb novice please forgive me if question has obvious answer... context: i've followed example in mongodb docs implement hierarchical aggregation using map-reduce. example uses "compound" _id field map-reduce key producing aggregate documents this... { _id: { u: "rick", d: isodate("2010-10-10t14:00:00z") }, value: { ts: isodate('2010-10-10t15:01:00z'), total: 254, count: 10, mean: 25.4 } } this , good. particular use case requires values several similar keys emitted each map step. example... { _id: { u: "rick", d: isodate("2010-10-10t14:00:00z"), hobby: "wizardry" }, value: { ts: isodate('2010-10-10t15:01:00z'), total: 254, count: 10, mean: 25.4 } } { _id: { u: "rick", d: isodate("2010-10-10t14:00:00z"), gender: "male" }, value: { ts: isodate('2010-10-10t15:01:00z...

Adding PatternMatchListener to Eclipse Console in which stage of View Lifecycle -

i developing eclipse plug-in triggered specific pattern string found (e.g., stack trace) in default console opened in eclipse , show notification in custom view. know how add listener available consoles.but not sure in phase of eclipse view life cycle need add listener. adding in createpartcontrol not want, because forces me open view manually perform binding listener consoles. public void createpartcontrol(composite parent) { //got default console consoleplugin textconsole tconsole=(textconsole)defaultconsole; tconsole.addpatternmatchlistener(new ipatternmatchlistener() { // implementation codes goes here } } any appreciated.

conditional statements - Conditionally apply filter in forward pipe chain in F#? -

i sequence of records csv file. want optionally filter records date , type , optionally consolidate records meeting criteria. optionally filtering date , type straightforward using seq.filter . optionally consolidate records meeting criteria. have function working, can't figure out how optionally apply resulting sequence. can't use seq.filter because consolidate operates on entire sequence not on 1 item @ time. can solve intermediate variable, wondering if there graceful idiomatic way handle this. basically want know way conditionally apply 1 (or more) parts of chain in forward pipe sequence. this want in pseudo code ( options holds command line parameters): let x = getrecords options.filepath |> seq.filter (fun r -> if options.date.hasvalue r.date.date = options.date.value.date else true) |> seq.filter (fun r -> if not(string.isnullorempty(options.type)) r.type = options.type else ...

javascript - strophe/xmpp set priority of a client manualy -

is there way set priority of client in strophe.js manually xmpp connection. i communicating google talk server, , have 2 seperate clients. 1 client signals availability status (online/offline/etc...).the other receiving messages regardless of other clients status. http://www.ietf.org/rfc/rfc3921.txt section 11.1.4 specifies that for message stanzas, server should deliver stanza highest-priority available resource (if resource did not provide value element, server should consider have provided value of zero). if 2 or more available resources have same priority, server may use other rule (e.g., recent connect time, recent activity time, or highest availability determined hierarchy of values) choose between them or may deliver message such resources. however, server must not deliver stanza available resource negative priority; if available resource has negative priority, server should handle message if there no available resources (defined below)....

c - File IO in the apache portable runtime library -

while working through zed shaw's learn c hard way, encountered function apr_dir_make_recursive() according the documentation here has type signature apr_status_t apr_dir_make_recursive(const char *path, apr_fileperms_t perm, apr_pool_t *pool) which makes directory, identical unix command mkdir -p. why io function need memory pool in order operate? my first thought was perhaps optional argument populate newly made directory, code below uses initialized presumptively empty memory pool. mean io function needs memory pool, passing in use? doesn't seem either; couldn't function create local memory pool use destroyed upon return or error? so, use memory pool? documentation linked unhelpful on point. code shortened , shown below, curious. int db_init() { apr_pool_t *p = null; apr_pool_initialize(); apr_pool_create(&p, null); if(access(db_dir, w_ok | x_ok) == -1) { apr_status_t rc = apr_dir_make_recursive(db_dir, ...

java - How could I draw an Outlined Mesh like this? -

Image
so saw blog parsing obj files, caught eye object parsing (this question isn't parsing obj files). i know mesh created using 3d noise algorithm, simplex noise, want know how make similar line effect in lwjgl. i have 3d simplex noise algorithm, , code thought work doesn't quite same thing. the pattern notice mesh there rows of lines start on outside noise density highest. lines evolve based on noise density in specific spots, tried make algorithm produce lines , evolve them well, didn't quite work. simplexnoise noise = new simplexnoise(23453) //variable seed worldlist = glgenlists(1); glnewlist(worldlist, gl_compile); //inefficient gets job done float prevx = 0.0f; float prevy = 0.0f; float prevz = 0.0f; for(int x=0;x<256;x++){ for(int y=0;y<256;y++){ for(int z=0;z<256;z++){ float xf = x/100; float yf = y/100; float zf = z/100; density = noise.simplex(3,x...

javascript - a SPAN within A (HREF) -

i have span function display div on onclick, within (href), clicking, performs function, , after go site (href), has no way click on span, perform function, , not go page of (href) ? <a class="style" href="http://stackoverflow.com/"> <span onclick="javascript:display('div1');">\/</span> stack overflow </a> sorry bad english. you may need use jquery magic here. <a class="style" href="http://stackoverflow.com/"> <span id="inner-button">\/</span> stack overflow </a> with js: $('a').click(function(e) { if (e.target.id == 'inner-button') { // display div. e.preventdefault(); } });

elasticsearch - How do i check if a field is empty or null with Tire gem on Rails -

i'm trying check tire if field null. here query on model. def self.search(params) tire.search(load: true, match_all: {}, page: params[:page], per_page: 12) query boolean must { string params[:query], default_operator: "and" } must { term :online, true } must_not { string 'name:undefined' } must_not { term 'price:null' } end end end end must_not { term 'price:null' } code wich leads me error. how can ? use must_not { |m| m.term "price", nil }

YouTube API: "no linked youtube account" with a YouTube Business Account -

Image
i've got client business. using google apps business (the paid version), , have created google apps email account. using email account, logged youtube , went create channel. because business, created business youtube channel associated business google+ page. have vendor using youtube api upload videos them. when vendor tries use api, error "no linked youtube account". we're thinking because google+ business page, page not associated single google account, rather multiple google accounts can set "managers" of page. when tried create "personal" youtube channel/google+ page associated email address, tried put company name in first name / last name , rejected because says it's company name , not real person's name. asks gender , birthdate, , of things associated person , not business. my questions is.... there way around issue? can use youtube api upload google+ business page , youtube business channel? thanks, justin ...

jboss - Hibernate SchemaExport fails to first create schema -

i running tests using arquillian, jboss, jpa/hibernate, h2 db , maven. in test persistence.xml file have: <property name="hibernate.hbm2ddl.auto" value="create-drop" /> <property name="hibernate.show_sql" value="true" /> for have single user class mapped 'users' table via hibernate annotations. things working. problem hibernate trying execute: drop table my_schema.users if exists but schema, 'my_schema' doesn't exist fails (i'm running against in-memory db after all). how hibernate execute 'create schema my_schema' step seems forgetting? update: messages see hibernate: 09:42:45,402 info [org.jboss.as.jpa] (msc service thread 1-7) jbas011402: starting persistence unit service 'test.war#ccmc' 09:42:45,524 info [org.hibernate.annotations.common.version] (msc service thread 1-7) hcann000001: hibernate commons annotations {4.0.1.final} 09:42:45,532 info [org.hibernate.version...

python - Fibonacci list how do i make a conditional that excludes a number -

fib = [0,1] = 1 b = 0 = 0 while < n: = a+b a,b = i, fib.append(i) this works in cases 'n' (which given variable) number in actual fibonacci sequence, 21 or 13. however, if number six, adds 1 more number should. list should not contain number greater n. you add a list first, incrementing. fib = [0] a, b = 1, 0 while <= n: fib.append(a) a,b = a+b,

python - PyFpdf without borders -

i using pyfpdf generate pdfs. want simple table, without lines. using code: html = """ <table border="0"> <thead border="0"><tr align="left" border="0"><th width="60%" align="left" border="0">header 1</th><th width="40%" align="right">header 2</th></tr></thead> <tbody border="0"> <tr border="0"><td align="left" border="0">cell 1</td><td align="left" border="0">cell 2</td></tr> <tr><td align="left">cell 2</td><td align="left">alsjdf asdcell 3</td></tr> <tr><td align="left">cell 1</td><td align="right">csdfsdfsdfsdell 2</td></tr> <tr><td align="left">cell 2</td><td align="rig...

AngularJS + Jasmine how to spy on a service's constructor called in a controller -

i trying unit test constructor of mine. within constructor, injecting custom service houses data , makes http requests. within save function of constructor, instantiate object on scope calling constructor custom service. i want test make sure constructor of custom service being called. trying use jasmine spy spy on constructor call, unsuccessfully. trying follow example given jasmine on how perform spy on constructor ([jasmine spies]) 1 , not working. my controller defined follows: controller('comments.editctrl', ['$scope', '$location', '$routeparams', 'comment', function($scope, $location, $routeparams, comment) { $scope.save = function(comment) { $scope.comment = new comment(comment); $scope.comment.postid = $routeparams.postid; comment.save($scope.comment, function() { $location.path('/blog/' + $routeparams.postid); }); }; }]) the custom service named 'comment...

How do I export issues from a Google Code project to Github? -

i'm trying move project google code github, , can't find way migrate issue tickets. i found https://github.com/arthur-debert/google-code-issues-migrator appears top hit in google search "migrate issues google code github", ever when attempt use is 404 . it appears can export google code tickets csv, a) don't see way import csv github, , b) seems barest data each ticket. is there way migrate issues google code github? i exported google code issues csv (which sadly not include comments), , used following script import them github: #!/usr/bin/env ruby # based on https://gist.github.com/visnup/1117145 require 'rubygems' require 'fastercsv' require 'httparty' require 'json' github_user = 'xxx' github_repo = 'xxx' gcode_repo = 'xxx' class github include httparty base_uri 'https://api.github.com' basic_auth "xxx", "xxx" end fastercsv.open argv.shift, :head...

Passing Variables Between Javascript and Python -

Image
i attempting pass value of integer within javascript function server side python script. have tried find way pass value directly javascript python have not yet been successful, instead have tried create hidden element contains value of int within html form javascript function. using action 'post' python bottle framework have tried copy value python script. however, int being processed being of nonetype, rather int, , cannot use within processing script. part of js function creates element int named instance follows function newitem(){ instance++; var oldinput = document.getelementbyid("iteminfo"); var parent = oldinput.parentnode; var newdiv = document.createelement("div"); var item = document.createelement("input"); var qty = document.createelement("input"); var color = document.createelement("input"); var count = document.createelement("hidden"); item.name = "item" + instance;...

jsp tags - JSP cannot parse form input to integer -

i have vector magazines keep titles of magazines. created form people can choose magazines want. ... <form action="magform.jsp"> <table> <% vector magazines; //already populated titles for(int = 0; < magazines.size(); i++) { %> <tr> <td> <input type="checkbox" name="mags" value="<%=i%>"> <%out.println(magazines.get(i)); %><br /> </td> </tr> <% } %> <input type="submit" value="submit"> </table></form> <% string select[] = request.getparametervalues("mags"); for(int = 0; < select.length; i++) { out.println(select[i]); } %> for above codes, can result of select. when modify to: <% string select[] = request.getparametervalues("mags"); int a; for(int = 0; < select.length; i++) { = integer.parseint(select[i]); out.println(a); } %>...

locking - Java Condition fail to re-aquire the lock(a ReentrantLock) associated with it after await() returns -

import java.util.linkedlist; import java.util.concurrent.locks.condition; import java.util.concurrent.locks.reentrantlock; class foo { private reentrantlock _lock; private condition _cond; private thread _thr; private linkedlist<string> _msgqueue; public foo() { _lock = new reentrantlock(); _cond = _lock.newcondition(); _msgqueue = new linkedlist<string>(); startthread(); } public void putmsg(string msg) throws exception { _lock.lock(); _msgqueue.addlast(msg); _cond.signal(); system.out.println(thread.currentthread().getid() + ": signal write thread."); _lock.unlock(); system.out.println(thread.currentthread().getid() + ": unlocked."); } private void startthread() { _thr = new thread() { public void run() { _lock.lock(); while(true) { try { ...

Reading csv file into 2-dimentional Array Java -

i'm trying write method take multiline csv file , return contents of file arraylist. problem is, when print array lines, appear have contents of last line of file. i'm suspecting might filereader or bufferedreader don't know. anyhow, here's code: import java.io.bufferedreader; import java.io.filereader; import java.io.ioexception; public int[][] readcsv(string pfilename) throws numberformatexception, ioexception { int[][] arr = new int[19][19]; bufferedreader br = new bufferedreader(new filereader(pfilename)); string line = " "; string [] temp; while ((line = br.readline())!= null){ temp = line.split(","); //split spaces for(int = 0; i<arr.length; i++) { (int j = 0; j<arr.length; j++) { arr[i][j] = integer.parseint(temp[j]); } } } printarray(arr); } public static void printarray (int[][] arr) { (int =0; <arr.length; i...

jquery - HTML5 attribute type "time" in phonegap android app hangs the app -

i have phonegap - android app (built jquerymobile), jquery version 1.9.1 , there time field (taken input) in 1 of screens. following code used. <td><input type="time" name="fromtime_2" value="" placeholder="time" /></td> <td><input type="time" name="totime_2" value="" placeholder="time" /></td> i have 6 of these time fields in same screens.. in <table> . on app (android v 4.1), when select first time field, works i.e. shows android clock , able select time. problem starts when select of other time fields. shows android clock , when "set" button tapped, app hangs there , won't respond. have manually "force stop" app , restart. updated:- "i need time field here. datetime not required" problem same when tried datetime field. works 1 datetime field. new update:- it's showing simple keyboard (not android clock) on emulat...

jquery - onbeforeunload issue in IE browser -

i using below code leaving current page. works fine in chrome , mozilla, calling every anchor tags in ie 10 browser. can prevent calling in ie 10 browser? window.onbeforeunload = function() { return ""; }; this default behavior of ie, need remove onbeforeunload event anchor tag while hovering on it: $(document).ready(function(){ //store onbeforeunload later use $(window).data('beforeunload',window.onbeforeunload); //remove||re-assign onbeforeunload on hover $('a') .hover( function(){window.onbeforeunload=null;}, function(){window.onbeforeunload=$(window).data('beforeunload');} ); }); or need 'return false' onclick event of each anchor tag: <a onclick="somefunction(); return false;" href="lnk" >my link</a>

javascript - Exclude submit button from beforeunload event -

i'm detecting form changes in page, , i've handled $('#element').change(function(){ metadatachange = true; }); so when user leaves page , change made in input in form. he/she alerted whether leave or stay on page , in facebook try post status , leave page, dialog box prompted giving options either leave or stay in page. $(window).on('beforeunload', function() { if(metadatachange === true || basicinfochange === true){ return "you have unsaved changes, want leave without saving?"; } }); the code above works however.. want exclude submit button this. because when click "submit" , behavior of submit button means redirecting page. user prompted again same message when in fact he/she intends save his/her changes. how exclude submit button being caught in beforeunload event of window? can hardly explain this... hope can understood..thanks! $('#submitbutton').click(function(){ metadatachange...

c - Using KSEG2 with wired TLB's in kernel mode -

we have code running in kuseg , see need more 2gb of memory kuseg provides. tried map more physical memory kseg2 (since run in kernel mode) setting wired tlbs. when wrote test application access , write kseg2 space (address 0xc0000000) see throws tlbs exception complaining there tlb miss. have double checked tlb's setup correctly. missing here. has used mips kseg2 in kernel mode. thanks lot in advance. vamsi. on chip using kseg2 address needs have high order 32 bits set 1. programming virtual address 0xffffffffc0000000 solved problem.

php - Unable to store File details in Database -

i trying store uploaded file details in database. have written following code, unable understand why not reading query block. not generating mysql error message or other syntax error. kindly check it. <head> <meta http-equiv="content-type" content="text/html; charset=utf-8" /> <title>untitled document</title> </head> <body> <form action="file_upload_test2.php" method="post" enctype="multipart/form-data"> <label for="file">filename:</label> <input type="file" name="file" id="file"><br> <input type="file" name="file2" id="file"><br> <input type="file" name="file3" id="file"><br> <input type="submit" name="submit" value="submit"> </form> </body> </html> <?php include 'connect.php...

Select Next and previous row data SQLite -

i want ask on how next , previous data when select "8787" this sample data on table name: nameid not auto number. nameid rname 6767 apple 8787 hallow 8627 orange thanks to next id, throw away ids not larger, sort table id next id first one, take 1 record: select * mytable nameid > 8787 order nameid limit 1 similar previous id: select * mytable nameid < 8787 order nameid desc limit 1

html - Stop a div scrolling once its content finishes, while the other div keeps scrolling -

working on new design 3 vertical columns. the leftmost column fixed the main content column , right sidebar vertically scrollable browser's main scroll bar parallely. when content of right sidebar reaches end stops scrolling while main content column keeps on scrolling. somewhat similar yahoo's layout i guess need this: http://andrewhenderson.me/tutorial/jquery-sticky-sidebar/ have @ demo: http://andrewhenderson.me/wp-content/tutorials/jquery-sticky-content/index.html if doesnt serve purpose, try googling keywords 'sticky div' or 'sticky sidebar'. sure you'll find looking for!

keil - C51 C compiler inline assembly to SDCC inline assembly -

i'm not assembly project have modify few lines of assembly code c51 c compiler sdcc. this code c51 setb t1run setb t0run setb idle jnb t0full, $ which, compiled sdcc produces ?aslink-warning-undefined global 'idle' referenced module 'com_func' ?aslink-warning-undefined global '$' referenced module 'com_func' ?aslink-warning-undefined global 't0run' referenced module 'com_func' ?aslink-warning-undefined global 't1run' referenced module 'com_func' ?aslink-warning-byte pcr relocation error symbol $ file module area offset refby ./com_func.rel com_func cseg 004a defin ./com_func.rel com_func cabs 0000 as compiler errors/warnings. i know $ -symbol replaced actual address of instruction assembler - sdcc equivalent? how can resolve warnings t0run etc.? i think repl...