Posts

Showing posts from September, 2011

linq to sql - How to modify linqtosql entityref objects in handcoded MVC model? -

i trying set own mvc model rather letting environment create 1 via graphic designer tool. had hoped make easier keep separate repositories parts of model space far has caused me nothing grief. the first problem ran entityref classes had updated via selectlist control in view. managed work adding interal id field every entityref designer.cs do. however, has made model class quite bit more complex code below demonstrates. unfortunately, run problem when want explicitly update of entities in controller. if manually set id field, update dropped, if change entity exception while saving. my model [table(name = "dbo.jobs")] public class job { [column(isprimarykey = true, isdbgenerated = true, autosync = autosync.oninsert)] public int jobid { get; set; } internal string _companyid; // string legacy reasons [column(storage = "_companyid")] public string companyid{ { return _companyid} set { if ((_companyid != val...

android - Which user action causes a click event -

a click event on desktop generated, when user clicks mouse. dont use mouse smartphone. so far didnt find way generate click event on touchscreen. there hardware features, whith can "click"? first, can't ui click events when user on android phone clicks "desktop" (home screen). click events when user clicks in app. taken handling ui events tutorial: // create anonymous implementation of onclicklistener private onclicklistener mcorkylistener = new onclicklistener() { public void onclick(view v) { // when button clicked } }; protected void oncreate(bundle savedvalues) { ... // capture our button layout button button = (button)findviewbyid(r.id.corky); // register onclick listener implementation above button.setonclicklistener(mcorkylistener); ... }

algorithm - How to represent street address ranges for geo location lookups? -

i have following type of inputs: zone 1 => alabama street, 1 135, west side alabama street, 2 144, east side bahama square, 2 4 zone 2 => bahama square, 5 8 cecil street, 3 27 etc. these data represent zones within area. small disctrict in city, defined couple of enclosing streets. if i'm given geo location (latitude, longitude), how can map value zone in above context? it's obvious google maps lookup give me address, how proceed there? best way represent kind of data (address ranges) effective zone establishment? (whoa, 3 questions within 1) i'll take stab @ followup question. assuming streets 1 .. 6 in zone 1 major streets , zeta side street between these streets within address range. my solution form shapefile zone , check if lat/lng of address check within shapefile. here's approach detail: use reverse api lat/lng of each street endpoint (e.g., 1 w. alabama, 135 w. alabama, etc). use these endpoints create polygon shape (...

How to check if a field exists using iMacro -

i need check see if html field exists in website using imacro plugin firefox. if field not exist, need perform different opperation tag pos=1 type=a attr=txt:c tag pos= class yo want. type= find text in class attr= want class. (txt, href...) txt(or different): can use * find in class. Ä°t marks object. or want search example: tag pos=1 type=b attr=txt:i<sp>am<sp>a<sp>text. this code means find first bold item in text:i text, , mark it.

linux - Using mknod on Ubuntu in c program -

i trying make c program using mknod command like #include<stdio.h> #include<fcntl.h> #include<string.h> char info[50]; main() { int fdr; int rc = mknod("testfile",'b',0); if(rc<0) { perror("error in mnod"); } fdr=open("testfile",o_rdonly); read(fdr,info,50); printf("\n received message=%s",info); printf("\n"); } and stuff. works on red hat system, fails on ubuntu giving error invalid argument. mknod deprecated; should not using it. if want create fifo, use standard mkfifo . if want create ordinary file, use creat or open o_creat . yes mknod can create device nodes, , on systems might still way it, on modern linux system rely on kernel and/or udevd handle this.

java - Sorting method not sorting correctly -

i'm calling arrays.sort(schedule, c); c instance of comparator so: import java.util.comparator; public class firstocccomparator implements comparator<abstractevent> { public int compare(abstractevent event1, abstractevent event2) { int result = 0; if (event1 == null || event2 == null) { //system.out.println("null"); } else if (event1.hasmoreoccurrences() && event2.hasmoreoccurrences()) { result = event1.nextoccurrence().compareto(event2.nextoccurrence()); } return result; } } the output i'm getting isn't it's supposed be. i'm wondering if can point me in right direction here. first sorting algorithm i've ever made , using concepts still new me (comparators , implementation), sorry multiple questions regarding code :) edit difference between outputs: http://pastebin.com/lwy1jqkt there 2 kinds of events, these hasmor...

cocoa - How can I use OS X's Accessibility API to write acceptance tests for my applications? -

i'm writing gui application in cocoa. i'd use cucumber write acceptance tests continually verify application's features work. i'm writing application in macruby. can use accessibility api click things , drag things around? can read how such things? i've found apple's site relatively mum on topic. i'd suggest checking out frank . uses accessibility approach , has worked great me far!

ajax - ajaxSubmit not working in IE jQuery Form plugin -

i using jquery form plugin upload images in mvc project. for reason code in ie no longer working (worked before): can tell submit successful, image successful uploaded, , recoded in database, response seems somehow corrupted in ie. function showresponse(responsetext, statustext, xhr, $form) { $("#loading").hide(); addimage(responsetext.imageid); buildarray(); } i tested on firefox, chrome, safari, working fine, when use in ie. i got error: message: 'imageid' null or not object anyone have had similar problem before? thanks in advance! well problem solved changing content type "text/plain" "text/html", that's it. omfg, internet explore! code have changed: return json(newimage, "text/html", encoding.unicode, jsonrequestbehavior.allowget); hope else well.

Repeat jQuery ajax call -

how repeat jquery ajax call every 10 seconds? $(document).ready(function() { $.ajax({ type: "get", url: "newstitle.php", data: "user=success", success: function(msg) { $(msg).appendto("#edix"); } }); i've tried wrap $.ajax function , call function setinterval $(document).ready(function() { function ajaxd() { $.ajax({ type: "get", url: "newstitle.php", data: "user=success", success: function(msg) { $(msg).appendto("#edix"); } }); } setinterval("ajaxd()",10000); }); but says "ajaxd not defined" your method should not placed inside ready method, or only be available there , not outside. $(document).ready(function() { setinterval("ajaxd()",10000); }); function ajaxd...

java - Dynamic target in a state machine -

in state machine made scxml, there way set dynamic target value transition? i mean, suppose have object called "obj" has been set datamodel scxml. there can set conditions (if there property called checkcondition in object) on like: cond="obj.checkcondition" <state id="state1"> <transition cond="obj.checkcondition" target="state2"/> </state> <state id="state2"> ... </state> i have property in obj called nexttarget. want set target in transition reading value object (as done in conditions). <state id="state1"> <transition cond="obj.checkcondition" target="eval(obj.nexttarget)"/> </state> <!-- in obj.nexttarget there has been set value "state1", "state2" or state name --> is there syntax this? thanks. you can specify cond attribute in transition element <transition cond="data.v...

multithreading - Practices for Foreground/Background threads in .NET -

i work in-house legacy communication framework exposes high level abstractions. these abstractions wrappers logic around .net threads. when looked @ code i've noticed abstractions wrappers around foreground threads while others wrappers around background threads. the sad thing don't see logic why in cases foreground threads used , background in other cases. are there guidelines or patterns & practices when it's better choose 1 on on server side , client side (i believe there should difference)? any examples own professional experience when crucial or solution prefer 1 on another? straight msdn a managed thread either background thread or foreground thread. background threads identical foreground threads 1 exception: background thread not keep managed execution environment running. once foreground threads have been stopped in managed process (where .exe file managed assembly), system stops background threads , shuts down.

sql server - How can I tell what recovery model my DB is using? -

is there sql command can run recovery model? select databasepropertyex('yourdatabasename', 'recovery') or select d.recovery_model_desc sys.databases d d.name = 'yourdatabasename'

Jquery load with variables -

can tell me i'm wrong here http://jsfiddle.net/djevrek/y9rej/ what want here scan #divholder divs in page, finds if div have div class stats sa_ , then, add in div, lets (sa_icon) content load page html.html div same class (sa_icon). so, more precise, want make icon help, , when user clicks on icon populate content in popups div content external html page. so, in demo, solution 1 works, want it, populates divs can find, , in solution 2 (click2) doesn't work @ when i'm using jquery load variables. in demos, i'm using load current page , finds div #documentation-info that's part of jsfiddle site. want part of code same class in popup icon div. #divholder should unique because ids should unique. try using class instead, should achieve more expecting results ;-) edit: in second method, you're passing second argument load(), not correct. should be: var url2 = "/"; var sta = "#documentation-info"; $(this).load(...

c++ - solaris 8 vs solaris 10 -

i have program compiled , ran using third party lib on solaris 8. after ran ported solaris 10 without issues. need compile/link , create new exe on solaris 10? despite me testing executable made on solaris 8? seems weird need to. can shed light on matter? thanks sun makes binary compatibility guarantee built run on solaris 8 or solaris 9 work on solaris 10. when worked in solaris world, link code built in solaris 10 libraries built solaris 8 (binaries 3rd party vendors, couldn't have recompiled if wanted). this explanation why build tools may have implementation issues (i encountered many issues in sunstudio compilers/libraries weren't fixed due need ensure compatibility). http://www.oracle.com/technetwork/server-storage/solaris/overview/guarantee-jsp-135402.html solaris binary application guarantee program the solaris application guarantee reflects sun's confidence in compatibility of applications 1 release of solaris next , designed make re-q...

html - CSS Div Alignment Problem -

i have 2 divs make header, #title , #header . inside #totaltop . should flush against top, , should flush against each other. here's how looks like: http://i53.tinypic.com/2ykj0b7.jpgy here's css code relevant part: #totaltop { text-align: center; } #title { background-image: url(../img/topbannergradientorange.png); border-bottom-color: #fff; text-align: center; border-bottom-style: solid; border-bottom-width: 3px; background: url(../img/topbannergradientorange.png); height: 150px; width: 20%; font-size: 25px; display: inline-block; } #header { border-bottom-color: #fff; border-bottom-style: solid; border-bottom-width: 3px; background: repeat-x; background: url(../img/topbannergradientorange.png); width: 60%; text-align: center; height: 150px; display: inline-block; margin-top: 0; } how can them fit together? have reset.css in full stylesheet. edit: added vertical-align: top; , looks sort of gap between elements. it's 3-4px , chrome's inspect tool can...

list - Plotting a table/chart/grid in Python -

assume user inputs file. format like: name\t182909876\n name 2\t090090090\n etc... i want plot data onto chart, grid, or table. data_list = [] infile f: data = [map(str, line.split('\t')) line in f] matplotlib need plot numbers . seeing code above generates nested lists of strings, might have improvise ..

java - Why this enum doesn't compile? -

why enum doesn't compile? public enum ackr implements cloneable{ instance; public <ackr extends cloneable> ackr getinstance(){ return instance; //type mismatch: cannot convert ackr ackr // return (ackr)instance; //type safety: unchecked cast ackr ackr } } that type argument is, far know, not neccessary. try simply public ackr getinstance(){ return instance; }

Is URT (universal runtime) equivalent to .net framework -

just curious ask. if 2 equivalent. short answer: kind of. java vm better example, .net framework has of these elements. the idea of "universal run-time" environment in programs written runtime live , work, can ported various hardware/os environments without program knowing difference. java fits description quite nicely. can write java programs execute anywhere; on desktop or laptop, android mobile devices, embedded in web browsers. language, , others compile use in java vm, work on hardware has java vm, , necessary libraries supported (different devices have different i/o possibilities , graphics capabilities, instance). .net... not quite much. .net run on "living" (still-supported) windows os, , on windows mobile devices, , there workalikes (mono) linux/mac , ports of c# language compile android , obj-c (iphone) environments, .net windows-only platform, , so, despite platform's popularity, not "universal". however, within bounds of ...

java EE adding entry...logical problem? -

i new @ java ee , still not familiar it. we instructed save entry using hashmap, problem don't know how let class read few strings servlet this servelet code : import java.io.ioexception; import javax.servlet.requestdispatcher; import javax.servlet.servletexception; import javax.servlet.http.httpservlet; import javax.servlet.http.httpservletrequest; import javax.servlet.http.httpservletresponse; public class adddata extends httpservlet { public void doget(httpservletrequest request, httpservletresponse response) throws servletexception, ioexception { string id = request.getparameter("newid"); string name = request.getparameter("newstockname"); string uprice = request.getparameter("newuprice"); string onstock = request.getparameter("newonstock"); dataservclass service = new dataservclass(); /*i planning call method dataservclass like: ...

Running Python Code on Xampp on windows platform -

xampp-python-windows i have installed xampp. i'm running apache web server , mysql service. want host python code on web server. however, having hard time setting python xampp. read modwsgi, downloaded , pasted in modules folder. have python 3.2 installed on c drive. please let me know should next, in should paste python files , how should execute them through web browser? should able this: http://74.xxx.xxx.xx/python/test.py (localhost/python/test.py) and should execute python code. when try above, this: server error! the server encountered internal error , unable complete request. either server overloaded or there error in cgi script. if think server error, please contact webmaster. error 500 74.194.129.16 3/2/2011 2:11:16 apache/2.2.17 (win32) mod_ssl/2.2.17 openssl/0.9.8o php/5.3.4 mod_perl/2.0.4 perl/v5.10.1 all highly appreciated. the official releases of mod_wsgi don't support python 3.2 cant use it. use python 3.2 need compile mod...

python - Django as SOAP web-service server -

i need rewrite existing soap service (we have wsdl file) in django/python libs or solutions recomend me? link wellcome. ps: zsi can parse wsdl, don't it, old (may i'm wrong) i used soaplib. project has been moved , named spyne .

java - How to reliably decode PDF417 barcodes on Android using software (not Zxing)? -

what need: i need java library (preferably android) capable of reliably decoding pdf417 barcodes, may distorted (not flat) and/or partially obscured. what i've tried: the zxing pdf417 decoder still in alpha stages , lacks speed and/or reliability require. i've tried porting pdf417decode project java; ported library worked no more reliable zxing implementation. details: decoding must take place in software; no external hardware permitted the library can cost money any appreciated. thank time! i have tried sdk aipsys, library native code android, fast compared java code, contact technical support details support@aipsys.com

castle windsor - Potentially Misconfigured Components using TypedFactory -

i'm learning how use windsor typedfactory: feature it's awesome! made work need, have concern having 1 potentially misconfigured components "castle.typedfactory.delegateproxyfactory" iproxyfactoryextension / delegateproxyfactory... that's container , working... still concern waring built container container = new windsorcontainer(); container.kernel.resolver.addsubresolver(new arrayresolver(container.kernel)); container.addfacility<typedfactoryfacility>(); container.register(component.for<itypedfactorycomponentselector>().implementedby<customtypedfactorycomponentselector>()); container.register ( component.for<contracts.iconverter>().implementedby<components.converter1>().named("converter1").lifestyle.singleton, component.for<contracts.iconverter>().implementedby<components.converter2>().named("converter2").lifestyle.singleton, component.for<contracts.iconverterfactory>(...

css - IE6 <li> images pushing down to next line -

i have basic top nav area: ul#topnav { margin:0; list-style-type:none; width:400px; font-weight:bold; padding:0; float:left; } ul#topnav li { display: inline; padding:0 3px; margin:0; float:left; } ul#topnav li a, ul#topnav li a:link, ul#topnav li a:active { text-decoration: none; padding:0; margin:0; font-size:11px; } the html follows: <ul id="topnav"> <li><a href="#">home</a></li> <li><a href="#">contact us</a></li> <li><a href="#">community</a></li> <%if session("id") <> "" %> <li><%response.write(hometopmenuwelcomemessage) %></li> <li><a href="#">log out</a></li> <%end if %> <li><a href="#"><img src="/_images/fb-icon.jpg" alt="facebook icon" /></a></li...

Mercurial merge permissions -

can configure mercurial permissions repository 1.1 can merged 1.0 , other repositories (ie: 1.2, 1.3) can not merged 1.0? interested in adding controls around can merged what. my other answer addresses named branches case, in have few (not great) options because branch name part of changeset , can watch changesets created on 1.2 branch being merged 1.0 branch. the clones branches case if you're working clones branches (my preferred work mode) "what branch changeset done on" information isn't available. do, however, put pretxnchangegroup hook in 1.0 repository blocks first changeset created in 1.2 branch. if tries push 1.2 stuff 1.0 central(-ish) repository push denied. here's example of how sort of hook: http://ry4an.org/unblog/post/mercurial_changeset_blacklist/

Mouse hover in WPF -

i'm facing problem of implementing mouse hover event in wpf . first there no such event in wpf , , second need make similar event routed event. mean, have global window , , want declare on buttonbase.mousehover , i'll handle event each time hover button on screen . any suggestion . best regards wasim ... how mouseenter ? serves same purpose :)

java - connect to database in eclipse rcp -

in eclipse rcp java best method show data of table in our form , how can u please tell me in detail. eclipse jface table - tutorial http://vogella.de/articles/eclipsejfacetable/article.html

Patch forked repo with git -

say, have fork of library ver. 1.1 under git. new tar-ball ver. 1.2 comes out. how can update forked library new version? you question isn't great, i'll offer potential solution. lets assume code base library looks this: vendor -- b you fork @ b 1.1 release. vendor -- b \ \ 1 -- 2 -- 3 now assuming development continues on vendor tree. vendor -- b -- c -- d \ \ (master) 1 -- 2 -- 3 and d becomes 1.2 release. if vendor tree in git repo , can access it, git pull or maybe git pull --rebase vendor tree should things need, may need resolve conflicts etc. if vendor tree not in git, , access have source code tarballs of each release more complicated might required. so create second branch @ point @ forked, doing: $ git checkout -b v1.2 b then untar v1.2 tarbar branch , commit changes. should have this: vendor -- b -- c -- d |\ | \ (master)...

html - ending block elements on the same vertical line; fixing double outlines -

in following html/css code i'm having 2 issues: the result class boxes have double sized outlines on top, left, , bottom. the group class elements stretch off past right side of screen. what can change make block elements end cleanly on right-side of screen , give them 1px outlines? thanks, paulh <!doctype html public "-//w3c//dtd html 4.01//en" "http://www.w3.org/tr/html4/strict.dtd"> <html> <head> <title></title> <style type="text/css"> .result { border: 1px solid #ffffff; outline: 1px solid #98bf21; color: #ffffff; background-color: #98bf21; font-size: 11px; font-weight: bold; text-align: center; text-decoration: none; width: 70px; display: inline-block; } .group { border: 1px solid #98bf21; background-color: #eeffcc; position:relative; left: 72px; ...

wpf - Problem with binding Stacked colums series chart to Series -

i have big problem binding stacked column series chart. i have public observablecollection series property in viewmodel , try many ways still not working. this code viewmodel prepare series: private void drawchart() { this.series.clear(); var datavalues = new list<list<simpledatavalue>>(); int wartoscniezalezna = 1; (int = 0; < 2; i++) { datavalues.add(new list<simpledatavalue>()); } foreach (var item in mycollection) { var param = someparam; datavalues[0].add(new simpledatavalue { independentvalue = "czujnik " + wartoscniezalezna, dependentvalue = 100 }); //czerwone datavalues[1].add(new simpledatavalue { independentvalue = "" + wartoscniezalezna, dependentvalue = 200 }); wartoscniezalezna++; } var stackedseries = activator.createinstance(typeof(stackedcolumnseries)...

Embedding a web browser in a java application on Mac OS X -

i'm developing cross-platform desktop application using java. application requires displaying couple of websites within application , not open them in full fledged web browser safari or firefox. i've found java libraries , projects accomplishing windows the dj project , jdic processing , [lobo browser]. don't support mac os x or maybe can't figure out how run them on mac. managed run lobo browser simple frame , load page, project 2 years old , doesn't render pages properly. please suggest if there cross-platform library available embedding web browser in java program or mac library do. take @ qt jambi , java api qt toolkit, webkit package. full dom rendering or without gui.

Opening a page in a second project in a Visual Studio solution -

sorry ignorance, ask following: have visual studio 2008 solution has 2 projects (a 'web site project' , second 1 'web application project'. when run solution in visual studio, first projects starts , can see asp web page (in run-time). when click button on page run procedure belongs second project, pass parameters , start second project in run-time well. i cannot figure out how reference "project1", files, procedures, etc belong "project2" in solution. thank you, m.r right click project1->add reference , make reference project 2.

visual studio 2010 - TFS work Item editing conflict (TFS error 237079) -

it seems tfs doesn't handle concurrent work item editing well. ran 2 problematic scenarios: scenario a: you start editing work item. while you're editing, else edits , saves same item. when try save horrible tfs237079 error which means have loose changes, refresh item , edit again. nice. scenario b: you have work item focused while. someone edits , saves item. when start editing you're editing outdated version of work item , tfs23709 when trying save. i'm quite familiar tfs sdk (wrote tfs vs addon , custom work item controls) can't find "beforeedit" event work item. having such event allow me warn user else editing (for scenario a) , latest revision before editing (for scenario b). thanks, raviv. optimistic concurrency is. server isnt tracking editing work items if wanted "someone else editing item" notifications have write own services , custom controls track it. you'd have deal edit flags not being release...

perl - How do I keep braces from moving in Emacs cperl mode? -

i'm using gnu emacs 22.2.1 , cperl 5.23. i have perl code this: sub foo { if($x) { print "x"; } else { print "y"; } } i'd reindent code 2-space indent. when run cperl-indent-region on code, get: sub foo { if ($x) { print "x"; } else { print "y"; } } how can keep outer brace @ left margin / column 0? how can prevent opening brace if , else moving previous line? i believe customization you're looking is: (setq cperl-extra-newline-before-brace t cperl-brace-offset -2 cperl-merge-trailing-else nil) you can customize cperl mode m-x customize-group <enter> cperl <enter> . indentation variables in cperl indentation details subgroup.

Rails cycle helper with a few exceptions -

i'm using rails cycle() helper method in standard way table rows make alternating rows different background colors. however, want occasional row or 2 (that match criteria) different, third color, without interrupting cycle. in other words, want rows like: white black red black white black white instead of: white black red white black white what's best way this? got store in temporary variable , make call cycle() ensure up-to-date. <% class = cycle('white', 'black', :name => 'colors') class = 'red' if should_be_highlighted %> <tr class="<%= class %>"> you wrap nicely in own helper.

javascript - Change the first value of a title -

i need change first value of title. did don't know if it's best way it. html: <div title="title have change"> div here </div> js: $("div").click(function(){ var title = $(this).attr('title').split(' ')[0]; /* title getting first value (title), so, need change him. */ // better way ? if(title == "title"){ $(this).attr("title", "changed have change"); } }); can change part of title, instead that? keep of parts of title around. change first part, join parts form new title. $("div").click(function(){ var parts = $(this).attr('title').split(' '); /* change part[0] */ // put parts $(this).attr("title", parts.join(" " )); }); alternatively, if transformation relatively simple (say remove first word if it's ...

Why can't I use TortoiseMerge as my git merge tool on Windows? -

i'm trying perform first git merge ever (exciting!), can't git gui (0.13.gitgui git 1.7.4.msysgit.0) recognize tortoisemerge (1.6.11.20210 x64) on windows 7. based on an answer similar question , i've made following configuration changes: $ git config --global merge.tool tortoisemerge $ git config --global mergetool.tortoisemerge.cmd 'tortoisemerge.exe -base:"$base" -mine:"$local" -theirs:"$remote" -merged:"$merged"' $ git config --global --list ...snip... merge.tool=tortoisemerge mergetool.tortoisemerge.cmd=tortoisemerge.exe -base:"$base" -mine:"$local" -theirs:"$remote" -merged:"$merged" $ unfortunately, when start git gui , attempt "run merge tool", receive error unsupported merge tool 'tortoisemerge' . can tell me i've done wrong? here's relevant sections of ~/.gitconfig : [merge] tool = tortoisemerge [mergetool "tortoisemerge...

Constructing membership site with joomla -

hi run joomla site on htpp://www.deeptechtons.net , wanted construct membership based subscription people pay premium articles. same tutsplus site network.[ think custom solution must available joomla]. looked extensions directory nothing fits purpose. requirements need are, 1.custom profile fields members. 2.any time un-subscribe plan. 3.simple interface show plans available 4.payment processor's support also how hide articles premium members not showing in search results, both joomla , google. joomla has teensy, weensy setting hides un categorized articles in search plugin. if want use 1.5, joomla 1.5 + jomsocial + aec. use k2 content because make filling request keeping content out of google trivial. wrote upgrade k2 content display module allow leave of content public , display intro text non-registered users. display member content in module displays registered users. easy maintain , implement.

c# - Adding Hyperlinks to ValidationSummary -

i have long form users fill out. there way hyperlink error message in validationsummary specific text field? the easiest way straightforward html anchor tags <a> , can include html in errormessage property of validation control displayed in validationsummary control. examples <asp:validationsummary id="validationsummary1" runat="server" /> <asp:button id="button5" runat="server" text="submit" /> <br /> <div style="height:800px"></div> <a name="textbox1"></a> required field <asp:textbox id="textbox1" runat="server" /> <asp:requiredfieldvalidator id="requiredfieldvalidator1" runat="server" errormessage="required field required <a href='#textbox1'>click here go to</a>" text="***" controltovalidate="textbox1" /> a more elegant approach com...

c# - asp.net Domain / Subdomain Authentication not working correctly -

i have w2k3 server hosts 2 sites under iis, such have mysite.com , foo.mysite.com i trying use forms authentication , single sign on. both sites have same machine key, , same domain prefixed . in web.configs. the 2 issues have are; 1) if go http://www.mysite.com/login.aspx , , login, navigate subdomain redirects me login page. but if go http://mysite.com/login.aspx , login, navigate subdomain works. why seeing www.mysite.com , mysite.com seperate domains , invalidating authentication? it understanding adding domain=".mysite.com" work sub sites under domain. 2) if change subdomain login url mysite.com not www.mysite.com , hit subdomain first, redirects login form fine, when log in not redirect subdomain, rather looks subdomain page on main site. i.e. browse foo.mysite.com/bar.aspx, redirects login page, , when logged in tries show mysite.com/bar.aspx not page first requested. any explaining , resolving these issues welcome! thanks as update this. found...

dropdown list jquery -

i have array following value, [['6','ltr'],['7','ml']] how can use array fill drop down list using jquery demo 2: http://jsbin.com/ewimo4/2 $(function() { var arr = [['6', 'ltr'], ['7', 'ml']]; var html = "<select>"; $.each(arr,function(i, item) { html += '<option value="' + item[0] + '">' + item[1] + '</option>'; }); html += "</select>"; $('#select').html(html); }); demo : http://jsbin.com/ewimo4 $(function() { var arr = [['6', 'ltr'], ['7', 'ml']]; $.each(arr,function(i, item) { alert(item[0] + ' ' + item[1]); }); });

javascript - How can I hide series from a HighCharts legend? -

i have 4 series in chart. 2 visible when chart loads. 2 hidden. when user zooms in, visibility switches. how can have legend displays 2 visible series? pass showinlegend parameter series don't want visible in legend like: series.showinlegend = false;

javascript - IE wont fire my jquery's .click function. what could i do? -

okay have following code below: script: <script> $(document).ready(function() { $(".header").click(function () { $(this).effect("bounce", { times:2 }, 200); $(".links").show("slow"); }); }); </script> html: <body> <div class="header"> <p><img src="images/logo.png" width="438" height="131" alt="larz conwell" /></p> <p><span class="dash">//</span> freelance web designer &amp; graphic artist</p> </div> <div class="links"> </div> </body> and in ie wont work @ all, works on other browsers. problem? also tried site have jquery on , works perfectly. i think javascript getting executed before dom ready. try using $.live(); $('.header').live('click', function(){}); this execute event if class created late...

How do C self-hosts itself? -

anyone knows complete chain of operations .c source code executable .exe ? i've downloaded source of gcc,and found c-parser.y written in c: extdef: fndef | datadef | asm_keyword '(' expr ')' ';' { strip_nops ($3); if ((tree_code ($3) == addr_expr && tree_code (tree_operand ($3, 0)) == string_cst) || tree_code ($3) == string_cst) assemble_asm ($3); else error ("argument of `asm' not constant string"); } | extension extdef { pedantic = $<itype>1; } ; so knows complete story of c's self-hosting? update i know how compilers scripts written,most of them depends on c compilers. so i'm asking how c compiler works. gcc has multi-stage process, starts working c compiler (which might or might not version of gcc). use other c compiler create first version of gcc - gnu c compiler. this gives worki...

jQuery Ui Dialog width:auto Ie8 -

i have jquery ui dialog below code : $("#roleproperty").dialog({ autoresize: true, show: "clip", hide: "blind", height: 'auto', width: 'auto', autoopen: false, modal: true, position: 'top', draggable: true, title: "مشخصات نقش", open: function (type, data) { $(this).parent().appendto("form"); }, buttons: { "بستن": function () { $(this).dialog("close"); document.getelementbyid("<%=btncancel.clientid%>").click(); } } }); but property width:auto works incorrectly in ie8. works right in firefox. jquery ui version 1.8.5 jquery version 1.5 -additional infromation. opening dialog server side (after asp.net postback) make sure not having issue ie compatibility mode. see broken page icon refresh button? if use following in :

php - Height of div using jQuery? -

i have created portfolio image gallery can't captions work properly... using: http://s3.amazonaws.com/buildinternet/live-tutorials/sliding-boxes/index.htm (i'm using second one) the problem captions different sizes i'm trying use code below: $('.boxgrid.caption').hover(function () { var $height = $("#description-text", this).height(); $(".cover", this).stop().animate({ top: '375' - $height }, { queue: false, duration: 160 }); }, function () { $(".cover", this).stop().animate({ top: '365px' }, { queue: false, duration: 160 }); }); but reason output code of $height 395 when should 150 or somewhere along lines... please help... thanks ben $("#description-text", this) rather odd. $("#description-text") should suffice, provided have 1 element id in code. if not, well, problem.

ruby on rails - Calculating difference in time between two Time objects -

let's create 2 time objects user model: created = u.created_at updated = u.updated_at how calculate difference in terms of hours between 2 time objects? hours = created - updated i'd wrap in method , extend time class. find hard believe i'd need extend it, can't seem find native method handles calculating elapsed time using different time units. this should work: hours = ((created - updated) / 1.hour).round related question: rails time difference in hours

Text editor for web development CSS, HTML, JavaScript, PHP on windows 7? -

i'm looking free text editor use web development on windows 7 format my: xhtml css javascript php i simple application without lots of confusing buttons auto complete xhtml tags, , recognize css attributes , attribute values if possible. intype ==> http://intype.info/home/index.php sublimetext ==> http://www.sublimetext.com/ nice

msbuild: "compile" context menu item for Custom Build Action in Visual Studio 2010 (on C++ project) -

i've added new build target c++ visual studio project (vcxproj). target runs custom tool when project built. tool processes specific files on solution according contenttype , itemtype specified. works project actions such "build" , "clean". now support action equivalent "compile", i.e. right click on file in solution explorer , select process specific file custom tool (the same way "compile" runs "cl" "c/c++ code" file types). i know add visual studio macro this. not solution me because it's harder deploy many users. better solution customize vcxproj (or files imported it). wonder if it's possible add "compile" action in menu (or change "compile" behavior file types other "c/c++ code") through msbuild targets scripts or propertypageschema. update: i've started a discussion on msdn forum. got answers microsoft moderator helped clearing things, problem still unsolved. ...

How to find mobile OS name and OS version using Java-ME? -

i need find mobile os name , os version programmatically: symbian s40 3rd edition or 5th edition . how achieve in j2me? system.getproperty("microedition.platform"); return nokia6310i/4.42. see http://www.developer.nokia.com/community/discussion/showthread.php?86604-j2me-system-properties http://developers.sun.com/mobility/midp/questions/properties/ i not sure need can offer you.

c++ cli - How to push data from unmanaged to managed code? -

i using c++/cli wrapper access purely c++ library (-> unmanaged) c# framework (-> managed). want build in mechanism enables c++ library push information status towards framework. in understanding means have call @ least managed function unmanaged code @ point. possible , how can achieve this? many help! best regards, jakob use delegate let unmanaged code call managed method. marshal::getfunctionpointerfordelegate() creates stub takes care of transition, calling instance method supported. can cast returned pointer function pointer usable unmanaged code. you'll find full code sample in this answer .

asp.net - Failed to load source for: /Telerik.Web.UI.WebResource.axd -

hi have used telerik controls in project. used "telerik:radscheduler" " " stylesheet manager. controls works fine on local machine when deployed test server following error: "the css stylesheet, failed load source for: /dotnet/telerik.web.ui.webresource.axd?... " the css stylesheet source link href="/dotnet/telerik.web.ui.webresource.axd?compress=1&_tsm_combinedscripts_=%3b%3btelerik.web.ui%2c+version%3d2008.3.1016.20%2c+culture%3dneutral%2c+publickeytoken%3d121fae78165ba3d4%3aen%3aeac793b3-98e6-41a6-90b1-e029d0d02234%3a348638f9%3ae081ff96%3a2b273692%3a2cfb35c4%3a950fbd9a%3ade780ebc%3ab10231fb" see full tag above stylesheet link * failed load source for: /dotnet/telerik.web.ui.webresource.axd?compress=1&_tsm_combinedscripts_=%3b%3btelerik.web.ui%2c+version%3d2008.3.1016.20%2c+culture%3dneutral%2c+publickeytoken%3d121fae78165ba3d4%3aen%3aeac793b3-98e6-41a6-90b1-e029d0d02234%3a348638f9%3ae081ff96%3a2b273692%3a2cfb35c4%3a9...

How to validate an XML with an XSD using LINQ -

edit2: problem seems xsd. validates pretty every xml. can't post xsd on here though. why every xml valid xsd? edit: found similar excample in answer on here . same issue, finds no errors no matter xml , xsd compare. if use random diffrent xsd keeps saying fine. i found lot of examples doing without linq, how linq? i used google find example seems skip validation of time validating every xml. (it once went it, rejecting file haven't been able reproduce it.) are there better ways of doing or there reason why skip on validation? public string validatexml2(string xml, string xsd) { string message = string.empty; var ms = new memorystream(encoding.default.getbytes(xml)); // create xml document validate against. xdocument xdoc = xdocument.load(ms, loadoptions.preservewhitespace); xmlschemaset schema = new xmlschemaset(); bool iserror = new bool(); // defaults false. int counterror = 1; // counts num...

What will be the SQL query for this UPDATE operation? -

i using mysql 5.1. have database tables users , users_group_mapping. user table : userid, username, points 1 user1 10 2 user2 21 3 user3 7 4 user4 44 users_group_mapping table : userid, usergroupid 1 1 2 2 4 2 4 1 4 3 and in allocation process have allocate points corresponding groups users. test data : data : $dtarr = array( [1] => 40, [2] => 80, [3] => 100 ) in array $dtarr, key attribute 'usergroupdid' in users_group_mapping table , value attribute points updated in users table. e.g. if usergroupid = 2 , points given = 40 users_group_mapping table users in usergroup '2' - userids '2' & '4' - both users 40 points each. userid '4' 40 points allocated through usergroup '2' though user belongs usergoups '1' & '3' also. what sql update query operat...

.net - Random MSDTC exception with WCF over MSMQ -

we have service performing wcf calls on msmq using netmsmqbinding. unfortunately we're seeing random (every few days after thousands of calls) accessviolationexception coming out of msdtc service. error happening on physically-older xp production systems , can't re-create in dev. i've resorted imaging , running actual production instances in vms runs solid days. i've compared version numbers of every msmq , msdtc-related dlls can find , match. windows updates have been applied recently. wcf endpoints running single instancecontextmode , concurrencymode set single well. short of resolving issue, there anyway can catch/recover following error? is there way keep netmsmqbinding promoting transaction? we're not using other resources queues themselves. the process terminated due unhandled exception. exception info: system.accessviolationexception stack: @ system.transactions.oletx.idtcproxyshimfactory.begintransaction(uint32, system.transactions.olet...

Android trying to use a recycled bitmap, not in my code -

i stacktrace market developer console every once in while; can't find way repro error. it's happening while displaying splashscreen imageview app first loading, stacktrace doesn't have of code. don't think activity has reached oncreate , though it's hard tell without log. indeed, never use bitmap anywhere in code; reference image in layout.xml. <imageview android:id="@+id/splashscreen" android:layout_height="fill_parent" android:layout_width="fill_parent" android:src="@drawable/splashscreen" android:scaletype="fitxy" /> the thing imageview set visibility gone when i'm finished starting. is there can this? java.lang.runtimeexception: canvas: trying use recycled bitmap android.graphics.bitmap@4721ec18 @ android.graphics.canvas.throwifrecycled(canvas.java:955) @ android.graphics.canvas.drawbitmap(canvas.java:1044) @ android.graphics.drawable.bitmapdrawable.draw(bitmapdrawable.java:323) @...

java - Writer or OutputStream? -

i'm designing library class should have ability able convert internals text. class shall use: outputstream or writer ? , key difference between them (in case)? public interface memento { void save(outputstream stream); void save(writer writer); } which one? an outputstream byte-oriented stream. text write has encoded bytes using encoding (most commonly iso-8859-1 or utf-8). writer character-oriented stream may or may not internally encode characters bytes, depending on writing to. edit if designing library, if provide outputstream -oriented interface text written, should provide client classes ability control encoding used.

c++ - STL iterators: Prefix increment faster? -

possible duplicates: preincrement faster postincrement in c++ - true? if yes, why it? is there performance difference between i++ , ++i in c++? i got told when using stl , it's iterators, should use ++iter instead of iter++ . i quote: because can faster, never slower is true? yes. true in general. postfix increment burdened task of preserving , returning old value of iterator. takes time , effort, makes slower. it true overloaded increment/decrement operators implement traditional pre/post semantics. this topic beaten death. search here on "prefix postfix" large number of more detailed explanations.

uitableview - Image caching in iOS -

if rowbackground = [[uiimageview alloc]initwithimage:[uiimage imagenamed:@"bottomcell2.png"] the image cached entire life cycle of app or reloaded , recached everytime execute instruction (in other views or part of app)? i in every tableview of app. efficient? thanks in advance! as reference of +imagenamed: : this method looks in system caches image object specified name , returns object if exists. if matching image object not in cache, method loads image data specified file, caches it, , returns resulting object. cache efficient, eats memory. if table view contains large amount of images, memory may burn up. may consider +imagewithcontentsoffile: or other similar methods load image.

arrays - Compare largest number among a list of XML input parse using Excel VBA -

set node = xmldoc.selectnodes("//attribute[@name='xship_location']") each n in node result = n.text logmsg = "xship_location: " & result call printlog(logmsg, logline) next n for every line in xml contains name=xship_location, value of attribute read. how can compare list of results read xml , pick highest number? example of result = 1, 2,1,3,5,4,1,2 i find largest number list of inputs read xml 5 in case using . can kind enough newbie? thanks why not add second variable capture maximum value, each iteration through loop, compare maximum result.... such result = n.text '->your code if result > max max = result logmsg = "xship_location: " & result '--> code note if n not number, throw error.

android - Caching images fetched from the internet? -

i want cache images fetch on internet. each time images swiped in gallery, wont fetched each time. if 1 tell me how code appreciated. if(build.version.sdk_int >= 11){ strictmode.threadpolicy policy = new strictmode.threadpolicy.builder().permitall().build(); strictmode.setthreadpolicy(policy); } my.setonclicklistener(new view.onclicklistener() { @override public void onclick(view v) { startactivity(n); } }); gamenews.setonclicklistener(new view.onclicklistener() { @override public void onclick(view v) { } }); //executing asynctask in background thread images. mytask mytask = new mytask(); mytask.execute(); } get image methods: //method images text documents updated every month. public void getimages() throws ioexception{ defaulthttpclient httpclient = new defaulthttpclient(); httpget httppost = new httpget("https://sites.google.com/site/theitrangers/images/webimages.txt"); httpresponse response; ...