Posts

Showing posts from February, 2015

c++ - How can I read a file line content using line number -

i have following code snippet working fine: ifstream ndsconfig( "nds.config" ) ; string szconfigval ; while( getline( ndsconfig, szconfigval ) ) { //code } but problem need update check box state comparing line values. code similar following: ifstream ndsconfig( "nds.config" ) ; string szconfigval ; while( getline( ndsconfig, szconfigval ) ) { if(szconfigval == "autostart = 1") { //set check box true } else if(szconfigval == "autostart = 0") { //set check box false } if(szconfigval == "autloghistory = 1") { //set check box true } else if(szconfigval == "autloghistory = 0") { //set check box false } if(szcon

merge - combining .mov movies with php -

i have quicktime movies uploaded server need combine (there sound tracks too). cannot install ffmpeg (or else matter away standard pear stuff). i suppose option open me open files php. can provide pointers on how this. entering world of pain? thanks in advance tudor am entering world of pain? probably yes. :) i'm not familiar internal workings of mov format, if format not mp3 (in can glue 2 files together , they'll work in players!), want not possible in pure php.

visual c++ - How to get AM/PM in System Date and Time in MFC(VC++ )? -

how am/pm in system date , time in format (15-nov-2010 16:24 pm) in mfc ? appreciated. use coledatetime::format correct format string.

Read local SVN repository in PHP -

i have subversion repository under /var/svn/ trying use subversion details of latest revision, have tried using shell_exec run svn info on external address, couldn't input it. there way can read information repository itself? solved: decided go svn pecl modudle see here php has native support svn (pecl though , not available on windows) you can use arbit 's vcs abstraction layer (supports svn, cvs, git, mercurial , archive)

button - layout over layout on android -

i have screen contains there different layout. biglayout [it contains 3 layout] layouta - title layoutb - body layoutc - button title layout contain textview, button , checkedtextview , of in bighlayout, if want checkedtextview display on body layout, how can such thing? if u want show 1 layout on other layout u can use framelayou. u can take 1] layout frame layout 2] layout b frame layout. u can able show checkedtextview on body layout

objective c - Releasing memory of a class which is calling a async method -

i have code this, classa *reference = [[classa alloc] init]; reference.delegate = self; [reference callasynchmethod]; here calling asynchronous method. takes around 4-5 seconds execute. how release memory of classa? if call release or autorelease crashes. thank you perhaps can make object retain @ start of callasynchmethod , , release after calls (i presume) delegate method signals end of asynchronous work? then, in code above, release immediately. edit if you're talking nsurlconnection , should use instance variable reference connection, , pass release in dealloc implementation of object.

sharepoint - SPListItem.CopyTo method fails when copying to some sub-sites, but not others -

a custom workflow has been developed copies pages top-level site sub-sites. pages copied specific folder within pages library of sub-sites. this workflow has been installed in 3 site collections , works without problems in 2 of these. in third site collection, achieve mixed results pages copied sub-sites, not others. an exception raised few levels deep within splistitem.copyto method call. call stack follows: system.invalidoperationexception: collection modified; enumeration operation may not execute. @ system.collections.arraylist.arraylistenumeratorsimple.movenext() @ microsoft.sharepoint.spcopy.copyintoitem(string srcurl, splistitem target, hashtable props, byte[] stream, boolean savestream) @ microsoft.sharepoint.spcopy.copyintonewitem(hashtable props, byte[] stream, spfolder targetfolder, string targeturl, string srcurl) @ microsoft.sharepoint.spcopy.copyintonewitem(splistitem src, spfolder targetfolder, string targeturl) @ microsoft.sharepoint.s

ruby on rails - How do I create a new attribute in a model? -

hi i'm new in ruby , rails , want create new attribute email model account. down below test new attribute. test copy of name attribute test figured working in similar way. it "should have email field" @account.email = "email" @account = save_and_reload(@account) @account.email.should == "email" end the thing i've done make test pass create email attribute in account model. , have manually inserted new column email in database account table. here part of account model code i've inserted email attribute: class account < activerecord::base attr_accessible :name, :logo, :account_preference_attributes,:email when run test error nomethoderror in 'account should have email field' undefined method `email=' #<account:0xb6468ca8> so how create new attribute in model? you have create migration add email column table , run rake db:migrate class addssl < activerecord::migration def self.up

bash - Problem checking if a file in a loop is a directory -

this code working example of checking if path directory: if [ -d "$1" ]; printf "directory exists\n" else printf "does not exists\n" fi i changed try , test if files in directory directories or not: for file in "$1/*"; if [ -d "$file" ]; printf "directory: %s\n" $file else printf "file: %s\n" $file fi done but not work - directories displayed if files. why wont work? , how can code want? cheers. you can't quote asterisk. for file in "$1"/* ;

How to draw chart using WPF and IronPython -

i'm french beginner dev , need draw charts using wpf , ironpython. i'm coding mvs2010 , didn't find on google. have idea ? me ? thanks all, ben charting difficult, , it's best rely on tried-and-true library chartfx , invest time , energy solving real business problems. if have difficulty convincing management purchase library, divide cost weekly pay , think if it's possible build better in many weeks. more it's not. if you're learning, there open source options visifire .

C# Get Generic Type Name -

