Posts

Showing posts from March, 2010

vba - How To Output access Report with Condition -

vba - How To Output access Report with Condition - good day dears i have form run study status when run form filter(condition) work correctly report but when create pdf( docmd.outputto) pdf homecoming value (the filter or status don't work). this code fsetaccesswindow (2) docmd.openreport "report1", acviewreport, _ "select * main id '" & nz(me.cmrtxt, "*") & "' , place_of_discharge_ar '" & nz(me.dischargecombo, "*") & "' , border '" & nz(me.bordercombo, "*") & "' , a_date between " & _ format(nz(me.statrdatetxt, "01/01/1900"), "\#mm\/dd\/yyyy\#") & " , " & _ format(nz(me.enddatetxt, "01/01/2900"), "\#mm\/dd\/yyyy\#"), , acdialog me.visible = true docmd.outputto acoutputreport, "report1&

filereader - HTML5 File Reader failed to add multiple files and only adding one file from the list -

filereader - HTML5 File Reader failed to add multiple files and only adding one file from the list - i want add together 3 files simulteneously.files extension kml,kmz , csv. when select 3 files , click open 3 files in filelist. 1 file getting added on map.if add together individual file i.e. 1 1 works fine. reader onloadend event fired 3 times.but time adds 1 of 3 files. function handlefileselect(evt) { var files = evt.target.files; // filelist (var = 0; < files.length; i++) { f = files[i]; fileextension = f.name.split('.').pop(); if(fileextension != 'kml' && fileextension !='kmz' && fileextension != 'csv'){ alert('unsupported file type ' + f.type + '(' + fileextension + ')'); return; } var filereaderkmlcsv = new filereader(); filereaderkmlcsv.readastext(f); filereaderkmlcsv.onloadend =loadend; } //- end loop } //handlefileselect

php - Required package couldn't be found in any version symfony2 -

php - Required package couldn't be found in any version symfony2 - hey facing problem in symfony2 admin panel generation , version of symfony 2.5 , here issues while installing sonata admin bundle problem 1 - installation request symfony-cmf/standard-edition 1.1.x-dev -> satisfi able symfony-cmf/standard-edition[1.1.x-dev]. - symfony-cmf/standard-edition 1.1.x-dev requires sonata-project/doctrine-ph pcr-admin-bundle 1.1.* -> no matching bundle found. potential causes: -a typo in bundle name -the bundle not available in stable-enough version according min imum-stability setting i searched on it, got stuff read nil help. can issue , best suitable solution. been 6 days stuck admin panel generation. next official documentation, backend - sonata admin , first statement directed me this , after next got errors. sorry, long story guys helpless. , while answering kindly explain me in simple word real solution :) please provide version constraint sonata

nullpointerexception - Unable to start activity ComponentInfo in Android -

nullpointerexception - Unable to start activity ComponentInfo in Android - the logcat details of error: 06-24 10:23:48.836: w/dalvikvm(276): threadid=1: thread exiting uncaught exception (group=0x4001d800) 06-24 10:23:48.865: e/androidruntime(276): fatal exception: main 06-24 10:23:48.865: e/androidruntime(276): java.lang.runtimeexception: unable start activity componentinfo{com.example.triviality/com.example.triviality.infoactivity}: java.lang.nullpointerexception 06-24 10:23:48.865: e/androidruntime(276): @ android.app.activitythread.performlaunchactivity(activitythread.java:2663) 06-24 10:23:48.865: e/androidruntime(276): @ android.app.activitythread.handlelaunchactivity(activitythread.java:2679) 06-24 10:23:48.865: e/androidruntime(276): @ android.app.activitythread.access$2300(activitythread.java:125) 06-24 10:23:48.865: e/androidruntime(276): @ android.app.activitythread$h.handlemessage(activitythread.java:2033) 06-24 10:23:48.865: e/androidruntime(276): @ android.os

hibernate - JPA CriteriaBuilder - Expression - -

hibernate - JPA CriteriaBuilder - Expression <List> - i have simple criteriaquery pattern match simple search string against field entires in person entity... e.g searchstring decorated %searchstring% //using metamodel expression<list<records>> records = root.get(person_.records); expression<string> param = builder.parameter(string.class); //pseudo code(i think need here) predicate mypred = records (any record.field searchstring) path<integer> status = root.get("status"); criteriaquery.where( builder.or( builder.like( root.<string>get("name"), searchstring ), builder.like( root.<string>get("second_name"), searchstring ) //pseuso code (i lean need check predicate here?) builder.like(mypredicate) ), builder.equal(status,value) ); the person object can contain many record objects. update query above include simi

php - wkhtmltopdf Generate PDF From File Random Empty Box -

php - wkhtmltopdf Generate PDF From File Random Empty Box - i'm using wkhtmltopdf create pdf file (using php if that's important) , it's working great except random empty box. here i've tried box go away: changed encoding wkhtmltopdf utf-8 made sure file encoded using utf-8 checked mysql database it's pulling create sure encoding utf-8 doubled/tripled checked create sure there no character @ end of line. deleted , re-inserted database row rendered except database row , box wasn't there, know it's entry. here re-create , paste of box adobe reader in case helps: ô€€€ . i've read null object generated wkhtmltopdf, if is, how can rid of it? finally figured out. appears issue wasn't text or database row @ all. trying utilize helvetica. i'm not sure why caused issue on 1 row, did. switched arial , works perfectly. php mysql pdf pdf-generation wkhtmltopdf

css - How to align this html layout properly? -

css - How to align this html layout properly? - hi iam trying remove these white spaces (green circles in image) , dont best way it. can margin-left -ve value , width more 100% there way solve issue in proper way . here html code <!doctype html> <html lang="en"> <head> <meta charset="utf-8" /> <title>hachi</title> <link rel="stylesheet" href="css/style_rec.css" type="text/css" /> </head> <body> <style> #container{ font-family: "proxima-nova", helvetica, arial, sans-serif; font-weight: normal; color:#414141; -webkit-font-smoothing: antialiased; height: auto; width: 100%; } #header{ width: 100%; height:100px; background-color: red; } #left_panel{ width: 50%; float: left; /* height: 400px; */ background-color: green; } #right_panel{ width: 50%; float: left; /* height: 400px; */ backgr

Printing 10 numbers in Haskell -

Printing 10 numbers in Haskell - i have began larn haskell. experienced c, c++, java , php. still cant figure out how print numbers 0 10 in haskell whithout having putstrln on different lines. in java, : for(int i=0; i<=10; i++) system.out.println(i); howver, haskell doesn't seem back upwards this. how can produce same result ? i guess question boils downwards to: how loop in haskell? and reply recurse. , because it's haskell, mutual kinds of recursions have idioms. can utilize ghci next examples. here 2 mutual loop translation examples: in c: int a[10]; (i=0; i<10; i++) a[i] = i*i; and in haskell: a = map (\i -> i*i) [1..10] which reads, apply function takes number , returns number multiplied itself, list of 10 numbers. technique called map . or a = [ i*i | <- [1..10] ] which similar set-builder notation. technique called list comprehension. their output: [1,4,9,16,25,36,49,64,81,100] here

formtastic - Rails 4 has_many view -

formtastic - Rails 4 has_many view - in model gainloss has many checks, , need create several checks before submiting gainloss model in form. creating collection adding json objects , submiting form. best way in rails ? hint: im using formtastic. class gainloss < activerecord::base self.table_name = "cashflow" has_many :operations has_many :checks belongs_to :account end class check < activerecord::base belongs_to :gainloss end _form.html.erb <%= semantic_form_for @gainloss |f| %> <%= f.inputs %> <%= f.input :date, :as => :date_picker, :required => true%> <%= f.input :gain, :as => :radio, :collection => [['in',true],['out',false]], :label => 'tx type'%> <%= f.input :description %> <%= f.input :account, :collection => account.all %> <%= f.input :cash %> <% end %> <%= f.semantic_fields_fo

android - Enable/Disable internet not working for SONY Xperia (Any other way?) -

android - Enable/Disable internet not working for SONY Xperia (Any other way?) - i developing 1 android app need enable/disable mobile net problematically. the code have written works fine other companies devices except sony xperia z. is there other way stop mobile net in sony? my code enable/disable mobile data: final class conmanclass = class.forname(conman.getclass().getname()); final field iconnectivitymanagerfield = conmanclass.getdeclaredfield("mservice"); iconnectivitymanagerfield.setaccessible(true); final object iconnectivitymanager = iconnectivitymanagerfield.get(conman); final class iconnectivitymanagerclass = class.forname(iconnectivitymanager.getclass().getname()); final method setmobiledataenabledmethod = iconnectivitymanagerclass.getdeclaredmethod("setmobiledataenabled", boolean.type); setmobiledataenabledmethod.setaccessible(true); setmobiledataenabledmethod.invoke(iconnec

javascript - Any way to exports a generator function? -

javascript - Any way to exports a generator function? - an example generator.js : exports.read = function *(){ var = yield read('co.github.js'); var b = yield read('co.recevier.js'); var c = yield read('co.yield.js'); console.log([a,b,c]); } function read(file) { homecoming function(fn){ fs.readfile(file, 'utf8', fn); } } co.js : var co = require('co'); var fs = require('fs'); var gen = require('./generator') /*function read(file) { homecoming function(fn){ fs.readfile(file, 'utf8', fn); } }*/ co(gen.read)() it seems exports doesn't back upwards generator function. require, module, __filename, __dirname) { module.exports.read = function *(){ ^ syntaxerror: unexpected token * @ exports.runinthiscontext (vm.js:69:16) @ module._compile (module.js:432:25) @ object.module._extensions..js (mo

ruby on rails 3 - Trouble running Jasmine specs headless -

ruby on rails 3 - Trouble running Jasmine specs headless - i'm trying jasmine run in command line (headless), have had no success. our current configuration: gemfile: gem 'jasmine', :git => "git://github.com/pivotal/jasmine-gem.git" gem 'jasmine-headless-webkit', :git => "git://github.com/johnbintz/jasmine-headless-webkit.git" my current configuration of jasmine specs runs in browser. rake jasmine:ci , however, opens browser, , aborts shortly thereafter error message: /users/`<me>`/.rvm/gems/ruby-2.0.0-p353/gems/selenium-webdriver-2.25.0/lib/selenium/webdriver/firefox/launcher.rb:79:in `connect_until_stable': unable obtain stable firefox connection in 60 seconds (127.0.0.1:7055) (selenium::webdriver::error::webdrivererror) i looked @ github page jasmine-headless-webkit, , saw project listed dead. so! tried replace jasmine & jasmine-headless-webkit gem jasmine-rails , , got error: error: typeerror: 'un

How can i access a static variable by a class name in Java? -

How can i access a static variable by a class name in Java? - i have many classes have same static attribute (staticattr) , have class accepts class name , accesses staticattr of class name specified. how can this. please help me! thanks. edit: public class group_name1 extends activity implements view.onclicklistener, { public static group_name1 staticvar; public void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.group_name1); staticvar = this; } } public class group_name2 extends activity implements view.onclicklistener, { public static group_name2 staticvar; public void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.group_name2);

