Posts

Showing posts from January, 2014

Where does PHP store the error log? (php5, apache, fastcgi, cpanel) -

i on shared hosting , have cpanel, apache, php run fastcgi. php store error log? is there other way can find error log on shared hosting environment instead of having go through entire site structure error_log files? i have access php.ini (i using php version 5.2.16). php stores error logs in /var/log/apache2 if php apache2 module. shared hosts storing log files in root directory /log subfolder. but...if have access php.ini file can this: error_log = /var/log/php-scripts.log according rinogo 's comment: if you're using cpanel, master log file you're looking stored (by default) at /usr/local/apache/logs/error_log if else fails can check location of log file using <?php phpinfo(); ?>

wpf - Transparent floating window. -

i'm trying create transparent floating dockable window. but, having difficulting achieving this. tried opacity, no luck. here snapshot of code : // floating dockable split pane splitpane splitfloating = new splitpane(); xamdockmanager.setinitiallocation(splitfloating, initialpanelocation.dockablefloating); xamdockmanager.setfloatinglocation(splitfloating, new point(my.xcoordinate, my.ycoordinate)); xamdockmanager.setfloatingsize(splitfloating, new size(my.width, my.height)); tabgrouppane tgpfloating = new tabgrouppane(); contentpane cprichtext = new contentpane(); cprichtext.content = new richtextbox(); cprichtext.opacity = 0.0; tgpfloating.items.add(cprichtext); tgpfloating.opacity = 0.0; splitfloating.panes.add(tgpfloating); splitfloating.opacity = 0.0; this.dockmanager.panes.add(splitfloating); this.dockmanager.opacity = 0.0; i don't know infragistics suite, speaking should set...

objective c - iOS - How do I create a read and write stream to a network socket? -

i new ios development. attempting create read , write stream. using cfnetworking programming guide's examples try , working. i trying schedule read stream on run loop work around issue of streams blocking. right away have run issues. how can create cfhost object using cfhhostcreatewithaddress? here have far: nsstring *address = @"irc.ubuntu.net"; cfdataref addressdataref = (cfdataref)[address datausingencoding:nsasciistringencoding]; cfhostref host = cfhostcreatewithaddress(kcfallocatordefault, addressdataref); //create read , write stream cfstreamcreatepairwithsockettocfhost(kcfallocatordefault, host, 8008, &readstream, &writestream); the second line bombs. can please tell me how create cfhostref? thanks lot! the documentation states second argument cfhostcreatewithaddress() must "a cfdataref object containing sockaddr structure address of host. value must not null." you're passing cfdataref representing "irc.ubuntu.ne...

java - StAX XML Parser not escaping single quote (&apos;) -

