Posts

Showing posts from May, 2010

Rails & Neo4j - background processing and or queue - DelayedJob, SideKiq, RabbitMQ, Resque - which will fill these requirements? -

Rails & Neo4j - background processing and or queue - DelayedJob, SideKiq, RabbitMQ, Resque - which will fill these requirements? - i have neo4j cypher queries take quite bit of time process (they aggregate data).. i've optimized them death, still take longer want.. (using rails 3.2, rest (neography gem), ruby 1.93, neo4j 1.98, mac osx 10.7 ) for example, when user comments on object, fan out updates of friends. right fan out process attached comment process, , need separate out, otherwise user comments waits longer necessary.. , need guarantee job run , not lost or never executed, if whole scheme has rebooted. so first question is, want require message queue , background processing tool, or can both of these found in 1 system. i.e., might case of needing message queue guarantee job executed, using background process execute job? secondly, system(s) meet requirements? here requirements, in order of priority: run in background. deed of commenting kick off

Import random Excel into Rails 4 app to create database schema on the fly -

Import random Excel into Rails 4 app to create database schema on the fly - one of recent rails app requires import info excel, i've been next along ryan's railscasts #396 importing csv , excel, worked out pretty okay, 1 limitation, have create database schema first, wondering how can create more adaptable, pick excel header or number of columns, base of operations on imported data, create database schema on fly. possible? :) relational database works when know construction of data, there not suitable making migrations triggered user data, if don't know construction can schema like: mytable col1: string col2: string col3: string coln: string other approach may seek utilize non-relational database mongodb, it's compatible ruby on rails. ruby-on-rails

python - Getstatusoutput function returns a value doesn't work -

python - Getstatusoutput function returns a value doesn't work - i utilize django application, view.py file phone call changes_to_test2 function, within of config.py file located in different folder view.py. the code is: view.py file: def test1(request): import commands command = "config.py --action=changes_to_test2" (status, output) = commands.getstatusoutput(command) print 'output %s' %output the print displays: output sh: config.py: command not found so never enters other function, suggestions? python django

ios - Compound predicate not returning the results -

ios - Compound predicate not returning the results - i'm stuck problem while can't seem think of way right. i'll seek explain clear can. there 3 entities in core info model. workplace, patient , handover. a workplace can have multiple patients. patient can belong multiple workplaces. a patient can have 1 handover , vice versa. in app, list of workplaces shown user. when user selects workplace, need set patients belong selected workplace , have handovers today. since patient can have multiple handovers, there can duplicate records patients , that's okay. this i'm doing now. first retrieve workplace object user selected. iterate through it's patients , extract ids of patient objects , collect them in array. pass array of patient ids , date filter out patients have handovers given date. let workplace = db.loadworkplace(155) // 155 id of workplace var patientids: [int] = [] p in workplace.patients { allow patient = p patient patienti

SharePoint::SOAPHandler perl script works for display not copy -

SharePoint::SOAPHandler perl script works for display not copy - i'm trying re-create files linux server sharepoint. i've got connection working on display of sharepoint. there 1 file out there view. 401 unauthorized on copy. why successful on display not copy? #!/usr/bin/perl utilize authen::ntlm qw(ntlmv2); utilize data::dumper; utilize sharepoint::soaphandler; utilize copytree::vendorproof; utilize copytree::vendorproof::localfileop; delete $env{'https_proxy'}; $sharepointobj = sharepoint::soaphandler ->new; $localfileobj = copytree::vendorproof::localfileop ->new; $sharepointobj->sp_creds_domain('operations.web.myworksite.com:443'); $sharepointobj->sp_creds_user('mydomain\myuserid'); $sharepointobj->sp_creds_password('mypassword'); $sharepointobj->sp_authorizedroot('https://operations.web.myworksite.com:443/sites/ca...'); $cpobj = copytree::vendorproof ->new; print dumper $sharepointobj->fd

c# - Cannot get response in ajax success -

c# - Cannot get response in ajax success - my ajax code below. in cannot response server side c# code. there no issues server side code ( have checked debugging ). server side returning string ajax. $.ajax({ type: "post", url: '@system.web.configuration.webconfigurationmanager.appsettings["baseurl"]' +"provider/getstate", contenttype: 'application/json', data: {countryid: country_id }, success: function (data) { alert(data); } }); server side code below public string getstate(string countryid) { int i= convert.toint32(countryid); var details = objuseraccount.sp_getstate(i).tolist(); if(details.count>0) { homecoming "success"; } else { homecoming "false"; } } add datatype in ajax request this , if datatype not matched received