i need way name of type, when type.isgenerictype = true . type t = typeof(list<string>); messagebox.show( ..?.. ); what want, message box pop list showing... how can that? type t = ...; if (t.isgenerictype) { type g = t.getgenerictypedefinition(); messagebox.show(g.name); // displays "list`1" messagebox.show(g.name.remove(g.name.indexof('`'))); // displays "list" }

SSL: Tomcat or JBoss? -

i have application deployed on tomcat server in future think i'll pass jboss. have implement use of https communication , don't know if it's better implement first on tomcat or if better pass jboss first , implement everything. https management different between them? there advantage in using jboss instead of tomcat? thanks jaxer tomcat supports ssl . jboss uses under covers fork of tomcat expanded services (ejb, jms, etc). original tomcat core modified. can readup jboss ssl howto here , is, see, not different tomcat's howto.

git tag - How do I read tagger information from a git tag? -

so far have: git rev-parse <tagname> | xargs git cat-file -p but isn't easiest thing parse. hoping similar git-log 's --pretty option grab info need. any ideas? thanks a more direct way of getting same info is: git cat-file tag <tagname> this uses single command , avoids pipe. i used in bash script follows: if git rev-parse $tag^{tag} -- &>/dev/null # annotated tag commit=$(git rev-parse $tag^{commit}) tagger=($(git cat-file tag $tag | grep '^tagger')) n=${#tagger} # number of fields date=${tagger[@]:$n-2:2} # last 2 fields author=${tagger[@]:1:$n-3} # first , last 2 message=$(git cat-file tag $tag | tail -n+6) elif git rev-parse refs/tags/$tag -- &>/dev/null # lightweight tag - commit, commit=$(git rev-parse $tag^{commit}) else echo "$tag: not tag" >&2 fi

content management system - Multi language cms with blog platform -

one of customers want have simple cms/blogging platform. i have experience sharepoint variations , method him anyway not afford cost of sharepoint internet license. which of platform available have easy use features adding multilanguage content , handle translations workflows? since mentioned sharepoint, assuming looking .net solution. if case, take @ umbraco , open source cms.

java - Initial HTML text field cursor position -

Image
i facing weird problem text field on page. html structure generated java code (which cluttered , written years back). problem facing is, when click on text field (highlighted in snapshot), cursor positions on second field instead of first one. happens particular column only. have shared basic html structure of 1 of table (though cluttered please bear me). html: http://jsfiddle.net/t3ch/yq4xb/ try change value="&nbsp;" to value=""

string - print hexadecimal representation of an int -

i looking pseudocode prints hexadecimal represenation of integer string. thanks! take remainder of integer modulo 16 convert remainder hex digit place hex digit left-most position in output string divide integer 16 repeat above until value zero

php - Doctrine with large datasets -

does have experience using doctrine large datasets? have import script uses doctrine , uses way memory. speed isn't huge problem memory usage is. have tips keeping doctrine's memory usage down? in doctrine 1.2 @ least, freeing objects after use frees memory, recommended long-running scripts: $my_object->free(); there's few tips on improving performance @ end of official guide: http://www.doctrine-project.org/projects/orm/1.2/docs/manual/improving-performance/en

CSS doesn't inheritance problem -

well, i'm working an ul - li multilevel menu , have problem. firstly, code (i know it's not perfect crappy div automatically added wordpress): <nav id="page-navigation"> <div class="menu-menu-container"> <ul id="menu-menu" class="menu"> <li><a href="#">home</a></li> <li><a href="#">blog</a></li> <li><a href="#">portfolio</a></li> <li><a href="#">pages</a> <ul class="sub-menu"> <li><a href="#">one column</a></li> <li><a href="#">two columns</a></li> <li><a href="#">three columns</a></li> </ul> </li> </ul> </div>

java - Problem using Spring 3 MVC -

i have jars in spring 3 framework on classpath , wanted add spring 3 mvc app config. originally, had following xml. <?xml version="1.0" encoding="utf-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xmlns:util="http://www.springframework.org/schema/util" xmlns:context="http://www.springframework.org/schema/context" xsi:schemalocation=" http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-2.5.xsd http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-2.5.xsd <context:annotation-config/> <bean class="com.apppackage.app.config.appcontextconfig" /> <

Django - Making TabulerInline's classes to collapse -

i want hide/show inlines in admin interface providing classes': ['collapse']}). there way achieve this? i don't know how official way, first thought override admin html template , put there short jquery script like: $('inline-panel-selector').click(function() {$(this).toggle(200);}); edit: as template should overriden, take here: http://docs.djangoproject.com/en/dev/ref/contrib/admin/#overriding-admin-templates http://docs.djangoproject.com/en/dev/ref/contrib/admin/#templates-which-may-be-overridden-per-app-or-model -- think should change_form.html , this: {% extends "change_form.html" %} {% block footer %} {{ block.super }} <script type="text/javascript"> $(function (){ $('inline-panel-selector').click(function() {$(this).toggle(200);}); }); </script> {% endblock %} note i'm not sure if $ symbol available, tells me django doesn't expose it

internet explorer - ietester? site looks very stretched? -

anybody ever used ietester test websites again multitple versions of ie? well, downloaded it, site looks stretched on versions of ie, little less stretched on newer versions. stackoverflow.com looks funny (for versions). have ie8 installed, , both of sites (stackoverflow.com , other one) fine on ie8. faced similar? didn't change settings on ietester. (also, need test website functionality, not see how looks, please don't suggest screenshot things. not option of virtualization of os either) those multiple side-by-side ie testing programs not reliable. you should use microsoft app compat vhds (which free).

Struts ActionMessage -

