text
stringlengths
0
30.5k
title
stringclasses
1 value
embeddings
listlengths
768
768
where you compare the first element that matches. I can't tell you which is more efficient. I've tested the code here using Marrowsoft Xselerator, my favorite xslt tool, although no longer available, afaik. The result I got is: ``` <html> <body> <h1>file1</h1> <p>desc1</p> <p>desc2</p> <h1>file2</h1> <p>desc1</p> </b...
[ 0.3741157054901123, 0.018423475325107574, 0.3334762156009674, -0.13388478755950928, -0.18372195959091187, 0.05933492258191109, -0.03136136755347252, -0.7723421454429626, -0.05106601119041443, -0.98893803358078, 0.33346500992774963, 0.5561420321464539, -0.18328194320201874, -0.2964226007461...
For testing purposes I want send mail to my localhost user account rather than my webserver. I am unsure how to do this using mail.app. Any help would be appreciated. If you don't specifically want to use Mail.app, you can send mail using the `mail` command. Open Terminal and: ``` mail -s "Testing" `whoami`@`hostname`...
[ 0.6331083178520203, 0.31884944438934326, 0.06328819692134857, 0.09207582473754883, -0.11647312343120575, 0.07489772886037827, 0.3861015737056732, -0.15399952232837677, 0.2426016479730606, -0.7327578067779541, 0.25560232996940613, 0.17284689843654633, -0.13762885332107544, 0.147162720561027...
file). The tables of interest would be `mailboxes` and `messages`. The text of the email is stored in individual files in the respective mailbox/folder directories. This would probably be the way to go, if you want to access email that has been fetched by Mail.app (in realtime). Yet another option would be to export y...
[ 0.2823736071586609, 0.09919502586126328, 0.46139460802078247, 0.1185154914855957, 0.03411160036921501, 0.11572901159524918, -0.05015428736805916, 0.10971089452505112, -0.4456699788570404, -0.7214312553405762, -0.4284507632255554, 0.32451650500297546, -0.31875282526016235, 0.025047497823834...
I'm writing a Firefox extension that needs to know what the username of the currently logged in user is in Windows, Mac, or Linux. So if I'm logged into my machine as "brh", it'll return "brh". Any idea how to do that from extension JavaScript? Firefox extensions play by different rules to normal JavaScript running in ...
[ 0.2866288423538208, 0.3054928183555603, 0.594645082950592, -0.2931436002254486, 0.2535149157047272, -0.22611048817634583, 0.30517444014549255, -0.29345613718032837, -0.4239833950996399, -0.6654011607170105, -0.263812780380249, 0.7049956321716309, -0.4573023021221161, -0.1003386601805687, ...
to create an [NsIFile](https://developer.mozilla.org/en/NsIFile) in `~` then look at its `.path`; I'm not sure if shell expressions are honoured there, though...
[ 0.29472729563713074, 0.04615480825304985, 0.03252995014190674, -0.11810711026191711, -0.008198323659598827, -0.3148830533027649, 0.38640421628952026, 0.2082999050617218, -0.18565993010997772, -0.6619001626968384, -0.21529585123062134, 0.36900046467781067, -0.24989765882492065, -0.069673672...
``` .section .data astring: .asciz "11010101" format: .asciz "%d\n" .section .text .globl _start _start: xorl %ecx, %ecx movb astring(%ecx,1), %al movzbl %al, %eax pushl %eax pushl $format call printf addl $8, %esp movl $1, %eax movl $0, %ebx int $0x80 ``` Suppose I wanna break the .asciz string 1101011 and ge...
[ 0.1101287379860878, 0.407171368598938, 0.6922394037246704, -0.3636130690574646, 0.14475388824939728, 0.24554051458835602, 0.2489040344953537, -0.35927262902259827, -0.13250015676021576, -0.45739880204200745, -0.41442111134529114, 0.5867504477500916, -0.3685513734817505, -0.0118802199140191...
I'm embedding a Flash video into an HTML and would like the user to have to click it to begin playing. According to the [Adobe `<object>` / `<embed>` element documentation](http://kb.adobe.com/selfservice/viewContent.do?externalId=tn_12701), there are variety of methods to do this: 1) Add a Flash parameter inside the ...
[ 0.5038599967956543, 0.20276296138763428, 0.3839474022388458, -0.0905529037117958, -0.05613098293542862, -0.19298876821994781, 0.026297569274902344, -0.595670223236084, -0.19665507972240448, -0.5576469302177429, 0.15517130494117737, 0.974819540977478, -0.15541529655456543, -0.12534993886947...
<embed src="untitled_skin.swf" width="590" height="475" type="application/x-shockwave-flash" play="false" flashvars="autoplay=false&play=false" menu="false"></embed> </object> ``` Anyone have any ideas? What am I doing wrong? A couple of wires are crossed here. The various `autoplay` settings that you're working with...
[ 0.6565199494361877, 0.11403359472751617, 0.48416027426719666, -0.04270942509174347, -0.08364325761795044, 0.008740320801734924, 0.15133650600910187, -0.26931169629096985, -0.4069705009460449, -0.5157513618469238, 0.19057132303714752, 0.5097828507423401, -0.11566857993602753, 0.096620388329...
component, which contains ActionScript that controls how the video behaves. To get that player component to start of paused, you'll have to change the settings of the component itself. Without knowing more about where the content came from it's hard to say more, but when one publishes from Flash, video player componen...
[ 0.3069380521774292, -0.3342406153678894, 0.5828778743743896, 0.22451205551624298, -0.33742836117744446, -0.19477175176143646, -0.02016208879649639, -0.20332396030426025, -0.14980348944664001, -0.04802963510155678, 0.06717602908611298, 0.7645055055618286, -0.33859312534332275, 0.13009501993...
from the level of the HTML page. (Unless you were talking to the SWF from JavaScript, and for that to work the video component would have to be designed to allow it.)
[ 0.34295400977134705, -0.3686971366405487, 0.5663113594055176, -0.000782527553383261, -0.2854015529155731, -0.3722984194755554, 0.19383051991462708, -0.11808791011571884, -0.4035615026950836, -0.45601242780685425, -0.5038670897483826, 0.5522319078445435, -0.17593269050121307, -0.03763574734...
I have just built up my first SVN server, along with the mod\_dav\_svn module for Apache so that I have a rudimentary web view into the repository. There appear to be lots of alternate/additional packages to make the web view more full-featured, along the lines of what you would see at Launchpad or Sourceforge. What'...
[ 0.4391193389892578, -0.037311531603336334, 0.4251810610294342, -0.041007593274116516, -0.3875766396522522, -0.341325044631958, 0.09930577874183655, 0.17539016902446747, -0.2875276207923889, -0.5697994828224182, 0.17883515357971191, 0.6289333701133728, 0.009264782071113586, 0.01253017224371...
I have a hibernate mapping as follows: ``` <hibernate-mapping> <class name="kochman.elie.data.types.InvoiceTVO" table="INVOICE"> <id name="id" column="ID"> <generator class="increment"/> </id> <property name="date" column="INVOICE_DATE"/> <property name="customerId" colu...
[ -0.05960189178586006, 0.12052135169506073, 0.6988451480865479, -0.2065182328224182, 0.026333363726735115, 0.09573808312416077, 0.003976392559707165, -0.3465839624404907, 0.40291929244995117, -0.77186518907547, -0.18278740346431732, 0.08655394613742828, -0.03095841221511364, 0.3429208397865...
<property name="totalFee" column="TOTAL_FEE"/> </class> </hibernate-mapping> ``` where InvoiceTVO has variables defined as: ``` private int id; private Date date; private int customerId; private int schoolId; private float bookFee; private float adminFee; private float totalFee; ``` When I do an insert on ...
[ 0.12153398245573044, 0.11817343533039093, 0.5045171976089478, -0.09334839880466461, -0.028865987434983253, 0.1610555648803711, 0.326765239238739, -0.47404488921165466, -0.05208166688680649, -0.2194056659936905, -0.2573423385620117, 0.6400793790817261, -0.0724264606833458, 0.335885316133499...
adminFee to double, and that didn't work either. The problem is, Hibernate did actually perform the insert properly, and future select statements work to return the current set of values, but this error prevents me from doing further processing on this invoice. The fields bookFee, adminFee, and totalFee are all suppos...
[ 0.30757275223731995, -0.062602199614048, 0.2778184711933136, 0.12097833305597305, -0.2418244332075119, 0.21530339121818542, -0.06990107148885727, -0.053269196301698685, 0.0054910313338041306, -0.0616195909678936, 0.1854390949010849, 0.5146865844726562, -0.03310356289148331, 0.0598201453685...
I have a site in rails and want to have site-wide settings. One part of my app can notify the admin by SMS if a specific event happens. This is an example of a feature that I want configurable via the site-wide settings. So I was thinking I should have a Setting model or something. It needs to be a model because I wan...
[ 0.41346582770347595, 0.10834618657827377, 0.1679992973804474, -0.03621980547904968, 0.020979272201657295, -0.08164912462234497, 0.5764526128768921, 0.14225390553474426, -0.2733421325683594, -0.7966419458389282, 0.08828473091125488, 0.48165619373321533, -0.2778627276420593, -0.1210428476333...
only prevents new object to be created right? Would I still need to create getter and setter methods for each attribute like so: ``` def self.attribute=(param) Model.first.attribute = param end def self.attribute Model.first.attribute end ``` Is it perhaps not best-practice to use Model.attribute directly but ...
[ 0.25868964195251465, 0.30373266339302063, 0.17052796483039856, -0.08606680482625961, 0.01655903086066246, -0.31939825415611267, 0.34537702798843384, -0.38955357670783997, -0.308239221572876, -0.5268471240997314, -0.010579009540379047, 0.657984733581543, -0.3782079517841339, 0.1699654310941...
initializer file that loads the settings into a constant. You won't have nearly as many of the unnecessary moving parts. There is no reason that data couldn't just sit in memory and save you a ton of complexity. Constants are available everywhere, and they don't need to be initialized or instantiated. If its absolutel...
[ 0.016140593215823174, -0.36481720209121704, -0.1281752735376358, 0.19972363114356995, 0.03792604058980942, 0.0806269645690918, 0.2875206172466278, -0.05078953132033348, -0.11698312312364578, -0.6974396705627441, 0.12195223569869995, 0.543834924697876, -0.2658785283565521, 0.141728654503822...
Hi I'm looking for some help in mapping the following tables to a hibernate mapping file: [schema image http://barry-jones.com/temp/sch2.jpg](http://barry-jones.com/temp/sch2.jpg) I'm trying to fill the localCalandarGroups List with related localCalendarGroups when loading my userVOs. I'm using a intermediary table(us...
[ 0.033162131905555725, -0.03753560036420822, 0.7913429737091064, -0.06231928989291191, -0.15159574151039124, 0.13903217017650604, 0.25814229249954224, -0.08647676557302475, -0.05516920983791351, -0.5498228073120117, -0.06920212507247925, 0.2725878059864044, -0.3129773437976837, 0.1107700765...
} public virtual List<LocalCalendarGroupVO> localCalendarGroups { get; set; } } public class LocalCalendarGroupVO { public virtual int id { get; set; } public virtual string name { get; set; } } ``` This is my mapping file thus far. How can I make NHibernate aware of the intermediary table? ``` <class...
[ -0.3254505395889282, -0.12897837162017822, 0.3532763123512268, 0.10701633244752884, -0.07838568091392517, -0.2176690399646759, 0.10520542412996292, 0.10526957362890244, -0.29520997405052185, -1.1083803176879883, -0.08364877104759216, 0.718698263168335, -0.3250592350959778, 0.18337392807006...
the collection. And here's the mapping file for the UserVO class: ``` <class name="UserVO" table="tb_users"> <id name="id" column="id"> <generator class="native" /> </id> <property name="name" /> <property name="pass" /> <property name="level" /> <property name="email" /> <bag name...
[ -0.01133873499929905, -0.15826177597045898, 0.4705725312232971, 0.2778724133968353, 0.21600015461444855, -0.005862100515514612, -0.47481006383895874, -0.37549611926078796, -0.34632280468940735, -0.7061833143234253, -0.20506331324577332, 0.5397019982337952, -0.20544637739658356, 0.128648981...
int id { get; set; } public virtual string name { get; set; } public virtual string pass { get; set; } public virtual string email { get; set; } public virtual string level { get; set; } public virtual IList<LocalCalendarGroupVO> localCalendarGroups { get; set; } } ```
[ 0.1303749680519104, -0.12756527960300446, 0.35512763261795044, 0.0984051525592804, 0.0645274668931961, -0.10916457325220108, 0.20248723030090332, 0.25263291597366333, 0.010541817173361778, -0.7647801637649536, -0.25941750407218933, 0.5825458765029907, -0.23128065466880798, 0.17827379703521...
When a user clicks on an image on a web page, I'd like to trigger the browser's Save Image dialog and to let the user save the image on their hard drive. Is there a cross-browser way to do this with jQuery/Javascript? Not precisely, but you can do it by hyperlinking to the img file and setting the content-type and cont...
[ 0.35856693983078003, -0.03365757688879967, 0.3016573488712311, -0.013035262934863567, -0.04145907238125801, -0.07263648509979248, 0.17985059320926666, 0.32135269045829773, -0.24335645139217377, -0.7829990983009338, -0.14605481922626495, 0.5850269198417664, -0.2796204686164856, 0.1593627482...
I have some rails models which don't need any persistence, however I'd like rails to think the model actually has attributes x, y, z so when calling methods like to\_json in the controller I get them included for free. For example, ``` class ModelWithoutTableColumns << ActiveRecord::Base def x return "Custom stuf...
[ 0.031732186675071716, 0.04223376139998436, -0.2733137011528015, -0.023938367143273354, -0.06659066677093506, 0.16501493752002716, 0.2578267455101013, -0.07456836849451065, -0.1751934438943863, -0.6129739284515381, 0.021862169727683067, 0.3499997854232788, -0.47766637802124023, -0.003608459...
I'm updating the `src` attribute of an `<img>` tag in javascript. After I've done this, I need to get the new height of its parent `<div>` so that I can update the size of other elements on the page. If I retrieve the parent's `offsetHeight` property directly after updating the image's `src`, however, I get the height ...
[ 0.38587984442710876, 0.09060635417699814, 0.8562920093536377, -0.4032426178455353, -0.08006862550973892, -0.008200856857001781, 0.1500777155160904, -0.7460370063781738, -0.23918597400188446, -0.5254129767417908, -0.40146106481552124, 0.5107523202896118, -0.2801149785518646, 0.0803042873740...
// here I need to re-render the page alert(document.getElementById("parent").offsetHeight); // ^ alerts the height of a.jpg, not b.jpg (unless this is the second click) } </script> </head> <body onclick="changeImage()"> <div id="parent"> <img id="image" src="a.jpg" /> </div> </body> </html> ...
[ 0.2947995066642761, 0.08312142640352249, 0.6282458305358887, -0.14623698592185974, -0.17339453101158142, 0.151448056101799, 0.05855046957731247, -0.46425560116767883, -0.22069843113422394, -0.5052647590637207, -0.07921823859214783, 0.40445536375045776, 0.025814427062869072, -0.076339982450...
notified when it's finished loading and rendering.
[ 0.2869710922241211, 0.3097246587276459, 0.5783762335777283, -0.09795764088630676, 0.2619231343269348, -0.21781274676322937, -0.13942503929138184, 0.5224136710166931, -0.13766595721244812, -0.5992969274520874, -0.46699875593185425, 0.18638235330581665, 0.22197458148002625, -0.05823653191328...
How can I grab something like ^MM (CTRL + M + M) in .NET, using C#? Here's a way to do it: ``` bool mSeenCtrlM; protected override bool ProcessCmdKey(ref Message msg, Keys keyData) { if (keyData == (Keys.Control | Keys.M)) { mSeenCtrlM = !mSeenCtrlM; if (!mSeenCtrlM) { MessageBox.Show("yada"); } ...
[ -0.1764906644821167, -0.20415478944778442, 0.7008371949195862, -0.17629936337471008, 0.22568535804748535, -0.036733511835336685, 0.464892715215683, -0.33519548177719116, -0.2519463002681732, -0.6406386494636536, -0.2988477051258087, 0.46669816970825195, -0.2945455014705658, 0.3565444946289...
I can see in the postgresql logs that certain simple queries (no joins and using only match conditions that use indexes) take anywhere from 1 to 3 seconds to execute. I log queries that take longer than a second to execute thus there are similar queries which execute under a second which don't get reported. When I try...
[ 0.3579011857509613, 0.07432477921247482, 0.06453438103199005, 0.12316449731588364, 0.06429924815893173, -0.02387414686381817, 0.4231235980987549, -0.10588388890028, -0.11964638531208038, -0.8091202974319458, 0.12325655668973923, 0.37467899918556213, -0.04362158104777336, 0.2531148493289947...
entry: Dec 30 10:14:57 db01 postgres[7400]: [20-1] LOG: duration: 3857.322 ms statement: SELECT \* FROM "responses" WHERE ("responses".contest\_id = 17469) AND (user\_id is not Dec 30 10:14:57 db01 postgres[7400]: [20-2] null) ORDER BY updated\_on desc LIMIT 5 contest\_id and user\_id is indexed. updated\_on is not in...
[ -0.2853972017765045, 0.09815675020217896, 0.5622040033340454, 0.06748335063457489, -0.10462356358766556, 0.333381325006485, 0.29367610812187195, -0.509016215801239, -0.26468202471733093, -0.5399923920631409, -0.37947210669517517, 0.546673059463501, -0.11711381375789642, 0.29846853017807007...
I seem to have a problem with this SQL query: ``` SELECT * FROM appts WHERE timeStart >='$timeStart' AND timeEnd <='$timeEnd' AND dayappt='$boatdate' ``` The time is formatted as military time. The logistics is that a boat rental can be reserved at 7am til 1pm or 9am til 1pm or 9am til 5pm. If there is an appt wi...
[ 0.2473798543214798, 0.15453441441059113, 0.7335667014122009, -0.08181367069482803, 0.1427416354417801, 0.30469706654548645, 0.3194200396537781, -0.2429780811071396, -0.6921705603599548, -0.6909340023994446, -0.1792893260717392, 0.5829627513885498, 0.004058565013110638, 0.12586714327335358,...
should with the 7am to 1pm. How do I make a SQL statement that includes the whole range from timeStart to timeEnd including those that overlap? The correct check would look like this: ``` SELECT * FROM appts WHERE timeStart <='$timeEnd' AND timeEnd >='$timeStart' AND dayappt='$boatdate' ``` Other good explanation...
[ 0.6496896743774414, -0.0033873552456498146, 0.7508355975151062, -0.2320624738931656, 0.16682837903499603, -0.036737456917762756, 0.13769368827342987, -0.29496636986732483, -0.18488511443138123, -0.7137974500656128, 0.2628111243247986, 0.573077380657196, -0.11939924210309982, 0.115077026188...
when do two time periods not overlap which for some reason is easier for me. Say the time period I am checking for is today, I want to find any time period that does not overlap today. There are really only two scenarios for that, either the time period starts after today (PeriodStart > EndOfToday) or the time period ...
[ 0.20404425263404846, -0.18825241923332214, 0.6651279926300049, -0.05382564291357994, 0.5115896463394165, -0.07043382525444031, -0.01840517483651638, -0.053776491433382034, -0.6223183274269104, -0.6161797046661377, 0.2025180459022522, 0.206332266330719, -0.03800441697239876, 0.1551430374383...
AND (PeriodEnd >= StartOfToday) -Shane
[ -0.08450894057750702, 0.11335337162017822, 0.12329388409852982, -0.01390551496297121, 0.11476458609104156, 0.03398986533284187, 0.40658363699913025, -0.12683050334453583, -0.09862416237592697, 0.04611106961965561, -0.5269874930381775, 0.22706426680088043, 0.28116574883461, 0.12650164961814...
I have a Grails application with a JSP page (I'm porting a legacy JSP application). For some reason, the page renders completely blank. Looking at the HTTP headers I see it's 200 with a content length of 0. ``` HTTP/1.1 200 OK Content-Language: en-US Content-Type: text/html; charset=iso-8859-1 Expires: Thu, 01 Jan 197...
[ -0.26557818055152893, 0.4657694399356842, 0.5716743469238281, -0.19180402159690857, -0.300569087266922, -0.07582755386829376, 0.5249260067939758, -0.12444627285003662, -0.12417501211166382, -0.20984481275081635, 0.04971960932016373, 0.47864317893981934, -0.295230895280838, 0.16058593988418...
The problem is related to the JSP `<jsp:include/>` include tag. If I remove all JSP includes then Grails will render. Is Grails compatible with JSP? Since JSP functionality is provided by the web application (Jetty, Tomcat) I would think yes. Edit: This occurs with Grails 1.0.4 and 1.1 beta 2 (1.1 claims to have added...
[ 0.06827248632907867, 0.16691307723522186, 0.2841414511203766, -0.14997193217277527, 0.12094563990831375, 0.011356638744473457, 0.5549297332763672, -0.14602620899677277, -0.18190810084342957, -0.4187687337398529, -0.15429078042507172, 0.8276506066322327, -0.5156001448631287, -0.208058804273...
each possible overlap, considering two time periods, they are trying to think of each combination of start and end that can make an appointment overlap. I think about it as when do two time periods not overlap which for some reason is easier for me. Say the time period I am checking for is today, I want to find any ti...
[ 0.28862857818603516, -0.0759470984339714, 0.7930780053138733, 0.01362949050962925, 0.4363609254360199, 0.020176278427243233, 0.12937921285629272, -0.04304329678416252, -0.4381035268306732, -0.7417138814926147, 0.3318823277950287, 0.38258790969848633, 0.032116957008838654, 0.204391032457351...
not overlapping: (PeriodStart > EndOfToday) OR (PeriodEnd < StartOfToday) A quick flip around and you have a simple test for overlap: (PeriodStart <= EndOfToday) AND (PeriodEnd >= StartOfToday) -Shane
[ 0.01760733872652054, 0.029479367658495903, 0.4638894498348236, 0.02748582512140274, 0.44376564025878906, -0.23798729479312897, 0.0977398008108139, -0.20830011367797852, -0.4357922673225403, 0.06933014839887619, -0.22959893941879272, 0.3664417564868927, 0.10075872391462326, -0.1762312501668...
I've been using ReSharper for the past months and, advertising aside, I can't see myself coding without it. Since I love living on the bleeding "What the hell just went wrong" edge, I decided to try my luck w/ the latest ReSharper 4.5 nightly builds. It's all nice. However, I've noticed that the using directives group...
[ 0.5575228333473206, -0.22826428711414337, 0.5535681247711182, -0.0269746333360672, -0.0710991695523262, -0.10054542869329453, 0.11212849617004395, -0.15433689951896667, -0.25520068407058716, -0.7779300212860107, -0.0740908831357956, 0.5887781381607056, -0.15329384803771973, 0.5028008818626...
reading Scott Hanselman's take on this @ <http://www.hanselman.com/blog/BackToBasicsDoNamespaceUsingDirectivesAffectAssemblyLoading.aspx>) Thanks; As Scott proceeds to discover in his post, there is **no runtime difference** between these two cases. Therefore, it does **not** serve the purpose of lazy loading referenc...
[ 0.3644164502620697, 0.30877748131752014, 0.003048836952075362, 0.16242258250713348, 0.3663250207901001, -0.27430832386016846, 0.37598755955696106, 0.030481655150651932, 0.057688601315021515, -0.3048427700996399, 0.08770483732223511, 0.41919952630996704, -0.31412968039512634, -0.16371868550...
an alias for a type *inside a namespace*, and you have another type *with the same name* defined in the namespace. But that's no runtime difference of course. Finally, I believe that MS coding guidelines say to do it as ReSharper 4.5 does. But it's silly to blindly follow this rule "because MS says so", since 1. It h...
[ 0.5053966045379639, -0.33607640862464905, -0.05373051390051842, 0.16609130799770355, 0.13082687556743622, -0.4518980383872986, 0.7019361853599548, 0.06041643023490906, 0.037158556282520294, -0.7222698926925659, -0.0054949382320046425, 0.5342299342155457, -0.19510339200496674, -0.2252742201...
For a scripting utility I need to be able to record a series of keyboard and mouse events that occur when an application has focus. The second part is being able to later send those events to the active window. I do not need to worry about menus or tracking the identifier of which window receives input. I know how to...
[ 0.42570480704307556, -0.1350582391023636, 0.1153741404414177, 0.050366535782814026, -0.19046469032764435, -0.4145437180995941, 0.4402756094932556, 0.2626825273036957, -0.12331754714250565, -0.7720935344696045, -0.05082090198993683, 0.842725932598114, -0.2556251883506775, -0.152880311012268...
security built into OSX. Here is a code snippit I am using in one of my applications to do this: ``` //this method calls a carbon method to attach a global event handler - (void)attachEventHandlers { //create our event type spec for the keyup EventTypeSpec eventType; eventType.eventClass = kEventClassKeyb...
[ -0.1202622652053833, -0.036057982593774796, 0.24561990797519684, -0.09788612276315689, 0.25654083490371704, -0.25492244958877563, 0.2876996397972107, -0.3116927444934845, 0.10407088696956635, -0.4178876280784607, -0.3572657108306885, 0.8641949892044067, -0.34586089849472046, -0.20361319184...
//error checking if( err ) { //TODO: need an alert sheet here NSLog(@"Error registering keyboard handler...%d", err); } //create our event type spec for the mouse events EventTypeSpec eventTypeM; eventTypeM.eventClass = kEventClassMouse; eventTypeM.eventKind = kEventMouseUp;...
[ -0.26051750779151917, -0.21959413588047028, 0.571520984172821, -0.03539755195379257, 0.5456110239028931, -0.04129783436655998, 0.38163307309150696, -0.18783895671367645, -0.027004456147551537, -0.5643607974052429, -0.307191401720047, 0.870239794254303, -0.3284689486026764, -0.2263758629560...
errM = InstallEventHandler(GetEventMonitorTarget(), handlerFunctionM, 1, &eventTypeM, self, NULL); //error checking if( errM ) { //TODO: need an alert sheet here NSLog(@"Error registering mouse handler...%d", err); } } ``` Here is an example of the callback method i am using: ``` OSS...
[ -0.5407983660697937, -0.1515505611896515, 0.5432142019271851, -0.4222649335861206, 0.24421820044517517, -0.02067909948527813, 0.6294565796852112, -0.39140066504478455, -0.04217589646577835, -0.5849125385284424, -0.3928440511226654, 1.0351239442825317, -0.2232976108789444, -0.22983597218990...
event? if( type == NSKeyUp) { //which key is it? switch( [anEvent keyCode] ) { case NUMERIC_KEYPAD_PLUS: //this is the character we are using for our toggle //call the handler function
[ 0.011896335519850254, -0.7015911936759949, 0.23650187253952026, -0.23725102841854095, 0.19119586050510406, -0.026629365980625153, -0.04633779078722, -0.09147270768880844, -0.10885536670684814, -0.23797082901000977, 0.03958040103316307, 0.5765208601951599, -0.21306771039962769, -0.133405193...
[application toggleKeyPressed]; break; //Comment this line back in to figure out the keykode for a particular character default:
[ -0.1816253960132599, -0.16711552441120148, 0.19308854639530182, -0.08521518111228943, 0.31781724095344543, -0.035090263932943344, 0.41682448983192444, 0.10032500326633453, -0.241378054022789, -0.19007521867752075, -0.38591134548187256, 0.5242263078689575, -0.2697087228298187, 0.26878470182...
NSLog(@"Keypressed: %d, **%@**", [anEvent keyCode], [anEvent characters]); break; } } return CallNextEventHandler(nextHandler, theEvent); } ```
[ -0.3816365599632263, -0.11854112148284912, 0.19074004888534546, -0.2776212990283966, 0.31577521562576294, -0.07132070511579514, 0.5027497410774231, -0.08325642347335815, -0.21348752081394196, -0.661767303943634, -0.2917972505092621, 0.6484650373458862, -0.17679552733898163, 0.1311295032501...
Recently I heard that there are 9 rules for OOP(Java). I know only four as Abstraction, Polymorphism, Inheritance and Encapsulation. Are there any more rules for OOP? Seems like what you're looking for are the [Principles of Object-Oriented Design](http://www.butunclebob.com/ArticleS.UncleBob.PrinciplesOfOod). Summar...
[ 0.2800543010234833, 0.2989899814128876, 0.09029604494571686, 0.11717213690280914, 0.2287389189004898, 0.37528830766677856, -0.05614107847213745, -0.07359707355499268, -0.44944363832473755, -0.3813738524913788, -0.04731256887316704, 0.48000964522361755, -0.25389084219932556, -0.214836552739...
of long-standing principles of software engineering. **SRP The Single Responsibility Principle** A class should have only one reason to change. **OCP The Open-Closed Principle** Software entities (classes, packages, methods, etc.) should be open for extension, but closed for modification. **LSP The Liskov Substition...
[ 0.06156850606203079, 0.0975366085767746, 0.30289164185523987, 0.11067178845405579, -0.22097676992416382, -0.1957463026046753, 0.12685629725456238, -0.287474662065506, -0.2663259208202362, -0.4284164309501648, -0.566079318523407, 0.42398375272750854, -0.43025657534599304, 0.1488699018955230...
The Common Closure Principle** The classes in a package should be closed together against the same kinds of changes. A change that affects a closed package affects all the classes in that package and no other packages. **CRP The Common Reuse Principle** The classes in a package are reused together. If you reuse one of...
[ 0.27859243750572205, 0.06793523579835892, 0.2576713263988495, 0.16653726994991302, -0.15294452011585236, -0.3360501527786255, 0.06093089282512665, -0.3835288882255554, 0.0012148239184170961, -0.5268527865409851, -0.4216594696044922, 0.5901052355766296, -0.5011076331138611, 0.02348665706813...
Can you suggest some of the best XML Parser for C ? Two of the most widely used parsers are [Expat](http://www.jclark.com/xml/expat.html) and [libxml](http://www.xmlsoft.org/). If you are okay with using C++, there's [Xerces-C++](http://xerces.apache.org/xerces-c/) too.
[ 0.22900216281414032, 0.08320163190364838, 0.17444589734077454, 0.031278859823942184, -0.2690843939781189, -0.08746956288814545, -0.2846970856189728, 0.27237677574157715, -0.2150816023349762, -0.3405255973339081, -0.06713014096021652, 0.5145149230957031, -0.3035906255245209, -0.217289179563...
It seems that ``` if (x=y) { .... } ``` instead of ``` if (x==y) { ... } ``` is a root of many evils. Why don't *all* compilers *mark it as error* instead of a configurable warning? I'm interested in finding out cases where the construct `if (x=y)` is useful. Most of the time, compilers try very hard to remai...
[ 0.5831977128982544, 0.6143701672554016, -0.15489333868026733, -0.04432966187596321, -0.11253608018159866, -0.21458333730697632, 0.7313780784606934, 0.13509391248226166, -0.10684165358543396, -0.3626171946525574, 0.05417836084961891, 0.5282458662986755, -0.38489875197410583, 0.4448285102844...
pretty much stuck with at the moment, but there are ways to circumvent and reduce the dangers of it. Example: ``` void *ptr = calloc(1, sizeof(array)); if (NULL = ptr) { // Some error } ``` This causes a compilation error.
[ 0.32420334219932556, -0.03872479870915413, -0.03666070103645325, -0.2228982299566269, 0.12131191045045853, -0.42465174198150635, 0.41739970445632935, -0.14782218635082245, -0.23653747141361237, -0.3344210088253021, -0.22368913888931274, 0.5091874599456787, -0.4562413692474365, 0.0849327892...
I have 3 buttons in a form. One of them is the submit button. How can I make it the default button to be clicked when I press the enter key. Is there a property for this? There is a property for the form: defaultbutton. ``` <form runat="server" defaultbutton="myButton"> ... </form> ``` It is first time implemented i...
[ -0.02655198611319065, -0.13759219646453857, 0.7995122075080872, -0.15394093096256256, -0.10649213939905167, 0.0018783556297421455, -0.04501529783010483, -0.4168878197669983, 0.0007569295703433454, -0.8955581188201904, 0.035745613276958466, 0.39674562215805054, -0.1882517784833908, -0.00820...
I'm looking for some input on how to implement custom eventhandling in jquery the best way. I know how to hook up events from the dom elements like 'click' etc, but I'm building a tiny javascript library/plugin to handle some preview functionality. I've got a script running to update some text in a dom element from a ...
[ 0.5179743766784668, -0.0866839811205864, 0.18803012371063232, 0.08632156252861023, -0.14882856607437134, -0.27829259634017944, 0.006102930288761854, -0.00003994276630692184, -0.273324579000473, -0.6253117918968201, 0.17635981738567352, 0.6936441659927368, -0.03051183372735977, -0.074980221...
I do this? Did I overlook some builtin functionality in jquery to raise/handle user events or do I need some jquery plugin to do it? What do you think is the best way/plugin to handle this? Take a look at this: (reprinted from the expired blog page <http://jamiethompson.co.uk/web/2008/06/17/publish-subscribe-with-jque...
[ 0.3339020907878876, 0.38464421033859253, 0.47783735394477844, 0.07574488967657089, -0.27004390954971313, -0.1255267709493637, 0.6176355481147766, -0.14969460666179657, -0.01061853114515543, -0.4583319127559662, 0.5793214440345764, 0.5192527770996094, -0.04175393655896187, -0.0493776910007,...
of a network detection object which will poll a URL at regular intervals. Should these HTTP requests fail we can assume that network connectivity has been lost, or the server is simply unreachable at the current time. ``` $.networkDetection = function(url,interval){ var url = url; var interval = interval; ...
[ -0.19760634005069733, -0.33542007207870483, 0.6331208944320679, 0.09433144330978394, 0.15795710682868958, -0.2972826063632965, 0.4908635914325714, -0.15550556778907776, -0.17821575701236725, -0.5391451120376587, -0.4730522036552429, 0.584858775138855, -0.5050353407859802, 0.211926162242889...
clearInterval(this.timer); }; this.setPollInterval= function(i) { interval = i; }; this.getOnlineStatus = function(){ return online; }; function poll() { $.ajax({ type: "POST", url: url, dataType: "text",
[ -0.1521020233631134, -0.3905662000179291, 0.6120182275772095, 0.03924306854605675, 0.11172797530889511, -0.08482971042394638, 0.35274460911750793, 0.12480872869491577, 0.001006238628178835, -0.6200116276741028, -0.3813627064228058, 0.42695069313049316, -0.23184025287628174, -0.056063350290...
error: function(){ online = false; $(document).trigger('status.networkDetection',[false]); }, success: function(){ online = true;
[ -0.09372071921825409, -0.1740649789571762, 0.30302175879478455, -0.03416343405842781, 0.3675917685031891, -0.0510186068713665, 0.6173039078712463, -0.022152623161673546, -0.16541285812854767, -0.43811824917793274, -0.31204310059547424, 0.8264524340629578, -0.3507625162601471, 0.00343475420...
$(document).trigger('status.networkDetection',[true]); } }); }; }; ``` You can view the demo here. Set your browser to work offline and see what happens…. no, it’s not very exciting. Trigger and Bind ---------------- What is exciting though (or at least what is exciting me) is the method by ...
[ 0.5672914981842041, -0.13924317061901093, 0.34408998489379883, 0.05150441825389862, 0.20808051526546478, -0.46019697189331055, 0.24410007894039154, 0.1877823770046234, -0.12275754660367966, -0.7189829349517822, -0.23048469424247742, 0.7889308333396912, -0.07859187573194504, -0.033449172973...
The network detection object publishes ’status ‘events to the document which actively listens for them and in turn publishes ‘notify’ events to all subscribers (more on those later). The reasoning behind this is that in a real world application there would probably be some more logic controlling when and how the ‘notif...
[ -0.03297583758831024, -0.2743496894836426, 0.6035992503166199, 0.17328551411628723, 0.033929333090782166, -0.33298683166503906, 0.29986387491226196, -0.1251181960105896, -0.33523792028427124, -0.551522970199585, -0.09938571602106094, 0.617877721786499, -0.49786704778671265, -0.092965759336...
connectivity could go here use google gears offline storage etc maybe trigger some other events */ }); ``` Because of jQuery’s DOM centric approach events are published to (triggered on) DOM elements. This can be the window or document object for general events or you can generate a jQuery object using a ...
[ 0.21269990503787994, -0.5266205668449402, 0.49194347858428955, 0.30238547921180725, 0.03924538940191269, -0.3984074890613556, 0.049173977226018906, 0.03979971259832382, -0.25857552886009216, -0.38666945695877075, -0.280903160572052, 0.5748831629753113, -0.228768453001976, 0.040727052837610...
there is only one in the demo) by triggering a notify event on **`$(“.subscriber.networkDetection”)`** The **`#notifier`** div which is part of the `.subscriber.networkDetection` group of subscribers then has an anonymous function bound to it, effectively acting as a listener. ``` $('#notifier').bind("notify.networkD...
[ -0.02055891789495945, -0.4024484157562256, 0.5944255590438843, 0.015371890738606453, 0.24739384651184082, -0.3009830713272095, 0.46588581800460815, -0.1534176915884018, -0.18807218968868256, -0.6453740000724792, -0.3360731601715088, 0.7016238570213318, -0.4098895788192749, -0.0261717364192...
.removeClass("offline") .text("ONLINE"); } }else{ if (!notifier.hasClass("offline")){ $(this) .addClass("offline") .removeClass("online")
[ -0.04987625405192375, -0.32987552881240845, 0.37991252541542053, -0.10511321574449539, 0.20164279639720917, -0.3380383849143982, 0.49715474247932434, 0.10983777791261673, -0.07755802571773529, -0.967552661895752, -0.5085124969482422, 0.4735260307788849, -0.39231547713279724, 0.167654857039...
.text("OFFLINE"); } }; }); ``` So, there you go. It’s all pretty verbose and my example isn’t at all exciting. It also doesn’t showcase anything interesting you could do with these methods, but if anyone’s at all interested to dig through the source feel free. All the code is inline in the head of the dem...
[ 0.37192991375923157, 0.24160084128379822, -0.08710353076457977, 0.3235088288784027, 0.2934936285018921, -0.5321218967437744, 0.1559770703315735, 0.4665173888206482, 0.14237652719020844, -0.5547759532928467, -0.13115307688713074, 0.6495733857154846, 0.10147877782583237, 0.060918718576431274...
After having solved the problem of getting the editor to launch when there's a merge conflict - [Mercurial: No editor appears when merge conflicts are detected](https://stackoverflow.com/questions/399606/mercurial-no-editor-appears-when-merge-conflicts-are-detected) I now have another problem, the editor now launches ...
[ -0.2514174282550812, 0.11193779110908508, 0.5342432260513306, 0.061039701104164124, -0.37322428822517395, -0.2145717591047287, 0.11540013551712036, 0.0344904400408268, -0.23163491487503052, -0.745247483253479, -0.11859386414289474, 0.5384436249732971, -0.27479732036590576, 0.09064330905675...
`require()` any files containing functions you need to test. You can then just test your function calls by typing them into the shell e.g. `var_dump(some_function(1, 2));`
[ 0.6025312542915344, -0.03371715918183327, -0.11339718848466873, -0.29801395535469055, 0.13125652074813843, -0.3910858631134033, 0.288982629776001, -0.4151037931442261, 0.2146718055009842, -0.34244078397750854, -0.3079119026660919, 0.8247939944267273, -0.43918177485466003, -0.16349162161350...
I'm writing a sparse matrix class in C++ in which every row and column are arrays of linked lists from a class I created (aptly named: LinkedList). I want to write a class that is a "smart" pointer to one cell in this matrix. In that class, let say `LIPointer`, I will implement a `++` operator function for moving in ...
[ 0.08359111100435257, 0.06566866487264633, 0.5528285503387451, 0.005054257344454527, 0.16596080362796783, 0.11294932663440704, -0.13927318155765533, -0.4899305999279022, -0.15332183241844177, -0.5580766201019287, 0.22198963165283203, 0.3107699453830719, -0.5797184705734253, -0.1860301941633...
the declarations: --- ``` class LinkedItem { private: int Column, Row; double Value; LinkedItem* Right; LinkedItem* Down; public: ... }; ``` --- ``` class SparseLinkedMatrix { private: //members int ColSize; int RowSize; LinkedItem ** Columns; LinkedItem ** Rows; public: //functio...
[ -0.0993972048163414, -0.03434527665376663, 0.9490804672241211, -0.014677918516099453, 0.3666830062866211, 0.06829584389925003, -0.10731364786624908, -0.5091619491577148, -0.12975284457206726, -0.4275508224964142, -0.359729140996933, 0.42416912317276, -0.5436162352561951, -0.090178087353706...
the arrays and the size of the matrix. The intended effect is that this would from the last cell in the linked list of the first row to the first cell in the second row. I have used [phpsh](http://www.phpsh.org/) in the past and found it very useful. Once you start it you will need to `chdir()` to where your files are ...
[ 0.40488606691360474, 0.062159765511751175, 0.047534000128507614, -0.35074466466903687, -0.006692605093121529, -0.052046071738004684, 0.011718741618096828, -0.3110203742980957, 0.09062480181455612, -0.37797045707702637, 0.002538103610277176, 0.6012518405914307, -0.2185337394475937, -0.01133...
E.g. if I set a timer to expire every day at midnight, what will happen if one "misfire" (does not trigger the callback because the server is down, for instance) ? I can't find that in the documentation. Is there a way to make this timer triggers the callback as soons as the server restart ? PS: I know about Quartz, ...
[ 0.046988680958747864, -0.11081696301698685, 0.4612697660923004, -0.1396906077861786, -0.16168572008609772, -0.3743954002857208, 0.5384595394134521, -0.1725555807352066, -0.4011012017726898, -0.4740493595600128, 0.11028644442558289, 0.4444010555744171, -0.2042003571987152, -0.05727381259202...
I just started reading Effective C++ today and got to the point where the author talks about the operator new. The book explains very well how you can catch (with various degrees of elegance) the std::bad\_alloc exception that the operator new can raise if you run out of memory. My question is: How often do you check...
[ -0.07706581056118011, 0.12677320837974548, -0.016011131927371025, -0.08198650926351547, -0.2658284306526184, -0.17269772291183472, 0.4546104371547699, -0.15270958840847015, -0.5520411133766174, -0.32461538910865784, -0.1775486171245575, 0.4678950607776642, -0.20904070138931274, -0.14674656...
answer is, "I have no idea. Maybe my caller knows." So I don't catch the exception. Let it bubble up to someone who knows better. When you catch an exception and let your function proceed running, you've said to your program, "Never mind. Everything's fine here." When you say that, by golly, everything had better be f...
[ 0.43026331067085266, 0.22207452356815338, 0.3726581931114197, 0.1397818922996521, 0.24994611740112305, -0.2635780870914459, 0.5583081841468811, 0.3560008704662323, -0.6019424200057983, -0.23721754550933838, -0.2745971977710724, 0.6050636768341064, -0.26278963685035706, 0.24115777015686035,...
still out of memory. Your handling of that exception should free some memory. Empty some caches, commit some things to disk, etc. But how many of the functions in your program do you really want to be responsible for reducing your program's memory usage? If you cannot solve the problem that triggered the exception, th...
[ 0.13926325738430023, 0.2320878654718399, -0.029240574687719345, 0.30619171261787415, 0.36771538853645325, 0.12156196683645248, 0.3304842412471771, -0.04015180841088295, -0.44970014691352844, -0.3361967206001282, -0.03918362408876419, 0.4738563001155853, -0.27184563875198364, 0.090048082172...
I am unable to create an empty solution in Visual Studio. The msdn documentation says this is possible but fails to mention how. (Where I have looked, anyway..) File --> New Project Under Projects Type, Select 'Other Project Types' --> Visual Studio Solutions You should see it on the right! ![Take a look here](https...
[ 0.1950405091047287, 0.21974921226501465, 0.23292803764343262, -0.24592596292495728, 0.10524070262908936, -0.25022485852241516, 0.38840991258621216, 0.07466746866703033, -0.458250492811203, -0.6659668684005737, -0.15162159502506256, 0.5128932595252991, -0.07709750533103943, 0.09674572944641...
While considering the JS framework for my next project, I can see the scale clearly tipping towards jQuery, however, Prototype is getting good reviews, too. The issue I am thinking of is how to **downscale these to have only the functionality I REALLY need.** The latest jQuery seems to be 55k compressed, for instance,...
[ 0.38932642340660095, 0.03650594502687454, 0.19871000945568085, 0.22310179471969604, -0.27861908078193665, -0.08627403527498245, 0.1488320380449295, 0.42053520679473877, -0.35355839133262634, -0.7549120187759399, 0.12681818008422852, 0.5717344284057617, 0.15686993300914764, -0.0916065201163...
since I need the cross-browser AJAX with timeouts, and the cross-browser cookie handling, but maybe there is some other lightweight solution? ASP-related bundles won't help since I am doing a PHP-based solution. Any tips on that will be much appreciated. Check these Frameworks out: * [Midori](http://www.midorijs.com...
[ 0.13354308903217316, -0.05172468349337578, 0.013324541039764881, 0.006881257053464651, -0.5922574400901794, -0.0063787116669118404, 0.06319376081228256, -0.21590758860111237, -0.40242284536361694, -0.6423332691192627, -0.1239439845085144, 0.41632744669914246, 0.1849396526813507, -0.1798490...
I am using XML minidom (xml.dom.minidom) in Python, but any error in the XML will kill the parser. Is it possible to ignore them, like a browser for example? I am trying to write a browser in Python, but it just throws an exception if the tags aren't fully compatible. There is a library called [BeautifulSoup](http://ww...
[ 0.22763319313526154, -0.025884104892611504, 0.20886138081550598, -0.082081139087677, -0.257313072681427, -0.18528269231319427, 0.3498058617115021, 0.0347285121679306, -0.0462677888572216, -0.5959827303886414, 0.07614137977361679, 0.0537971593439579, -0.4880720376968384, 0.1756686121225357,...
screen-scraping. Three > features make it powerful: > > > 1. Beautiful Soup won't choke if you give it bad markup. It yields a > parse tree that makes approximately as > much sense as your original document. > This is usually good enough to collect > the data you need and run away. > 2. Beautiful Soup provides a...
[ -0.16018573939800262, -0.14988945424556732, 0.18277914822101593, -0.05662640929222107, -0.4340108036994934, -0.026110786944627762, 0.11085671186447144, -0.1507486253976822, -0.06071547791361809, -0.7982816100120544, 0.1472124457359314, 0.20638641715049744, -0.3684023320674896, -0.153900012...
Beautiful Soup automatically converts incoming documents to Unicode > and outgoing documents to UTF-8. You > don't have to think about encodings, > unless the document doesn't specify an > encoding and Beautiful Soup can't > autodetect one. Then you just have to > specify the original encoding. > > > Beautiful ...
[ -0.3245416283607483, -0.21931225061416626, 0.37902939319610596, -0.28878918290138245, -0.40303122997283936, 0.046620193868875504, 0.16600269079208374, 0.09883350878953934, -0.02030254900455475, -0.9955158829689026, -0.28520911931991577, 0.08768077194690704, -0.49900150299072266, -0.1482171...
heading that's got > bold text, then give me that text."
[ 0.3676674962043762, 0.07123515009880066, 0.639290452003479, 0.25455906987190247, 0.08210725337266922, -0.08978826552629471, 0.16761580109596252, -0.05063818395137787, -0.18655997514724731, -0.378646582365036, 0.38949519395828247, 0.4590727388858795, -0.28175053000450134, -0.108717732131481...
So I purchased myself an iPhone ... everybody has one ... so I figured I'd **see** what the big deal was. To my surprise ... and overall skepticism ... I must say that I am **very** impressed with the iPhone. There's not any **real** magic going on here ... it just seems to be a **very clean and very easy** to use devi...
[ 0.35194650292396545, 0.5696765780448914, -0.1337309330701828, -0.12344575673341751, 0.3906225264072418, 0.2308715581893921, 0.0867447555065155, 0.43901216983795166, 0.0017602434381842613, -0.27815496921539307, 0.07890577614307404, 0.675090491771698, -0.0280012134462595, -0.1937001645565033...
where you can use some additional Html attributes to get certain things to appear iPhonish as well as a User Interface library to help out with the rendering. Do you know of any good sites or having any recommendations for getting started creating an iPhone web user interface using ASP.NET? Is there any references out...
[ 0.11438997834920883, 0.505831241607666, 0.190465047955513, 0.062330517917871475, -0.11125822365283966, -0.045222342014312744, 0.2959626615047455, -0.15681126713752747, -0.35329553484916687, -0.18938469886779785, -0.08810847252607346, 0.5536490082740784, -0.08081542700529099, -0.37923485040...
to try it, but it looks good. Hope this helps. **EDIT:** The [MVC 4 roadmap](http://aspnet.codeplex.com/wikipage?title=ASP.NET%20MVC%204%20RoadMap) indicates that MVC 4 should have support for Mobile views.
[ 0.1317303478717804, -0.0647202581167221, 0.9274080395698547, -0.07116976380348206, -0.08701135963201523, -0.19132545590400696, 0.40701794624328613, 0.10241339355707169, -0.5655376315116882, -0.3583255112171173, -0.40424108505249023, 0.6867048144340515, -0.20130950212478638, -0.134873479604...
What is the point of having a dynamic class on which you can call methods that may, or may not be there? The point is that you'll usually be confident that the method will be present (or handled dynamically - e.g. a `FindByAuthor` method in a "book repository" class which is translated into an appropriate SQL query) bu...
[ 0.03709883242845535, -0.2987012565135956, 0.11642952263355255, 0.34042754769325256, -0.05474073812365532, -0.29116159677505493, 0.12704001367092133, 0.1603173464536667, -0.35950788855552673, -0.26545828580856323, -0.16706730425357819, 0.7252644300460815, -0.33417245745658875, -0.2249314785...
handy.
[ -0.35575419664382935, 0.0317600853741169, 0.1256895810365677, 0.17420515418052673, 0.22762519121170044, -0.11616352200508118, -0.24256402254104614, -0.10067421942949295, -0.20021168887615204, -0.23972149193286896, -0.13256871700286865, 0.4164573848247528, -0.08742949366569519, -0.269712448...
Using Python, how would I go about reading in (be from a string, file or url) a mathematical expression (1 + 1 is a good start) and executing it? Aside from grabbing a string, file or url I have no idea of where to start with this. Because python supports some algebraic forms, you could do: ``` eval("1 + 1") ``` B...
[ -0.08268044888973236, 0.0006557750748470426, -0.0548943467438221, -0.06993251293897629, -0.2984662353992462, -0.14341548085212708, 0.15351980924606323, -0.21127447485923767, -0.0009448884520679712, -0.3371002972126007, -0.10755826532840729, 0.4548637866973877, -0.39458295702934265, -0.3409...
and a parser with [ply](http://www.dabeaz.com/ply/). Evaluating a thing like '1 + 1' ought not take more than ten lines or so. You could also implement the tokenizer and the parser by hand. Read about LL and LR parsers. Before attempting this it's also better to learn using parser generators first.
[ -0.06607753038406372, -0.2067945897579193, -0.20394200086593628, 0.022097518667578697, -0.46099552512168884, 0.0024399692192673683, 0.10568507015705109, -0.3816138207912445, 0.13940441608428955, -0.3892458379268646, -0.16320472955703735, 0.45836135745048523, -0.08868219703435898, -0.714660...
I have a basic test web form with a DataList and a DetailsView and two XmlDataSource components for each of them. The binding of the DataList to the underlying XML document was easy to set up, but I'm struggling with getting the DetailsView hooked up. The idea is that there is a master/details relationship between the...
[ 0.35861557722091675, -0.11358600109815598, 0.40352964401245117, 0.4137149155139923, 0.1276388019323349, -0.04968586936593056, -0.0622393824160099, -0.4122769236564636, 0.338684618473053, -0.7539571523666382, 0.2975735068321228, 0.7337673306465149, 0.11184118688106537, -0.12250901013612747,...
to get this to work? cheers, --larsw Because python supports some algebraic forms, you could do: ``` eval("1 + 1") ``` But this allows the input to execute about anything defined in your env: ``` eval("__import__('sys').exit(1)") ``` Also, if you want to support something python doesn't support, the approach fa...
[ -0.01830848678946495, -0.045384086668491364, 0.10647574067115784, -0.09872964024543762, -0.21609006822109222, 0.03454726189374924, 0.46760737895965576, -0.40709951519966125, -0.08258821070194244, -0.44457536935806274, -0.23610900342464447, 0.5212991237640381, -0.3388245105743408, -0.622035...
better to learn using parser generators first.
[ -0.10084564983844757, 0.0006712742615491152, -0.4433452785015106, 0.37377944588661194, -0.4532020688056946, -0.06137946620583534, 0.20380553603172302, -0.2553853988647461, 0.029384832829236984, -0.6244369745254517, 0.17219945788383484, 0.678728461265564, 0.17626884579658508, -0.59711956977...
We are preparing to develop an enterprise Human Resources Project using ASP.NET and our team is interested in using MVC instead of WebForms but we are a bit worried about this. We are not sure that this is a suitable solution for an Enterprise project. If your developers have not yet worked on any solutions using a M...
[ 0.3016726076602936, -0.14553074538707733, 0.4137803018093109, 0.32856106758117676, 0.017321914434432983, -0.3232841491699219, -0.147096186876297, -0.0033090722281485796, -0.3166397511959076, -0.6766573190689087, 0.023504719138145447, 0.3502178490161896, -0.35372915863990784, 0.254962056875...
is separated accordingly into a View, a Controller and a Model. **If the deadline for your application is a strict one, I do not suggest that you build it with the MVC Framework, but rather stick with what the developers already know, being Web-Form based applications.** But, if the management is willing to give time...
[ 0.36181971430778503, 0.020240522921085358, 0.4600614905357361, 0.26406988501548767, 0.18254047632217407, -0.07984494417905807, 0.08151274919509888, -0.17612554132938385, -0.19381557404994965, -0.7303982973098755, -0.18308883905410767, 0.6516500115394592, 0.18655987083911896, -0.03646616265...
There are many debugging option available, but it says you need to compile Perl with -DDEBUGGER option. How do we do that on Windows with ActivePerl. Also, I had this problem of out of memory with Perl. I was reading a XML file with 5 lines but the second line was way way too big, (the file size was 4.3Mb) for 5 line...
[ 0.013829896226525307, -0.038440097123384476, 0.44391462206840515, 0.06796826422214508, -0.3676871955394745, -0.1030731275677681, 0.3317805528640747, -0.15249677002429962, -0.13766130805015564, -0.49145403504371643, 0.09892332553863525, 0.5896470546722412, -0.4571211040019989, -0.0494487322...
Model-View-Controller concept, they will find that the ASP.Net MVC Framework will have **quite a bit of a steep learning curve**. This is because it's not built on the usual code behind and .aspx physical pages that you normally use in a Web-Forms application, but everything is separated accordingly into a View, a Con...
[ 0.22612540423870087, -0.20719164609909058, 0.7447513341903687, 0.32341957092285156, -0.06563196331262589, -0.35242795944213867, 0.0582234226167202, -0.2650344669818878, -0.2809523344039917, -0.6415306329727173, -0.03580633923411369, 0.4719845950603485, -0.033068832010030746, 0.272286504507...
to learn about the 'new' (*more like, different rather than new*) concept and get comfortable with it, then Yes, by all means, go for it and develop it using the MVC Framework.
[ 0.48051610589027405, 0.21051505208015442, 0.20705725252628326, 0.08441759645938873, 0.23099909722805023, -0.4002949595451355, 0.19969728589057922, -0.11116190999746323, -0.08991070836782455, -0.5320265293121338, -0.24763870239257812, 0.6909191608428955, 0.09601252526044846, 0.1655893474817...
I'm looking for a best way to implement common Windows keyboard shortcuts (for example `Ctrl`+`F`, `Ctrl`+`N`) in my [Windows Forms](http://en.wikipedia.org/wiki/Windows_Forms) application in C#. The application has a main form which hosts many child forms (one at a time). When a user hits `Ctrl`+`F`, I'd like to show...
[ 0.18251994252204895, 0.17420382797718048, 0.5213795900344849, 0.036641620099544525, 0.22901651263237, 0.3591689169406891, -0.0317186638712883, -0.01324526872485876, 0.023783709853887558, -0.8305659294128418, 0.08079145848751068, 0.5672403573989868, -0.019023211672902107, 0.3190184235572815...
event doesn't even fire when you press a key. What is the solution? You probably forgot to set the form's [KeyPreview](http://msdn.microsoft.com/en-us/library/system.windows.forms.form.keypreview.aspx) property to True. Overriding the [ProcessCmdKey()](http://msdn.microsoft.com/en-us/library/system.windows.forms.contro...
[ -0.305894672870636, -0.3529326021671295, 0.6039113402366638, -0.17887650430202484, -0.018752144649624825, -0.19390010833740234, 0.5607529878616333, -0.3073210120201111, -0.1114143580198288, -0.4283665120601654, -0.38798263669013977, 0.7442597150802612, -0.32260245084762573, 0.0612122192978...
I've got a couple of ASP.Net Usercontrols that I am using in different locations of my new website. These usercontrols had links like this : ``` <a href="daily/panchang/"></a> ``` If the usercontrol is used in pages in various subdirectories the relative path just doesn't work, and I don't want to provide my full w...
[ -0.07450602203607559, 0.0868794396519661, 0.4808967411518097, 0.06766624003648758, -0.1718723326921463, 0.09720050543546677, 0.3609601557254791, 0.15328748524188995, -0.48251280188560486, -0.8445873260498047, 0.0953812301158905, 0.17496934533119202, -0.12257850915193558, -0.137509554624557...
HTML way? Thanks I won't say whether it's an elegant solution, I'll just point out an alterantive within System.Web: ``` <a href="<%= VirtualPathUtility.ToAbsolute("~/daily/panchang/") %>"> ```
[ 0.004296015482395887, -0.11464377492666245, 0.6256561875343323, 0.1526387333869934, -0.09580925852060318, 0.05855255946516991, 0.44453245401382446, 0.378726989030838, -0.2879446744918823, -0.9996357560157776, -0.10876487195491791, 0.4215804636478424, -0.1951097995042801, -0.130506128072738...