Posts

Showing posts from May, 2010

c++ - Can I build a shared library by linking static libraries? -

c++ - Can I build a shared library by linking static libraries? - i have bunch of static libraries (*.a), , want build shared library (*.a) link against static libraries (*.a). how can in gcc/g++? thanks! you can (just extract .o files , link them -shared create .so ), whether works, , how works, depends on platform , whether static library compiled position-independent code (pic). on platforms (e.g. x86_64), non-pic code not valid in shared libraries , not work (actually think linker reject create .so ). on other platforms, non-pic code work in shared libraries, in-memory re-create of library not sharable between different programs using or different instances of same program, result in huge memory bloat. c++ c gcc shared-libraries static-libraries

Ruby on rails, form isn't passing part of a parameter -

Ruby on rails, form isn't passing part of a parameter - i'm trying invite new users web application. have next code: = f.fields_for(:memberships, membership.new(:user => user.new( :account => account.new( :invited_by => current_profile))), :child_index => 'new_membership') |ff| = ff.fields_for :user |user_fields| = user_fields.fields_for :account |account_fields| = account_fields.hidden_field :invited_by_id %div{:class => "label_top field"} = account_fields.label :email - if account_fields.object.new_record? = account_fields.text_field :email - else = account_fields.object.email %div{:class => "label_top field"} = user_fields.label :first_name = user_fields.text_field :first_name %div{:class => "label_top field"} ...

automated conversion Mysql Table into an XML-File - Preserve hierarchy -