hi have struts 1.x app, , in order show errors detected in action class, use: errors.add("error global", new actionmessage("some_string_in_properties_file")); which works fine. my problem string need send jsp page error has session variable in (like "you have 3 more valid attempts", being 3 session variable). how can accomplish ? thanks. try use actionmessage constructor of 2 arguments. according javadoc: public actionmessage(java.lang.string key, java.lang.object value0) construct action message specified replacement values. parameters: key - message key message value0 - first replacement value in case: errors.add("error global", new actionmessage("some_string_in_properties_file", sessionvariable)); some_string_in_properties_file should this: some_string_in_properties_file=you have {0} more valid attempt(s)

css selectors - jQuery check box question -

how can make 5th box work "checked" or "not checked"? var price_1_startup = 800; var price_1 = 0; function upgrade_1(str) { if (str == 1) {price_1 = 0;} else if (str == 2) {price_1 = +125;} else if (str == 3) {price_1 = +200;} else if (str == 4) {price_1 = +325;} $("#price_1").hide().html(price_1_startup+price_1).fadein('slow'); } function checkbox() { $("#price_1").hide().html(price_1_startup+1500).fadein('slow'); } <input type="radio" name="upgrade1" value="1" onclick="upgrade_1(this.value);" checked="checked" /><br> <input type="radio" name="upgrade1" value="2" onclick="upgrade_1(this.value);" /><br> <input type="radio" name="upgrade1" value="3" onclick="upgrade_1(this.value);" /><br> <input type="radio" name="up

performance - How to implement database-style table in Python -

i implementing class resembles typical database table: has named columns , unnamed rows has primary key can refer rows supports retrieval , assignment primary key , column title can asked add unique or non-unique index of columns, allowing fast retrieval of row (or set of rows) have given value in column removal of row fast , implemented "soft-delete": row kept physically, marked deletion , won't show in subsequent retrieval operations addition of column fast rows added columns deleted i decided implement class directly rather use wrapper around sqlite. what data structure use? just example, 1 approach thinking dictionary. keys values in primary key column of table; values rows implemented in 1 of these ways: as lists. column numbers mapped column titles (using list 1 direction , map other). here, retrieval operation first convert column title column number, , find corresponding element in list. as dictionaries. column titles keys of dictionary.

c++ - flicker free tab control with WS_EX_COMPOSITED -

i have vs2008 c++ application windows xp sp3 developed using wtl 8.1. application contains tab control flickers when application border resized. my window hierarchy looks this: cframewindowimpl cmainfrm |-csplitterwindow splitter |-ctabview configuration tabs | |-cdialogimpl configuration view 1 | |-cdialogimpl configuration view 2 | |-cdialogimpl configuration view 3 |-cdialogimpl control view the solution i'm trying make cframewindowimpl derived class use ws_ex_composited style , windows beneath use ws_ex_transparent style. unfortunately, makes tab control buttons show empty black bar , controls of configuration view not show @ all. if remove ws_ex_composited , ws_ex_transparent styles, form displays properly, ctabview , beneath flickers horribly when resized. what need change eliminate flicker , draw controls properly? thanks, paulh edit: got working. removed ws_ex_transparent styles per mark ransom's suggestion. put ws_ex

web services - Using NetTcpBinding to communicate with non-WCF clients -

nettcpbinding used wcf wcf communication. used communication non-wcf clients? namely, use several of ws-* protocols, there particular reason why wouldn’t able communicate non-wcf clients? thank you nettcpbinding not interoperable. work other wcf clients. have @ this article more information.

iphone - How to implement a callback with phonegap -

working on testing phonegap on iphone; have plugin returns simpl json data : nsstring* retstr = [[nsstring alloc] initwithformat:@"%@({ code: '%@', image: '%@' });", resulttext.text,resultimage.image]; [ webview stringbyevaluatingjavascriptfromstring:retstr ]; and call js : var mydata = phonegap.exec("mymodile.myfunction", 'mycallback'); function mycallback (data) { alert (data); } doesn't produce upon return. any idea ? // callback arguments nsstring * jscallback = [arguments objectatindex:0]; // create string nsstring* retstr = [[nsstring alloc] initwithformat:@"%@({ code: '%@', image: '%@' });", jscallback,resulttext.text,resultimage.image]; //execute [ webview stringbyevaluatingjavascriptfromstring:retstr ];

javascript - What is CavalryLogger and do I need it? -