we using stax parser read large xml files , strip off of elements/attributes , write xml file the source xml file valid xml file i.e. have xml special characters( < , > , ' , " , & ) escaped respective xml versions( &lt; , &gt; , &apos; , &quot; , &amp; ) when stax parser writing these special characters in output file escaping < , > , & characters not ' , " characters i.e in output file can see ' , " characters, although input file have escaped versions i have tried replace using string.replaceall("'","&apos;") method before sending output stax parser writeattribute method but stax parser escaping <,>,& character output showing &amp;apos; can let me kow there configuration/utiltity in stax parser api solve issue in stax parser? or, alternatively, other suggestions use xml writer tool solves problem? single quotes need escaped if occur in attribute ...

Call R plots from c++ using RInside/ Rcpp -

is possible call plot functions c++ ? when try that, ubuntu terminal sort of freezes sometime ( may duration 3d plot created , rotated full 360 degrees) , unfreezes, without ever popping new window. expected behavior or there doing wrong ? how can plots ( r graphics ) run within c++ using rinside , rcpp ? thnx -egon yes, there working examples in rcpp package. @ file functioncallback/newapiexample.r in examples/ directory. may need experiment sleep() 'hold' plot moment, or plot file , have file displayed. depends gave little detail.

wpf - Binding of static method/function to Func<T> property in XAML -

i'm working on using xaml create object tree , 1 of nodes looks this: public class executemethod : inode { #region implementation of inode public bool evaluate() { return function != null && function(); } public string name { get; set; } private string _type; public string type { { if (string.isnullorempty(_type)) { _type = gettype().name; } return _type; } } #endregion public func<bool> function { get; set; } } my goal essential make xaml , code behind clean possible isn't case right i'm creating wrapper properties every function: public static func<bool> func1 { { return method1; } } public static bool method1() { //do stuff here return true; } and xaml looks above code: <root xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns="clr-namespace:xamlbt;assembl...

jquery - javascript submit -

i have form 4 question, each have 2 answers choose - radio button type. (1)do want milk? yes no (2)are happy? yes no (3)do have parents? yes no (4)do have sisters? yes no (1) first have javascript or jquery validation make sure each question have answer chosen, form should not submited null value. (20) if user chooses yes of question, takes them yes.html page if user chooses no, takes them no.html. them no.html, have choose no answers each question so yes, higher preference here.. please help. i want this, validation make sure selected: <script type="text/javascript"> function choosepage() { if(document.getelementbyid('weightloss').form1_option1.checked) { window.location.replace( "http://google.com/" ); } if(document.getelementbyid('weightloss').form1_option2.checked) { window.location.replace( "http://yahoo.com/" ); } } </script> ...

cakephp - Ajax Autocomplete field: display one value, but use another? -

i've got autocompleter in cakephp app provides dropdown list of neighborhoods attach place. i'm pulling table 'neighborhoods' name , id fields. want user see name of neighborhood, , want app see id of neighborhood , insert places table. how can make happen? another way of doing storing id. when user presses submit replace input field's value stored value.

javascript - jquery making local variable in function global -

i have function populates currsong variable data. problem variable currsong available inside function , need access globally. // single audio url echonest.artist(artist).audio( function(audiocollection) { var currsong = audiocollection.data.audio[0].url; return currsong; }); thank you! to declare global variable, can remove var : currsong = audiocollection.data.audio[0].url; i'm not sure if global variable solution whatever you're trying do, though. people suggest avoid them reason. edit an example . note, variable undefined before function executed first time. in code, pass audio , don't invoke it. edit2 tgr notes, can declare global variable explicitly : window.currsong = ... . there's no functional difference, improves code quality.

asp.net - Network access for Distributed Transaction Manager (MSDTC) has been disabled -

error: network access distributed transaction manager (msdtc) has been disabled. please enable dtc network access in security configuration msdtc using component services administrative tool. using (system.transactions.transactionscope ts = new system.transactions.transactionscope()) 11 { 12 try 13 { 14 foreach (datarow row in this.dt1.rows) 15 { 16 int titleid = int.parse(row["titleid"].tostring()); 17 string fname = row["fname"].tostring(); 18 string lname = row["lname"].tostring(); 19 20 if (cmd.parameters.count > 0) 21 cmd.parameters.clear(); 22 23 cmd.parameters.addwithvalue("@titleid", titleid); 24 ...

r - Compression issue when saving anR project -

i solved problem moving r installation directory out of disk c. joris great suggestions! think r core team should take bug , against protecting mechanism of windows xp. dear community: while using biomod packages in r, following problem: error in xzfile(file, "wb", compression = 9) : cannot open connection in addition: warning message: in xzfile(file, "wb", compression = 9) : cannot initialize lzma encoder, error 5 it said author of package , in file of "save" problem should caused lack of permission write. however, logging in administative account , have assess operations, have no idea problem is. can me out? need run package now. in advance~ sincerely, marco below illustration in file of "save": the common reason failure lack of write permission in current directory. 'save.image' , saving @ end of session shown messages like error in gzfile(file, "wb") : unable open connection in addit...

Css content(Images) added in a mail Html file is not displaying images -

i have div classes mail in css of mail. when open mail in outlook or in gmail not able view images. when open mail in browser displays images fine... attached email's content <!--ctype html public "-//w3c//dtd html 4.01 transitional//en" "http://www.w3.org/tr/html4/loose.dt--><!--ctype html public "-//w3c//dtd xhtml 1.0 transitional//en" "http://www.w3.org/tr/xhtml1/dtd/xhtml1-transitional.dt--> <!doctype html public "-//w3c//dtd html 4.01 transitional//en"> <html> <head> <style type="text/css"> .logo_print { background-image:url("http://www.websitename.com//en-ca/images/logo_print.jpg"); width:105px;height:79px; } .icon_shipped { background:url("http://www.websitename.com//en-ca/images/icon_shipped.jpg");widt h:14px;height:14px; } .icon_not_shipped { background:url("http://www.websitename.com//en-ca/images/icon_not_ship...

What are the differences between git cherry-pick and git show | patch -p1? -

i ran situation git cherry-pick x have conflicts, created inserts (when verified git diff ). i re-ran git show x > my.patch , , did patch -p1 < my.patch on tree. got better results, conflicts, cleaner result. what git special cherry-picks? use git 1.7.0.4. edited: cleaner results, mean resulting tree matched lot more results of git show x , whereas git cherry-pick included lot more code. when cherry-pick commit, commits result using metadata of commit, not diff represents - you'll original commit message , author. patch pipeline working tree contents want, you'll have commit yourself, git commit -c <original-commit> copy metadata cherry-pick have. cherry-pick has additional options helpful, , can accept multiple commits (perhaps specified rev-list range). patch doesn't support of that. i'm not sure assertion result "cleaner". suggesting git applied diff differently patch did?

iphone - Apple Enterprise Developer to Distribute Ad Hoc To Clients? -

with apples enterprise developer account able distribute ad hoc customers aswell? or limited in-house employees? ad-hoc deployment suit our application deployment structure better our customers, purchase software , provide them provisioning , ad hoc files install. have feeling apple wont have bar of it. any advice appreciated. thanks in advance if can't through app store, apple don't support business model. enterprise in-house distribution, ad hoc testing, app store selling app. your best option go through app store, i'm guessing if you're posting question, it's because you're doing violates app store guidelines. perhaps if post reason why avoiding app store, might able give better advice.

uiview - Adding actions to buttons in a subview -

in app call uiview , uiview settings screen in app , have buttons in uiview , question how add actions buttons iv added uiviews subview? thanks, assuming you're writing code in view controller settings uiview, uiview bound view property of controller, , have referenced 1 of buttons variable button , here write: - (void)viewdidload { [super viewdidload]; [button addtarget:self action:@selector(buttonpressed) forcontrolevents:uicontroleventtouchupinside]; } - (void)buttonpressed { // things here in response button being pressed } another way write method passing in pointer button pressed, so: - (void)viewdidload { [super viewdidload]; [button addtarget:self action:@selector(buttonpressed:) // note colon here forcontrolevents:uicontroleventtouchupinside]; } - (void)buttonpressed:(id)sender { uibutton *buttonwhichwaspressed = (uibutton *)sender; // can things hide button, change text, etc. } rat...

math - The inverse Fibonacci algorithm? -

there dozens of ways of computing f(n) arbitrary n, many of have great runtime , memory usage. however, suppose wanted ask opposite question: given f(n) n > 2, n? (the n > 2 restriction in there since f(1) = f(2) = 1 , there's no unambiguous inverse). what efficient way of solving problem? it's easy in linear time enumerating fibonacci numbers , stopping when hit target number, there way of doing faster that? edit: currently, best solution posted here runs in o(log n) time using o(log n) memory, assuming mathematical operations run in o(1) , machine word can hold number in o(1) space. i'm curious if it's possible drop memory requirements, since can compute fibonacci numbers using o(1) space. since op has asked matrix solution not involving floating point computations, here is. can achieve o(logn) complexity way, assuming numeric operations have o(1) complexity. let's take 2x2 matrix a having following structure 1 1 1 0 no...

c# - Hide SortedList's .Add method vs using another method name with base.Add -

i have custom class sortedlist few properties , methods. additional processing when new key/value pair added (i.e when .add method called). can hide .add method or use method name (ex: .addpair ) , call base.add in method. preferred approach? why? hide .add method: using system; using system.collections.generic; using system.linq; using system.text; namespace inheritence_test { class program { static void main(string[] args) { dyseries d = new dyseries() { fieldname = "test" }; d.add(new datetime(2010, 12, 1), 2345); d.add(new datetime(2010, 12, 5), 2340); d.add(new datetime(2010, 12, 2), 2343); console.writeline("fieldname {0} \n count {1} \n max {2} \n min {3}", d.fieldname, d.count(), d.keys.max(), d.keys.min()); } } class dyseries : sortedlist<datetime, double> { public string fieldname { get; set; } new public void add(dat...

ms word - Reading MS doc image from Java -

i want read image embedded in ms word document using java. want reconstruct image file. can suggest java library hep task? please refer apache poi handling microsoft word files using java api's just code snippet. check out. import org.apache.poi.poifs.filesystem.*; import org.apache.poi.hwpf.*; import org.apache.poi.hwpf.extractor.*; import java.io.*; public class readdoc { public static void main( string[] args ) { string filesname = "hello.doc"; poifsfilesystem fs = null; try { fs = new poifsfilesystem(new fileinputstream(filesname; //couldn't close braces @ end site did not allow close hwpfdocument doc = new hwpfdocument(fs); wordextractor = new wordextractor(doc); string[] paragraphs = we.getparagraphtext(); system.out.println( "word document has " + paragraphs.length + " paragraphs" ); for( int i=0; i<par...

linq to sql - How to use DbLinq SqlMetal for MySQL on Mac? -

i'm using mono/monodevelop on mac os, , want example using sqlmetal (dblinq version included mono) linq-to-sql mysql database. oddly, found many examples sqlite, none mysql. examples found mysql seems refer microsoft's sqlmetal.exe. i tried arrange sqlmetal command sqlite adapt mysql, have message: sqlmetal: not load databaseconnectiontype type 'bytefx.data.mysqlclient.mysqlconnection, bytefx.data'. try using --with-dbconnection=type option. help appreciated! thank you. find , edit sqlmetal.exe.config , replace settings not use bytefx (long unsupported) , use mysql.data. remember include qualified assembly name, in case line looks like: provider name="mysql" dblinqschemaloader="dblinq.mysql.mysqlschemaloader, system.data.linq, version=3.5.0.0, culture=neutral, publickeytoken=b77a5c561934e089" databaseconnection="mysql.data.mysqlclient.mysqlconnection, mysql.data, version=6.2.3.0, culture=neutral, publickeytoke...

php - Fatal error: Maximum execution time of 30 seconds exceeded -

i downloading json file online source , and when runs through loop getting error: fatal error: maximum execution time of 30 seconds exceeded in c:\wamp\www\temp\fetch.php on line 24 your loop might endless. if not, extend maximum execution time this: ini_set('max_execution_time', 300); //300 seconds = 5 minutes

When does one use Web Parts vs. Full blown ASP.NET application in SharePoint? -

i'm still struggling question i'm trying speed sharepoint, coming asp.net web forms. we're looking use sharepoint exclusively several reasons; 1 of main selling points consolidate our development efforts. example, today have several one-off websites anywhere 1-5 pages (smallish) on several servers, iis installs, etc. , seem bit fragmented. let's have requirement smallish site (1-5) pages. sharepoint way handle situation? create several web parts, create pages in sharepoint , plug them in or create asp.net web forms application , provide link within sharepoint it? thanks! update i'm going neither. based on feedback , additional research seems application pages i'm looking for. here's article: http://grounding.co.za/blogs/brett/archive/2008/07/13/sharepoint-the-role-of-a-web-part-vs-using-application-pages.aspx what kind of user experience looking for? makes sense have static page, , it's better allow users ability move things a...

Flash/Actionscript Tween not smooth -

i using flash - actionscript 3.0 - load image paths (and images) xml file , using tweener class animate tweens scroll across header. the problem: scroll not smooth, quite choppy , can't figure out why. i've read around web enabling bitmap smoothing helps don't know how images loaded xml. if need code can post it, rather long thought wouldn't if think of common reasons choppy tween. can check out scroll @ 1 of our pages such as... http://community.greencupboards.com/2011/07/15/lions-fighting-extinction/ thanks! edit: code requested import fl.transitions.tween; import fl.transitions.easing.*; import fl.transitions.tweenevent; import caurina.transitions.* var imageloader:loader; var currentloader:loader; var xml:xml; var xmllist:xmllist; var xmlloader:urlloader = new urlloader(); var xmlloader2:urlloader = new urlloader(); var k:int; var iterator:int = 0; var imagecount:int; //********** begin editable region *************/// //----------------------...

c# - Any libraries that can parse ID3 chunks from aiff files? -

i learning aiff format , according wiki these files can contain id3 chunk . of tools have tried far not seem support aiff files. there libraries (preferably java or c#) capable of parsing/reading id3 chunks within aiff files? taglib# this. it's .net wrapped version of taglib library (which supports reading aiff tags). it's maintained developers of banshee media player: http://download.banshee.fm/taglib-sharp/ if want read more on taglib in general, here's taglib site: http://developer.kde.org/~wheeler/taglib.html i took file in itunes, converted aiff, placed in root c:\ folder , renamed sample.aif. here's code used read it: taglib.file file = taglib.file.create(@"c:\sample.aif"); string album = file.tag.album; string title = file.tag.title; seems work fine, taglib reports id3v2 tag.

How can I disable editing cells in a WPF Datagrid? -

i'm constructing datagrid in windows presentation foundation, , have problem. when user double-clicks on cell in datagrid, cell goes edit mode. want prevent that. instead want users able select full row - not edit values in it. how can make double-clicks select full row instead of putting clicked-on cell in edit mode? the wpf datagrid has isreadonly property can set true ensure users cannot edit datagrid 's cells. you can set value individual columns in datagrid needed.

windows phone 7 - How to drag sprite on WP7 with XNA? -

i can't find information, how should create draggable (by touch events) sprite on wp7, can show me how possible do? you'll have manually redraw based on touch changes. the logic should like: -- when touch detected on top of item move. -- until touch not detected on top of item move. ---- update position want display item @ relative new touch position. ---- redraw page.

css - LESScss converting rgba to hex? how to nest color variables into a mixin? -

does lesscss convert rgba colors hex values? i trying create mixin, say, .color, allows pass in color variable defined, , want in rgba. this doesn't work, here's idea: .bgcolor(@colorvariable,@alpha) { background-color: @colorvariable + rgba(0, 0, 0, @alpha); } where @colorvariable be, @blue: rgb(17,55,76); or @green: rgb(125,188,83); etc. i want define bunch of these variables, , able pass them in .bgcolor or .color mixin , change alpha transparency on fly. i feel should possible, missing something. -right now, code ever outputs hex color value, no matter input.- if pass in @alpha value of 1, outputs hex color value. @alpha values less 1 force browser show me rgba value. that's solved. now--how pass in rgb , parts separately predefined variable? turns out, less has hsla functions built in (see less color functions ). help, here's discovered: @dkblue: #11374c; .colorize_bg(@color: @white, @alpha: 1) { backgr...

How to apply custom image to checkbox in android -

i'm trying apply custom image checkbox in android, create check_custom.xml file in define custom image different states of check box like: <item android:state_checked="true" android:drawable="@drawable/btn_check_on" /> <!-- checked --> <item android:state_checked="false" android:drawable="@drawable/btn_check_off" /> <!-- unchecked --> <item android:state_focused="true" android:drawable="@drawable/btn_check_onfocus" /> <!--on focus--> <item android:drawable="@drawable/btn_check_off" /> <!-- default --> three different images on 3 states on checked,on focus , on unchecked, , assign xml file background attribute of check boxes,but i'm not getting required result, technique apply custom image default image both. salman, set android:button instead of android:background . see custom checkbox image android

Access VBA: Can you open same record set twice? -

i"m opening record set so: dim rst dao.recordset set rst = db.openrecordset(cursku) can open same recordset twice different variables: dim rst dao.recordset set rst = db.openrecordset(cursku) dim rst2 dao.recordset set rst2 = db.openrecordset(cursku) is allowed? cause problems if try iterate through each set @ different times using rst.movenext, etc? i don't know if i've ever done yes work. may run page locking problems if updating records in both recordsets. 4 kb access page can and, does, contain multiple records. if adding records that's less of issue access 2000 , newer, jet 4.0, appears add new records in individual pages.

iphone - how to avoid overwrite file -

i using nsurlconnection download file server , storing locally follows -(void) connection:(nsurlconnection *)connection didreceivedata:(nsdata *)data { [webdata appenddata:data]; paths = nssearchpathfordirectoriesindomains(nsdocumentdirectory , nsuserdomainmask, yes); self.documentsdir = [[paths objectatindex:0]stringbyappendingpathcomponent:@"newresult.zip" ]; [[nsfilemanager defaultmanager] createfileatpath:documentsdir contents:nil attributes:nil]; nsfilehandle *file1 = [nsfilehandle filehandleforupdatingatpath: documentsdir]; [file1 writedata: webdata]; [file1 closefile]; } this working overwrite old file every time how avoid on writing know possible nsurldownload here not using nsurldownload. if (![filemanager fileexistsatpath: path]){ nslog(@"file not exists @ path %@", path); }else{ nslog(@"file exists @ path:%@", path); }

android - How to reload the images when level comple(Andengine) -

i developing game using andengine. place coding // private tiledtextureregion levelregion; int level; //in onloadresources() this.mtexture = new texture(2048, 512); this.levelregion=textureregionfactory.createfromasset(this.mtexture, this, "bg"+level +".png",0,0); this.mengine.gettexturemanager().loadtexture(this.mtexture); when level complete , increased level , try call again onloadresources(). got error , screen in blank.. how fix problem .

caching - Ipad development architecture -

i have ipad noob question. here task trying achieve: i need build ipad/iphone app display lot of images , data. problem app needs work offline online. so, data needs stored in way on ipad. i looking opinions on techniques/architecture/development. to provide bit of background work in c#.net , first ipad app. far know can either create native app using objective c, or go html app later may or may not converted native app. furthermore, testing creating simple html page image, , trying cache image , page work offline. far, not working image or page not seem cached. edit: know how caching limit. believe have somewhere around 10-15 mbs of images. i appreciate ideas/opinions/resources on task. use coredata store images offline apple coredata docs i unsure wot need online bit for, retrieving images off net or uploading them?

wcf binding - WCF netTCPBinding -

wcf's nettcpbinding "secured default". understand means that.. callers authenticated using windows credentials. messages signed messages encrypted. however, can set basic wcf client service set on localhost. authentication work on same machine, how signing , encryption work? wcf needs certificate sign , encrypt messages. if dont have certificate how service manage work? how message - going same machine signed , encrypted. thanks. by default nettcpbinding uses transport security, default characteristics list. signing , encryption of messages in context not mean same thing in message security. rather means packets of data sent on network transport signed , encrypted. not rely on certificates. done security providers installed in operating system on sending , receiving machines, invoked via sspi ( security support provider interface ) - same mechanism involved, example, when domain credential used access resource such file on different machine on n...

web services - Presenting missing values as null or not at all in JSON -

i building web service api, using json data language. designing structure of data returned service, having trouble deciding how deal missing values. consider example: have product in web store price yet unknown, maybe because product has not yet been released. include price: null (as shown below) or omit price property on item? { name: 'osx 10.6.10', brand: 'apple', price: null } my main concern making api easy consume possible. explicit null value makes clear price can expected on product, @ other hand seems wasted bytes. there whole bunch of properties irrelevant particular product, while relevant other products – should show these explicitly null well? { name: 'osx 10.6.10', price: 29.95, color: null, size: null } are there "best practices" on web service design, favoring explicit or implicit null values? de-facto standard? or depend entirely on use case? fwiw, personal opinion: do include ...

delphi - Drag and drop bitmap on form -

i drawing onformpaint event same bitmap in diffrent places on form add drag , drop functionality bitmaps enable user place them wishes on form.i have idea seems quite rudimentary , don't want put useless effort.i appreciate implementation ideas guys. thanks. p.s implement onclick event on bitmaps too here useful example let move or resize tcustomcontrol descendents @ run time. i think best option use timage instead of custom drawing. iamjoosy points out, above example won't work tgraphiccontrols. there freeware components might more helpful here , here .

actionscript 3 - default font in flash as3 stylesheet -

i have stylesheet, applies text wrapped matching tag, want apply default formatting textfield, tried unsuccessfully via: * { font-family:gotham,arial; } where gotham imported font option. how set up? perhaps try switching "body" "*" ..?

regex - grepping using the "|" alternative operator -

the following sample of large file named at5g60410.gff: chr5 tair10 gene 24294890 24301147 . + . id=at5g60410;note=protein_coding_gene;name=at5g60410 chr5 tair10 mrna 24294890 24301147 . + . id=at5g60410.1;parent=at5g60410;name=at5g60410.1;index=1 chr5 tair10 protein 24295226 24300671 . + . id=at5g60410.1-protein;name=at5g60410.1;derives_from=at5g60410.1 chr5 tair10 exon 24294890 24295035 . + . parent=at5g60410.1 chr5 tair10 five_prime_utr 24294890 24295035 . + . parent=at5g60410.1 chr5 tair10 exon 24295134 24295249 . + . parent=at5g60410.1 chr5 tair10 five_prime_utr 24295134 24295225 . + . parent=at5g60410.1 chr5 tair10 cds 24295226 24295249 . + 0 parent=at5g60410.1,at5g60410.1-protein; chr5 tair10 exon 24295518 24295598 . + . parent=at5g60410.1 i having trouble extracting specific lines using grep. wanted extract lin...

c++ - Problem compiling libjson in "Release" configuration with VS2010 -

i downloaded libjson package , added vs2010 projects folder. created new project called checkjson , added following code: #include "../../libjson/libjson.h" int main(){ return 0;} when compile error : "release build of libjson, ndebug not on" since first time using visual studio think have basic mistake here. can me please ? moreover, if there problem package, or if know other json parsing packages use without lots of configuration issues don't care using them instead of package. for starters, try compiling project in "release" configuration. if works (and believe should), may try , define ndebug variable in debug configuration. may yield unexpected results !

extract xml from image column in sql server -

i have xml documents stored image data type in sql server 2000 table. how can extract data xml , save file, or @ least see xml contents in query window, using sql tools? look, here essentially want extract text varbinary.

How can I use the unique(a, 'rows') from MATLAB in Python? -

i'm translating stuff matlab python language. there's command, unique(a), in numpy . since matlab program runs 'rows' command also, gives little different. is there similar command in python or should make algorithm same thing? assuming 2d array stored in usual c order (that is, each row counted array or list within main array; in other words, row-major order), or transpose array beforehand otherwise, like... >>> import numpy np >>> = np.array([[1, 2, 3], [2, 3, 4], [1, 2, 3], [3, 4, 5]]) >>> array([[1, 2, 3], [2, 3, 4], [1, 2, 3], [3, 4, 5]]) >>> np.array([np.array(x) x in set(tuple(x) x in a)]) # or "list(x) x in set[...]" array([[3, 4, 5], [2, 3, 4], [1, 2, 3]]) of course, doesn't work if need unique rows in original order. by way, emulate unique(a, 'columns') , you'd transpose original array, step shown above, , transpose back.

mysql - Change a column type from Date to DateTime during ROR migration -

i need change column type date datetime app making. don't care data still being developed. how can this? first in terminal: rails g migration change_date_format_in_my_table then in migration file: for rails >= 3.2: class changedateformatinmytable < activerecord::migration def change_column :my_table, :my_column, :datetime end def down change_column :my_table, :my_column, :date end end

java - How to check jndi bind/unbind status? -

i'm looking way of checking bind status of object , appropriate jndi name. for example, i've got ldap jms queue name: "/therootcontext/somesubcontext/some.queue.name:queue" i need check appropriate queue exists , binded passed name. what correct way check "bind status"? i see such algorithm: perform jndi lookup ensure provided name exists. object obj = ctx.lookup("/therootcontext/somesubcontext/some.queue.name:queue"); %i don't know next% , suggest checking that: obj != null && obj instanceof javax.jms.queue am correct? correct way? most if object not found lookup throw namingexception in 1. need either catch exception or try use list method check if object exists.

Tesing Admob Tracking in Android App -

i want implement admob tracking in android app. ads generated , published. far understand admob tracking used keep track of downloads of app means of ads published. , track need have app tracking implemented in market. there way test if tracing happening properly. or not understanding concept properly. any views appreciated. regards i have used in app , believe way test having app in marketplace.

iphone - Release MPMoviePlayer when using a tabbarcontroller -

i'm using tabbarcontroller in 1 of views has mpmovieplayer. works fine, except if change tab, movie doesn't stop , keeps playing in background. if try tab movie tab, crashes. i think code have release mpmovieplayer when it's finished playing, want released when change views instead. if go movie tab, start fresh. in .h file have set as: import < uikit/uikit.h> import < mediaplayer/mediaplayer.h> @interface secondviewcontroller : uiviewcontroller { mpmovieplayercontroller *player; } @end and in .m file have: - (void)viewdidload { nsstring *url = [[nsbundle mainbundle] pathforresource:@"vid" oftype:@"m4v"]; player = [[mpmovieplayercontroller alloc] initwithcontenturl:[nsurl fileurlwithpath:url]]; [[nsnotificationcenter defaultcenter] addobserver:self selector:@selector(moviefinishedcallback:) name:mpmovieplayerplaybackdidfinishnotification object:player]; //--called when movie view , add view window...

user interface - very basic python GUI program help -

so i'm working on pretty basic program in 1 of 3 "doors" randomly selected. choice compared user's choice , user wins if choice same randomly selected one. so basically, want re-set text in gui based on whether user correct or not. there "settext" method in graphics library i'm using (comes textbook) should trick reason keep getting error: label.settext("congrats! got it!") attributeerror: 'nonetype' object has no attribute 'settext' but i'm settext method text class! user_select = win.getmouse() in range(n): selection = door_list[randrange(0,3)] user_select = win.getmouse() label = text(point(5,9), "hello").draw(win) if selection.clicked(user_select): label.settext("congrats! got it!") wins = wins + 1 elif not selection.clicked(user_select): label.settext("sorry, try again") losses = losses + 1 print(wins, losses) ...

c# - how to get the earliest date Excel support programmatically -

excel addin, c#, udf, myudf calls web service retrieve date. date returned not in range of jan-1-1900 dec-31-9999 (excel date range). e.g. in 1 case returned date jan-2-0002 (valid in c# not valid in excel), excel crashes. not hard code "jan-1-1900", wonder if there way can programmatically. inside excel, convert date corresponding 1 string can parse: =text(1,"dd-mm-yyyy") which should give 01-01-1900 or 02-01-1904 depending on date system chosen (hat tip barrowc!). note how date systems don't differ 4 years fact in 1 case value 1 corresponds january 1st (in 1900) , in other 0 corresponds january 1st (in 1904). given workbook, workbook.date1904 property can tell date system being used.

html - Inconsistent textarea handling in browsers -

Image
here's i'm seeing markup provided below. none of browsers keeping textareas in container inconvenient not big of issue. however, annoying no matter can't rid of bottom margin textarea in chrome. suggestions? here in fiddle: http://jsfiddle.net/radu/ryzub/ markup: <div id="wrap"> <textarea id="txtinput" rows="6" cols="20"></textarea> <div id="test"></div> </div> css: #wrap { background-color:green; height:210px; width:440px; } #txtinput { height:100px; width:100%; margin:0px; padding:0px; } #test { background-color:gray; height:100px; width:100%; margin:0; padding:0; } to fix "the bottom margin textarea in chrome", add vertical-align: top #txtinput . live demo now have consistent rendering between browsers listed. do want solution textarea extending outside container? this fixes ie8, firefo...

swing - how do you set text on JTextField that carries the java bean value after clicking submit -

when clicking jbutton (submit) 1 class class supposed replace text of jtextfield. new text value collected bean. new value appears on console doing system.out.println why doesn't replace value in jtextfield. when program compiled jtextfield initialize current inventory read once user submits new order jtextfield inventory supposed show new inventory value. (subtracting number of books ordered , current inventory) inventorytextfield.settext(string.valueof(currentinventory)); this code have been working with: submit.addactionlistener(new actionlistener() { public void actionperformed(actionevent ae) { info.setbillingstreet(billingstreetaddresstextfield.gettext()); //this test edit menu item bookorder class system.out.print(billingstreetaddresstextfield.gettext()); info.setquantitypurchase(quantitypurchasetextfield.gettext()); info.setcurrentinventory(integer.parseint(quantitypurchasetextfield.gettext())); ...

sql - find records from previous x days? -

how can come stored procedureroc selects results past 30 days? where month(requestdate) > 6 , day(requestdate) >= 10 , month(requestdate) < 21 , day(requestdate) < 7 select * table getdate() >= dateadd(day, -30, getdate()) substitute first getdate() appropriate column name. select * table table.columnname >= dateadd(day, -30, getdate())

java - How to coordinate send and receive with UDF DatagramSockets -

i have integration test needs coordinate 2 datagramsockets , each running in own thread. 1 socket waits read data blocking call receive(). other socket needs call send(), must happen after receive() has blocked, otherwise data lost. the code little this: receiver byte[] buf = new byte[1024]; new datagramsocket(7654).receive(new datagrampacket(buf, buf.length)); sender new datagramsocket(7654).send( new datagrampacket("hello".getbytes(charset.forname("utf-8")), 5)); i'm loath put thread.sleep() before send() call, although sufficient allow receiver block. there elegant way this? wait on semaphore before send(). signal unit before receive() call. given network delays, amazed if udp reply arrived before receive() call made , rx socket set up. make sure raising priority of receive thread, (or lowering priority of send thread). you wait on semaphore after send() , signal after receive(), ensuring send thread not attempt send again...

iphone - Are there any existing library for Automation of UI controls in IOS -

i new ios programming. have task find if can automate ui testing. want do: put code in application randomly (sounds bad may pre-defined events)sends event messages controls on screen. since code should able take app, deploy in iphone or ipad , run program. once app automated code guess easy analytics on obtained performance data. i have seen fonemonkey looks needs user interaction recorded manually on each device. any thoughts or suggestions welcome. lalith hello lalith have been creating ui automation tests application , working well. although has tricks, think should take @ these links: http://answers.oreilly.com/topic/1646-how-to-use-uiautomation-to-create-iphone-ui-tests/ http://alexvollmer.com/posts/2010/07/03/working-with-uiautomation/ if need more help, let me know. :) edit1: on viewdidload of viewcontroller can add this: - (void)viewdidload { [super viewdidload]; //(your code...) // set start after 5 seconds... ...

iAd question iPhone -

have quick question on iad i create free app , make apple display iads. can test ad displayed. understand once put app in apple store real ads show after accepting iad contract. so, example if nissan ad shows in app , paid apple ...??? there cost associated iad contract ...??? i don't want app show on others app under ad banner, others app show ad in app ad banner. thanks clarifying questions...!!! you have pay 99$ app store. once there money iads. if app isn't awesome won't rich that. i have kinda niche application (but awesome) in store gets downloaded around 100 times day. and income ads (i use adwhirl iad, admob , inmobi) $3 month or so. last month implemented in-app-purchase , more money every day through iap got in month ads. nobody see ads if nobody use app. should ask if app enough used. and wrote think waste $99.

java - Session in Webserver -

can give me link or describe me, how webservers recognize continuous requests coming same user. or how webserver maintains sessions not application. there multiple ways via cookies, via hidden fields or session objects. google 'session management using cookies, using hidden fields, using session objects. you'll links.

How can I write windows 7 desktop gadgets using c# & WPF? -

i want write desktop gadget group icons on desktop (using c# & wpf). docked window can drag icons , stay their. there can couple of windows. where begin? **i saw post here got lost. please direct me examples , explanation pages. maybe this you. template started on developing sideber gadget using silverlight 3.0 or 4.0 controls in c#.

javascript - How to get the old value of a textarea -

that's it. how can old value of textarea in order compare new value?. current value becomes old value after triggering event (say, keyup event). i have seen solutions, example, using cookies record old value , new value, however, such solution doesn't work in case because of type of manipulation want perform later. hopefully, there suggestion works better that. thanks in advance. update : after following suggestions @drachenstern, @matthew, @peter, ended this var starttimer = null; var oldvalue; $("#textarea").keydown($.debounce( 1000, true, function(){ oldvalue = $("#textarea").val(); } )); $("#textarea").keyup(function(){ if(starttimer) cleartimeout(starttimer); starttimer = settimeout(function(){ var newvalue = $("#textarea").val(); d = // here clever comparison oldvalue = newvalue; },2000); }) by way, $.debounce function jquery throttle / debounce plugin. this want, however, i'd obtain variable d outside of...

Mysql DateTime compare -

hi have table of following 2 records: descript | start | end test 1 | 2011-07-18 14:30:00 | 2011-07-18 17:00:00 test 2 | 2011-07-18 00:00:00 | 2011-07-19 00:00:00 when tried select, can't seems retrieve 2nd result (test 2) seems dated 19th of july. select * event start >= "2011-07-18 00:00:00" , end <= "2011-07-18 23:59:59"; would appreciate advise. "2011-07-19 00:00:00" more "2011-07-18 23:59:59" by condition should less, query not match test 2 . your sql query should be: select * event start >= "2011-07-18 00:00:00" , end <= "2011-07-19 00:00:00";

java - How do I call an overridden parent class method from a child class? -

if have subclass has methods i've overridden parent class, , under specific situations want use original methods, how call methods? call super class { int foo () { return 2; } } class b extends { boolean somecondition; public b(boolean b) { somecondition = b; } int foo () { if(somecondition) return super.foo(); return 3; } }

How do I use properties in ants replace task? -

i need replace token property. property has path location set. not getting replacing $ <replace file="${apache_home}/conf/wc_server1.conf" > <replacetoken>@install_base_directory@</replacetoken> <replacevalue>$installerbase</replacevalue> you have 2 options: <replace file="${apache_home}/conf/wc_server1.conf" > <replacetoken><![cdata[@install_base_directory@]]></replacetoken> <replacevalue><![cdata[$installerbase]]></replacevalue> </replace> or since it's single line replace, use: <replace file="${apache_home}/conf/wc_server1.conf" token="@install_base_directory@" value="$installerbase" />

sql server 2005 - Failed to connect to sql data base on remote pc on network -

i had windows application installed on pc on network , connect sql database on other pc had connection string error apeared cannot connect database as guys have said, highly firewall or other networking issue, if have checked through following might help. 1) open sql server configuration manager 2) in tree on left , expand sql server network configuration 3) highlight sql server looking (i have sql express , sql server) 4) on right hand side see list of installed protocols , whether or not enabled. from there enable protocol looking use.

ruby on rails - Pass arguments in scope -

can provide example on how use scope and parameters? for example: class permission < activerecord::base scope :default_permissions, :conditions => { :is_default => true } end i have code returns default_permissions , want convert return default permissions given user (user_id) thanks new syntax (ruby 1.9+), prevent errors if don't supply user - scope :default_permissions_for, ->(user = nil) { ... }

c++ - Boost regexp how to parse Cookie string into map<string, string>? -

Image
so cookie strings remixsettings_bits=1; wysiwyg=1,2,3,abc; remixclosed_tabs=0; remixgroup_closed_tabs=786432; remixlang=0; remixchk=5; remixsid=35d4f9907281708019490d07728c27ca5c10e5de7a869c322222225e3219e; audio_vol=100 wonder how parse tham map name <-> value ? try regex: (\w+)=([^;]*) \w+ - alphanumeric 1 or more repetitions = [^;]* - character except ; number of repetitions result:

pseudocode - Can't get insertion sort from introduction to algorithms 3rd ed. right. Where is my thinking mistake? -

i working way through book introduction algorithms, 3rd edition. 1 of first things explained insertion sort. on page 18 there pseudo code: a = { 5, 2, 4, 6, 1, 3 }; insertion-sort(a) 1 j = 2 a.length 2 key = a[j] 4 = j - 1 5 while (i > 0 , a[i] > key) 6 a[i + 1] = a[i] 7 = - 1 8 a[i + 1] = key it says pseudo code used translated kind of language (c, c++, java, don't mention, guess c# too). since program in c#, translated in linqpad. int[] = { 5, 2, 4, 6, 1, 3 }; (var j = 1; j < a.length; j++) { var key = a[j]; var = j - 1; while(i > 0 && a[i] > key) { a[i + 1] = a[i]; i--; } a[i + 1] = key; } a.dump(); you're going ask, why j start @ 1, when says 2? in book, array has index starting @ 1. , yes, should have updated [i - 1] , [i + i] well. anyways, after done, run code , notice doesn't sort correctly. output { 5, 1, 2, 3, 4, 6 } . late , should have stopped, struggled on ma...

visual studio - Package Manager Console can't find packages -

i'm trying to install-package nhibernate but i'm getting "package ... not found". if open pcm-options, list of available sources filled, green ok-symbol isn't there. can use alternative source different ms-links-id 206669 default source in vs? i had similar problem last night. 2 linkid values had were: 206669 , 19913 meaning url pass settings dialog were: https://go.microsoft.com/fwlink/?linkid=206669 https://go.microsoft.com/fwlink/?linkid=19913 the 19913 did not yield in list of packages available. think number came when installed package few weeks (months?) ago , gave first time. the 206669 seemed work. see expected packages, install packages, not all. example, castle, not log4net. automapper, not restsharp. ones failed said "operation timeout". i'm glad i'm not 1 see these issues - did not see in faqs or documentation. it seems linkid , url weakness in framework. see more discussion these values mean, ...

Could not successfully Import class in Groovy? -

i created 2 class named vendor , address in 1 file called business.groovy(that created package using name business ) , in same folder created groovy code imports business package , make use of vendor class attributes(vendor class in business package). when try create object vendor in groovy script, throwing error stating that: /home/anto/groovy/pakg/imports.groovy: 2: unable resolve class vendor @ line 2, column 13. def canoo = new vendor() what have do? did go wrong? these files created: business.groovy package business class vendor { public string name public string product public address address = new address() } class address { public string street, town, state public int zip } impottesting.groovy import business.* def canoo = new vendor() canoo.name = 'canoo engineering ag' canoo.product = 'ultralightclient (ulc)' and when try execute importtesting.groovy file using groovy importtesting command, error mentioned before! i ...

python - Too many files open with multiprocessing.Pool -

i have python script runs multiprocessing.pool process lot of files separately. have cpu limit of 8. problem after running while "ioerror: [errno 24] many open files". each child process opens few files reading file.open(). these file handlers passed multiple functions retrieve data. @ end of each child process these files closed file.close(). tried statement did not fix issue. 1 have idea whats wrong. googled around failed find answers. closing files , functions returning keep file handlers around. my settings mac 10.5 python 2.6 thanks ogan custom import func1, func2 # func1 , func2 seek, read , return values form file # however, not close file import multiprocessing def worker(*args): f1 = open("db1.txt") f2 = open("db2.txt") each in args[1]: # many stuff x = func1(f1) y = func2(f2) f1.close() f2.close() return data = {1:[2], 2:[3]} ...

Auto Increment on Composite Primary Key - Sqlite3 + Python -

i have code this c.execute('create table if not exists base (id integer not null, col2 text not null, col3 integer, primary key(id, col2))') this code gives me sqlite3.integrityerror exception though sure writing record first time. so, tried c.execute('create table if not exists base (id integer, col2 text, col3 integer, primary key(id, col2))') this inserts row fine in base table but, id column not auto incremented @ all. what can do? idea? in sqlite, autoincrement behavior when 1 integer column primary key. composite keys prevent autoincrement taking effect. you can similar result defining id primary key, adding additional unique constraint on id, col3 . if that's still not quite want (say, id's don't need unique @ all), have use trigger make autoincrement work.

c# - trap paste event in excel and allow only pastespecial -

i developed excel template , come across following problem... there scenarios have validate cell.hence format of cell must preserved.if user copies value different sheet template format of cell overwritten. there way trap paste event in excel , use pastespecial using c# thanks in advance.... i googled out 2 3 days , find work around,before using code have check trust acess vba object model in macro setting....of excel run project.. //add macro module microsoft.vbe.interop.vbcomponent component = this.vbproject.vbcomponents .add(microsoft.vbe.interop.vbext_componenttype.vbext_ct_stdmodule); component.codemodule.addfromstring("sub paste_cell()" + environment.newline + "if msgbox(\"normal paste operation has been disabled. paste values (cannot undone), proceed?\", vbquestion + vbokcancel, gsappname) = vbok then" + environment.newline + "on error resume next" + environment.newline + "activesheet.pastespecia...