java - StaX parsing: Transformer.transform method moves cursor automatically, not always nice -

java - StaX parsing: Transformer.transform method moves cursor automatically, not always nice - i using xmlstreamreader accomplish goal(splitting xml file). looks good, still not give desired result. aim split every node "nexttag" input file: <?xml version="1.0" encoding="utf-8"?> <firsttag> <nexttag>1</nexttag> <nexttag>2</nexttag> </firsttag> the outcome should this: <?xml version="1.0" encoding="utf-8"?><nexttag>1</nexttag> <?xml version="1.0" encoding="utf-8"?><nexttag>2</nexttag> referring split 1gb xml file using java achieved goal code: import java.io.bufferedreader; import java.io.fileinputstream; import java.io.inputstream; import java.io.inputstreamreader; import java.io.stringwriter; import javax.xml.stream.xmlinputfactory; import javax.xml.stream.xmlstreamreader; import javax.xml.transform.transfor

java - Ubuntu: datanode won't start -

java - Ubuntu: datanode won't start - i have installed hadoop on ubuntu 14. have install next how-to: http://www.michael-noll.com/tutorials/running-hadoop-on-ubuntu-linux-multi-node-cluster/#java-io-ioexception-incompatible-namespaceids but not first hadoop install. the problem that: datanode don't start. log of datanode.log: 2014-06-22 18:51:34,438 info org.apache.hadoop.metrics2.impl.metricssystemimpl: datanode metrics scheme started 2014-06-22 18:51:35,640 info org.apache.hadoop.metrics2.impl.metricssourceadapter: mbean source ugi registered. 2014-06-22 18:51:35,719 warn org.apache.hadoop.metrics2.impl.metricssystemimpl: source name ugi exists! 2014-06-22 18:51:37,078 error org.apache.hadoop.hdfs.server.datanode.datanode: java.net.unknownhostexception: ubuntu: ubuntu @ java.net.inetaddress.getlocalhost(inetaddress.java:1402) @ org.apache.hadoop.security.securityutil.getlocalhostname(securityutil.java:252) @ org.apache.hadoop.security.s