automated conversion Mysql Table into an XML-File - Preserve hierarchy - i want convert lines of table xml hierarchial structure. mysql-table structured this: ---table construction create table if not exists `carrier_template_helper` ( `carrier_id` int(5) not null default '0', `tarifs_v` int(10) not null default '0', `customer_f` varchar(30) not null, `templates_f` varchar(30) not null, `page` int(2) not null default '1', `customer_f_contains_str` varchar(100) not null, replace_str varchar(100) not null, add_str_before varchar(100) not null, add_str_after varchar(100) not null, call_method varchar(50) not null, font_size float not null default '8', add_xy varchar(10) not null default '0:0', key carrier_id ( carrier_id , tarifs_v , customer_f , templates_f ) ) engine=myisam default charset=latin1; insert `carrier_template_helper` (`carrier_id`, `tarifs_v`, `customer_f`, `templates_f`, `pag...

.net - How do I launch a .pdf programmatically? -

.net - How do I launch a .pdf programmatically? - i have .pdf help file , launch c++/cli application. currently following: system::diagnostics::process::start("iexplore", "c:\\mypdf.pdf"); ...which works has irritating side effect of opening in net explorer. there way launch in whatever windows uses open .pdf files? this allow scheme decide viewer use.. system::diagnostics::process::start("c:\\mypdf.pdf"); .net windows pdf c++-cli

firefox - CSS text-underline rendering difference between FF/IE and Chrome -

firefox - CSS text-underline rendering difference between FF/IE and Chrome - i have question. in next url have set of h1,h2 , p elements respective css styling. h1 element has text-decoration underline. http://nostalgia.mx/light2.html open site both firefox+ie , chrome , you'll notice profound differences: 1.- firefox+ie create underline proportional fontsize of element beingness underlined, smart. google keeps lean , un-proportional. 2.- firefox+ie 'fuse' or 'meld' text underline silhouette 1 single piece, nice. chrome on other hand not. ok. question is: is possible create chrome's ff/ie's? regards sotkra the phenomenon can observed in simple setting have element big font size , set text-decoration: underline on it. browsers implement in different ways regarding width of underline. there no way impact in css. css3 text draft has nil this, though has properties affecting other features of underlining. in discussions, a prop...

c# - Bogus (?) File Not Found error when trying to do client SharePoint coding -

c# - Bogus (?) File Not Found error when trying to do client SharePoint coding - i getting think bogus "file not found" error when simple sharepoint 2010 client coding. not i'm building wrong cpu type or wrong .net version. (i'm building "any cpu" or "x64" , .net 3.5.) copied microsoft.sharepoint*.dlls server , set them in c:\program files\common files\microsoft shared\web server extensions\14\isapi. (i've tried other folders too.) opened visual studio 2010 project, right-clicked on references, clicked browse tab , added 1 or of dlls (i should need microsoft.sharepoint.dll.) simple programme seek run: using system; using system.collections.generic; using system.linq; using system.text; using microsoft.sharepoint; namespace spliststoconsole { class programme { static void main( string[] args ) { using ( spsite sc = new spsite( "http://orsandbox01/sitepages/home.aspx" ) ) { spwe...

java - Debugging with Tomcat -

java - Debugging with Tomcat - i trying test (spring-based) war wrote , deploying tomcat_home/webapps/ , starting tomcat. after min or obvious war not running (because should consuming messages off activemq queue...and not). @ standard output console , see: info: deploying web application archive optimizer.war log4j:warn no appenders found logger (org.springframework.web.context.contextloader). 23 [thread-2] info org.apache.camel.spring.handler.camelnamespacehandler - osgi environment not detected. jan 19, 2012 10:54:20 org.apache.catalina.core.standardcontext startinternal severe: error listenerstart jan 19, 2012 10:54:20 org.apache.catalina.util.sessionidgenerator createsecurerandom info: creation of securerandom instance session id generation using [sha1prng] took [184] milliseconds. jan 19, 2012 10:54:20 org.apache.catalina.core.standardcontext startinternal severe: context [/optimizer] startup failed due previous errors here log4j.properties file: log4j.rootlogge...

ruby on rails - How can i sort Cassandra-cql Results by timestamp? -

ruby on rails - How can i sort Cassandra-cql Results by timestamp? - hi how can sort entries timestamp of columns? def self.get_users @@db.execute("select * users") end do mean timestamp of values, or column key kind of timestamp? cql doesn't back upwards sort - returns info in order stored on disk. tell cassandra how want columns sorted specifying comparator_type on column family. in case, might consider using composite column keys of [timestamp, column name]. ruby-on-rails cassandra cql

pdf - How to add PDFBox to an Android project or suggest alternative -

pdf - How to add PDFBox to an Android project or suggest alternative - i'm attempting open existing pdf file , add together page pdf document within android application. on added page, need add together text , image. i wanting give pdfbox try. other solutions such itextpdf aren't suitable our company because of licencing terms/price. i have library project main code base, , total , lite projects reference library project. i have downloaded jar http://pdfbox.apache.org/download.html , copied library projects lib folder , added pdfbox-app-1.6.0.jar file java build path libraries. i able import librarys eg import org.apache.pdfbox.pdmodel.pddocument; , compile projects. when run application crashes on pddocument document = new pddocument(); next error. e/androidruntime(24451): java.lang.noclassdeffounderror: org.apache.pdfbox.pdmodel.pddocument i read somewhere version 1.5 of pdfbox onwards didn't work android tried downloading pdfbox-app-1.4.0.jar...

Why does Visual Studio 2008 always build a setup project even when it is up to date? -

Why does Visual Studio 2008 always build a setup project even when it is up to date? - for normal source code projects, when inquire visual studio build project build if considered out of date. (the documentation /build command line switch confirms this.) however, setup projects seems visual studio builds them, regardless of whether or not dependencies date. happens simple scenario setup project contains primary output of project. why setup projects behave way? there way alter behavior? the setup project packaging utility, check of projects , build them if necessary, create new bundle each time run it. there no way alter behavior can see. i set build - configuration manager not build setup projects. run build on them when wanting create/update setup. visual-studio setup-project

java - websocket closing connection automatically -

java - websocket closing connection automatically - i'm building application in java has embedded websocket server based on jetty. client default websocket implementation in google chrome. working ok, if there no transfer between server , client after time connection closed. i'm not sure who's closing connection: jetty server or chrome browser. the solution think send message every x seconds, i'm opened improve solutions. so... questions are: is websocket protocol requires , in case chrome browser closing connection? is more jetty related , has more or less websocket protocol? in case how disable in jetty? is there problem?? thanks update: if send 1 message/second still connection closed you need send ping messages time time. think default timeout 300 seconds. sending websocket ping/pong frame browser java javascript google-chrome jetty websocket

adodb - ms access - return records from sql Stored procedure -

adodb - ms access - return records from sql Stored procedure - i have access 2010 , want phone call sql stored proc on sql 2008 server , homecoming results recordset or bind straight report. the method below returns error "feture not available in adp" or - works form not report. how go doing this? dim cn new adodb.connection dim rs adodb.recordset dim cm new adodb.command 'use ado connection access uses set cn = currentproject.accessconnection cn .provider = "microsoft.access.oledb.10.0" .properties("data provider").value = "sqloledb" .properties("data source").value = "dsidsw923" .properties("integrated security").value = "sspi" .properties("initial catalog").value = "promotions_dev_dsi" .open end 'create instance of ado recordset class, , 'set properties set rs = new adodb.recordset cm .activeconnection = cn .commandtext = ...

windows - USB disk encryption at driver level -

windows - USB disk encryption at driver level - i trying implement simple encrypted file scheme usb storage devices (flash disks) on specific pc. matter of security , assure flash disks formatted other pcs cannot used in pc , vice versa. os of pcs either windows xp, 7 or linux. now question: best approach this? best point implementing such system? i have read ifs documents in msdn , seems minifilters may best way go. can implement minifilter attaches usb devices , encrypts write operations , decrypts read operations. think minifilters cannot alter file-system tables. means files , folders can read unathurized pcs , file contents encrypted. alternative custom file-system seems much more hard implements. 1) there way insert software processing layer between file-system info output , usb bus? in way can protect finish disk data, no matter file-system uses. 2) there way manipulate file-system tables in minifilter level , create unreadable normal systems? 3) best solut...

mysql - Does first LEFT JOIN apply to multiple JOINs? -

mysql - Does first LEFT JOIN apply to multiple JOINs? - i have multiple join in form of select * column1 left bring together column2 using(id) bring together column3 using(name) bring together column4 using(info) column1.id = 44 if changing left join join ; obvious reason, query homecoming nil in absence of column2.id. main info column1 , others supportive data; thus, want retrieve info if column1.id exists. my question is: first left join guarantees query homecoming column1 values column1.id exists, regardless of subsequent join s (e.g. when column3.name not exist)? or need alter next (all) join s left join too? you have few options direct reply question no . change subsequent joins left joins. select * column1 left bring together column2 using(id) left bring together column3 using(name) left bring together column4 using(info) column1.id = 44 if possible, re-arrange query... select * column1 bring together column3 us...

java - Record screen with Android SDK? -

java - Record screen with Android SDK? - i don't want code, need help finding start project. need write app runs in background on adroid os , takes screenshot @ set interval , saves them file or database. far i've used java sdk, think might need stuff in c project, because: i don't see way in java work straight canvas/screen of other activitys? since each activity has own memory , kept pretty separate security reasons, think need go @ lower level? ideally parent install app on child's phone , wouldn't trivial them disable or uninstall without parent noticing. tricky, , can think of out-of-box solutions if needed, hoping @ lower c level there might help this. if need go c level sdk, there going restrictions distribution/install tricky? example, stuff require agreements oems have our software pre-installed. ...i imagine anti-virus software might in similar category app needs do, unfortunately spy-ware , viruses similar things, becomes issue, though ...

ios - Linking error duplicate symbol _kCHPointerSize with CHDataStructure static lib -

ios - Linking error duplicate symbol _kCHPointerSize with CHDataStructure static lib - i trying utilize chdatastructures static library iphone in xcode project. included # import "chdatastructures.h" in class header. however, when compile project error: d: duplicate symbol _kchpointersize in /users/sam/desktop/apps/libchdatastructures.a(util.o) , /users/sam/desktop/apps/build/apps.build/debug-iphonesimulator/apps.build/objects-normal/i386/appsappdelegate.o collect2: ld returned 1 exit status command /developer/platforms/iphonesimulator.platform/developer/usr/bin/g++-4.2 failed exit code 1 i using gcc-4.2 compiler , have tried llvm gcc 4.2 well. tried -objc , -all_build , , -force_build flags set in build setting not compiling. tried clean target, , create sure static lib included target binary or not. couldn't figure out problem. can help? probably far late ran similar if still issue, check import statements. it looks might referencing kchpoi...

string - Regex for code formatting -

string - Regex for code formatting - i add together line feed after semi-comas in text. something replace(";",";\n\r") but need exclude semi-comas within double quotes, how can regex? in case of quotes want replacement: var="hello;world"; var="hello;world";\r\n and not this: var="hello;world"; var="hello;\r\nworld";\r\n thnak you! you like: s/;(?=[^"\n]*(?:"[^"\n]*"[^"\n]*)*$)/;\n/gm; # perl synax if there no escaped quotes in strings, , strings not span multiple lines. that replace: ;(?=[^"\n]*(?:"[^"\n]*"[^"\n]*)*(?m:$)) with ;\n regex string replace quotes

Key-value pair serialization vs. JSON, XML, etc -

Key-value pair serialization vs. JSON, XML, etc - a naive question: developers, periodically have need save info disk. few, few 10s, or few 100s values. people utilize xml, utilize json, sense old ini-file format key1=value1 key2=value2 meets needs best. files readable, 1 can utilize text-processing on them, diffs in version command work well. yet, seems key=value not popular in serialization. overlooking something? it depends on you're trying values. json, can nest arrays of objects (each own sets of name/value pairs) in concise format. xml, can nest objects, , each object can have number of attributes (which end beingness name/value pairs). so comes downwards matter of style. do like: [{name="john", last="smith", salary="100"},{name="mary",last="smith",salary="200}] or <people> <person name="john" last="smith" salary="100" /> <person na...

Silverlight Telerik RadTimeBar -

Silverlight Telerik RadTimeBar - i've created simple radtimebar linearsparkline series: <telerik:radtimebar x:name="maintimebar" telerik:stylemanager.theme="windows7" periodstart="1/1/2012" periodend="1/1/2013" selectionstart="1/1/2012" selectionend="1/1/2013" minselectionrange="28.00:00:00" issnaptointervalenabled="true" grid.columnspan="2" selectionchanged="maintimebar_selectionchanged"> <telerik:radtimebar.intervals> <telerik:monthinterval> <telerik:monthinterval.intervalspans> <system:int32>1</system:int32> </telerik:monthinterval.intervalspans> </telerik:monthinterval> <telerik:dayinterval /> </telerik:radtimebar.intervals> <telerik:radlinearsparkline x:name="charttimeline" xvaluepath="{binding timestamp}" yvaluepa...

c# - DataSet.GetXmlSchema() do not returns nillable attribute -

c# - DataSet.GetXmlSchema() do not returns nillable attribute - i'm serializing dataset using getxmlschema() , getxml() methods (code below), in schema , xmldata there no xsi:nil or nillable attributes columns nullable. when deserializing how know column nullable? xelement schema = xelement.parse(dataset.getxmlschema()); xelement xmldata = xelement.parse(dataset.getxml()); is there way attributes in serialized xml? http://msdn.microsoft.com/en-us/library/ybce7f69%28v=vs.100%29.aspx looks may need using xmlserializer. also if non-nullable type (int example) has nil=true looks it'll throw error. that's on referenced page. c# xml serialization dataset xelement

css - Implementing Unobtrusive Javascript -

css - Implementing Unobtrusive Javascript - i'm reworking old website , focusing on making javascript/jquery unobtrusive possible. i'm looking advice on 1 part of project: uj requires that, if javascript turned off in browser, site content still available user. 1 part of site has big list of items. each item in list has it's own description, uses css display:none hide default. clicking on item toggles visibility of description using jquery .toggle():, person unable utilize javascript (for whatever reason) never see it. if utilize javascript/jquery rather css hide descriptions, momentarily visible when page loads, want avoid. what's best solution? basically can insert class "no-js" in html element, so <html class="no-js" lang="en"> and if javascript enabled on client remove class (using modernizr or simpler code snippet like <head> <script> (function(d) { d.classname = d.classname....

.net - How can I check VB, console application, user input to make sure they entered a valid number? -

.net - How can I check VB, console application, user input to make sure they entered a valid number? - vb not language of selection , have school , i'm not having easy time vb's documentation. i'm creating simple console application accepts user input: degrees in celsius, , converts fahrenheit. want create sure if user hits come in without entering degrees in celsius, if else statement grab , write come in celsius again. here's i've tried: module module1 'chapter 2: celcius fahrenheit 'programmer: scott mcpherson 'date: feb 2, 2012 'purpose: convert user input celcius output fahrenheit ' 'declaration dim deccelcius decimal = 0 dim decfahrenheit decimal = 0 sub main() 'input in celcius console.write("enter degrees in celsius: ") console.writeline() if cdec(console.readline()) <> 0 deccelcius = cdec(console.readline()) decfahrenheit = 1.8 * deccelc...

javascript - Generic HTTPClient or Ajax Class -

javascript - Generic HTTPClient or Ajax Class - var url = "https://www.appcelerator.com"; var service = someservicename; var xhr = ti.network.createhttpclient({ onload: function(e) { // this.responsetext holds raw text homecoming of message (used json) // this.responsexml holds returned xml (used soap web services) // this.responsedata holds returned binary info ti.api.debug(this.responsetext); alert('success'); }, onerror: function(e) { ti.api.debug(e.error); alert('error'); }, timeout:5000 }); xhr.open("post", url); xhr.send(someservicename); here how making async calls, how create in class , send url, , requrired service... parameters var jsoncall = function(url,servic, onload, onerror){ // api url phone call this.url = url; this.service = service; }; jsoncall.prototype = { call: function(){ var jsonclient = titanium.network.c...

linux - Is there a command to return the owner of a file? -

linux - Is there a command to return the owner of a file? - is there shell command print owner of file? i guess do: ls -l | awk '{print $3}' but feels there more straightforward reply problem. try using stat(1) [cnicutar@fresh ~]$ stat -c %u file.c cnicutar there lots of format sequences available: user id, total size, etc. linux shell scripting

mysql - DBIx::Class: Only select results where has_many greater than zero -

mysql - DBIx::Class: Only select results where has_many greater than zero - in our mysql database, have third_party_accounts table , has_many third_party_campaigns . however, not accounts have campaigns. in dbix::class select accounts have 1 or more campaigns. simplest i've found follows: my $third_party_account_rs = $schema->resultset('thirdpartyaccount'); $with_campaigns_rs = $third_party_account_rs->search( { third_party_account_id => \'is not null' }, { bring together => 'third_party_campaigns', group_by => 'me.id', } ); for relevant database columns: mysql> select id third_party_accounts; +----+ | id | +----+ | 1 | | 2 | | 3 | +----+ 3 rows in set (0.00 sec) mysql> select id, third_party_account_id third_party_campaigns; +----+-------------...

wcf - F# SOAP client with reserved word in parameter -

wcf - F# SOAP client with reserved word in parameter - i'm using languageservice (translation service) bing. generated f# soap client code svcutil (and modified little got working) got stuck methods utilize word to in parameters. , reserved in f#. [<system.servicemodel.operationcontractattribute(action="http://api.microsofttranslator.com/v2/languageservice/translate", replyaction="http://api.microsofttranslator.com/v2/languageservice/translateresponse")>] abstract translate :appid:string * text:string * from:string * to:string * contenttype:string * category:string -> string i tried _to , __to without luck. i don't know if there way undefine keywords or define parameter way (something this: soappy - reserved word in named parameter list ). thanks in advance! abstract translate :appid:string * text:string * from:string * ``to``:string * contenttype:string * category:string -> string double back-ticks allow set string ...

c# - Split message in serial communication -

c# - Split message in serial communication - i new serial communication. have read fair few tutorials, , of trying working, have question regarding serial communication c#. have micro controller sending info through serial line. info ist in format: bxxxxixx.xx,xx.xx* x's represent different numbers, + or - signs. @ times want read info c# programme on pc. problem having messages seem split in random positions though using readto("*"); assumed read upto * character. how can create sure message recieved complete? thank help. public string receivecommandhc() { string messagehc = ""; if (serialhc.isopen) { serialhc.discardinbuffer(); messagehc = serialhc.readto("*"); } homecoming messagehc; } you'll find in serial comms info messages (unless small) split. downwards speed of communication , point @ retrieve info port. usually you'd set cod...

Visual Source Safe - Is there a way to get last version of the files in a code set that I checked in? -

Visual Source Safe - Is there a way to get last version of the files in a code set that I checked in? - i working on old project when left off, checked everying in , since then, other people have worked on project. wondering if there way lastest version of code set, files checked in last, not current latest version. i have been in world of svn of late, bit rusty vss. have searched web , cannot seem key in on create happen. know can more command line vss closer database query, not savy. maintain looking, no brainer on here. thanks in advance. click history button. can come in date range or user name (or neither finish history). visual-sourcesafe

jquery - How to get an array of all selected values of all dropdownlists in div -

jquery - How to get an array of all selected values of all dropdownlists in div - here's i'm trying parse jquery: <tr> <td>5</td> <td>abc@abc.com</td> <td>asdfasdf asdfasdf</td> <td> <div class="roleoption"> <img src="/public/images/delete.png" alt="delete" /> <select id="role" name="role"> <option value="1">anonimo</option> <option value="2">registrado</option> <option value="3">tecnico</option> <option value="4">empresario</option> <option selected="selected" value="5">editor</option> <option value="6">financias</option> <option value="7">adm...

scala - Possible to perform pattern match on a generic value with type conforming result? -

scala - Possible to perform pattern match on a generic value with type conforming result? - is possible perform pattern match result conforms type parameter of outer method? e.g. given: trait key[a] { def id: int def unapply(k: key[_]): boolean = k.id == id // used fail2 def apply(thunk: => a): = thunk // used fail3 } trait ev[a] { def pull[a1 <: a](key: key[a1]): option[a1] } trait test extends ev[anyref] { val key1 = new key[string] { def id = 1 } val key2 = new key[symbol] { def id = 2 } } is there implementation of test (its pull method) uses pattern match on key argument , returns option[a1] each key checked, without utilize of asinstanceof ? some pathetic tries: class fails1 extends test { def pull[a1 <: anyref](key: key[a1]): option[a1] = key match { case `key1` => some("hallo") case `key2` => some('welt) } } class fails2 extends test { def pull[a1 <: anyref](key: key[a1]): option[a1] = key match {...

extjs - Sencha Touch - Is creating Stores often expensive? -

extjs - Sencha Touch - Is creating Stores often expensive? - is expensive operation create ext.data.store objects, because quite create stores retrieving info once. it depend on quantity of info you're retrieving , how utilize in application. you need weigh overheads calling info datasource more once, overhead of storing on page , using client side. using stores retrieve info 1 time isn't problem store client side d collection of data. there isn't much weight them. it may worth knowing if you're using extjs4 , you're talking retrieving single info item, rather collection of items, can create single 'model' , interact rather store, lighter solution. extjs sencha-touch sencha-touch-2

Can I have a double-keyed map in Java -

Can I have a double-keyed map in Java - possible duplicate: how implement map multiple keys? imagine table columns k1, k2 , d. may need search info keys k1 or k2 or both. there 'standard' solution in java apart creating several maps keeping references? consider using guava's table. sample documentation table<vertex, vertex, double> weightedgraph = hashtable.create(); weightedgraph.put(v1, v2, 4); weightedgraph.put(v1, v3, 20); weightedgraph.put(v2, v3, 5); weightedgraph.row(v1); // returns map mapping v2 4, v3 20 weightedgraph.column(v3); // returns map mapping v1 20, v2 5 java map

CakePHP - How to call JS function when ajax request is completed -

CakePHP - How to call JS function when ajax request is completed - how can phone call js function when ajax request completed i'm using js helper , requesthandler component this view file <?php echo $this->js->submit('create user', array( 'before'=>$this->js->get('#loading')->effect('fadein'), 'success'=>$this->js->get('#loading')->effect('fadeout'), 'update'=>'#success', )); ?> i'm getting loading message , success message... want phone call js function when ajax request done/completed, can close user registration div i solved it...there method in js helper called complete , can phone call js function <?php echo $this->js->submit('create user', array( 'before'=>$this->js->get('#loading')->effect('fadein'), 'success'=>$this->js->get('#loading')...

php - Including links in text message using twilio API -

php - Including links in text message using twilio API - how can include url in outgoing text message using twilio api? tried, message not sent. there specific format? syntax? update: here's code: (i using php api) perhaps problem using variable in link? or maybe in different format? $sms = $client->account->sms_messages->create( "xxx-xxx-xxxx", $send_to_number, "hey $var1. words words $var2. via example.com. see: https://graph.facebook.com/$fb_id/picture"); the example.com link works perfect, $var1 , $var2 . when adding lastly link includes variable (and facebook graph api, don't think matters), message not sent. there way solve without url shortener? sms messages sent via twilio limited 160 characters because carriers break messages 160 character sized chunks. these chunks doen't arrive in order, recommended send sort of pagination along message if expect on 160 chars. https://www.twilio.com/help/f...

artificial intelligence - How does a back-propagation training algorithm work? -

artificial intelligence - How does a back-propagation training algorithm work? - i've been trying larn how propagation works neural networks yet find explanation less technical aspect (i have searched places , found http://www.alexandria.nu/ai/neural_net_demo/ useful far). how propagation work? how larn training dataset provided? have code until then, need gain stronger understanding of them. back-propagation works in logic similar of feed-forward. difference direction of info flow. in feed-forward step, have inputs , output observed it. can propagate values forwards train neurons ahead. in back-propagation step, cannot know errors occurred in every neuron ones in output layer. calculating errors of output nodes straightforward - can take difference between output neuron , desired output actual output instance in training set. neurons in hidden layers must update errors this. have pass error values them. these values, hidden neurons can update error , other p...

How to point Log4net to its configuration file? -

How to point Log4net to its configuration file? - we moved our tests nunit mstest. using spring.net ioc container , log4net. log4net unable find log4net.xml despite having in test project. ideas be? here error receiving: unable create instance of class ourcompany.dataaccess.documentmanagement.tests.emailverificationtokensadaptertests.deletetests. error: common.logging.configurationexception: unable create instance of type common.logging.log4net.log4netloggerfactoryadapter. possible explanation lack of 0 arg , single arg namevaluecollection constructors ---> system.reflection.targetinvocationexception: exception has been thrown target of invocation. ---> common.logging.configurationexception: log4net configuration file 'log4net.xml' not exists. @ common.logging.log4net.log4netloggerfactoryadapter..ctor(namevaluecollection properties) --- end of inner exception stack trace --- @ system.runtimemethodhandle._invokeconstructor(iruntimeme...

cookies using Delphi 2010 and Indy -

cookies using Delphi 2010 and Indy - i'm new dealing cookies , not sure if code or maybe indy version problem based on researching other posts. using delphi 2010 , indy 10.5.5. have set cookiemanager @ design time. can send initial login request (using post method) server successful (get "success" code server app) , cookie manager shows has accepted cookie server. when seek reply server (again using post) next set of information, error code server app indicates authorization failure , i'm beingness told server tech back upwards people check cookie beingness sent reply. how can check contents of cookie header beingness sent server? also, in post saw indy 10 idcookiemanager.pas , idcookie.pas have been updated in 2011. should update indy latest version might problem? thanks in advance. here more info: thank previous assistance; appear getting closer reinstalling indy10. i purged scheme of indy stuff except recent version (10.5.8) download...

python - What's the pythonic way to assign default values to be printed by help()? -

python - What's the pythonic way to assign default values to be printed by help()? - i have written next script load , assign default values fields help() searches for: import os os.chdir(os.path.dirname(os.path.abspath(__file__ ))) def _get_authors(): path = os.path.dirname(os.path.abspath(__file__ )) open('%s\authors' % path, 'r') authors: homecoming ', '.join([author author in ''.join(authors.readlines()).splitlines()]) def _get_readme(): path = os.path.dirname(os.path.abspath(__file__ )) open('%s\readme' % path, 'r') f: homecoming ''.join(f.readlines()) def _get_copyright(): import datetime start = 2011 end = datetime.date.today().year if start == end: years = str(start) else: years = "%d - %d" % (start, end) homecoming "copyright %s, %s" % (years, __maintainer__) __doc__ = _get_readme() __author__ = _get_aut...

php - Executing a long running screen scraping script -

php - Executing a long running screen scraping script - i have screen scraping script in php on godaddy shared lamp server running via command-line. the script scrapes, parses , stores required info in database. takes 1.5 seconds entire process per page, , needs scrape close 10,000 pages (and each of pages, fetch cookies 2 others, making total of 30k pages curl ed). the entire script take 5 hours run. have done memory profiling, , memory consumption stays more or less constant throughout run - not increase. if run script overnight, godaddy notice abnormal it? cpu consumption should not much how bad bandwidth consumption of fetching 3 pages per 1.5 seconds duration of 5 hours be? plenty raise alarms on godaddy's end? if yes, suppose break script run through 1500 pages, , halt 1 hr , resume. should that? for sake of not leaving question unanswered, i'll post answer: i ran script overnight. took 5 hours run , neither terminated godaddy nor did receive noti...

C# Downcasting Lists to IList "special tactics" -

C# Downcasting Lists to IList "special tactics" - so i'm working @ company , i'm relatively new here i've come across unusual in production code i'm told written much more knowledgable in c# myself "does things special way". i'm trying think of reasons i'm explain, giving benefit of uncertainty can't come anything. ilist<facility> facilities = new list<facility>(); the above line @ core of problem... other oddities throughout code come beingness unable utilize interfaces things , hence info has copied out list before using them (for illustration exporting via webservice, not allow using interface, must implementation of ilist) now understand interfaces wonderful in sense can write methods expect methods presribed in interface exist on implementation beingness passed method but... can please help me out here... can think of reason you'd downcast list interface in info layer of application? also ...

sql - How to Limit CTE Recursion Depth but Select Generic Table? -

sql - How to Limit CTE Recursion Depth but Select Generic Table? - currently have stored procedure returns info table in it's original schema doing this: with cte ( -- start cte off selecting id provided stored procedure. select * [dbo].[testtable] [id] = 1 -- recursively add together tasks children of records found in previous iterations. union select t.* [dbo].[testtable] t inner bring together cte tcte on t.[parentid] = tcte.[id] ) select * cte this nice, because no matter how table schema changes, long there [id] , [parentid] columns, won't have update stored procedure. i'd similar, able specify depth of recursion dynamically. way i've seen add together level/depth identifier so: with cte ( -- start cte off selecting task provided stored procedure. select *, 0 [level] [dbo].[testtable] [id] = 1 -- recursively add together tasks children of parent tasks have been found in p...

.net - How to take control of the currently running instance of PowerPoint, by process id? -

.net - How to take control of the currently running instance of PowerPoint, by process id? - another program, outside own program, creates new powerpoint presentation. when does, programme can observe process id of powerpoint presentation. i want take command of running instance of powerpoint can re-create slides or @ to the lowest degree save presentation. how in .net? powerpoint offers big automation api utilizable though .net. .net powerpoint

How do I plot a slope field using mathematica? -

How do I plot a slope field using mathematica? - i trying plot slope fields of differential equations using mathematica can't figure out. have equation y' = y(t) y(t) = c * e^t how plot slope field? i found illustration way complex me understand http://demonstrations.wolfram.com/slopefields/ the command need (since version 7) vectorplot . there examples in documentation. i think case you're interested in differential equation y'[x] == f[x, y[x]] in case gave in question, f[x_, y_] := y which integrates exponential in[]:= sol = dsolve[y'[x] == f[x, y[x]], y, x] out[]= {{y -> function[{x}, e^x c]}} we can plot slope field (see wikibooks:ode:graphing) using vectorplot[{1, f[x, y]}, {x, -2, 2}, {y, -2, 2}] this can plotted solutions de using like show[vectorplot[{1, f[x, y]}, {x, -2, 2}, {y, -2, 8}, vectorstyle -> arrowheads[0.03]], plot[evaluate[table[y[x] /. sol, {c, -10, 10, 1}]], {x, -2, 2}, ...

list - Python 3 FTPLIB, NoneType Errors, and Uploads/Downloads -

list - Python 3 FTPLIB, NoneType Errors, and Uploads/Downloads - in script want able, in end, able download files in directory , sub-directories... trying ftplib. i'm trying phone call dir of ftp server , set variable, nonetype?! can connect server , when phone call directory = session.dir() displays kind of matrix style output in console files, read/write perms, dates, etc.... when seek print directory seem "none". initial thought each item in directory download them computer, can't seem list of directory! directory = session.dir() print(str(directory)) sorry long , trivial explanation, have become little bit frustrated. any help much appreciated! -clem first, read this. http://docs.python.org/library/ftplib.html#ftplib.ftp.nlst then, seek this: directory = session.nlst() print(directory) note. don't need print(str(...)) . print function gets string representation you. python list file-upload download ftplib

windows - How to run javac with paths as argument that contain white spaces? -

windows - How to run javac with paths as argument that contain white spaces? - i trying run next javac -xlint:unchecked -classpath c:/users/a b/workspace/ @c:/users/a b/workspace/files_to_compile but i'm getting a javac: invalid flag c:/users/a i've tried surround both paths double quotes doesn't seem help bit: javac -xlint:unchecked -classpath "c:/users/a b/workspace/" @"c:/users/a b/workspace/files_to_compile" what doing wrong? same code worked correctly in other computers (probably because didn't have white space in paths..). thanks your sec seek right javac -xlint:unchecked -classpath "c:/users/a b/workspace/" @"c:/users/a b/workspace/files_to_compile" but complete, have escape spaces text file "files_to_compile" using: the same syntax properties file : \ or double quote each line i suggest sec i'm not sure. windows javac

objective c - How can I delete an AddressBookGroup entry? -

objective c - How can I delete an AddressBookGroup entry? - here code create new grouping in adress book: abrecordref grouping = abgroupcreate(); //create grouping abrecordsetvalue(group, kabgroupnameproperty,@"my group", nil); // set group's name abgroupaddmember(group, person, nil); // add together person grouping abaddressbookaddrecord(addressbook, group, nil); // add together grouping but how can delete grouping (and other) programmaticaly app ? sample code ? thanks lot! best regards there sample project abuigroups shows how this. it uses method: // remove grouping given address book - (void)deletegroup:(abrecordref)group fromaddressbook:(abaddressbookref)myaddressbook { cferrorref error = null; abaddressbookremoverecord(myaddressbook, group, &error); abaddressbooksave(myaddressbook,&error); } objective-c ios

javascript - Many to many relationship events with backbone.js -

javascript - Many to many relationship events with backbone.js - i have many-to-many relationship 2 of backbone.js models implemented using pivot table on serverside. i'm trying figure out how construction clientside. current construction is: 1) have tag model, , tagview renders checkbox , tag label, have checked event on checkbox nil @ moment. i have tagscollection, holds bunch of tags. i have tagscollectionview, binds add, reset etc of tagscollection, , adds tagviews added tags, renders them, , appends html current html (on reset, html reset). i have global tagcollection instance contains possible tags i have notes model contains (empty) tagcollection called selectedtags on init. the server returns array of selected tagids each notes, add together tagcollection. now comes hard part, tying together.. notesview has own tagscollectionview bound global tagscollection (so can list tags).. now, how checked event on checkedbox of sub tagviews trigger add together this notes...

asp.net mvc 3 - Ugly url in mvc3-how make it nice looking? -

asp.net mvc 3 - Ugly url in mvc3-how make it nice looking? - have action in ideas controller in aplication: public viewresult newideas(int numberofpage = 1) that action "produces" url that: /ideas/newideas/?numberofpage=1 it's quite ugly-it should just: /ideas/newideas/1 i know new maproute propably solve problem-but how should like? help. you should add together new route in global.asax: routes.maproute( "newideas", // route name "ideas/newideas/{numberofpage}", // url parameters new { controller = "ideas", action = "newideas", numberofpage= urlparameter.optional } // parameter defaults ); asp.net-mvc-3 url maproute

html - How to force a container element to the width of its widest child element using CSS? -

html - How to force a container element to the width of its widest child element using CSS? - here simplified code of tabulated input form: <html> <body> <div class='container' style='width: 950px; margin-left: auto; margin-right: auto'> <form> <table> <colgroup> <col width='175' /> <col width='200' /> <col width='200' /> </colgroup> <tr> <td>input field 1</td> <td>input field 2</td> <td>input field 3</td> </tr> </table> <div class='buttons-small' style='float: right';> <button class='submit'>update</button> <button class='...

Android - Is it possible to have dynamically moving clickable objects in a view -

Android - Is it possible to have dynamically moving clickable objects in a view - for purposes of game development, possible set view , create class extends button or implements clickable or something. im trying figure out best way handle screen clicks on moving objects onscreen , right im drawing in canvas inturn drawn view cant create individual bitmaps representing objects clickable. so before throw out lot of work , seek know if possible have dynamically moving objects within view can independently handle screen clicks. add ontouchlistener view (the 1 that draws objects on canvas), , in ontouch(view v, motionevent event) , coordinates of event: int x = event.getx(); int y = event.gety(); then loop through objects draw , see if these coordinates on objects current area, if so, know has been clicked. android view extend

ios - Hiding the pins/markers from the map view through method in iPhone -

ios - Hiding the pins/markers from the map view through method in iPhone - in viewdidload: method show different locations of number of vehicles have used pins/markers/annotations. what want know if user selects 1 vehicle how can hide other pins/markers. is possible? how that? yes, possible. first need add together observer each annotationview observe when user selects annotation. first must add: static nsstring * const gmap_annotation_selected = @"gmapannotationselected"; to top of implementation (right below @implementation). must add together observer each annotationview. done by: -(mkannotationview *)mapview:(mkmapview *)localmapview viewforannotation:(id<mkannotation>)annotation //create custom annotation called annotationview [annotationview addobserver:self forkeypath:@"selected" options:nskeyvalueobservingoptionnew context:(void*)("gmapannotationselected")]; homecoming annotationview; then add together ...

GWT Popup with Editor Framework -

GWT Popup with Editor Framework - in simple inventory management app have activity handle assigning equipment types employees (if user checks out). wondering this: currently have drag , drop equipment can dragged on employee. want have is, equipment dragged, popup opens asking user confirmation amount wishes assign. deed editor around 2 entities (equipmentcheckin , equipmentcheckout). here's issues i'm running into: 1. should popup initialized in view , set visible on drop event (this planned on doing) - in doing how initialize editor (should there separate activity called on drop - don't imagine there editor part confusing me) 2. should each popup have own class , ui.xml file - way going go , phone call set visible true on drop event (i think right way go) guess i'm asking here validation on how of this, can't find decent illustration stuff. that's used google music before want they're doing when go edit album or song info - imagine behind ...

linux - Unbind C-d from Delete in Emacs -

linux - Unbind C-d from Delete in Emacs - on scheme (ubuntu 11.04) c-d acts alias delete in emacs. there way break connection? if so, how? put in emacs init file: (global-unset-key "\c-d") linux emacs

In emacs Python mode, how do I set a different auto-fill width for docstrings and code? -

In emacs Python mode, how do I set a different auto-fill width for docstrings and code? - i have auto-fill set 79 columns code sections , 72 docstrings automatic pep8 compliance. there seems alternative lisp mode (emacs-lisp-docstring-fill-column) not python. is there enhanced python-mode.el around somewhere includes this? current python-mode.el provides (defcustom py-docstring-fill-column 72 [...] (defcustom py-comment-fill-column 79 [...] while code value of fill-column used. python emacs docstring pep8 autoformatting

xcode - Adding rows to a table -

xcode - Adding rows to a table - i have table objects added nsarray called listofconjprocedures want utilize insert command appears above top row in table add together rows table when tapping edit button in uinavigation controller , cannot find sample code. edit function looks this: - (nsinteger)tableview:(uitableview *)tableview numberofrowsinsection:(nsinteger)section { if ([tableview isediting]) homecoming [listofconjprocedures count] + 1; else homecoming [listofconjprocedures count]; } - (void)tableview:(uitableview *)tableview commiteditingstyle:(uitableviewcelleditingstyle)editingstyle forrowatindexpath:(nsindexpath *)indexpath { if (editingstyle == uitableviewcelleditingstyledelete) { // delete row info source. [listofconjprocedures removeobjectatindex:indexpath.row]; [tableview deleterowsatindexpaths:[nsarray arraywithobject:indexpath] withrowanimation:uitableviewrowanimationfade]; } else if (editingsty...

c++ - cuda, pycuda -- how to write complex numbers -- errors:class "cuComplex" has no member "i" -

c++ - cuda, pycuda -- how to write complex numbers -- errors:class "cuComplex" has no member "i" - i have difficulties utilize complex numbers in cuda,pycuda. i have in c: #include <complex> typedef std::complex<double> cmplx; .... cmplx j(0.,1.); also,in same code: #include <boost/python.hpp> #include <boost/array.hpp> ... typedef std::vector< boost::array<std::complex<double>,3 > > complexfieldtype; typedef std::vector< boost::array<double,3> > realfieldtype; ... __global__ void compute(realfieldtype const & rs,complexfieldtype const & m,..) ... how can convert utilize pycuda? tried sth (according book 'cuda example'): struct cucomplex { float real; float imag; cucomplex(float a,float b): real(a),imag(b){} cucomplex operator *(const cucomplex& a) { homecoming cucomplex(real*a.real -imag*a.imag ,imag*a.real +real*a.imag); } cucomplex operat...

node.js - express.js / serve generated image -

node.js - express.js / serve generated image - i using express , serve generated image. html source <img src="/generated/image"> , route setup when get /generated/image called, png gets created (and put, example, in public directory, guess not strictly necessary). i'd send image user. should utilize res.send() purpose? how can info user? depending on library you're using create image, should able res.end(image, 'binary'); create sure include right content-type header. if don't want generate file every time can write file disk, store in key/value store, relational database, etc... , check/serve if has been created before going through creation routines. node.js express

parameters - Using named arguments in Javascript with regular expressions as names of arguments -

parameters - Using named arguments in Javascript with regular expressions as names of arguments - is possible utilize named arguments in java or javascript regular expressions names of arguments? want create possible phone call function this: f("function name:", "drawcircle", "radius:" 1, "xpos:" 0, "ypos:", 0, "color:", "red"); or this, same effect: f("name of function:", "draw circle", "y position:", 0, "color:", "red", "rad:" 1, "x location:" 0); both of these should equivalent foo(1, 0, 0, red). in both cases, arguments given should match list of regular expressions. should possible list arguments , function name in order same result. is there way implement this? f({ "name": "drawcircle", "radius": 1, "xpos": 0, "ypos": 0, "color": "re...

mobile - What is the state of whitelisting in phonegap 1.3.0? -

mobile - What is the state of whitelisting in phonegap 1.3.0? - does phonegap/callback/cordova have whitelist on platforms? implemented same way on each? the whitelist nowadays on both ios , android, not other platforms yet. under ios, goes under name of "external hosts," explained here: http://wiki.phonegap.com/w/page/41631150/phonegap%20for%20ios%20faq q. links , imported files external hosts don't load? a. latest code has new white-list feature. if referencing external hosts, have add together host in phonegap.plist under "externalhosts" key. wildcards ok. if connecting "http://phonegap.com", have add together "phonegap.com" list (or utilize wildcard "*.phonegap.com" match subdomains well). for example: <key>externalhosts</key> <array> <string>*</string> </array> for android, feature undocumented , buggy, although undergoing fixes. thread holds troublesho...