i'm doing optimisation on site ive taken over. i've found script don't recognise: http://static.ak.fbcdn.net/rsrc.php/zo/r/v95lkt_ulnb.js it facebook thing, , there's key logging going on (that im not keen on) it without doubt largest file being requested on page load (87kb) if can without it, it'll speed page load. does know: a) is b) it's for c) does d) can without okay had on beautified version of minified code , have noted following: by these bunch of utility functions. cavalrylogger doesn't file because doesn't exist, nor defined. the code in question regarding key binding: function keyeventcontroller() { copy_properties(this, { handlers: {} }); document.onkeyup = this.onkeyevent.bind(this, 'onkeyup'); document.onkeydown = this.onkeyevent.bind(this, 'onkeydown'); document.onkeypress = this.onkeyevent.bind(this, 'onkeypress'); } copy_properties(keyeventcontroller, { instance: null

c# - Routing and Controller Actions - Optional Data -

i created route in asp.net mvc application looks this: routes.maproute( "articleroute", "{year}/{month}/{day}/{articleid}/{displayname}", new { controller = "article", action = "details" } ); i want route blog post article. example: http://www.foobar.com/2010/01/01/123456789/the-name-of-the-article in details controller action want permanent redirect if year, month, date , display name not correct. want know best way write details() controller method. the field required articleid. if have article id database have article date , name are. i want know how controller method should like. pass in of values method or use routedata them? public actionresult details(int articleid, string displayname) { var article = */snip*/; int articleyear = routedata.values["year"]; // etc. datetime articledate = new datetime(articleyear, articlemonth, articleday); string realdisplayname = article.name.tos

c# - How To Queue Work To Be Done By The Server ASP.NET -

we have csv uploader users can upload csv file filled address, city, state, zipcode. csv files can hundreds, thousands, 10's of thousands of rows. we need geocode rows; no problem, using google maps restful web service, don't want make user wait while geocode every row (it can take time). basically, want upload complete, , magically, pass geocode job off server, , allow user continue navigating web app, while geocodes happen in background. i think, system, requires queue or job based software; maybe zeromq or rabbitmq? have no experience this, baby feeding amazing. using asp.net c#. your idea use queuing sound. wcf msmq endpoints alternative third-party queuing technologies if you're developing windows boxes.

jQuery circular menu -

i'm looking circular jquery navigation tutorial. there demo in last mounths. remember link? (with eminem images) there is: http://addyosmani.com/blog/jquery-roundrr/

php - Zend_Navigation & Zend Router -

i looking solution of problem of combining zend_navigation within multilanguagal page-setup routers. wrote several routers (eg '/:lang/:controller/:action'), work fine. @ same time use navigation.xml has definitions <user> <label>users</label> <uri>mdm/users</uri> </user> have add dynamically default language navigation. how can this? thanks lot, anatoliy why don't set default language in route? $router->addroute('default', new zend_controller_router_route( ':lang/:controller/:action', array( 'lang' => 'en', 'module' => 'default' 'controller' => 'index', 'action' => 'index' ) )); notice i've replaced "default" route routing scheme match default :module/:controller/:action

Scripting language for .net which supports yield and saving the state of the vm -

is there embeddable scripting language .net supports kind of yield (program stops , yields control host... next run continues left off)? furthermore should possible save state of vm, , let continue @ later point. edit1: i've looked @ lua, , while 1 can access globals c#, whole method feels hacky. edit2: i'm looking @ ironruby , seems 1 can query , set global variables, not of them in 1 go. write in vb or c#, well-defined tree of classes hold state. tree consist of root class, data in lists etc., serialisable. at appropriate point, xml-serialise out stream file. on re-start, de-serialise saved file , start left off.

Python script opening a bash prompt terminating the script -

i want write chroot wrapper in python. script copying files, setting other stuff , executing chroot , should land me in chroot shell. the tricky part want no python processes running after in chroot. in other words, python should setup work, call chroot , terminate itself, leaving me in chroot shell. when exit chroot, should in directory when invoked python script. is possible? my first thought use 1 of os.exec* functions. these replace python process chroot process (or whatever decide run exec* ). # ... setup work os.execl('/bin/chroot', '/bin/chroot', directory_name, shell_path) (or that)

php - Need help processing a ZIP file -

this scenario: i upload zip file check each file in zip file if file != image, move file destination if file == image, resize image , move destination i googled around , seen different solutions, none 1 can process files before saving them @ final destination. this function got far: // extract zip file , return files in array. private function processzip() { $zip = new ziparchive; $tmp_dir = fb_plugin_dir.'tmp/'; // extract files tmp dir if ($zip->open($this->file['tmp_name']) === true) { //check if temp dir exists. if not, create one. if (!is_dir($tmp_dir)) { mkdir($tmp_dir, 0700); } $zip->extractto($tmp_dir); $zip->close(); /* process extracted files */ foreach(glob($tmp_dir.'*.*') $filename) { // somehow mime type here without using 'finfo' , 'mime_content_type' // haven't installed pear , 'mime_content_type' de

c++ - C/ObjC - parameter size. Using a pointer vs value -

at point should passing pointer data in functions/methods, rather passing value? obviously there's cases want function operate on given data, if i'm passing value info/copying purposes? for example, foo basic type: void setfoo(int foo); ... int foo = 1; setfoo(foo); now foo simple structure: typedef struct { int x; int y; } foo; void setfoo(foo foo); ... foo foo = {1, 2}; setfoo(foo); // apple code kind of thing cgsize, cgpoint... but if foo bigger struct... typedef struct { int x; int y; int z; char str[256]; } foo; void setfoo(foo *foo); // taking pointer instead. ... foo foo = {1, 2, 3, etc ... }; setfoo(&foo); q. @ point here should start using pointer when providing data function? thanks when on embedded systems, think it's practice pass pointers (or references) that's not primitive type. way struct can grow , add members needed without affecting amount of data copied. needless copying way slow down

Remove all files for git commit? -

possible duplicate: undo “git add”? i made mistake of running: git add . which added important things such .bashrc. though run: git rm . when run: git push project master everything still added. i've reinstalled git, still pestered this. solution found start on , remove files commit. there other things remove files commit? you can use git reset unstage changes, or git reset --hard head~ blow away recent commit (careful one, not keep changes around.) see http://git-scm.com/docs/git-reset

c++ - cannot declare pointer to ‘const class FOO&’ error -

i can't understand why compiler giving me these errors: brain.cpp:16: error: cannot declare pointer ‘const class fact&’ brain.cpp: in constructor ‘fact::fact(const fact*)’: brain.cpp:20: error: cannot convert ‘fact**’ ‘fact*’ in assignment brain.cpp: in member function ‘void fact::addrelation(fact*)’: brain.cpp:29: error: expected type-specifier before ‘*’ token brain.cpp:29: error: cannot convert ‘int**’ ‘fact*’ in initialization brain.cpp:29: error: expected ‘,’ or ‘;’ before ‘fact’ brain.cpp:35: error: expected type-specifier before ‘*’ token brain.cpp:35: error: cannot convert ‘int**’ ‘fact*’ in assignment brain.cpp:35: error: expected ‘;’ before ‘fact’ brain.cpp: @ global scope: brain.cpp:47: error: expected unqualified-id before ‘=’ token brain.cpp:48: error: expected type-specifier before ‘*’ token brain.cpp:48: error: cannot convert ‘int**’ ‘fact*’ in initialization brain.cpp:48: error: expected ‘,’ or ‘;’ before ‘fact’ brain.cpp: in function ‘void addfact(fact*)’

c# - Comparison of Join and WaitAll -

for multiple threads wait, can compare pros , cons of using waithandle.waitall , thread.join ? waithandle.waitall has 64 handle limit huge limitation. on other hand, convenient way wait many signals in single call. thread.join not require creating additional waithandle instances. , since called individually on each thread 64 handle limit not apply. personally, have never used waithandle.waitall . prefer more scalable pattern when want wait on multiple signals. can create counting mechanism counts or down , once specific value reach signal single shared event. countdownevent class conveniently packages of single class. var finished = new countdownevent(1); (int = 0; < num_work_items; i++) { finished.addcount(); spawnasynchronousoperation( () => { try { // place logic run in parallel here. } { finished.signal(); } } } finished.signal(); finished.wait(); update: the reason why want signal e

iphone - How can I count the number of non-alphanumeric characters in an NSString object? -

i'm diving ios development , i'm still getting familiar nsstring object. i'm @ point need count number of non-alphanumeric characters in string. 1 approach came stripping non-alphanumeric characters string, subtracting length of stripped string length of original string, so... nscharacterset *nonalphanumericchars = [[nscharacterset alphanumericcharacterset ] invertedset]; nsstring *trimmedstring = [originalstring stringbytrimmingcharactersinset:nonalphanumericchars]; nsinteger numberofnonalphanumericchars = [originalstring length] - [trimmedstring length]; but it's not working. count zero. how can count number of non-alphanumeric characters in nsstring object? thanks wisdom! the problem approach you're not stripping characters, you're trimming them. means stripping characters off ends of string match set (nothing in middle). for iterate on string , test each character not member of alphanumeric set. example: nsstring* thestring = //

javascript - Parsing YouTube API XML response with jQuery for Google Map -

i trying parse xml response youtube api jquery. goal take url links , geotag data results , insert markers google map. each marker have embedded youtube video in infowindow object. api request make youtube servers asks videos geotag data within 100km of coordinates. i’m working local file. have suggestions parsing xml , adding videos google map? trying multidimensional array approach. known problems: “latlng” variable undefined. it’s not supposed be. 1 of few leads problem. advice? my code: <!doctype html> <html> <head> <meta name="viewport" content="initial-scale=1.0, user-scalable=no" /> <style type="text/css"> html { height: 100% } body { height: 100%; margin: 0px; padding: 0px } #map_canvas { height: 100% } </style> <script type="text/javascript" src="http://maps.go

What does Firefox add to XULRunner? -

firefox - xulrunner = what? details... another way of putting question is, 'firefox app' consist of (besides xulrunner portion of code)? firefox adds user interface, provides @ least of add-on system , makes can used web browser user. xulrunner platform run xul apps on, whether firefox or thunderbird or songbird or else.

jquery - Javascript Download to excel sheet -

there html table as <table> <tr><th>name</th></tr> <tr><td>sal</td></tr> <tr><td>tom</td></tr> <tr><td>sam</td></tr> <tr><td>jenny</td></tr> </table> download excel sheet on click hyperlink how save table excel sheet try this: function makesheet() { var x = thetable.rows var xls = new activexobject("excel.application") xls.visible = true xls.workbooks.add (i = 0; < x.length; i++){ var y = x[i].cells (j = 0; j < y.length; j++){ xls.cells( i+1, j+1).value = y[j].innertext } } }

java - How to check something in the list in Struts2 -

how put condition on list data in struts2? i have list have string sportsmen, businessmen, employer, software-engg etc in single td of table. want check if list have employer string in td next td can display setting option. use <s:iterator> tag iterate through list, , use <s:if> tag define condition.

jquery - how to style a article with separate horizontal sections -

i have used jquery create simple slideup/down effect when user clicks on title of article, article slides down. i want style article make visually appealing(because text after text). finding feet new css3 concepts. i appreciate help. thanks. i don't think you' ll proper answer here layout redirections other websites: try these inspiration: http://www.sixrevisions.com/ http://css-tricks.com http://thinkvitamin.com there other websites or blogs giving hints tricks on kind of things, try find idea on how make design website/blog

java - Call a HTML File From Jar -

im generating report template html file in program. resides in /src/main/resources , name "template.html". im using classloader inside code this: private string readtemplatefile() { string str = ""; url url = classloader.getsystemresource("template.html"); try { filereader input = new filereader(url.getfile()); bufferedreader bufread = new bufferedreader(input); string line; line = bufread.readline(); str = line; while (line != null) { line = bufread.readline(); str += line + "\n"; } bufread.close(); } catch (ioexception e) { } return str; } it doing nicely when run code inside ide when make runnable jar it, generating empty report. solution? reading. if it's in jar, it's no longer file. use classloader.getresourceasstream() retrieve

OWL's EquivalentClass vs. SubClassOf -

what difference between equivalentclass , subclass of? while reading through owl primer, find tutorial uses subclassof lot declare new class, follows subclassof( :teenager datasomevaluesfrom( :hasage datatyperestriction( xsd:integer xsd:minexclusive "12"^^xsd:integer xsd:maxinclusive "19"^^xsd:integer ) ) ) can write equivalentclass( :teenager datasomevaluesfrom( :hasage datatyperestriction( xsd:integer xsd:minexclusive "12"^^xsd:integer xsd:maxinclusive "19"^^xsd:integer ) ) ) instead? when stating a subclass of b , restricts a inherit characteristics of b , but not other way around . in example, a = teenager , , b = hasage [12:19] (my own notation, idea). this means instance of teenager in owl ontology must have property hasage value in range [12:19] , not other way around . specifically, not mean instance of property hasage value in range [12:19] instance of

iphone - cocos2d screen orientation problems -

i using standard rotation code present in cocos2d 0.99-rc0 support portrait + 2 landscape modes. showing menu in portrait mode, , screen rotates landscape actual game. problem when go portrait, whole mainmenu scene off half screen, had moved anchor point or something. any ideas please? a possible simple solution apply orientation @ start of scene after wards re-apply positions of menu items aligned. i following change screen orientation: firstly, first line goes inside init method set timer start after quick 0.5 seconds. putting in timer means in game scene transition (fade) works smoothly, screen doesn't rotate/snap round then, won't need use this. [self schedule:@selector(rotate:) interval:0.5]; -(void)rotate:(cctime) dt{ [[ccdirector shareddirector] setdeviceorientation:ccdeviceorientationlandscapeleft]; [self unschedule:@selector(rotate:)]; } the key line below, don't need timer: [[ccdirector shareddirector] setdeviceorientation:ccdevic

php - Send variabiles ajax -

1.php ... <script src="/jquery-1.3.1.min.js" type="text/javascript"></script> <script type="text/javascript"> var = $a var b = $b var c = $c apclick = function() { $.ajax({ url: 'a1.php', data: { a: a, b: b, c: c }, datatype: json, success: function(results) { if (results.msg == 'success') { alert(a) alert(b) alert(c) } else { alert(results.msg) } }, error: function(results) { alert("data returned: " + results.msg ) } }); settimeout("location.reload(true);", 3000) return false; } </script> ..... <strong><br><a href="#" onclick="apclick();return false;">afisea

sql server - Sql Query t find out maximum from name field -

i have 5 tables field name name . & name appear maximum time in each table need find out output maximum in answer select top 1 name, count(*) table group name order count(*) desc

c# - changing the property of class file at run time -

how change property name of class file @ run time being used property in propertygrid ex) public class propertygrid_sample { string m_displaystring; public string text { { return m_displaystring; } set { m_displaystring = value; } } //some code change name } when propertygrid.selectedobject == propertygrid_sample class object, name text displayed property in property grid after compilation. need textalign displayed when accessing property text . making [displayname("textalign")] able solution expecting code make change @ run time it sounds you're looking this: http://www.codeproject.com/kb/grid/propertygriddynamicprop.aspx

Block access for user to change his machine address in C# .NET for Windows Forms -

what want : there 1 windows app ( made in .net 3.5, vs2008, c# ) windows xp sp2 & sp3 generally users can change there ip or modify ip address. now,when apps starts dont want users change there ip address untill app stops. hope question clear. need advice soon. recommend solution in c# .net or vb.net only. i don't think can block access, can monitor ip address, , when changes can roll old ip using wmi.

templates - Custom Menu tabs in Drupal user profile page -

i want add menu item along side [view] [edit] [files] ... menu links @ top of user profile page. when user clicks it, should behave others, in doesn't launch new page, menu item clicked on (let's call "funky button") turns greyish , user remains in user profile area. i've created hook below: function my_module_funky() { // todo: do? } function my_module_menu() { $items['user/%user/funky'] = array( 'title' => t('funky button'), 'page callback' => 'my_module_funky', 'page arguments' => array(1), 'access callback' => true, 'access arguments' => array('access funky button'), 'type' => menu_local_task, ); return $items; } so above code snippet adds button -- can't figure out how display view , edit buttons display content. thanks! your callback needs return string containing html c

jsf - Is it possible to implement vertical tabs using richfaces? -

hi i create vertical tabs using rich faces tab controls. possible ? are there other jsf implementations offer same ? richfaces doesn't support vertical tab in tabpanel. you can use jquery doing this

html - Difference between URI and URL -

possible duplicate: what's difference between uri , url? how uri , url distinguished? a url type of uri . having said that, people use 2 terms interchangeably. from wikipedia (url): in computing, uniform resource locator (url) uniform resource identifier (uri) specifies identified resource available , mechanism retrieving it. so, uri identifies resource (acts id), url specifies resource location .

c# - Assembly has 2 assembly rows build error, when using dotfuscator -

i'm running free version of dotfuscator bundled vs2008 on console app, keep getting following error. this assembly has 2 assembly rows. build error. any idea means , how fix it? was problem 3rd party licensing software

debugging - -XX:+TraceClassLoading equivalent for JRockit -

we having classloading issues , want trace jvm classloader. on sun jvm use -xx:+traceclassloading flags throw light @ problem, time using jrockit. do of know if there way same class loading information jrockit jvm? thank you. thanks this page i've found jrockit supports more standard -verbose:class way of showing class loader traces.

caching - are ms-dos api calls hard coded into exe? -

if remember correctly, when dos loads programm, programm gets use of processor, i.e. dos doesn't in meantime, somehow doesnt figure me, i.e. api calls still have evaluated. api calls hard coded programm when asm file assembled , linked? reason want know this, need know weather cache free exe, experiment cache optimization. you remember right, dos single-tasked operating system. when program runs, gets full control on processor. the dos api calls made through int 21 interrupt. when call api function, registers loaded appropriate parameters , int 21 interrupt invoked. control gets operating system, processes request , passes control application. the parameter setup , interrupt call mentioned linked in executable statically, no dynamic loaded libraries.

iphone - Problems with caching using NSURLConnection and querying HTTP Headers -

i trying write crude app loop round querying of http header fields come server in order find out servers responding ok. servers respond header this: server = server1 (or server2, server 3 etc). unfortunately when same server name time , time again app unless stop , run again @ point different server back. how can stop happening? need app treat each connection if brand new, seems cache , appear come same place, load balancer returns same server name. i can replicate similar behaviour(expected) in safari going url repeatedly without shutting down safari - gets same server each time, if shut down safari go new server. the code using follows: for (int = 0; < 999; i++) { request = [nsurlrequest requestwithurl:url cachepolicy:nsurlrequestreloadignoringcachedata timeoutinterval:10]; [nsurlconnection sendsynchronousrequest: request returningresponse: &response error: nil]; if ([response respondstoselector:@selector(allheaderfields)]) { dictionary = [resp

active directory - How do I add permissions to an OU using C#? -

i want give access permission on ou of active directory. have done part below, removes access of ou. code below: directoryentry rootentry = new directoryentry("ldap://ou=test ou,dc=test,dc=com"); directorysearcher dsfindous = new directorysearcher(rootentry); dsfindous.filter = "(objectclass=organizationalunit)"; dsfindous.searchscope = searchscope.subtree; searchresult oresults = dsfindous.findone(); directoryentry myou = oresults.getdirectoryentry(); system.security.principal.identityreference newowner = new system.security.principal.ntaccount("yourdomain", "yourusername").translate(typeof(system.security.principal.securityidentifier)); activedirectoryaccessrule newrule = new activedirectoryaccessrule(newowner, activedirectoryrights.genericall, system.security.accesscontrol.accesscontroltype.deny); myou.objectsecurity.setaccessrule(newrule); myou.commitchanges(); now problem if remove permission ad ou how can give permission a

iphone - UIView changes width after switching orientation to landscape? -

i got uiview 2 subviews. uiview set uiviewautoresizingflexiblewidth. when enters layoutsubviews resizes frames of subviews relative uiview so: rect.size.width = self.frame.size.width - rect.origin.x - textlabel.frame.origin.x; but problem occurs in landscape mode cause in portrait mode self.frame.size.width (and bounds matter) respond 768 @ start , 788 after it's done rotating. meaning when rotates seems add 20pixels assume status bar. when hard code 768 works expected. don't want of course. store initial state var , use don't think that's right way it. anyone have solution? greetings, in application have been facing same problem. solve used didrotatefrominterfaceorientation: method resize view when device rotated. self.view.frame = cgrectmake(0,0,self.view.bounds.size.width,self.view.bounds.size.height); hope help.

iphone - How can I parse XML using JSON -

sorry question. didnt knew json, want parse xml file new technique. can help? you cant parse xml using json, since both data formats. in other words cant used parse each other, since data "containers", means purpose give data specific format. if want parse xml, use xml parser. if want parse json use json parser.

javascript - jQuery: Lazy Loading for JS -

i read http://ajaxpatterns.org/on-demand_javascript , got interested in "lazy loading" js. questions: can recommend plugin this? any "real world" advice implementing such strategy? "gotchas" should out for? no plugin needed. can use jquery's $.getscript() . put particular event's javascript in separate file, bind event calls $.getscript() . $(function() { $('#yourelement').click(function() { $.getscript('/path/to/script.js'); }); }); this ensure never load more javascript need to. if user never clicks on element, never loaded javascript event. there small delay http request, should indicate loading animation on click while script loads.

How to make a submit button in WPF? -

when press enter anywhere in html form triggers action , equivalent of pressing submit button. how make window when press enter anywhere trigger event? set isdefault property on button true enable enter key activate button's action. there iscancel property same thing escape key.

How to generate random numbers in Javascript -

possible duplicate: generating random numbers in javascript hi.. i want generate random numbers (integers) in javascript within specified range. ie. 101-999. how can that. math.random() function supports range parameters ? the function below takes min , max value (your range). function randomxtoy(minval,maxval) { var randval = minval+(math.random()*(maxval-minval)); return math.round(randval); } use: var random = randomxtoy(101, 999); hope helps.

c++ - How do I read boot time events on Windows 7? -

i trying use etw functions without success read file c:\windows\system32\winevt\logs\microsoft-windows-diagnostics-performance%4operational.evtx in order capture boot time events. have tried various functions - opentrace gives error 161 evtquery gives error 15000 does have native code example of reading system trace files? i got working follows - lpwstr pwspath = l"microsoft-windows-diagnostics-performance/operational"; lpwstr pwsquery = l"event/system[eventid=100]"; hresults = evtquery(null, pwspath, pwsquery, evtquerychannelpath | evtqueryreversedirection); the channel name can found going properties on eventlog , using it's full name. the error 15000 due me trying open log file given flags rather channel name.

Is jQuery UI Widget library there to enable developers to extend jQuery UI? -

is jquery ui widget library there enable developers extend jquery ui or write jquery plug-ins. reason ask because there great ui widget tutorial here dan wellman , couldn’t thinking have done same thing, quicker , easier without using widget library. plain old jquery plug-in pattern. well, maybe not quicker. yes, jquery ui designed widget object basis library , if want extend jquery ui best way widget. remember, jquery ui focused on different functionality jquery. goal of ui create user interactive elements, in example, having simple visual element not "show off" makes ui (and widget) good. can see hints... example add in events take 1 line of code using widget. widget , ui work javascript aspects interact user, browser ui, , contain state. if not doing these things not make sense use widget.

SVN repository creation question -

i checking out current version of design current command: svn checkout svn+ssh://test@example.com/mainrepository/trunk/projects/design1 . that works fine, , made substantial changes implemetation hold copy of milestone in svn. in other words, check in current version own directory, ie "design2": in doing so, able checkout version similar above svn checkout svn+ssh://test@example.com/mainrepository/trunk/projects/design2 . i have never create new directory in svn, wondering if have create subrepository able check out design2 follows: su - svn mkdir svn+ssh://test@example.com/mainrepository/trunk/projects/design2 svnadmin create svn+ssh://test@example.com/mainrepository/trunk/projects/design2 is there problem when create files checked out earlier? know how deal svn after step, never created new directory/repository new implementation appreciated! i'm assuming want make new branch, i.e. want design1 , design2 live side side can diverge. do

Generate NACHA file using PHP? -

i trying generate bank nacha (national automated clearing house association) file customers payment details submit bank on regular basis. our site built in php , though probably build file ourselves, curious if knew of existing scripts or reference guides others have done using php. i have searched around google pretty hard unsuccessfully assistance appreciated. thank time. i needed such thing... didn't find 1 made one. https://github.com/snsparrish/nachalibphp

Is there any way to get 30 individual days of data in one call using the New York Times Most Popular API? -

it gives options popular articles on last 30, 7, or 1 days. i'm hoping find popular articles of each day last 30 days. far way know find recent 1 day's popular articles 30 days in row. that correct. there no archive aspect popular api. have make daily calls next 30 days , store response. after able continue normal long continued daily request. you should, if haven't already, post in nyt dev forum: http://developer.nytimes.com/forum its possible if requested others there push implement it.

How to create custom Document Libraries and Folders with SharePoint API -

i've got external application performs web service calls sharepoint api. need create 2 functionalities: create document libraries e.g. foo, bar , baz required data (columns). data should passed via web service without manual work user. create folders inside said document libraries foo , bar required columns automatically populated. order of columns should set in web service call. i've got working solution generates document library foo , bar not baz. how can add additional custom column baz , populate value via web service call. , same question folder structure. cannot find reasonable solution create dynamically custom columns , place data in them. thanks in advance. one way create new doc library foo, bar , baz, copy content, rename old 1 "obsolete" , rename new 1 original name.

c# - LINQ to XML Select Nodes by duplicate child node attributes -

need pull out employees have pager. <employees> <employee> <name>michael</name> <phone type="home">423-555-0124</phone> <phone type="work">800-555-0545</phone> <phone type="mobile">424-555-0546</phone> <phone type="cell">424-555-0547</phone> <phone type="pager">424-555-0548</phone> </employee> <employee> <name>jannet</name> <phone type="home">423-555-0091</phone> <phone type="work">800-555-0545</phone> </employee> </employees> i've got linq phone nodes have pager , can employees. can't wrap head aroud drilling down phone node still selecting employee node? var data = xelement.load(@"employee.xml" ); var whohaspager = teammember in data.elements("employee") (string)teamm

cygwin - Disable ruby extension -

i'm trying compile ruby 1.9.2-p0 sctraches under win7 x64 cygwin.. goes fine, extensions compiled until reaches win32ole ext fails following errors: win32ole.o: in function `load_conv_function51932': /home/jack/ruby-1.9.2-p0/ext/win32ole/win32ole.c:934: undefined reference `_clsid_cmultilanguage' win32ole.o: in function `fole_activex_initialize': /home/jack/ruby-1.9.2-p0/ext/win32ole/win32ole.c:4762: undefined reference `_iid_ipersistmemory' win32ole.o: in function `mf_queryinterface': /home/jack/ruby-1.9.2-p0/ext/win32ole/win32ole.c:597: undefined reference `_iid_iunknown' /home/jack/ruby-1.9.2-p0/ext/win32ole/win32ole.c:597: undefined reference `_iid_imessagefilter' win32ole.o: in function `queryinterface': /home/jack/ruby-1.9.2-p0/ext/win32ole/win32ole.c:699: undefined reference `_iid_iunknown' /home/jack/ruby-1.9.2-p0/ext/win32ole/win32ole.c:699: undefined reference `_iid_idispatch' win32ole.o: in function `eventsink_queryinterface&