Some errors occurred while accessing svn working copy database.Idea 13.1.2 -

Some errors occurred while accessing svn working copy database.Idea 13.1.2 - i using intellij thought 13.1.2 want utilize svn project on idea, but some errors occurred while accessing svn working re-create database. how can pass issue? give thanks you. i solved problem... downloaded http://www.sliksvn.com/en/download/ , show svn.exe path intellij idea. svn intellij-idea

javascript - How to automate text file update in windows 7 -

javascript - How to automate text file update in windows 7 - i have file called environment text file path: c:\program files (x86)\cpw\cpw.ini its has info port : 2012 now want create exe or programme straight run on scheme , update particular text file new data. port : 2014. i have around 6000 users, need broadcast programme of them , file can updated automated running mailed program. please help ashu if utilize c#, can utilize file.writealltext overwrite text within file. encased within main function end with: using system.io; using system; class programme { static void main() { file.writealltext(@"c:\program files (x86)\cpw\cpw.ini", "port : 2014"); } } javascript window

angular ui - Export ng-Grid to csv not working in IE -

angular ui - Export ng-Grid to csv not working in IE - tried implement export ng-grid csv functionality using ng-grid-csv-export plugin. did not work ie. next, followed blog. uses node.js on server homecoming csv webservice, however, don't have access there. then followed this post implement form action ie. however, not work downloadcsv function not getting called. please allow me know if i'm missing out on , request please post example of url accepts post request json encoded object in payload , homecoming csv. ie doesn't back upwards info uri link. i got around issue detecting ie , falling iframe solution , using document.execcommand details can found here. http://stackoverflow.com/a/26003382/378151 angular-ui export-to-csv ng-grid

