Posts

Showing posts from April, 2014

.net - Can disabling a control cause a radio buttons value to change? -

i have for each loop going through controls in panel disabling them. when loop reaches 1 grid control , disables checkedchanged event fires next control in loop radio button. the call stack follows: system.windows.forms.dll!system.windows.forms.radiobutton.oncheckedchanged(system.eventargs e = {system.eventargs}) + 0x15 bytes system.windows.forms.dll!system.windows.forms.radiobutton.wnproc(microsoft.agl.forms.wm wm = wm_radiobutton_notifyvaluechanged, int wparam = 0, int lparam = 0) + 0x17 bytes system.windows.forms.dll!system.windows.forms.control._internalwnproc(microsoft.agl.forms.wm wm = wm_radiobutton_notifyvaluechanged, int wparam = 0, int lparam = 0) + 0x9 bytes system.windows.forms.dll!microsoft.agl.forms.wl.setenabled(system.intptr hwnthis = 1179753, microsoft.agl.common.bool fenabled = ffalse) system.windows.forms.dll!system.windows.forms.control._syncenabled() + 0x21 bytes system.windows.forms.dll!system.windows.forms.control.enabled.set(bool val...

How to rename a git repository? -

git mv renames file or directory in repository. how rename git repository itself? there various possible interpretations of meant renaming git repository: displayed name, repository directory, or remote repository name. each requires different steps rename. displayed name rename displayed name (e.g., shown gitweb ): edit .git/description contain repository's name. save file. repository directory git not reference name of directory containing repository, used git clone master child , can rename it: open command prompt (or file manager window). change directory contains repository directory (i.e., not go repository directory itself). rename directory (e.g., using mv command line or f2 hotkey gui). remote repository rename remote repository follows: go remote host (e.g., https://github.com/user/project ). follow host's instructions rename project (will differ host host, settings starting point). go local repository directory (i.e., op...

c++ - EXEC_BAD_ADDRESS -

maybe continuation of this thread, the program compiles without errors or warnings when run it, , handler function called, exec_bad_address void maincontroller::show_color_trackbars(int *h, int *s, int *v){ string winname = "hsv trackbars"; namedwindow(winname, cv_window_autosize); std::map<string, void*> user_data_h; user_data_h["object"] = this; //this maincontroller object user_data_h["h"] = h; createtrackbar("trackbar_h", winname, h, 255, trackbar_handler, &user_data_h); }; void trackbar_handler(int value, void *user_data){//callback track bar std::map <string, void*> *user_data_map; user_data_map = reinterpret_cast<std::map<string, void *> *>(user_data); maincontroller *controller; controller = reinterpret_cast<maincontroller *>((*user_data_map)["object"]); int *var; var = reinterpret_cast<int*> ((*user_data_map)["h"]); ...

Java Generic Primitive type n-d array -

i have pass primitive 2d array filtering routine.the algorithm filtering(median filter) same irrespective of type of array.is there way pass type of array in generic manner or should overload same same function different array types.in second case same code have repeated different data types. int[][] medianfilter(int[][] arr){ ... } float[][] medianfilter(float[][] arr){ ... } is there way make above code generic one,instead of repeating code medianfilter in each every overloaded function ? there no way primitive arrays, why library functions (such java.util.arrays) have these duplicated methods. you define method object[] medianfilter(object[] arr); // note missing dimension and use reflection find out runtime type. system.arraycopy doing. need type-cast. ugly. int[][] result = (int[][]) medianfilter( input ); go duplicated methods.

Embedded video, Javascript button to make it fullscreen? -

is possible have button on page, make embedded video go fullscreen mode when clicked, using javascript? (for stupid users) seems there no actual code go fullscreen. can enable button , can change size . here demo http://code.google.com/apis/youtube/youtube_player_demo.html (from here )

Prevent asp.net generating someValidator.display = "Dynamic"; -

my asp.net page dynamically displays 207 questions (i can't control this). each question have 10 validators. when asp renders page creates following 3 lines each validator: var qsnquestionset_adult_qcquestion_1_vldmaxanswersvalidator = document.all ? document.all["qsnquestionset_adult_qcquestion_1_vldmaxanswersvalidator"] : document.getelementbyid("qsnquestionset_adult_qcquestion_1_vldmaxanswersvalidator"); qsnquestionset_adult_qcquestion_1_vldmaxanswersvalidator.display = "dynamic"; qsnquestionset_adult_qcquestion_1_vldmaxanswersvalidator.evaluationfunction = "customvalidatorevaluateisvalid"; althrough these 3 lines 4kb can imagine 4*10*207 quite lot. how can mark validators dynamic , set evaluationfunction same value without asp generating line me? this code generated automatically asp.net when enableclientscript option set true. far i'm aware way rid of set false obvious drawback validation happen on server side during...

Extending a long SQL with inner joins (server 2000) -

recently friendly user on stackoverflow helped me sql: select (select top 1 a.id vanalyseshistory a.companyid = n.stockid order a.chosendatetime desc) id, n.name, (select top 1 a.chosendatetime vanalyseshistory a.companyid = n.stockid order a.chosendatetime desc) chosendatetime vstocknames n which working great. want extend sql. in table vanalyseshistory there attribute called analyseid. rows analyseid = 3 example. my try: select (select top 1 a.id vanalyseshistory a.companyid = n.stockid , analyseid = 3 order a.chosendatetime desc) id, n.name, (select top 1 a.chosendatetime vanalyseshistory a.companyid = n.stockid , analyseid = 3 order a.chosendatetime desc) chosendatetime vstocknames n the problem there isnt analyses analyseid = 3 every row i...

C# / LINQ / get all elements of sub-collection matching a condition? -

i have : observablecollection<x> x_collection = new observablecollection(); public class x { public x() { items = new observablecollection<y>(); for(int = 0; < 10; i++) { items.add(new y(i % 2 == 0)); } } public observablecollection<y> items {get; set;} } public class y { public y() : this(true) {} public y(bool y) { myproperty = y; } public bool myproperty { get; set; } } how create linq query return ienumerable or observablecollection y elements have myproperty == true? realize it's easy question i'm pretty confused linq atm. if possible i'd ask lambda-query - they're easier me understand var result = items.where( y => y.myproperty ); var biggerresult = x_collection.selectmany( x => x.items.where( y => y.myproperty ) );

what is this SQL select construct called? -

what term select construct in following select statement in bold? select a.t1 a, (select b.n b b b.x = a.t1), c.t2 c a,c a.x = c.x i explaining can done in oracle when asked called, couldn't think of term. there term this? or selecting select result? edit: expanded query make sub-query use clear it subquery. if b.n refers table aliased b in outer query, referred correlated subquery . as guigui42 notes, scalar query, since returning @ 1 column , row. in fact, must take care ensure @ 1 row ever returned, or query may crash @ later date. guarded against using top 1 or equivalent.

php - Script not working on Internet Explorer only? -

i have function in header function bingframe() { var iframe = document.getelementbyid('bframe'); iframe.src = 'http://www.bing.com/search?q=' + document.searchform.search.value.replace(/ /g,'+') + '&go=&form=qblh&filt=all&qs=n&sk='; } so when call function responds in google chrome,firefox , modern browsers not internet explorer. can of modify code accordingly ? thanking you. works me - ie8 <html> <head> <title></title> <script> function bingframe(theform) { var iframe = document.getelementbyid('bframe'); var url = 'http://www.bing.com/search?q=' + escape(theform.search.value).replace(/ /g,'+') + '&go=&form=qblh&filt=all&qs=n&sk='; iframe.src = url; return false } window.onload=function() { document.forms[0].search.focus(); } </script> </head> <body> <form name="searchform" onsubmit=...

racket - PLT Scheme: Converting one of the macros in 'Casting SPELs in LISP' -

(defspel game-action (command subj obj place &rest rest) `(defspel ,command (subject object) `(cond ((and (eq *location* ',',place) (eq ',subject ',',subj) (eq ',object ',',obj) (have ',',subj)) ,@',rest) (t '(i cant ,',command that.))))) thats code http://www.lisperati.com/actions.html 'macro defining macro'. can't seem convert appropriately scheme. can explain me process of creating same sort of thing in scheme? this kind of macro simpler in scheme, since can define-syntax-rule (in standard scheme code need define-syntax + syntax-rules ). same thing, minus whole quote/unquote mess. (defspel (game-action command subj obj place rest ...) (defspel (command subject object) (cond [(and (eq? *location* 'place) (eq? 'subject 'subj) (eq? 'object 'obj) ...

mercurial - Tab Completion in Python Command Line Interface - how to catch Tab events -

i'm writing little cli in python (as extension mercurial) , support tab-completion. specifically, catch tabs in prompt , show list of matching options (just bash). example: enter section name: ext*tab* extensions extras the problem i'm not sure how catch tab events. i'm using ui.prompt() api of mercurial, calling raw_input() under hood. as far know, raw_input() returns on 'enter' , if user enters tab, string returned includes "\t" . for use readline module. simplest code can think: import readline commands = ['extra', 'extension', 'stuff', 'errors', 'email', 'foobar', 'foo'] def complete(text, state): cmd in commands: if cmd.startswith(text): if not state: return cmd else: state -= 1 readline.parse_and_bind("tab: complete") readline.set_completer(complete) raw_input('ente...

Facebook friend-selector dialog in iphone -

is there way have iphone native app display friend-selector dialog of facebook? or have manually retrieve user's friends , create dialogs myself? thanks in current sdk able friend picker. // initialize friend picker fbfriendpickerviewcontroller *friendpickercontroller = [[fbfriendpickerviewcontroller alloc] init]; // set friend picker title friendpickercontroller.title = @"pick friends"; // todo: set delegate handle picker callbacks, ex: done/cancel button // load friend data [friendpickercontroller loaddata]; // show picker modally [friendpickercontroller presentmodallyfromviewcontroller:self animated:yes handler:nil]; https://developers.facebook.com/ios/friendpicker-ui-control/

asp.net - Session variable getting lost? -

given global.asax.cs: using system; using system.web; namespace foo.web { public class global : httpapplication { private const string introductionpageshownsessionkey = "introductionpageshownsessionkey"; protected void application_acquirerequeststate(object sender, eventargs e) { showintroductionifnotyetshown(); } private void showintroductionifnotyetshown() { if (httpcontext.current.session != null) { var introductionpageshown = convert.toboolean(session[introductionpageshownsessionkey]); if (!introductionpageshown) { if (request.path.endswith("/introduction.aspx")) { session[introductionpageshownsessionkey] = true; } else { response.redirect("~/introduction.aspx" + request.url.query); } } } } ...

git bisect doesn't work, no output -

i tried use git bisect lately, didn't work. tree remained in master , saw no output git bisect whatsoever. here's i've tried: git bisect start git bisect bad # no output, tried couple of times git bisect # no output git bisect reset #-> on 'master' i tried on 2 different repos. didn't work. git --version 1.6.3.3 on ubuntu 9.10 ideas? introduction git bisect "git bisect" can little confusing @ first. once understand does, it'll easy. the typical scenerio "git bisect" is: bug discovered. want find out rev introduced bug. know bug exists in latest rev, introduced in prior rev. need way find out whether or not bug exists. can automatic test, or can test run hand. let's started. starting latest rev in branch, issue: git bisect start and tell git current version known bad: git bisect bad now need find rev. check 1 old enough not have bug. if think 32 revs ago ought good, then: git checkout he...

JQuery: Is there a way to show status msg from code behind (asp.net) -

i trying figure out how display message box after done executing server side code here code works client side still looking way make work code-behind .aspx <div id="status"></div> script: $("#status").fadeto(500, 1, function() { $(this).html("you registered!").fadeto(7000, 0); }) not sure why fading status div twice. i now. trying show div , fade away. try this: $("#status").html("you registered!").show().fadeto(7000, 0); or use fadein , fadeout make them both fade, this: $("#status").html("you registered!").fadein(500).fadeout(7000); server side to on server side use registerclientscriptblock method of scriptmanager class so: scriptmanager.registerclientscriptblock(me, me.gettype(), "clientscript", "$(function() { $('#status').html('you registered!').fadein(500).fadeout(7000); });", true) the first parameter page using on. ...

asp.net - Export Repeater to excel -

i trying export repeater excel , here code... stringwriter sw = new stringwriter(); htmltextwriter htw = new htmltextwriter(sw); string attachment = "attachment; filename=file.xls"; response.clearcontent(); response.addheader("content-disposition", attachment); response.contenttype = "application/vnd.ms-excel"; rpt.rendercontrol(htw); response.write(sw.tostring()); response.flush(); response.end(); when trying open file getting error the file trying open, 'file.xls', in different format specified file extension. verify file not corrupted , trusted source before opening file. want open file now? yes no option available what's wrong in code or have resolve issue. thanks you setting content type application/vnd.ms-excel sending html contents in response stream when call rendercontents method. might need library generate excel files.

Difference between vxworks 6.1 and 6.6 -

please let me know difference between vxworks 6.1 , 6.6 regards, sikandar here highlights: posix conformance pse52 profile when using real-time processes hrfs - new journaling file system new advanced network stack smp support support new processors release notes provide considerably more details

sql order by - SQL multiple column ordering -

i trying sort multiple columns in sql, , in different directions. column1 sorted descending, , column2 ascending. how can this? order column1 desc, column2 this sorts column1 (descending) first, , column2 (ascending, default) whenever column1 fields 2 rows equal.

python - Google Apps Engine / Django, calling action upon user login? -

i'm new google apps engine (working on existing project else) , seems bit different django far login login handled google, i'm trying make app creates custom cookie user upon logging in can't seem find handler login action... apologize newbie question appreciate if can point me in right direction on how accomplish this. (just calling action upon user's login) i'm looking @ tutorials, one: http://www.browse-tutorials.net/tutorial/login-register-logout-python-appengine , says generate links since google handles login can't seem figure solution issue this. thanks i solved problem using django middleware system , session. think use of session best way guarantee action happens on login (whereas url can reloaded manually). django sessions not work out of box, implemented own sessions. however, there exists appengine-specific implementation article points out: http://blog.notdot.net/2010/02/webapps-on-app-engine-part-5-sessions i implemented midd...

jQuery accommodating both HOVER and FOCUS together (mouse and keyboard) -

i'm building mega menu want able trigger menu via both hover (using mouse) , focus (such tabbing via keyboard). this i'm presently doing: $(".megamenu-trigger").focus(function (){$(this).hover()}); $(".megamenu-trigger").hover(function(){ // stuff }); this works, wondering if that's ideal way handle both keyboard , mouse interactions together. you can use bind method bind multiple events 1 action i.e. $('.megamenu-trigger').bind("mouseenter focus mouseleave", function(event) { console.log(event.type); });

.htaccess - 301 redirects to all except robots.txt -

we have moved our website new domain , want pages of old site removed search engines. it's same site, same content, new domain, search engines taking time because of duplicate content (maybe). have added .htaccess 301 our old site new site as: redirect 301 / http://new-domain.com/ now, remove our old site search engines, changed our robots.txt on old site as: user-agent: * disallow: / the problem is, search engines fetching robots.txt new-domain.com because of .htaccess 301 redirect. how restrict 301 redirect robots.txt? remove redirect directive , try mod_rewrite rule: rewriteengine on rewriterule !^robots\.txt$ http://other.example.com%{request_uri} [l,r=301] this redirect request except /robots.txt .

Is it Possible to Nest Collections within Collections using Wpf DataGrid? -

Image
i want simple sample program nests collections within collections using wpf datagrid. here's implementation using vb.net codebehind. code needed create test data. class mainwindow public property cs new list(of c1) sub new() ' call required designer. initializecomponent() i1 = 1 3 dim c1 = new c1 cs.add(c1) c1.c1text = i1 i2 = 1 3 dim c2 = new c2 c1.c1col.add(c2) c2.c2text = i1 & i2 i3 = 1 3 dim c3 = new c3 c2.c2col.add(c3) c3.c3text = i1 & i2 & i3 i4 = 1 3 dim c4 = new c4 c3.c3col.add(c4) c4.c4text = i1 & i2 & i3 & i4 i5 = 1 3 c4.c4col.add(i1 & i2 & i3 & i4 & i5) next next next next next datagrid1.it...

javascript - Get the item that appears the most times in an array -

var store = ['1','2','2','3','4']; i want find out 2 appear in array. how go doing that? i like: var store = ['1','2','2','3','4']; var frequency = {}; // array of frequency. var max = 0; // holds max frequency. var result; // holds max frequency element. for(var v in store) { frequency[store[v]]=(frequency[store[v]] || 0)+1; // increment frequency. if(frequency[store[v]] > max) { // frequency > max far ? max = frequency[store[v]]; // update max. result = store[v]; // update result. } }

MySql AVG issue - Does AVG gives exact calculation in float? -

my sql query looks this: select m.original_name, m.type, m.title, m.views, m.description, m.hash, avg(mr.rating_scale5) avg_rating_scale5 c7_media m, c7_media_ratings mr m.public=1 , m.hash = mr.media_hash group mr.media_hash here taking average of mr.rating_sacle5 grouped mr.media_hash i want ask 1 thing, avg gives float value: suppose if takes avg of (5+4+4)/3. because me not giving exact calculation. if run same query using sum, instead of avg, different out puts. or can using sum(mr.rating_scale5)/count() dont know how should count every different file? if think avg not solve purpose plz let me know how should count in sum(mr.rating_scale5)/count() .

c# - submit button click -

i have gui data acceptance. need pass parameters of form on click of submit button function declared in c#. please help. using .net have types of submit tags, 1 starting <asp: , other starting <input . <input html tag can call javascript , if add runat="server" attribute, enable have c# code behind button.

xhtml - Is there any online text editor for HTML, CSS with saving and syntax highlighting facility? -

i want make css file accessible everywhere (home, office etc) , ready edit. , save. i hand coding ,just want syntax highlighting , saving on net facility. i tried google docs (it's because can save online , has revision history feature useful) doesn't have syntax highlighting , tried http://www.amyeditor.com/ it's same want save file on our local pc. and use jsbin.com heard delete code if nothing happen code in 3 month. update: in nutshell i'm looking online editor dreamweaver source view. code hosting too. update 2 i found useful , no facility saving. http://marijn.haverbeke.nl/codemirror/csstest.html https://bespin.mozilla.com/ bespin mozilla project lot of potential. couldn't recommend more highly.

Maven goal raises "Required goal not found" -

i trying generate maven plugin described in the maven documentation . so created new plugin project eclipse, using mvn archetype: <project xmlns="http://maven.apache.org/pom/4.0.0" xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xsi:schemalocation="http://maven.apache.org/pom/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelversion>4.0.0</modelversion> <groupid>com.test</groupid> <artifactid>hotdeploy</artifactid> <version>0.0.1-snapshot</version> <packaging>maven-plugin</packaging> <description>maven plugin hotdeploy portlets server</description> <dependencies> <dependency> <groupid>org.apache.maven</groupid> <artifactid>maven-plugin-api</artifactid> <version>2.2.1</version> </dependency> </dependencies> </project> i used created java class file: ...

http - How do I POST XML data with curl -

i want post xml data curl. don't care forms said in how make post request curl . i want post xml content webservice using curl command line interface. like: curl -h "text/xml" -d "<xmlcontainer xmlns='sads'..." http://myapiurl.com/service.svc/ the above sample cannot processed service. reference example in c#: webrequest req = httpwebrequest.create("http://myapiurl.com/service.svc/"); req.method = "post"; req.contenttype = "text/xml"; using(stream s = req.getrequeststream()) { using (streamwriter sw = new streamwriter(s)) sw.write(myxmlcontent); } using (stream s = req.getresponse().getresponsestream()) { using (streamreader sr = new streamreader(s)) messagebox.show(sr.readtoend()); } -h "text/xml" isn't valid header. need provide full header: -h "content-type: text/xml"

php - Simple XML HELP ! -

i need , all need change "here" value of $date $line1 = $sxe->addchild("date","here"); how can add value of $date area "here" ? please $sxe->addchild("date", $date);

Javascript Call from ASP.NET GridView - Parameter not getting passed -

i use jquery popup window show new page parameter in query string. <script language="javascript" type="text/javascript"> function showprofile(clickeditem) { $.fn.colorbox({ html: '<iframe scrolling="yes" frameborder="0" src="sitevp.aspx?siteid="' + clickeditem + ' width="999" height="550" />', width: "999px", height: "550px", close: 'continue' }); } the popup window works fine, can't "siteid" value passed. on new page siteid "". code in asp.net <td style="width:80%"> <a href="javascript:showprofile('<%#eval("site").tostring().replace("'", "\'")%>')"> <%#eval("site") %> </a> </td> can't life of me figure out possibly wrong such simple javascript call. please help. l...

cron - running crontab via web gives error that nobody does not have access to run crontab -

i'm having such hard time getting work. have looked on place. here's situation. i'm hosting in shared environment. dynamically creating crontab file , trying execute using exec command. runs fine when via telnet when run php file runs exec command, error saying "you (nobody) not allowed use program (/usr/bin/crontab)" how make sure (nobody) have access run crontab command. the sysadmin might have forbidden use of cron listing user nobody in /etc/cron.deny.

iis - Change to Asp.net 4.0 got "The page cannot be found" -

i've change existing virtual dir asp.net version 2.0 4.0 , browsed previous working web page. but right i'm getting error saying "http error 404 - file or directory not found." any ideas? revert asp.net 2.0, problem went away. i've executed "aspnet_regiis.exe -i", didn't work. what's path home page? check home page included "default document" in iis. if you're using application pool, try changing managed pipeline mode classic, , check correct .net version set (app pool basic settings).

html - css div issue in ff and ie -

<!doctype html public "-//w3c//dtd xhtml 1.0 transitional//en" "http://www.w3.org/tr/xhtml1/dtd/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script> <script type="text/javascript"> hasvbar="";hashbar=""; $(document).ready(function() { if ($(document).height() > $(window).height()) { hasvbar="y"; } if ($(document).width() > $(window).width()) { hashbar="n"; }}); </script> <script type="text/javascript"> <!-- cua=""; window.onload=function starterjobs(){ chkbrowser();setmidsecstart();} // chk browser function chkbrowser(){ if(navigator.appname=="microsoft internet explorer") {cua="ie...

database - a question on many-many relationships -

i have following tables items similars items_similars = pivot table items->similars has many-many relationship the items_similars has following field item_id similar_id if using innodb engine, need create relation between items.id , items_similars.id? or between similars.id , items_similars.id? or both? are there advantages in doing or in not doing so? many-to-many relationships, afaik, can implemented via transition tables (pivot tables) in rdbms. "items_similar" table should have @ least "items_id" , "similar_id" foreign keys "items" , "similars" tables' primary keys.

prototypejs - How do I create a Hash from an Array using the Prototype JavaScript framewor? -

i've array ['red', 'green', 'blue'] i want create new hash array, result should be {'red':true, 'green':true, 'blue':true} what best way achieve goal using prototype? just iterate on array , create hash: var obj = {}; for(var = 0, l = colors.length; < l; i++) { obj[colors[i]] = true; } var hash = new hash(obj); you can create new hash object beginning: var hash = new hash(); for(var = 0, l = colors.length; < l; i++) { hash.set(colors[i], true); } i suggest have @ documentation .

ASP.NET MVC twitter/myspace style routing -

this first post after being long-time lurker - please gentle :-) i have website similar twitter, in people can sign , choose 'friendly url', on site have like: mydomain.com/benjones i have root level static pages such as: mydomain.com/about and of course homepage: mydomain.com/ i'm new asp.net mvc 2 (in fact started today) , i've set following routes try , achieve above. public static void registerroutes(routecollection routes) { routes.ignoreroute("{resource}.axd/{*pathinfo}"); routes.ignoreroute("content/{*pathinfo}"); routes.ignoreroute("images/{*pathinfo}"); routes.maproute("about", "about", new { controller = "common", action = "about" } ); // user profile sits @ root level check before displaying homepage routes.maproute("userprofile", "{url}", new { controller = ...

Fonts and character encodings -

a) fonts know coded character sets (unicode, ascii, etc.)? in other words, font file specify coded character sets may use font? b) assume if font supports coded character sets, character encoding (aka code page) coded character set can use font? a) font's file specify code point particular glyph mapped to? b) can glyph mapped several code points @ once? if yes, how correct mapping (of glyphs code points) chosen when application tries map font particular coded character set? c) font file instructions how draw glyphs? if yes, assume each font has own set of glyphs (ie. own set of instructions on how draw glyphs)? thank a lot of questions, can't answer them in detail so: a. yes, b. yes a. yes, b. don't know, c. yes all of details you'll want .ttf/.otf fonts here: http://www.microsoft.com/typography/otspec/otff.htm if putting fonts in code bracket fonts mean object in, say, .net, wpf offers of info: http://msdn.microsoft.com/en-us/library/ms74...

asp.net - Using DataTables and storing values -

i new c#.net. have method pass parameters in loop , each parameter there different rows returned . rows (which have data of different data types) database. want store data rows somewhere arraylist. , use furthue peocessing. plz tell me how this. enter code here /*ideally get_childandparentinfo(int pointid) function returns array list how deal array list containing datarows different data types */ public static arraylist get_childandparentinfo(int pointid) { string sp_name = "usp_get_parents"; sqlparameter[] parameters = new sqlparameter[1]; parameters[0] = new sqlparameter("@intpointid", dbtype.int32); datatable dtchildinfo = new datatable(); arraylist childnparents = new arraylist(); arraylist collect = new arraylist(); int = 0; parameters[0].value = pointid; dtchildinfo = datalayer.getdata1(sp_name, parameters); // (i = 0; < dtchildinfo.rows.count; i++...

Netbeans 6.8 C++ IDE: program crashes while debugging in cygwin on windows -

whenever try debug project in netbeans 6.8 c++ ide cygwin on windows, gives me message window "application crashed".(netbeans ide not crash program)there no problem while running only, while debugging, crashes. please help ok, im having been trying install c/c++ plugin netbeans ide 6.9 using instruction netbeans support , website: http://royalexander.wordpress.com/2009/03/20/configuring-cygwin-cc-compiler-for-netbeans-65-under-windows/ so decided use cygwin build engine. build fine crashes when run it. dig , dig. open location in c drive , run manually. finally, found different error message: "entry point cygwin_create_path not located in dynamic link library cygwin1.dll" this narrows down problem cygwin after googling, found might compatibility issue new cygwin update 1.7 install 1.5 version instead , worked!!! here how can too: download older version off cygwin website:the setup_legacy.exe run .exe make sure change new root directory name (if ...

c# - Converting asmx SOAP webservice to REST on ASP.NET: is WCF really useful for just that ? -

why not add http support in config , that's done advantage service dual both soap , rest? what's buzz around rest ? wcf bring ? i mean what's difference from viewpoint of rest client application if set in web.config asmx webservice being able accept rest-like syntax <webservices> <protocols> <add name="httpget" /> </protocols> </webservices> and wcf rest implementation http://geekswithblogs.net/.netonmymind/archive/2008/02/04/119291.aspx ? seems nobody can answer ... because it's hard or question stupid :) client sees url (encapsulation principle) why bother more ? , what's more that's still not clear :) other problem: if switch wcf, need change url ? if yes means our hundred partners clients broken , i'll have notify them of our change ? wcf nothing rest. can build own rest services without using wcf & soap stuff.. check out sample rest service build in .net 2.0 and...

sql - Get Roles which are still not assigned to member query -

how query mysql database return roles still not assigned (like available him). with table user_roles: |user_id|role_id| | 1 | 1 | | 1 | 2 | | 1 | 4 | | 1 | 7 | how can query roles table return role name , id of roles not assigned. role_id: 3,5,8,... try select * roles r not exists ( select 1 user_roles ur ur.role_id = r.id , ur.user_id = 1 )

jquery - Trouble with show/hide JavaScript -

i going have expressionengine weblog place user designed content blocks in footer. but, it's going show 1 @ at time. my html looks this: <ul class="footernav"> <li class="first"><a class="active" href="#">get in touch</a></li> <li><a href="#">interested in joining?</a></li> <li><a href="#">feedback</a></li> <li><a href="#">link 4</a></li> </ul> <div class="copy gutters show"> <p>lorem ipsum</p> </div> <div class="copy gutters hide"> <p>lorem ipsum</p> </div> <div class="copy gutters hide"> <p>lorem ipsum</p> </div> i want switch show class hide class depending on clicked link. not sure how can accomplish this. has flexible enough work n number of content blocks--because...

java - How to show set locations in a google map and add navigate button -

i looking create map application. want show location user selects list , show here location is, add button on map user can navigate there current location 1 selected. i have looked @ tutorials cannot find this. anyone know might find tutorial shows or how can extend simple map show given location. import com.ff.org.r; import com.google.android.maps.mapactivity; import com.google.android.maps.mapview; public class locbrad extends mapactivity { @override protected boolean isroutedisplayed() { return false; }@override public void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.map1); mapview mapview = (mapview) findviewbyid(r.id.mapview); mapview.setbuiltinzoomcontrols(true); } } i wrote simple tutorial shows listview , mapview in 2 tabs (and 1 activity). in tutorial, when click location in listview, mapview zooms location. it might start application. doesn't have button on map go...

mouseover - jquery mouse out and mouse leave problem -

<!doctype html public "-//w3c//dtd xhtml 1.0 transitional//en" "http://www.w3.org/tr/xhtml1/dtd/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" dir="ltr"> <head> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.0/jquery.min.js" type="text/javascript"></script> </head> <body> <div id="popupcontact" style="position:absolute;left:100px;top:100px;width:100px;height:50px;background-color:orange;border:1px solid red ;"> </div> <div id="divtoshow" style="display:none;background-color:green; border:1px solid black;width:200px;height:100px;position:absolute;"> dsfdssd <div><a href="#">rahul</a></div> </div> </body> </html> <script type='text/javascript'> $(document).ready(function(){ var popup_pos=$('#popup...

Visual Studio 2008 Create new Smart Device project option not available -

i have installed visual studio 2008 (also tried 2010 beta) , cannot see option start new smart device project (for windows mobile) i have tried multiple websites - appears have install windows mobile 6 sdk when try install says need have visual studio 2005 installed. am missing obvious? have installed on several pcs , don't see options visual studio install this? smart device development supported in professional edition or better. if you're running express or standard, won't have smart device projects.

C#: Application without a window or taskbar item (background app) that can still use Console.WriteLine() -

i'm trying create application adheres following: no taskbar no console or form window can utilize console.writeline() . (i.e. if executes app command prompt write console.) the problem if create windows form (or wpf) application can have there no taskbar, console or window show up, console.writeline() nothing. if create console app, writes console, can't figure out how hide (and if did hide it, write command prompt window?)... how do this? just create standard console application. callers responsibility hide window caused program (from how run c# console application console hidden ): system.diagnostics.processstartinfo start = new system.diagnostics.processstartinfo(); start.filename = dir + @"\myprocesstostart.exe"; start.windowstyle = system.diagnostics.processwindowstyle.hidden;

javascript - document.getElementById("ID").focus() + Google Chrome -

document.getelementbyid("id").focus() not work in google chrome. there alternative? thank you. if you're trying focus can't focused might need add tabindex: <span id="something" tabindex="0">something</span> document.getelementbyid("something").focus()

centering a google map based on marker lat long values -

i'm plotting 20 markers on map, locations in city. when use getlatlng find city center it's little removed locations i'm plotting, means markers located in corner of map instead of in center. is there way center map on location more central locations? i'm guessing need sort of "average" lat / long coordinate calculated 20 lat / long values have available. is possible? finding center should pretty easy. find smallest , largest latitude , longitude coordinates in group of 20. the center [min_lat + (max_lat - min_lat)/2, min_long + (max_long - min_long)/2] . something like: var points = array(); points.push(new glatlng( xxx, yyy )); ... min_lat = 90; max_lat = -90; min_long = 180; max_long = -180; (p in points) { if (p[0] < min_lat) { min_lat = p[0]; } if (p[0] > max_lat) { max_lat = p[0]; } if (p[1] < min_long) { min_long = p[1]; } if (p[1] > max_long) { max_lon...

c# - how to create a single webapplication as a sub domain for many companies -

i working on project can subscribe company name , can use features of site specificly company. example company abcd can own url our website like www.test.com/abcd/productlist.aspx company efgh can login own url , see product list. www.test.com/efgh/productlist.aspx can 1 me how can implement site best approaches i thinking on approach use global.ascx file distinguish companies, write code extract company name url in global.ascx every valid request , in pages put this.form.action = request.rawurl. is there other approaches? if implemented type of feature, please let me know approaches. thanks if you're working asp.net 3.5 sp1 should investigate new routing engine has been introduced mvc project. make clean solution.

javascript - Stack a div under an absolutely positioned image that changes in scale -

i used jquery image scaling plugin large image on page building: http://seans.ws/sandbox/test/thrive/ i trying put navigation div below image, cannot because image absolutely positioned, , scale of image changes, cannot specify padding-top value navigation show under photo. any appreciated. i put both image , navigation div in 1 container , specify absolute position on (instead of image). seems simplest , straightforward solution.

testing - How to mimic SMPP connection -

i have situation. application sending multiple smses end client number varies 50000 100000 smses @ point of time. achieve functionality using kannel sms sender interface. so solution complete. in development environment! before going in production supposed testing of solution environment. is there suggestion created testing environment? to give more input environment; kannel using smpp connection deliver messages end client. so, think need mimic smpp server kannel. smppsim www.seleniumsoftware.com also try sctt , logica smscsim

java - Regular expression to match text between <a ..> and </a> -

could able give regular expressiont match link text between <a> , </a> tags in html snippet. sample data: <a href="link.html">link title</a> - 15 comments <br/> <a href="otherlink.html">some other title</a> - 6 comments requirement: need extract link texts (i.e. 1 between <a> , </a> - link title , some other title ) use in application. please note link text might contain non-english characters , possible puncutations also. tried using '.' operator, since greedy match, matches entire text between first <a> , last </a> . want link texts. any help? try <a[^>]+>(.*?)</a>

c++ - Why are global and static variables initialized to their default values? -

in c/c++, why globals , static variables initialized default values? why not leave garbage values? there special reasons this? security : leaving memory alone leak information other processes or kernel. efficiency : values useless until initialized something, , it's more efficient 0 them in block unrolled loops. os can 0 freelist pages when system otherwise idle, rather when client or user waiting program start. reproducibility : leaving values alone make program behavior non-repeatable, making bugs hard find. elegance : it's cleaner if programs can start 0 without having clutter code default initializers. one might wonder why auto storage class does start garbage. answer two-fold: it doesn't, in sense. first stack frame page @ each level (i.e., every new page added stack) receive 0 values. "garbage", or "uninitialized" values subsequent function instances @ same stack level see previous values left other method instances of o...

iphone - stringWithContentsOfFile works, but requestWithURL doesn't -

for reason, first method doesn't display anything, while second does: //common nsstring *path=[[nsbundle mainbundle] pathforresource:@"about" oftype:@"html"]; //method1 [webview loadrequest:[nsurlrequest requestwithurl: [nsurl fileurlwithpath: path isdirectory: no]]]; //method 2 nsstring *html=[nsstring stringwithcontentsoffile:path encoding:nsutf8stringencoding error:null]; [webview loadhtmlstring:html baseurl:[nsurl urlwithstring:[[nsbundle mainbundle] bundlepath]]]; //common uiviewcontroller* controller=[webview controllerwithtitle:@"help"]; [delegateref.navcontroller pushviewcontroller:controller animated:yes]; on other hand, tried loading using url well. similarly, first method didn't display while second did. //common nsurl *url=[[nsbundle mainbundle] urlforresource:@"about" withextension:@"html"]; //method 1 [webview loadrequest:[nsurlrequest requestwithurl:url]]; //method 2 nsstring *html=[nsstring stri...

android - Want to know database behavior when Maximum cache size is exceeded -

after extensive use of email database (there more 1000 mails), email app crashed. if come app again mails started deleting automatically. the error logs obtained below: e/androidruntime( 417): java.lang.outofmemoryerror e/androidruntime( 417): @ java.lang.string.<init>(string.java:468) e/androidruntime( 417): @ java.lang.abstractstringbuilder.tostring(abstractstringbuilder.java:659) e/androidruntime( 417): @ java.lang.stringbuilder.tostring(stringbuilder.java:664) e/androidruntime( 417): @ com.android.email.mail.transport.discourselogger.addreceivinglinetobuffer(discourselogger.java:57) e/androidruntime( 417): @ com.android.email.mail.transport.discourselogger.addreceivedbyte(discourselogger.java:70) e/androidruntime( 417): @ com.android.email.mail.store.imapresponseparser.readbyte(imapresponseparser.java:71) e/androidruntime( 417): @ com.android.email.mail.store.imapresponseparser.expect(imapresponseparser.java:332) e/androidruntime( 417): ...

html - Anchor links that point to ID of a hidden element will cause browser to automatically show the element and scroll to it when clicked -

anchor links point id of hidden element cause browser automatically show element , scroll when clicked. i've seen girl post demo of this, cannot find anymore. no javascript please. use octothorpe in href attribute of anchor element. <a href="#somewhereelse">click here</a> <div id="somewhereelse">when click browser should scroll here</div>

java - How to get web session on Spring AOP -

i have question using spring aspectj. want create audit log when user , user information web session create audit log. can provide examples of how this? spring mvc's dispatcherservlet stores request in thread-local variable (if don't use spring mvc, may declare requestcontextlistener in web.xml same thing). variable can accessed via requestcontextholder : httpsession s = (httpsession) requestcontextholder .currentrequestattributes() .resolvereference(requestattributes.reference_session);

assembly - General Purpose Registers - Order -

why general purpose registers ordered (eax, ecx, edx, ebx)? example, "inc" instruction opcodes are: inc eax - 40 inc ecx - 41 inc edx - 42 inc ebx - 43 is there reason why ordered way? the odd placement of (e)bx due way 8086 evolved 8080. the 8080 has accumulator (a) , 6 general-purpose registers b, c, d, e, h , l, b/c, d/e , h/l can used in pairs, , in particular h/l can used address memory access. 8086 designed existing 8080 code translated it; guess seemed logical map registers in following order: 8080 register -> 8086 internal register 0 b,c -> 1 d,e -> 2 h,l -> 3 sp -> 4 as noted in answer, ax, bx, cx , dx in 8086 not arbitrary names 4 general-purpose registers - have mnemonic meanings special functions registers have: "accumulator", "base", "count" , ...

windows - Save and restore applications and layout -

Image
i'm looking ways reduce wasted time spent open applications needed, position windows, open urls/files/change directories/etc. before actual coding starts. in perfect world there 2 buttons marked 'save state' , 'restore state' per 'project'. kind of feature find in games. i'm on mac , spent afew hours banging head 'automator' (which reason has problems open firefox dock) , applescript (which gives me feeling i'm in long ride). searching on net led me script: http://snipt.net/fotinakis/applescript-to-save-and-restore-window-positions/ #!/usr/bin/osascript -- usage: -- $ osacompile -o windowpositions.compiled.scpt windowpositions.scpt -- $ osascript windowpositions.compiled.scpt --save -- $ osascript windowpositions.compiled.scpt --restore -- change list of windows want save/restore property affectedprocesses : {"chrome", "adium", "eclipse", "terminal"} property windowrecord : {} on run ar...

c# - How to include ampersand in connection string? -

i'm using entity framework 4 simple app , bake connection credentials following connection string: <connectionstrings> <add name="myentities" connectionstring="metadata=res://*/mydatamodel.csdl|res://*/mydatamodel.ssdl|res://*/mydatamodel.msl;provider=system.data.sqlclient;provider connection string=&quot;data source=localhost\dev;initial catalog=mydb;userid=myuser;password=jack&jill;multipleactiveresultsets=true&quot;" providername="system.data.entityclient" /> </connectionstrings> however, password (which cannot change) contains ampersand. asp.net throws: configuration error: error occurred while parsing entityname. line xx, position yyy. if replace ampersand in password &amp; , sqlexception: login failed user 'myuser'. trick works, i'm guessing failing because technically connection string inside connection string. what should here? of classes include code like:...

Can you use scons to build PHP extensions? -

the standard way of writing php extensions use autoconf/automake alongside script called phpize, seems generate autoconf configuration based on template that's specific php environment. let's build php extension right version of php, etc. autoconf , m4 language used configure arcane, , people have written alternatives, such scons. want able use 1 of these when building php extension. in principle, should able use scons or similar tools build php extensions. however, can't see how replace phpize step. has had success in building php extensions scons, or more modern build tool? the path of least resistance have scons run autoconf, phpize , whatever else needed php extension. may able extract compiler configuration out of there , let scons actual building, or can have scons run "make". declaring shell command targets scons easy, getting dependencies right tricky. basically have let scons know of intermediate file produced these external tool...

c# - Clean Code: Readable Dependency Injection suggestions? -

i have project adds elements autocad drawing. noticed starting write same ten lines of code in multiple methods (only showing 2 simplicity). initial implementation: notice thing changes adding line instead of circle. [commandmethod("test", commandflags.session)] public void test() { addlinetodrawing(); addcircletodrawing(); } private void addlinetodrawing() { using (documentlock lockeddocument = application.documentmanager.mdiactivedocument.lockdocument()) { using (database database = application.documentmanager.mdiactivedocument.database) { using (transaction transaction = database.transactionmanager.starttransaction())//start transaction { //open block table read blocktable blocktable = transaction.getobject(database.blocktableid, openmode.forread) blocktable; //open block table record model spac...