verilog - Assign localparam with concatenation satement? -

verilog - Assign localparam with concatenation satement? - here's i'm trying . . . localparam nine1 = {3{4'b0000}, 4'b1001}; localparam nine2 = {2{4'b0000}, 2{nine1}}; is possible assign localparam concat satement , utilize localparam in localparam assignment? seems work, might have fuddled up. not scheme verilog way. well, error wasn't wrapping replication statements in {} within concatenation . localparam nine1 = {{3{4'b0000}}, 4'b1001}; localparam nine2 = {{2{4'b0000}}, {2{nine1}}}; subtle, important. verilog

vb.net - Pass-through methods vs. accessing nested objects directly -

vb.net - Pass-through methods vs. accessing nested objects directly - what have object contains list of objects each contain list of objects have properties , such. currently utilize pass-through methods able add together nested objects, in extremely simplified example: public class clsa private objb list(of clsb) = new list(of clsb) public sub new() objb.add(new clsb) end sub public sub addint(byval bindex int32, byval cindex int32, byval number int32) objb(bindex).addint(cindex, number) end sub end class public class clsb private objc list(of clsc) = new list(of clsc) public sub new() objc.add(new clsc) end sub public sub addint(byval cindex int32, byval number int32) objc(cindex).addint(number) end sub end class public class clsc private lstnum list(of int32) = new list(of int32) public sub addint(byval number int32) lstnum.add(number) end sub end class it seems proper coding standards tell me right compared to: public class clsd

How to remove tags from a pdf -

How to remove tags from a pdf - i have pdf there tags this: 62 0 obj << /type /structelem /s /dokumentnavn /p 56 0 r /k 2 /pg 58 0 r >> endobj 60 0 obj << /type /structelem /s /bundtekst /p 56 0 r /k 0 /pg 58 0 r >> endobj 61 0 obj << /type /structelem /s /referencelinjer /p 56 0 r /lang (da) /k 1 /pg 58 0 r >> endobj 68 0 obj << /type /structelem /s /fritekst /p 56 0 r /k 6 /pg 58 0 r >> endobj i have "removed" them overwriting them % tool checks against whitelist still complains i'm thinking maybe tags used in binary sections of pdf. can abcpdf remove tags or there solution? docotic.pdf library can remove construction info pdf documents. below sample code task: public static void savewithoutstructureinformation(string input, string output) { using (pdfdocument document = new pdfdocument(input)) { document.removestructureinformation(); document.saveoptions.removeunusedobject

javascript - jQuery Form gets lost after Bootstrap modal is cloned -

javascript - jQuery Form gets lost after Bootstrap modal is cloned - my thought submit myform placed within bootstrap modal via jqueryform, immediate upload status response user. works fine until seek reset myform cloning mymodal. after cloning looks fine untill seek submit myform 1 time again. result instead of getting mystatus filled in redirected upload_replay-echo.php. solution easy: location.reload() makes whole thought pointless. the code below working example. upload_replay-echo.php can homecoming anything. example: <?php echo 'upload echo..<br>'; ?> can help me in matter? thanks in advance! <!doctype html> <html lang="en"> <head> <meta http-equiv="content-type" content="text/html; charset=utf-8"> <title>test</title> <link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css">

jquery - Set focus on dropdown by select name with variable -

jquery - Set focus on dropdown by select name with variable - i'm trying set focus of dropdown using variable in select name=+variable+ alert shows right name of select focus on focus doesn't set. if utilize actual name of select instead of variable focus works. i've looked @ several examples , tried mix of putting in " around name still won't focus. looking. css <style> select:focus { background-color: yellow; } </style> jquery <script> $('input[name^=dialsetting]').click(function () { var name = $(this).attr('name'); var headtypenum = name.replace('dialsetting', 'headtype'); alert(headtypenum); $('select[name=+headtypenum+]').focus(); }); </script> html <select name="headtype1"> <option id="item37_0_option" selected value="1">choose one</option> <option id="item37_1_option&quo

jenkins can't see anaconda python -

jenkins can't see anaconda python - trying jenkins work anaconda python. i'm using shiningpanda plugin , python plugin. whenever seek set python installation point python 2.7 executable, /home/lminer/anaconda/bin/python2.7 , message neither directory nor executable. there 2.7 compatibility problem? edit: here's python info # python /home/lminer/anaconda/bin/python2 # ls -l /home/lminer/anaconda/bin/python* lrwxrwxrwx 1 root root 7 oct 9 17:02 /home/lminer/anaconda/bin/python -> python2 lrwxrwxrwx 1 root root 9 oct 9 17:02 /home/lminer/anaconda/bin/python2 -> python2.7 -rwxr-xr-x 1 root root 10038 oct 9 17:02 /home/lminer/anaconda/bin/python2.7 -rwxr-xr-x 1 root root 1600 oct 9 17:02 /home/lminer/anaconda/bin/python-argcomplete-check-easy-install-script -rwxr-xr-x 1 root root 1678 oct 9 17:02 /home/lminer/anaconda/bin/python-config not sure how give evidence on error. go jenkins > configuration > python > python installations . u

http - REST PUT vs POST with UUID -

http - REST PUT vs POST with UUID - if using uuid identify entity part of uri of rest endpoint: /entities/<uuid>/ and uuid generated client when creating new entities, there best practice far using put vs post ? in other words uuid generated client opposed server. if utilize put , expected message payload contain uuid well? in case both message uri identifying entity contain uuid . for spec, see: rest rfc since (the client) know uuid, put best practice, , don't need include uuid in payload. admittedly, put vs post controversial , reading , re-reading rfc doesn't totally clear me. think preceding orthodoxy. see put vs post in rest nice discussion. rest http post routing put

Handle with overflowing memory in matlab -

Handle with overflowing memory in matlab - i have problem overflowing memory in matlab. working in channel coding using ludy code. encoding symbol y created following y=x*g where g matrix n-by-m , x input symbol size 1-by-n my problem want work number of input symbols large. hence, must allocate g matrix size large. however, occurs overflow memory problem. using matlab 2012a it. suggest me method resolve problem for illustration g matrix 40000-by-60000 code function g = gen_matrix(n,m) g = zeros(n,m); i=1:m d=randi(n/2); column = [ones(1,d) zeros(1,n-d)]; column = column(randperm(n)); g(:,i) = column'; end end this memory information [userview systemview] = memory; systemview.virtualaddressspace ans = available: 1.4074e+14 total: 1.4074e+14 try using sparse matrix: function g = gen_matrix(n,m) g = sparse(zeros(n,m)); i=1:m d=randi(n/2); column = [ones(1,d) s

tfs2010 - TFS Removing Values From Custom Fields -

tfs2010 - TFS Removing Values From Custom Fields - in our implementation of tfs 2010 have added various custom fields alter requests, , of these drop downwards lists of items. as time has went on of these items no longer valid, potentially assigned alter requests past , present. should remove items these drop downwards lists scenario when opening tfs alter requests via visual studio / web interface? need update mandatory field new value, or start throwing horrible index out of range exceptions? ideally test in development instance of tfs, don't have access one, , such i'd nervous 'having go' see happens. got reply myself doing it. created brand new field in tfs new field reference, new field displayed items in drop downwards list 1 time imported. i saved tfs alter request having selected 1 of these values, went xml file exported create initial changes, remove selected item, imported updated wit, , 1 time refreshed updated list. the se

groovy - Grails Gorm reference a property's (column's) value within a named query? -

groovy - Grails Gorm reference a property's (column's) value within a named query? - so... there way this? class kitty { string name string nickname public static string getexpectednickname(string name) { homecoming name.replaceall('mr. ', '') } static namedqueries = { bykitywithpredictablenickname { ilike 'name', '%kitty%' ilike 'nickname', kitty.getexpectednickname('name') } } } can reference value of current row's column value somehow? thought property('name') work, alas, no. edit: another example: thought work... doesn't :( ... static namedqueries = { whydoesntthisreturneverything { int c = kitty.bysubquery(id).count() //returns when set "1" instead of "id" c == 1 } bysubquery { long paramid -> eq 'id', paramid } } instead stupid illegal argument e

css3 - Setting language for multiple elements in CSS -

css3 - Setting language for multiple elements in CSS - what simplest way in css 3 of specifying international language variation quotes q , blockqote , cite . css below works, seems rather verbose: :lang(af) > q, :lang(af) > blockquote, :lang(af) > cite {quotes: '“' '”' '‘' '’';} i looking less verbose solution, perhaps this: :lang(af) > (q, blockquote, cite) {quotes: '“' '”' '‘' '’';} but i'm not sure if kind of css declerations legal , supported browsers. how having different classes , switch them bases con locale? obviusly no css based locale used... css css3 iso

java - Storing input from a while loop outside the loop -

java - Storing input from a while loop outside the loop - so have question wants user input unknown amount of numbers compute total , average of these numbers. wants utilize while loop inquire input of numbers based off of how many numbers user said had input. how store input utilize compute total , average? this have: int numofmarks, mark ; scanner kdb = new scanner(system.in); system.out.print("enter number of marks: "); numofmarks = kbd.nextint() ; int = 1 ; while(i<=numofmarks) { system.out.print("enter mark: ") ; mark = kbd.nextint() ; i=i+1 ; } but is, mark overwritten every time loop performed. how store each loops input farther use? for total , average, need maintain 2 variables around - 1 total, , 1 number of numbers. have - numofmarks . so define: double total = 0; inside loop, add together each mark total. total += mark; then @ end, can print: system.out.println

unicode - Can't see certain characters in Chrome (yes I searched, results didn't work) -

unicode - Can't see certain characters in Chrome (yes I searched, results didn't work) - so found this site create silly text. see this. have bunch of fonts installed should allow me see (dejavu, arial unicode, quivira, etc) , tried various encoders too. have no issues in firefox , chrome works on macbook on windows 8.1 pc won't show. able see thing: » people have problem seeing. , tried incognito , still not working. doing wrong or what? have tried installing font code2000? if doesn't work chrome, seek code2000 in newest ie (where confirmed work). google-chrome unicode encoding fonts

xades4j sugestions for changes -

xades4j sugestions for changes - i have list of suggestion xades4j. these minor changes in xades4j usability. class defaulttimestamptokenprovider it should possible override method gethttpconnection(). opinion, today in many enterprises systems behind proxy. so, if gethttpconnection can have custom implementation, different way set connection, or may else i'm not thinking @ moment, more generic. class objectidentifier i implemented signaturepolicydocumentprovider. in used hashmap store policies. , in order have method getsignaturepolicydocumentstream working correctly, had add together methods hashcode() , equals() objectidentifier (eclipse generated code). interface keystorekeyingdataprovider.signingcertselector i imagining scenario have keystore several private keys different alias , utilize selectcertificate select right 1 based on alias. rhe method selectcertificate have input list of x509certificates not possible, need have kind of hashmap. becau

grid - How to stop Telerik CSS from overriding local changes? -

grid - How to stop Telerik CSS from overriding local changes? - i have kendo grid , default css background-color or 'text' color display. i able override background colors lines 1 & 2, however, replaced colors. need to able set color based on "intruck" boolean field. i tried lines 5 , 6, , html mark correctly updated , see flash right color before reset defaults. have tried adding in !important in rows 3 , 5, still no luck. seems setting style after done using kendo/telerik css. how stop that? <style> 1 /*.k-grid-content>table>tbody>tr{background-color:lightgreen;}*/ 2 /*.k-grid-content>table>tbody>.k-alt{background-color:red;}*/ 3 .in{color:lightgreen;} </style> <div id="divsearchresults"> @(html.kendo().grid((ienumerable<models.searchresult>)model.searchresults) 4 // .events(ev => ev.databound("grid_onrowdatabound")) 5 // .rowaction(row => { if (row.

Why this MySQL Query Not working? -

Why this MySQL Query Not working? - i have wrote mysql query check rows between given start , finish time, doesn't work, please help me find error? query: select * users user_id='".$input['guard']."' , (start_time >= '".$startdatetime."' or finish_time <= ".$finishdatetime."' error: syntax error or access violation: 1064 have error in sql syntax; check manual corresponds mysql server version right syntax utilize near '' @ line 3 (sql: select * users user_id='13' , (start_time >= '2014-10-20 10:30:00' or finish_time <= '2014-10-20 21:30:00' ) $guard=$input['guard']; $sql="select *from users user_id='$guard' , (start_time >='$startdatetime' or finish_time <='$finishdatetime')"; mysql

Java 8 + Swing: How to Draw Flush Polygons -

Java 8 + Swing: How to Draw Flush Polygons - (sorry long post... @ to the lowest degree has pictures?) i have written algorithm creates mosaic image statistically generating n convex polygons cover image no overlap. these polygons have anywhere between 3-8 sides, , each side has angle multiple of 45 degrees. these polygons stored internally rectangle displacements each corner. below image explains how works: getright() returns x + width - 1 , , getbottom() returns y + height - 1 . class designed maintain tight bounding box around filled pixels coordinates shown in image correct. note width >= ul + ur + 1 , width >= ll + lr + 1 , height >= ul + ll + 1 , , height >= ur + ul + 1 , or there empty pixels on side. note possible corner's displacement 0, indicating pixels filled in corner. enables representation store 3-8 sided convex polygons, each of sides @ to the lowest degree 1 pixel in length. while it's nice mathematically represent these regi

processing - My Arduino automatic LED 'nightlight' is not working -

processing - My Arduino automatic LED 'nightlight' is not working - i have arduino uno, , i'm trying write programme if photoresistor detects low amount of light, led turns on. here code. int led = 2; int phores = a4; int val = 0; void setup() { pinmode(led, output); pinmode(phores, input); serial.begin(9600); } void loop() { val = analogread(phores); if(val > 256) { digitalwrite(led, high); } if(val < 256) { digitalwrite(led, low); } serial.println(val); } you might need set sec if block within loop function. i'm pretty should prepare things. adding little delay might thought avoid doing check @ every iteration. arduino processing led arduino-ide arduino-uno

TFS 2013 Build Service connect to TFS2012 server -

TFS 2013 Build Service connect to TFS2012 server - i have tfs2012 update 3 server. have started new vs 2013 project. need prepare build server , service. initial thought install vs 2013 tfs2013 build service. after installation tfs2013 , registration tfs collection got below issue: the register command not supported team foundation service [our_tfs_url] because server not compatible. please advice solution how create builds vs 2013 projects stored in tfs 2012. update 1: 1) installed tfs 2012 build service , redirect msbuild ( toolpath) in build template utilize vs 2013 msbuild 2) able build project test 3) there still issue code coverage, finish warning: install visual studio. seems me cc used still vs 2012. way redirect cc vs 2013? below solution helps me build on vs 2013 build machine tfs 2012 build service , generate code coverage. tfs 2012 buid service runs tests 11.0 location, replace commonextensions in folder c:\program files (x86)\microsoft visua

python - Twisted with multiple ports, protocols, and reactors -

python - Twisted with multiple ports, protocols, and reactors - will twisted back upwards listening on multiple ports, different 'handlers' (different set of callbacks each port) @ same time? essentially, want process host 2 servers in 1 process, each performing different function. need utilize 2 reactors this? yes, instance, modifying quote server example add together sec instance listening on different port different quote: from twisted.internet.protocol import factory, protocol twisted.internet.endpoints import tcp4serverendpoint twisted.internet import reactor class qotd(protocol): def connectionmade(self): # self.factory set factory's default buildprotocol: self.transport.write(self.factory.quote + '\r\n') self.transport.loseconnection() class qotdfactory(factory): # used default buildprotocol create new protocols: protocol = qotd def __init__(self, quote=none): self.quote = quote or &#

vb.net - How to round value to nearest integer -

vb.net - How to round value to nearest integer - i have next code, trying round value nearest integer. can't seem figure out how. have looked @ few sources none useful trying achieve. there method takes care of this? or there way can programmatically? eg. in database table have column sets limit single sms char length allowed ie- 160. if input string in form < max length allowed, split input string / sms lenth allowed, , round value nearest int. what have tried far: if (cint(strtext.length) <= cint(maxsmslength)) doublevaluereturned = (cdec(cint(strtext.length) / cint(singlesmslength))) smscount = round(doublevaluereturned) msgbox(smscount) end if thanks help. the simple solution real problem (counting how many sms messages required send string of text of arbitrary size) utilize integer division ( symbol \ ) instead of floating point division ( symbol / ). the partition returns integer discarding float

pandas - How to create new column with positive instead negativ values -

pandas - How to create new column with positive instead negativ values - okay, have pandas dateframe shown beneath. date time value/mwh 01.08.2009 00:00 - 01:00 0 01.08.2009 01:00 - 02:00 -100 01.08.2009 02:00 - 03:00 80 01.08.2009 03:00 - 04:00 50 if there value < 0, wanted have value positive value in new column. if es case, in left columns shoult 0. it have this: date time value/mwh 01.08.2009 00:00 - 01:00 0 0 01.08.2009 01:00 - 02:00 0 100 01.08.2009 02:00 - 03:00 80 0 01.08.2009 03:00 - 04:00 50 0 how can this? this works me: df['new'] = 0 df.new.loc[df['value/mwh']<0] = df['value/mwh'].abs() df['value/mwh'].loc[df['value/mwh']<0] = 0 you should avoid utilize unusual column names, can generate errors. pandas

Need help writing and reading with Python -

Need help writing and reading with Python - at moment wrote code: class device: naam_device = '' stroomverbuirk = 0 aantal_devices = int(input("geef het aantal devices op: ")) = aantal_devices x = 0 voorwerp = {} while > 0: voorwerp[x] = device() = - 1 x = x + 1 = 0 while < aantal_devices : voorwerp[i].naam_device = input("wat device %d voor een device: " % (i+1)) # hier moet nog gekeken worden naar afvang van foute invoer bijv. als gebruiker een string of char invoert ipv een float voorwerp[i].stroomverbruik = float(input("hoeveel ampére uw device?: ")) += 1 = 0 totaal = 0.0 ##test while print while < aantal_devices: print(voorwerp[i].naam_device,voorwerp[i].stroomverbruik) #dit totaal moet nog worden geschreven naar een bestand zodat je na 256 invoeren een totaal kan bepalen. totaal = totaal + voorwerp[i].stroomverbruik = + 1 print("totaal ampére = ",totaal)

touch event - how to get TouchEvent in Qt environment with Laptop touchPad? -

touch event - how to get TouchEvent in Qt environment with Laptop touchPad? - i want touchevent in qt, programme doesn't work, help me? , os ubuntu 14.04 , win7, qt library 4.8.6, qt creator 3.2.1. give thanks you. mymainwindow::mymainwindow(qwidget *parent) : qmainwindow(parent) { _uicls::setupui(this); setattribute(qt::wa_accepttouchevents); // has setattribute } bool mymainwindow::event(qevent *evt) { qdebug()<<evt->type(); // can't touchevent switch(evt->type()) { case qevent::touchbegin: qdebug()<<"touch begin"; evt->accept(); homecoming true; case qevent::touchupdate: qdebug()<<"touch update"; homecoming true; case qevent::touchend: qdebug()<<"touch end"; default: homecoming _basecls::event(evt); } } qt touch-event touchpad

ios - Cannot install my Phonegap app on iPod Touch 3G device. It says "requires a newer version of iPod software" -

ios - Cannot install my Phonegap app on iPod Touch 3G device. It says "requires a newer version of iPod software" - i have created app using phonegap build , tried test on ipod touch 3g device. says cannot install because requires newer version of ipod software. ipod has ios version 5.1.1. max os ipod touch 3g device can have. i not sure how move forward. dont have other ios device test app. can help me work around app tested? or can suggest me how build app lower version of ios? please note: using phonegap build build *.ipa file. thanks in advance. if using phonegap 3.5.0 or newer, works ios 6 & newer (phonegap 3.5.0 dropped back upwards ios 5). you'll need older version of phonegap, running risk of app not beingness accepted apple app store (if that's want do), since apple tends prefer applications have been built against latest ios sdk versions. ios cordova

html - Cannot turn off placeholder wrap in Firefox textarea -

html - Cannot turn off placeholder wrap in Firefox textarea - the code disabling wrapping in textarea works in webkit, not in firefox. demo (webkit): http://jsfiddle.net/cuk2072g/2/ html: <textarea class="form-control" id="textarea" placeholder="_____________________________________________________________________________________________________________"> </textarea> css: #textarea { color:red; height: 200px; width: 300px; text-align:left; white-space: nowrap; overflow: hidden; resize: none; } #textarea::-webkit-input-placeholder { color:green; white-space: nowrap; overflow: hidden; } webkit works expect. firefox has issues... demo (firefox): http://jsfiddle.net/g7csp/3/ html: same above css: #textarea { color:red; height: 200px; width: 300px; text-align:left; resize: none; } #textarea::-moz-placeholder { color:green; white-space

primary key - Duplicate entry mysql -

primary key - Duplicate entry mysql - i have table has not have primary key.table has indexes. whenever seek insert record first time ,record gets inserted when seek insert record same value 1 time again gives duplicate entry '125249-1'. create table :- create table `schedules` ( `entity` bigint(20) default null, `id` bigint(20) default null, `applicationid` int(16) default null, `apptnid` int(16) default null, `apptorgunitid` bigint(20) default null, `orgid` int(16) default null, `nid` int(16) default null, `logged_date` datetime default null, `logged_by` int(16) default null, `last_updated_date` datetime default null, `last_updated_by` int(16) default null, `rowstate` int(8) default '1', `status` int(16) default '1', key `applicationid` (`applicationid`), key `apptnid` (`apptnid`), key `id` (`id`) ) engine=innodb default charset=latin1; insert schedules (entity, id, applicationid, apptnid, apptorgunitid, orgid, n

ios - Swift: Override can only be specified on class members -

ios - Swift: Override can only be specified on class members - in gamescene.swift file, there errors causing build fail. override func touchesbegan(touches: nsset, withevent event: uievent) { /* called when touch begins */ touch: anyobject in touches { allow location = touch.locationinnode(self) allow sprite = skspritenode(imagenamed:"spaceship") sprite.xscale = 0.5 sprite.yscale = 0.5 sprite.position = location allow action = skaction.rotatebyangle(cgfloat(m_pi), duration:1) sprite.runaction(skaction.repeatactionforever(action)) self.addchild(sprite) } } override func update(currenttime: cftimeinterval) { /* called before each frame rendered */ } i told 'override can specified on class members'. how should prepare this? this whole thing: // // gamescene.swift // swipe racer // // created william clark on 25/10/2014. // copyright (c) 2014 arc of clark. righ

php - Magento - Blank page when creating new module -

php - Magento - Blank page when creating new module - i'm using mangeto 1.9.1 , i'm trying create module 50% discount grandtotal price. i've made things module when seek open http://mymagento.com/checkout/cart/ i've got blank page bellow main menu. blank page cart items , total should be. take look: i've made module answer: magento - issue creating custom module so here i've done: in app/code/local/vivasindustries/percentpayment/etc/config.xml : <?xml version="1.0"?> <config> <modules> <vivasindustries_percentpayment> <version>0.1.0</version> </vivasindustries_percentpayment> </modules> <global> <models> <percentpayment> <class>vivasindustries_percentpayment_model</class> <resourcemodel>percentpayment_mysql4</resourcemodel> </percentpayment> </models> <resources>

Exception not caught when using PowerShell command line but caught as expected when using PowerShell ISE -

Exception not caught when using PowerShell command line but caught as expected when using PowerShell ISE - i running powershell 2.0. i have powershell script adds record database , returns id of record added. record id returned property called new_deal_id within datarow object (called resultset ). if there problem on database end possible new_deal_id property not set, or doesn't exist @ all. to counter scenario wrapped reading of property in try/catch block shown here. try { $erroractionpreference = "stop" $resultset = read-databasedata -odbccommand $odbccommand -sqlquery $sql $newdealid = $resultset.new_deal_id } grab { throw } { $erroractionpreference = "continue" } if run script using powershell ise or powergui exception shown below gets caught when property doesn't exist property 'new_deal_id' cannot found on object. create sure exists. @ line:1 char:12 + $resultset. <<<< newdeal + categ

java - Socket clientSocket = serverSocket.accept(); cannot be resolved -

java - Socket clientSocket = serverSocket.accept(); cannot be resolved - after years of creating small- medium-scale flash games (and little java command-line apps), i'm ready introduce myself world of sockets :). i'm pretty sure i've grasped decent understanding can't work out why wont work... seems work everywhere else i've seen it. try { serversocket serversocket = new serversocket(6644); } grab (ioexception e) { e.printstacktrace(); } while(true){ socket clientsocket = serversocket.accept(); } eclipse keeps telling me 'cannot resolved' when hover mouse on serversocket on clientsocket = serversocket.accept(); line. variable exists , there isn't typo what's matter? i've imported java.io.* , java.net.* i'm pretty sure have need. your serversocket variable visible within try block. move declaration outside, maybe this: serversocket serversocket = null; seek { serversocket = new serversocket(664

javascript - Angular-Sprout: module.controller() function is not defined; unable to add controller -

javascript - Angular-Sprout: module.controller() function is not defined; unable to add controller - i've been using angular-seed starter project, , although has changed app construction within past month or i've decided take @ angular-sprout. angular-sprout doesn't have updated index-async page, decided fork code , work on it. i've got wired correctly, when seek add together controller (via module.controller() function, receive error saying module.controller undefined. when log angular.module('mymodule') console on index-async.html page, angular object right methods - filter() , service() , provider() , etc - controller isn't there: module object { _invokequeue: array[0], _runblocks: array[0], requires: array[0], name: "application.controllers", provider: function…} _invokequeue: array[0] _runblocks: array[0] config: function (){c[d||"push"]([a,b,arguments]);return g} constant:

linux - Is anyone using netlink for IPC? -

linux - Is anyone using netlink for IPC? - i planning utilize netlink communication between 2 userland processes. part of reason beingness picky netlink - of processing 1 of process go in kernel space , netlink based communication can used (hopefully). the approach taking - define new generic netlink family (i have write kernel module back upwards family - appears @ moment). fine, looking @ illustration code, kernel routing messages between different processes , not doing work - actual population of messages handled processes. my question - using netlink in similar manner in of projects? - above approach makes sense? i read proposal netlink based dbus. haven't found implementation of that. comes closest requirements. thanks. what looking netlink_usersock if want communicate between userspace processes. netlink documentation awfully scarce unfortunately. might help bit: who can give me latest netlink programming samples? just create sure nl_pid non-zer

javascript - What does "check:" mean in front of a for loop? -

javascript - What does "check:" mean in front of a for loop? - this question has reply here: colon within javascript function while loop 4 answers i came across today: check: (var = 0; < versionlist.length; i++) { var curversion = versionlist[i]; // find critical ranges version in (the ranges can support) var ranges = getcriticalranges(target.name, curversion); // if version satisfies of ranges, can replace version (var j = 0; j < ranges.length; j++) { if (!semver.match(ranges[j], lookup.version)) go on check; } // if version not equal our target, deprecate old version if (lookup.version != curversion) { var oldname = lookup.name + '@' + curversion; if (ranges.length) { useexisting = true; ui.log('info', (nodesemver.gt(lookup.version, curversion) ? 'upgrading' : 'downgradin

r - Delete one aes from legend generated from two layes sharing common aes name -

r - Delete one aes from legend generated from two layes sharing common aes name - my question want overlay scatter plot on top of line plot , these 2 plots' color alter 1 variable. want maintain legend 1 color. if utilize scale_colour_discrete(guide = "none") both of them gone. a reproducible illustration is: library(reshape2) iris2 <- melt(iris, id.var = "species") ggplot(iris2, aes(x = variable, y = value, grouping = species)) + geom_point(aes(color = ifelse(value < 3, "type1", "type2"))) + geom_line(aes(color = species)) i want show legend 'species' rather type. setting show_guide=false in geom_point layer, ggplot(iris2, aes(x = variable, y = value, grouping = species)) + geom_point(aes(color = ifelse(value < 3, "type1", "type2")), show_guide=false) + geom_line(aes(color = species)) + scale_colour_discrete("species", breaks=levels(iris2$s

java - How to test if a PreparedStatement is going to run out of memory -

java - How to test if a PreparedStatement is going to run out of memory - so have java code using jdbc insert info postgresql database using prepared statement looks little this: preparedstatement statement = // prep statement (int value: values) { statement.setint(1, value); statement.addbatch(); } statement.executebatch(); the problem is, i'm hitting exception java.lang.outofmemoryerror: java heap space . i've taken around, can't find on it; how test if statement run out of memory can execute batch. this: preparedstatement statement = // prep statement (int value: values) { statement.setint(1, value); statement.addbatch(); if (statement.currentsize() + sizeof(int) > statement.mazsize()) { statement.executebatch(); } } statement.executebatch(); thanks help. there no reliable way find out in advance whether instantiation fail. however, more point: misusing jdbc batching facility, there solve issue of n

ruby on rails - Storing unconfirmed email column on the sign up -

ruby on rails - Storing unconfirmed email column on the sign up - i'm using devise confirmable module enabled. i realised unconfirmed email column used when user has confirmed email , wants alter it. i have next issue: the user "a" signed email belongs user "b". user "a" never success on confirm account. after that, user "b" seek sign own email (already used user "a" before). user "b" can't sign because email beingness used else. i think on sign page, email should stored in unconfirmed email column avoid behavior above. there workaround prevent this? it interesting question. think simplest way (but not sure best way) prevent problem alter email uniqueness validation , create work if email confirmed. to should disallow validatable module in user model , implement validations manually. you can re-create default validations here https://github.com/plataformatec/devise/blob/master/lib/de

How can I tell if my soundjs soundInstance is paused vs completed? -

How can I tell if my soundjs soundInstance is paused vs completed? - i'm using soundjs build simple sound mixer standard pause/play/scrub functionality each track. i have working well, creating manifest, creating soundinstances per "track" when added play list. but cannot find in documentation or available info on soundjs how dynamically found whether play state of specific soundinstance playing or paused. though can track "playstate" property, not appear tell me need know. says whether soundinstance "playfinished" or "playsucceeded". checking property on soundinstance has been paused through soundinstance.pause() yields "playsucceed". checking 1 time again after soundinstance has been resumed through soundinstance.resume() yields "playsucceeded" value. while can track play state separately, seem much cleaner approach able check soundinstance determine things like: "completed" (stopped), &qu

css - Bootstrap modal width -

css - Bootstrap modal width - i trying create modal popup alter it's width matches col-lg-8, col-xs-10 but found modal fixed width. so, found css styling can alter width: <div class="modal fade" id="mdlbudgets" role="dialog"> <div class="modal-dialog"> <div class="modal-content modal-graph col-lg-8 col-xs-10 well-sm"> <div class="row"> <div class="col-xs-12"> <span class="glyphicon glyphicon-align-left debit_colour"></span> <strong>budgets</strong> </div> </div> @if (model.bardescriptions.length == 0) { <small><span class="glyphicon glyphicon-info-sign debit_colour"></span> have no budgets setup yet.</small> } else {