android - VideoView and content provider -

android - VideoView and content provider - according android api videoview, can load images (videos) content provider. yet can not find examples of how write content provider can this. can point me such example? thanks, paul android

javascript - ajaxSetup beforeSend only being called the first time button is clicked -

javascript - ajaxSetup beforeSend only being called the first time button is clicked - i using asp.net mvc , jquery 1.8.2 i have form button calls javascript when clicked: $(function () { $('#searchbutton').click(function () { var info = $('#filterdefinition :input').serialize() + "&pagenumber=1"; $.post('@url.action("search")', data, loadcontentcallback); $("#searchresults").show(); }); }); this calls mvc controller action returns partialviewresult on layout page have next javascript code: //add custom header ajax requests $(document).ready(function () { $.ajaxsetup({ beforesend: function(xhr) { debugger; if ($('[name=__requestverificationtoken]').length) { var token = $('[name=__requestverificationtoken]').val(); xhr.setr

python - Scrapy - star_urls containing square brackets -

python - Scrapy - star_urls containing square brackets - i'm trying crawl website , star_urls contain square brackets (?sec[3]=3) when seek run spider happens brackets replaced %5b , %5d . i tried utilize ulrlib.unquote(url) problem remains! here code: import urllib ul ... urls = [] sec in range(1, 20): url = "http://www.website.com/something?sec[%d]=%d" % (sec,sec) url = ul.unquote(url) urls.append(url) start_urls = urls can help me? python url scrapy brackets

Small map scale bar showing up in the map footer on Google Docs view, but not in embedded site view -

Small map scale bar showing up in the map footer on Google Docs view, but not in embedded site view - i using derek eder's searchable map template. in google docs map view, along bottom, there tiny scale bar, when embed map on website, scale disappears. know how retain scale when using embedded map? google docs version scale embedded map without scale set scalecontrol -property of map-options true (default false ) mapslib.initialize(); map.setoptions({scalecontrol:true}); google-fusion-tables

javascript - Updating jqplot Pie Chart via JS not working -

javascript - Updating jqplot Pie Chart via JS not working - i trying update jqplot piechart via js since yesterday , not having breakthrough this. have searched online , cant seem solution work the chart info saved in session , session continuously beingness updated application. this json looks like [ ['take home pay', 44228.33], ['tax', 8771.67], ['super', 4162.5 ], ['regular expenses', 0 ], ['unallocated', 44228.33], ['testing', 8000] ] the chart loads fine when user navigates page first time. this div chart loads <div id="savings_expense" class="jqplot-target"></div> this jqplot js when page loads works fine $(document).ready(function () { var storeddata = <?php echo $_session['chart_data'] ?>; var plot1; jquery.jqplot.config.enableplugins = false; plot1 = jquery.jqplot('savings_expense', [storeddata], { seriesdefau

c# - WritableBitmap - Save custom live tile as Transparent PNG -

c# - WritableBitmap - Save custom live tile as Transparent PNG - having bit of problem creating writablebitmap , saving beingness writablebitmap seems back upwards jpeg. obviously, quite inconvenience , don't know it. how can go making writablebitmap save png file that supports windows phone 8.1 transparent tiles w/ background? note i'm targeting 8.0. my code: private static void createbitmap(int width, int height) { writeablebitmap b = new writeablebitmap(width, height); var canvas = new grid(); canvas.width = b.pixelwidth; canvas.height = b.pixelheight; var background = new canvas(); background.height = b.pixelheight; background.width = b.pixelwidth; // removed area of code contains design live tile. b.render(background, null); b.render(canvas, null); b.invalidate(); //draw bitmap using (isolatedstoragefile isf = isolatedstoragefile.getuserstoreforapplication()

c# - Do I understand this Strategy Pattern correctly? -

c# - Do I understand this Strategy Pattern correctly? - in previous question, i've been taught below code illustration of strategy pattern. line _player.draw(spritebatch, _context); in particular. i don't see difference between line , 1 below it, aside former beingness method call. could explain me why wouldn't utilize sec phone call right _drawhugecontext , (gasp) delete draw() player class? illustration simple , there situation former much better? public class arena { player _player; iplayercontext _drawhugecontext; public void draw(spritebatch spritebatch) { _player.draw(spritebatch, _drawhugecontext); _drawhugecontext.draw(spritebatch, _player); } } public class player { public int percentage { get; private set; } [...] //a few more fields public void draw(spritebatch spritebatch, iplayercontext context) { context.draw(spritebatch, this); } } public class iplayercontext { public void dr

Javascript won't apply css-style on dynamic table -

Javascript won't apply css-style on dynamic table - after research on net discovered can add together css-class new created row .classname: <tr id="producttablerow" onclick=' var table = document.getelementbyid("cardtable"); var row = table.insertrow(-1); var cell1 = row.insertcell(0); cell1.classname ="cardlefttd"; var cell2 = row.insertcell(1); cell2.classname ="cardcentretd"; var cell3 = row.insertcell(2); cell3.classname ="cardrighttd"; cell1.innerhtml = "new cell1"; cell2.innerhtml = "new cell2"; cell3.innerhtml = "new cell3"; '> but when run on website, can see there no style applied, there's style applied on static part of website, css working fine, guess problem in javascript part above, , uncertainty if sentence right: cell3.classname ="car

python - Django: User can only edit or delete objects tied to their account -

python - Django: User can only edit or delete objects tied to their account - there similar question this, requires utilize of tastypie - i'm looking way without additional add-ons. i'm trying create scheme users can edit objects tied account. models.py: class item(models.model): ... author = models.foreignkey(user) ... i scheme whereby user specified in author field able edit or delete object. doesn't seem (to me) possible using default admin system. implement writing own admin page checks whether user authorised delete specific object, improve if there way. you need create modeladmin instance model(s) , override appropriate methods: class mymodeladmin(admin.modeladmin): def has_add_permission(request): # should homecoming true if adding object permitted, false otherwise. def has_change_permission(request, obj=none) # should homecoming true if editing obj permitted, false otherwise. # if obj no

html - Gradient looks jagged -

html - Gradient looks jagged - so have gradient supposed but when utilize background-image: -o-linear-gradient(134deg, #61fada 0%, #1c64f7 100%); background-image: -moz-linear-gradient(134deg, #61fada 0%, #1c64f7 100%); background-image: -ms-linear-gradient(134deg, #61fada 0%, #1c64f7 100%); background-image: linear-gradient(44deg, #61fada 0%, #1c64f7 100%); border: 1px solid #979797; i end getting little "sections". question how can smooth effect. here zoomed in html css css3

How do I pass a string from Visual Studio 2012 to an Oracle Package -

How do I pass a string from Visual Studio 2012 to an Oracle Package - package spec: create or replace bundle testarea procedure deletetwcblusgprocesstable; procedure preptwcblusgprocesstable(sdate in varchar2); end testarea; package body: create or replace bundle body mrobinson28518.testarea procedure deletetwcblusgprocesstable begin delete mrobinson28518.twcblusg_processing; end deletetwcblusgprocesstable; procedure preptwcblusgprocesstable(sdate in varchar2) begin insert mrobinson28518.twcblusg_processing ( billdate, ubr_carrier, ubr_bill_grp, ubr_div, ubr_exchange, ubr_jur, ubr_exch_carr, ubr_date, ubr_jdate, ubr_rate_pd, ubr_element, ubr_call, ubr_type, ubr_qty, ubr_rate, ubr_amount, ubr_mileage, ubr_own_pct, ubr_pop_clli, ubr_filler) select

c# - Where do I find Microsoft.VisualStudio.ExtensionManager to add as reference? -

c# - Where do I find Microsoft.VisualStudio.ExtensionManager to add as reference? - i wanted add together next refernces on console application in vs2013 installed vs2013 sdk microsoft.visualstudio.extensionmanager microsoft.visualstudio.extensionmanager.implementation i'm not able find reference in reference manager. the below image shows can find microsoft.visualstudio.settings.12.0 of vs2013 sdk the below image shows above mentioned extensionmanager refernces cannot found. i don't see either of them in "reference manager" either, on machine they're in gac: c:\windows\microsoft.net\assembly\gac_msil\microsoft.visualstudio.extensionmanager\v4.0_10.0.0.0__b03f5f7f11d50a3a c:\windows\microsoft.net\assembly\gac_msil\microsoft.visualstudio.extensionmanager.implementation\v4.0_11.0.0.0__b03f5f7f11d50a3a as in vs2013 install directory: c:\program files (x86)\microsoft visual studio 12.0\common7\ide\privateassemblies if y

django - why would my databse entries be coming up empty? -

django - why would my databse entries be coming up empty? - i'm trying create new instances based off of form below when saves, database saves foreign key value , order value nil else. thought why? models: class dancetype(models.model): eventtype = models.foreignkey(comptype) dance_name = models.charfield(max_length = 20) cost = models.floatfield(max_length = 7, null=true, blank=true ) field_2 = models.charfield(max_length = 20, null=true, blank=true) def __unicode__(self): fields = ('field_2') homecoming self.dance_name class dancer(models.model): dancetype = models.foreignkey(dancetype) e_number = models.integerfield(max_length = 4, null=true, blank=true) d1_first_name = models.charfield(max_length = 20) d1_last_name = models.charfield(max_length = 20) d1_email = models.emailfield(max_length = 20) city = models.charfield(max_length = 20) order = models.positiveintegerfield() perform = models.

c# - Branch prediction on sorted/unsorted different sized arrays -

c# - Branch prediction on sorted/unsorted different sized arrays - i stumbled across question long ago why processing sorted array faster unsorted array? and wanted seek myself. had surprising results when trying different array sizes. here's test code. (c# microsoft compiler, have not tested other languages) static void main(string[] args) { var rand = new random(); time(rand, true, 1000, 100000); time(rand, false, 1000, 100000); time(rand, true, 1000000, 100); time(rand, false, 1000000, 100); console.readkey(true); } static void time(random rand, bool sort, int arraysize, int loopsize) { var stopwatch = new stopwatch(); var array = new int[arraysize]; array = array.convertall(array, _ => (int)(rand.nextdouble() * int.maxvalue)); if (sort) array.sort(array); stopwatch.start(); var count = 0; (var j = 0; j < loopsize; j++)

regex - Replace text in multiple file extentions -

regex - Replace text in multiple file extentions - i'm trying replace text in several files using sed. for example: replacing lion hawk in txt , md files within directory , subdirectories. so far have research best (non-working) effort have is: find . -type *.txt | xargs sed -i '' 's/lion/hawk/' also trying add together md txt regex - *\.(txt|md) gives error. thanks in advance help. you want find . -type f \( -name '*.txt' -o -name '*.md' \) -exec sed -i 's/lion/hawk/g' {} \; the -o logical or on 2 -name predicates. can straight utilize -exec instead of piping xargs (both work). edit updated quoting & parens. regex sed

sockets - How to programmatically broadcast a String message from PC to multiple USB-attached Android phones? -

sockets - How to programmatically broadcast a String message from PC to multiple USB-attached Android phones? - my goal: want programmatically broadcast string message (containing scheme time of pc) pc 2 usb-attached android phones. my attempt: (1) have 2 android phones attached computer via usb. (2) utilize "adb -s forward" commands set forwarding of computer port 38300 device ports 38300. (3) programming android phones: basically, create serversocket on port 38300, set timeout, , phone call accept() method. (4) programming pc: create socket using this.pchost_socket = new socket("localhost", 38300); , , message containing scheme time of pc sent using oos = new objectoutputstream(this.pchost_socket.getoutputstream()); oos.writeobject(msg); . problem: only 1 android phone (in case, phone 067125a40acc819e ) has received message. (1) default behaviour of communication via usb/adb? (2) how programmatically broadcast string message pc

rally - Calculating a Total for a Grid -

rally - Calculating a Total for a Grid - i have grid of has actual time 1 of columns. how can add together rows total actual time similar way done on track team status page. edit: i trying find sum using var sum = grid.getstore().sum('actuals');, when run it, error on console: uncaught referenceerror: grid not defined i have tried using piece of code found online: var tasks = []; var users = []; = if (data.length ===0) { this._creategrid(); //to refresh grid when no items in iteration } ext.array.each(this.tasks, function(task) { var owner = task.get('owner'); var total; ext.array.each(data, function(actual){ //some tasks have no owner. if status not checked uncaught typeerror: cannot read property '_refobjectname' of null

java - Intent extras not passed properly on some devices -

java - Intent extras not passed properly on some devices - when send intent 1 activity (holding extras), on devices not deliver extras properly, while in other devices delivers extras (it same code on both devices) this problem happens on android 4.3 on samsung note 3 neo while test same code on samsung note tab 10.1 ... works fine why !? edit pendingintent getpendingintent(){ intent extraintent = getintentwithextras(); intent mainintent = new intent(context, myactivity.class); mainintent.setaction(myactivity.action_start_intent); // add together several extras mainintent addextras(mainintent, extraintent, intent_type_activity); homecoming getactivitypendingintent(mainintent,pendingintent.flag_update_current); } thanks comments, found out i'm using these intents in pendingintents, , while set flag of pendingintent pendingintent.flag_update_current and utilize same action ... intent not updated , keeps repeating first inte

php - Set Rules Not Working CI -

php - Set Rules Not Working CI - for reason, codeigniter callbacks in hierarchical model–view–controller not working, have my_form_validation library function. it should throw $error if required or missing. i renamed image folder , no error showed up. ideas how can create work phone call validate? here's code: <?php if (!defined('basepath')) exit('no direct script access allowed'); class step_2 extends controller { // controller renamed in my_controller.php public $error = array(); public function __construct() { parent::__construct(); $this->load->helper('url'); $this->load->helper('file'); $this->load->helper('form'); $this->load->library('form_validation'); $this->lang->load('english', 'english'); } public function index() { $this->form_validation->set_r

string - Number of digits for an int to use in a file name in c++ -

string - Number of digits for an int to use in a file name in c++ - this question has reply here: print leading zeros c++ output operator (printf equivalent)? 4 answers i need utilize integer values part of file names create outputs in c++ program. utilize code above. thing int values ( named n_irrad in code) goes 1 20000 example, need file names mc_interface00001.txt, mc_interface00002.txt, ..., mc_interface20000.txt. so, ¿how can set number of digits in file name? code i'm using mc_interface1.txt, mc_interface2.txt, ..., mc_interface20000.txt. thanks in advance. ofstream mc_interface; string irrad = static_cast<ostringstream*>( &(ostringstream() << n_irrad) )->str(); string mc_interface_filename = "mc_interface" + irrad + ".txt"; mc_interface.open(mc_interface_filename.c_str()); try following #include <i

android - How to cross compile a mobile SDK? -

android - How to cross compile a mobile SDK? - i have sophisticated nlp engine wish create available on mobile sdk developers use. engine hybrid of multiple languages looking rationalise single language , codebase. reply question influence selection of language. in particular, wish ios developers able phone call engine using objective c (or perhaps swift) , android developers able utilize engine in java. i not want port engine , maintain 2 separate codebase core nlp algorithms. while there many options cross compiling applications, such xamarin, apportable, or phonegap. none see create easy cross compile sdk. what approach take core engine cross compiled unique code base of operations while still providing java , objective c bindings? i not want port engine , maintain 2 separate codebase core nlp algorithms then need write in c or c++ , ensure code not platform-specific. then, can write wrappers needed, such jni wrapper utilize android ndk, android d

javascript - Zclip not copy text -

javascript - Zclip not copy text - zclip plugin not re-create text. <head> <script type = "text/javascript" src = "jquery.min.js"></script> <script type = "text/javascript" src = "jquery.zclip.min.js"></script> </head> <button id = "copy-description">132</button> <p id = "description">123456789132456789</p> <script type = "text/javascript"> $(document).ready(function(){ $('#copy-description').click(function(){ $('#copy-description').zclip({ path:'zeroclipboard.swf', copy:function(){return $('p#description').val();} }); }); }); </script> when click on button, clipboard not change. seek jquery v1.11.1, , v 1.6 help. http://jsfiddle.net/lnd6p/ this should work. got rid of space id tags in html. <button id="copy-description&

ios - Swift - Get list of countries -

ios - Swift - Get list of countries - how can array countries names in swift? i've tried convert code had in objective-c, this: if (!pickercountriesisshown) { nsmutablearray *countries = [nsmutablearray arraywithcapacity: [[nslocale isocountrycodes] count]]; (nsstring *countrycode in [nslocale isocountrycodes]) { nsstring *identifier = [nslocale localeidentifierfromcomponents: [nsdictionary dictionarywithobject: countrycode forkey: nslocalecountrycode]]; nsstring *country = [[nslocale currentlocale] displaynameforkey: nslocaleidentifier value: identifier]; [countries addobject: country]; } and in swift can't pass here: if (!countriespickershown) { var countries: nsmutablearray = nsmutablearray() countries = nsmutablearray.arraywithcapacity((nslocale.isocountrycodes).count) // here gives error. marks nslocale.isocountrycodes , .count does of know this? thanks first of isocountrycodes requ

java - Viewing complete strings while debugging in Eclipse -

java - Viewing complete strings while debugging in Eclipse - while debugging java code, strings in views "variables" , "expressions" show till length, after eclipse shows "..." is there way inspect entire string? (this eases pain of adding logging statements debugging everywhere) in variables view right-click on variable , select change value. if variable huge have wait few minutes (in case eclipse doesn't respond commands) in end eclipse show variable entirely. java eclipse debugging

java - How is minimum priority thread getting executed before maximum priority thread? -

java - How is minimum priority thread getting executed before maximum priority thread? - while executing code, notice thread minimum priority getting executed before thread maximum priority. can help me understand what's going on here? class test implements runnable { public void run() { for(int i=0; i<5; i++) system.out.println(thread.currentthread().getname()); } } class testmain { public static void main(string[] args) { test test = new test(); thread t1 = new thread(test); thread t2 = new thread(test); t1.setpriority(thread.max_priority); t1.setname("max priority thread"); t2.setpriority(thread.min_priority); t2.setname("min priority thread"); t1.start(); t2.start(); } } sometimes, i'm getting output min priority thread min priority thread min priority thread min priority thread max priority thread max priority thre

asp.net - ajax combobox not rendering correctly -

asp.net - ajax combobox not rendering correctly - ajax combobox command not rendering , going in front end of other controls. when click on menu (li) tag , menu goes behind th ajax combo box. here ajax combo box css using .windowsstyle .ajax__combobox_inputcontainer .ajax__combobox_textboxcontainer input { margin: 0; border: solid 1px #7f9db9; border-right: 0px none; padding: 1px 0px 0px 5px; font-size: 13px; height: 18px; } .windowsstyle .ajax__combobox_inputcontainer .ajax__combobox_buttoncontainer button { margin: 0; padding: 0; background-image: url(/images/ajax/windows-arrow.gif); background-position: top left; border: 0px none; height: 21px; width: 21px; } .windowsstyle .ajax__combobox_itemlist { border-color: #7f9db9; } is there anythinf ajax css using? here menu css { height: 24px; position: relative; border-left: 1px solid #069; font-family: arial,sans-serif; margin-bottom: 6px; } z-index css property sets stack order of specific elem

How can I change the texture in a Blender model loaded into three.js, after it's been loaded, with ImageUtils.loadTexture? -

How can I change the texture in a Blender model loaded into three.js, after it's been loaded, with ImageUtils.loadTexture? - i'm doing pupil project @ involves gift box users can alter how looks. i started learning making cube, importing texture , setting gui.dat command allow user alter texture. i'm trying replace cube blender model of gift box i'm having problem changing texture. edit: total code on github here: https://github.com/gitkiwi/giftbox/blob/master/workspace/proto%208c%20changing%20textures%20on%20giftbox.html the coding working cube model is: `// add together cube texture var cubegeometry = new three.cubegeometry(4,4,4); var cubematerial = new three.meshlambertmaterial({ map: three.imageutils.loadtexture("birthday.jpg") }); var cube = new three.mesh(cubegeometry,cubematerial); cube.position.set (0,0,0); cube.rotation.set (0,-1.2,0); cube.receiveshadow = true; // add together cu

How to write multiple arrays of a excel sheet to different excel sheet using matlab -

How to write multiple arrays of a excel sheet to different excel sheet using matlab - in excel sheet have info in a1:x1,a2:x2....a30:x30 . have values 120101 , 120102 in ad1:ad30 . want xlsread read info of a1:x1 , , xlswrite name nowadays in ad1 i.e 120201 . want arrays @ time , xlswrite them @ time. here code used 5 array, ( a1:x5 ) , ad1:ad5 (i want code 30 rows or else should write 30 switch cases) clc; clear all; format long a=xlsread('entiredata.xls',1,'a1:x5'); k=size(a) b= a.'; h=xlswrite('har.xls',b); q=xlsread('har.xls',1,'a1:e24'); fname=xlsread('entiredata.xls','ad1:ad5'); f=1:length(fname) d=fname(f) d k=num2str(fname(f)); if f<6 switch(f) case 1 f=q(1:24); case 2 f=q(25:48); case 3 f=q(49:72); case 4 f=q(73: 96); cas