text
stringlengths
0
30.5k
title
stringclasses
1 value
embeddings
listlengths
768
768
I have seen this syntax in MSDN: [`yield break`](https://msdn.microsoft.com/en-us/library/9k7k7cf0.aspx), but I don't know what it does. Does anyone know? It specifies that an iterator has come to an end. You can think of `yield break` as a `return` statement which does not return a value. For example, if you define a...
[ 0.07078632712364197, -0.12931422889232635, 0.5454433560371399, -0.3017926812171936, 0.06174542382359505, -0.15748047828674316, 0.4401080012321472, -0.02213061973452568, -0.280925452709198, -0.4576309621334076, -0.3399486541748047, 0.37716078758239746, -0.12544368207454681, 0.22469437122344...
your console app. Or like this with `yield break`: ``` int i = 0; while (true) { if (i < 5) { yield return i; } else { // note that i++ will not be executed after this yield break; } i++; } Console.Out.WriteLine("Won't see me"); ``` In this case the last statemen...
[ -0.2117210030555725, -0.10100279003381729, 0.7522836327552795, -0.2902488708496094, 0.37328004837036133, -0.1374637335538864, 0.7552235722541809, 0.1511130928993225, 0.2301340401172638, -0.6989020109176636, -0.45916929841041565, 0.8383536338806152, -0.08354753255844116, 0.11696949601173401...
I was about to add an extra signal handler to an app we have here and I noticed that the author had used `sigaction()` to set up the other signal handlers. I was going to use `signal()`. To follow convention I should use `sigaction()` but if I was writing from scratch, which should I choose? Use [`sigaction()`](http://...
[ 0.08892671763896942, 0.05113701894879341, 0.2966585159301758, -0.22124050557613373, -0.11257077753543854, -0.13693808019161224, 0.14435634016990662, -0.24745336174964905, -0.20077279210090637, -0.32159629464149475, -0.33297285437583923, 0.5470895171165466, -0.4536879360675812, -0.187965273...
flags explicitly added to `sigaction()` to allow it to faithfully simulate the old `signal()` behaviour. 1. The `signal()` function does not (necessarily) block other signals from arriving while the current handler is executing; `sigaction()` can block other signals until the current handler returns. 2. The `signal()`...
[ -0.10454051941633224, -0.40723875164985657, 0.23954255878925323, -0.13245448470115662, -0.00011873699259012938, -0.030321737751364708, 0.325529009103775, -0.3608493506908417, -0.2285916656255722, -0.4877004325389862, -0.4533063471317291, 0.39259862899780273, -0.3642309904098511, -0.0057547...
signal arrives, the default behaviour (usually terminate, sometimes with prejudice - aka core dump) occurs. 3. The exact behaviour of `signal()` varies between systems — and the standards permit those variations. These are generally good reasons for using `sigaction()` instead of `signal()`. However, the interface of ...
[ -0.3928667902946472, -0.3140963613986969, 0.6886111497879028, -0.26648181676864624, -0.20831507444381714, 0.04814954102039337, 0.3998408019542694, -0.18333056569099426, -0.28025978803634644, -0.628062903881073, -0.3892049789428711, 0.37602174282073975, -0.3295879662036896, 0.03499918058514...
programs is undefined. Multi-threaded programs and signals is a whole other complicated story. ~~AFAIK, both `signal()` and `sigaction()` are OK in multi-threaded applications.~~ [Cornstalks](https://stackoverflow.com/users/1287251/cornstalks) [observes](https://stackoverflow.com/questions/231912/what-is-the-differen...
[ -0.21494893729686737, 0.11219393461942673, 0.24581846594810486, -0.04685277119278908, 0.07374345511198044, -0.022046513855457306, 0.21149912476539612, -0.1561538726091385, -0.40508726239204407, -0.5187751650810242, -0.2610816955566406, 0.5562692284584045, -0.3544219434261322, -0.0062422938...
> > * The process calling `abort()`, `raise()`, `kill()`, `pthread_kill()`, or `sigqueue()` to generate a signal that is not blocked > * A pending signal being unblocked and being delivered before the call that unblocked it returns > > > the behavior is undefined if the signal handler refers to any object other than...
[ -0.143488809466362, -0.31059491634368896, 0.4063268005847931, -0.27245455980300903, -0.11262291669845581, -0.040278851985931396, 0.33399322628974915, -0.4400397837162018, -0.3814830780029297, -0.3220900297164917, -0.45026764273643494, 0.3700716197490692, -0.36428436636924744, 0.11036859452...
a multi-threaded application. Nevertheless, `sigaction()` is to be preferred in essentially all circumstances — and portable multi-threaded code should use `sigaction()` unless there's an overwhelming reason why it can't (such as "only use functions defined by Standard C" — and yes, C11 code can be multi-threaded). Wh...
[ -0.045105766505002975, 0.18461818993091583, 0.17450140416622162, 0.13104841113090515, -0.22373352944850922, -0.3721633851528168, -0.03688263148069382, -0.018999161198735237, -0.5451279878616333, -0.3674670457839966, -0.6137202382087708, 0.4956870675086975, -0.31175515055656433, -0.23191213...
I have basically two separate sites, a SharePoint collaboration site, and an ASP.Net application site. The only linkage between the two are the hyperlinks going back and forth, and the user validation on the behalf of the SharePoint site. The user will enter and be authenticated through the SharePoint site and then may...
[ 0.7708160281181335, 0.19360658526420593, 0.12442716211080551, 0.02102413773536682, 0.09176724404096603, -0.02175264060497284, 0.25451207160949707, -0.12963728606700897, -0.15650297701358795, -0.47042834758758545, -0.07198493182659149, 0.15324027836322784, 0.06900248676538467, -0.1815004497...
the .aspx code behind pages as a SharePoint feature. He sets out how to do this on his site [here.](http://www.andrewconnell.com/blog/articles/UsingCodeBehindFilesInSharePointSites.aspx) Can the Asp.net application live within a web part on the sharepoint site?
[ 0.43755853176116943, -0.10690420120954514, 0.5046141147613525, 0.16801398992538452, 0.09801197052001953, 0.06264731287956238, 0.48155078291893005, -0.13800911605358124, -0.2720206379890442, -0.6240853667259216, -0.2196229249238968, -0.08777199685573578, -0.2318890392780304, -0.181052878499...
Python has a [number of soap stacks](https://stackoverflow.com/questions/206154/whats-the-best-soap-client-library-for-python-and-where-is-the-documentation-fo); as near as I can tell, all have substantial defects. Has anyone had luck consuming *and* using WSDL for S3, EC2, and SQS in python? My experience is that su...
[ 0.3677860200405121, 0.08478543162345886, -0.04547091946005821, -0.07968264073133469, -0.3151751160621643, -0.14086376130580902, 0.4368348717689514, -0.009735213592648506, -0.2824658751487732, -0.39670249819755554, -0.08998451381921768, 0.5336902737617493, -0.34196534752845764, -0.121542394...
to SOAP. As you've already discovered, Python's existing SOAP implementations are woefully inadequate for most purposes; one workaround approach is to just generate the XML for the SOAP envelope/body directly, instead of going through an intermediate SOAP layer. If you're somewhat familiar with XML / SOAP, this isn't t...
[ 0.5752280354499817, 0.0694081261754036, -0.21353888511657715, 0.0021342069376260042, -0.21898576617240906, -0.2284148931503296, 0.10460717231035233, -0.0314863920211792, -0.1406976580619812, -0.4723511040210724, -0.136368989944458, 0.38981494307518005, -0.49072787165641785, -0.128931105136...
How to capture user clicks in a winform application without making the code very complicated? is AOP the answer? How to track instrumentations? This does depend rather on your actual requirements. For a simple/sample/prototype winforms app, I'd suggest basic [WinForms Event Handlers](http://msdn.microsoft.com/en-us/li...
[ 0.31764909625053406, -0.29904982447624207, 0.21286898851394653, 0.04534723237156868, -0.04360443353652954, -0.21046383678913116, -0.12652674317359924, -0.4187586307525635, -0.26870426535606384, -0.3654903471469879, -0.07266706228256226, 0.673907458782196, -0.4434775710105896, -0.3414472639...
for your form elements (and I recommend sticking to the control-based event handlers - don't try creating your own global event handling facility), but they should make calls to Command objects (see [Command Pattern](http://www.dofactory.com/patterns/patterncommand.aspx) in GangOfFour). Those command objects can then b...
[ -0.0418127216398716, -0.10334619134664536, 0.40505191683769226, 0.019512861967086792, -0.033985551446676254, -0.13610820472240448, 0.3632450997829437, -0.584746778011322, -0.4166305661201477, -0.2522347569465637, 0.07475841790437698, 0.3542240858078003, -0.5280513763427734, -0.144544705748...
For the moment the best way that I have found to be able to manipulate DOM from a string that contain HTML is: ``` WebBrowser webControl = new WebBrowser(); webControl.DocumentText = html; HtmlDocument doc = webControl.Document; ``` There are two problems: 1. Requires the `WebBrowser` object! 2. This can't be used ...
[ 0.03486444801092148, -0.1854420155286789, 0.7725793123245239, -0.0926976427435875, -0.3025830388069153, -0.2500981390476227, 0.2793876826763153, -0.4701659083366394, -0.07914245128631592, -0.8084637522697449, 0.10906189680099487, 0.714155912399292, -0.23762474954128265, 0.2049066573381424,...
I want a pure virtual parent class to call a child implementation of a function like so: ``` class parent { public: void Read() { //read stuff } virtual void Process() = 0; parent() { Read(); Process(); } } class child : public parent { public: virtual void Process() { //pr...
[ 0.48804399371147156, 0.08692674338817596, 0.01589999906718731, -0.0697440356016159, 0.4242498278617859, 0.09916690737009048, 0.16813257336616516, 0.03425788879394531, 0.07805172353982925, -0.537434458732605, -0.22311633825302124, 0.4396950900554657, -0.2910647988319397, 0.5659087896347046,...
an unlinked error :/ This is using VC++ 2k3 Or shouldn't it work, am I wrong? Title of the following article says it all: [Never Call Virtual Functions during Construction or Destruction](http://www.artima.com/cppsource/nevercall.html).
[ 0.2565295696258545, -0.3248445689678192, 0.13198824226856232, 0.23244503140449524, 0.28222566843032837, -0.010568768717348576, 0.47338029742240906, 0.30988916754722595, -0.3931003212928772, -0.23304489254951477, -0.18133419752120972, 0.5443240404129028, -0.1411282867193222, 0.2098074406385...
Sam Ruby, author of "RESTful Web Services" seems to come out against the use of HTTP PUT for partial updates: <http://intertwingly.net/blog/2008/02/15/Embrace-Extend-then-Innovate> What isn't clear is how partial updates *should* take place. As I commented near the bottom of his blog, it isn't clear how using HTTP PAT...
[ 0.4552716016769409, 0.09496311098337173, 0.11857552081346512, -0.33580148220062256, -0.15734267234802246, -0.24231143295764923, 0.40559297800064087, 0.12930619716644287, 0.18542912602424622, -0.7337143421173096, 0.09204638749361038, 0.49690669775009155, -0.20374789834022522, 0.080147884786...
no agreed upon way to do partial updates. If heavyweights like Sam Ruby, Joe Gregario, Mark Nottingham, Mark Pilgrim, Bill de hÓra, etc cannot come to an agreement, what hope do we have. As far as I am concerned, I wouldn't worry too much. Create a partial update media type that works for you, use PATCH to indicate yo...
[ 0.7525773048400879, 0.15148189663887024, 0.18901073932647705, -0.007390438113361597, -0.014024868607521057, -0.1965954750776291, 0.4077017605304718, 0.27653244137763977, -0.16386140882968903, -0.7167362570762634, 0.1802261471748352, 0.7488048076629639, -0.38203343749046326, -0.165940985083...
[Capistrano](http://www.capify.org/) is a great solution for building scripts that automatically deploy a website and/or a database. But, it's also very \*nix centric, and from I've read it would probably be more trouble than it's worth to get it working with a Windows server. Is there a similar solution that would all...
[ 0.5138363242149353, 0.0064596859738230705, 0.5336466431617737, 0.18775305151939392, 0.05945495143532753, -0.2998010814189911, -0.05943962186574936, -0.19670391082763672, -0.4144509732723236, -0.5636558532714844, 0.29713499546051025, 0.5471725463867188, -0.49577757716178894, -0.088714763522...
to pull from, how it will handle rollbacks to a previous version of a site, etc. So far, I haven't been able to find a free solution that has the same sort of functionality that Capistrano has. We use msi files created by Setup Factory. It pretty much allows you to put any setup parameters you need. We are also staring...
[ 0.7398059964179993, -0.41048264503479004, 0.2213282436132431, 0.187886044383049, -0.025542818009853363, -0.229717418551445, 0.0186783280223608, -0.08113892376422882, -0.2666720449924469, -0.7126035094261169, 0.15287524461746216, 0.7940213680267334, -0.3756644129753113, 0.1161852478981018, ...
the cheapest. I am sure you can use this in combination with batch files and a little custom programming and you can deploy what ever you need to iis and sql server.
[ 0.3349299728870392, -0.08637324720621109, 0.046626318246126175, 0.3201201260089874, 0.2152000218629837, -0.02229965478181839, -0.2501232624053955, 0.3453849256038666, -0.06529417634010315, -0.8402541279792786, 0.20163990557193756, 0.8011037111282349, 0.10148666799068451, 0.1223131939768791...
I'm using the MessageBox class to show errors to users, and while that might not be the right behavior, it's very convenient. This is a touchscreen application, however, so I need the 'ok' button to be much larger than it is (curse my inordinately large fingers!). I think that if I increase the font size in the dialog...
[ 0.1984221488237381, 0.382292240858078, 0.47076037526130676, -0.13775470852851868, 0.17699123919010162, 0.20231693983078003, 0.19315499067306519, 0.0864029973745346, -0.6317819952964783, -0.4639454483985901, 0.18651598691940308, 0.4860149323940277, -0.06725957244634628, -0.02471305988729, ...
is probably the best way forward. It's fairly trivial to do, and much fun! And you can build in things that the standard dialog doesn't support (without PInvoke magic) such as centering in the middle of the screen etc.
[ 0.3592313826084137, -0.1428912729024887, 0.5131284594535828, 0.21641142666339874, -0.041427988559007645, -0.07345761358737946, -0.07546016573905945, 0.042503733187913895, -0.06116007640957832, -0.3693717420101166, -0.009442885406315327, 0.29642191529273987, 0.21929946541786194, -0.05402291...
In C and C++ a variable can be marked as [**volatile**](http://en.wikipedia.org/wiki/Volatile_variable), which means the compiler will not optimize it because it may be modified external to the declaring object. Is there an equivalent in Delphi programming? If not a keyword, maybe a work around? My thought was to use ...
[ 0.3072047233581543, 0.11880645900964737, 0.08022122085094452, -0.20551449060440063, -0.08873092383146286, -0.16717272996902466, -0.007021771278232336, 0.1535828560590744, -0.20765548944473267, -0.1329421103000641, -0.16870273649692535, 0.5908212661743164, -0.4858277142047882, 0.12665019929...
local before doing any further manipulation; similarly, restrict writes to a single assignment. The Delphi compiler does not perform common subexpression elimination (CSE) on non-local location expressions when there are calls to non-inlined methods between the expressions, as the compiler doesn't do interprocedural o...
[ -0.4106651544570923, -0.20269188284873962, 0.22090837359428406, 0.07560370862483978, 0.0015527399955317378, -0.11311907321214676, 0.4100826680660248, 0.09321246296167374, -0.09021608531475067, -0.5482584238052368, -0.1804666817188263, 0.4812054932117462, -0.43122074007987976, 0.04378009587...
I have three projects. One is a WCF Services Project, one is a WPF Project, and one is a Microsoft Unit Testing Project. I setup the WCF Services project with a data object that looks like this: ``` [DataContract] public enum Priority { Low, Medium, High } [DataContract] public struct TimeInfo { [Data...
[ 0.15801358222961426, -0.18470120429992676, 0.5746387839317322, 0.04259778931736946, 0.14464071393013, 0.24247340857982635, -0.08732707053422928, -0.310712993144989, -0.036012571305036545, -0.6770489811897278, 0.0994279533624649, 0.3382565975189209, 0.15937478840351105, 0.2544369101524353, ...
public DateTime EndDate { get; set; } [DataMember] public DateTime CompletionDate { get; set; } } [DataContract] public class Task { [DataMember] public string Title { get; set; } [DataMember] public string Description { get; set; } [DataMember] public Priority Priority { get; set; }...
[ 0.14480143785476685, -0.31869077682495117, 0.6835962533950806, 0.026735378429293633, 0.41188210248947144, 0.04774576053023338, -0.04626915231347084, 0.11700548976659775, -0.14705176651477814, -0.47611570358276367, -0.39695975184440613, 0.47354012727737427, 0.12583397328853607, 0.3135622739...
ITaskManagement { [OperationContract] List<Task> GetTasks(); [OperationContract] void CreateTask(Task taskToCreate); [OperationContract] void UpdateTask(Task taskToCreate); [OperationContract] void DeleteTask(Task taskToDelete); } ``` When I try to use the service in either the WPF ...
[ -0.24278205633163452, -0.2139321267604828, 0.6408190727233887, -0.14351479709148407, 0.10030176490545273, 0.01729338802397251, 0.43542808294296265, -0.2658177614212036, -0.2747081518173218, -0.3721267282962799, -0.402377724647522, 0.5388429164886475, -0.08175172656774521, 0.259887933731079...
<wsHttpBinding> <binding name="WSHttpBinding_ITaskManagement" closeTimeout="00:01:00" openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00" bypassProxyOnLocal="false" transactionFlow="false" hostNameComparisonMode="StrongWildcard" maxBufferPo...
[ -0.38307541608810425, -0.11460359394550323, 0.3820165693759918, -0.015040518715977669, -0.0545053631067276, -0.07664396613836288, 0.8225345015525818, -0.3028256595134735, -0.28977102041244507, -0.42300766706466675, -0.3919934928417206, 0.6122301816940308, -0.27950212359428406, 0.2563864588...
allowCookies="false"> <readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384" maxBytesPerRead="4096" maxNameTableCharCount="16384" /> <reliableSession ordered="true" inactivityTimeout="00:10:00" enabled="false" /> ...
[ -0.3630578815937042, -0.10436790436506271, 0.7037445306777954, 0.3038671314716339, 0.3793065547943115, -0.5022953152656555, 0.934465765953064, -0.4817400872707367, 0.10628687590360641, -0.3907351493835449, -0.42526698112487793, 0.851983368396759, -0.37959447503089905, -0.2637324631214142, ...
<transport clientCredentialType="Windows" proxyCredentialType="None" realm="" /> <message clientCredentialType="Windows" negotiateServiceCredential="true" algorithmSuite="Default" establishSecurityContext="true" />
[ -0.29030609130859375, -0.2874421775341034, 0.6098337173461914, 0.10096067935228348, 0.1526077538728714, 0.3138673007488251, 0.35901662707328796, -0.17483563721179962, -0.25018376111984253, -0.8920889496803284, -0.2841583788394928, 0.5811677575111389, -0.17469482123851776, 0.103798963129520...
</security> </binding> </wsHttpBinding> </bindings> <client> <endpoint address="http://localhost:9999/TaskManagement.svc" binding="wsHttpBinding" bindingConfiguration="WSHttpBinding_ITaskManagement" contract="TaskManagement.ITaskManagement" name="WSHttpBinding...
[ -0.4748173654079437, -0.008351162075996399, 0.497058629989624, -0.18289904296398163, -0.18925698101520538, 0.08659874647855759, 0.3211587965488434, -0.4261813163757324, -0.33223122358322144, -0.4595947563648224, -0.3098445236682892, 0.18308398127555847, -0.07030947506427765, 0.293091148138...
<dns value="localhost" /> </identity> </endpoint> </client> </system.serviceModel> ``` and the web.config of the WCF Service looks like this: ``` <system.serviceModel> <behaviors> <serviceBehaviors> <behavior name="InternetBasedWcfServices.TaskManagementBehavior"> ...
[ 0.05721117928624153, -0.2706977128982544, 0.30423614382743835, -0.30757424235343933, -0.12641571462154388, -0.06487465649843216, 0.3963328003883362, -0.18996332585811615, -0.3930265009403229, -0.8878575563430786, -0.1426515132188797, 0.44304749369621277, -0.041039347648620605, 0.2607726156...
includeExceptionDetailInFaults="false" /> </behavior> <behavior name="InternetBasedWcfServices.ScheduleManagementBehavior"> <serviceMetadata httpGetEnabled="true" /> <serviceDebug includeExceptionDetailInFaults="false" /> </behavior> </serviceB...
[ 0.19870060682296753, 0.13095605373382568, -0.15153098106384277, -0.31054532527923584, 0.004341793246567249, -0.046813081949949265, 0.9487460851669312, -0.5568047761917114, -0.22506707906723022, -0.30073338747024536, -0.12136980146169662, 0.67161625623703, -0.2913512885570526, 0.06355803459...
name="InternetBasedWcfServices.TaskManagement"> <endpoint address="" binding="wsHttpBinding" contract="InternetBasedWcfServices.ITaskManagement"> <identity> <dns value="localhost" /> </identity> </endpoint>
[ -0.20959380269050598, -0.2743789553642273, 0.20244234800338745, -0.3266873359680176, -0.15364272892475128, -0.11261892318725586, 0.28801998496055603, -0.1605318784713745, -0.18293461203575134, -0.6203491687774658, -0.28292250633239746, 0.11445170640945435, -0.09248751401901245, 0.505797803...
<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" /> </service> <service behaviorConfiguration="InternetBasedWcfServices.ScheduleManagementBehavior" name="InternetBasedWcfServices.ScheduleManagement"> <endpoint address="" binding="wsHttpBinding" contra...
[ -0.24279464781284332, -0.18246325850486755, 0.325951486825943, -0.2959930896759033, -0.07099533081054688, 0.07628452032804489, 0.5636810064315796, -0.053921300917863846, -0.19139042496681213, -0.9041962027549744, -0.38999292254447937, 0.40666431188583374, -0.059123922139406204, 0.337350487...
</identity> </endpoint> <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" /> </service> </services> </system.serviceModel> ``` This is not the first time this has happened, and I'm guessing it is a configuration issue. But each time I've usually just blo...
[ 0.3873148560523987, 0.17301450669765472, 0.3885056972503662, -0.13282980024814606, 0.15626144409179688, -0.23174065351486206, 0.4859645664691925, 0.24245195090770721, -0.3057059645652771, -0.8312544226646423, -0.13339298963546753, 0.4034395217895508, 0.06410153955221176, 0.208927720785141,...
comments for more > of my troubleshooting on this problem. > When an answer is available, if the > answer is unpublished, I'll add it as > an official "answer". \*\* I Found the Answer Ok, not sure if it is kewl answering my own question, but here we go. For some reason the enumeration needed to be marked with th...
[ 0.026583297178149223, 0.1438683718442917, 0.3144947588443756, 0.32143354415893555, 0.1976272463798523, -0.18020863831043243, -0.016282562166452408, -0.09171353280544281, -0.3123210668563843, -0.6221322417259216, -0.21443864703178406, 0.26487305760383606, 0.23205702006816864, 0.307702898979...
error occurring. I'm still not sure why that specific error was displayed. The error doesn't seem to align in any correlation with the functional reason the error occurred, but this fix definitely smoothed everything out.
[ 0.28464147448539734, 0.09095604717731476, 0.22484879195690155, 0.3106439411640167, 0.065026193857193, 0.036557216197252274, 0.21397586166858673, 0.36718663573265076, -0.1606156826019287, -0.6333336234092712, 0.2631419897079468, 0.36988967657089233, -0.1562756896018982, 0.31794366240501404,...
I'm trying to get a file with ant, using the get property. I'm running apache 2, and I can get the file from the indicated URL using wget and firefox, but ant gives me the following error: ``` [get] Error opening connection java.io.IOException: Server returned HTTP response code: 503 for URL: http://localhost/jars/ja...
[ 0.4381289482116699, 0.490958034992218, 0.19500750303268433, -0.3323814570903778, -0.23384340107440948, 0.017558526247739792, 0.838304877281189, -0.4191734790802002, 0.09125886112451553, -0.6641225814819336, 0.06937948614358902, 0.4419473707675934, -0.20204252004623413, 0.2201603353023529, ...
`src` URL isn't getting interpreted properly and sent by the ANT task or perhaps the JRE. Here are some things to try: * As always, with ANT, execute the smallest possible build.xml with **-verbose** to see if that gives any more information, **-debug** for even more information. * Try the `verbose="true"` attribute ...
[ 0.17820778489112854, 0.029466800391674042, 0.3425236940383911, -0.05256214737892151, -0.3857008218765259, -0.13503624498844147, 0.6036113500595093, -0.2799011766910553, -0.09956680238246918, -0.7599542737007141, -0.05990291014313698, 0.5547761917114258, -0.06491494178771973, -0.00383625156...
I would guess most people on this site are familiar with tail, if not - it provides a "follow" mode that as text is appended to the file tail will dump those characters out to the terminal. What I am looking for (and possibly to write myself if necessary) is a version of tail that works on binary files. Basically I ha...
[ 0.6719486117362976, -0.023066991940140724, 0.21969614923000336, 0.0002536528336349875, 0.12314893305301666, -0.23897644877433777, 0.19240052998065948, 0.4040472209453583, -0.17641659080982208, -0.4150056540966034, 0.318258672952652, 0.37722039222717285, -0.3199692964553833, 0.0238132607191...
the wheel! This wouldn't strictly be "tail" as I would like the entire file to be copied, but it would watch as new bytes were added and stream those. Ideas? There is also the [bintail](http://kk5jy.net/bintail/) application which appears to be more robust than the aforementioned script. > The **bintail** package con...
[ 0.3620101511478424, 0.029566030949354172, 0.4211949408054352, 0.07393715530633926, -0.2638161778450012, -0.023231888189911842, -0.03505012020468712, 0.07293344289064407, -0.2414795458316803, -0.4591929316520691, 0.09197771549224854, 0.6070550084114075, -0.12416691333055496, -0.079861268401...
work in progress, but it already does what it was designed to do for me.
[ 0.529635488986969, 0.06150020286440849, 0.3095933198928833, -0.05495879426598549, 0.41267067193984985, 0.010445890948176384, 0.038481879979372025, 0.0030820786487311125, 0.02174900658428669, -0.5010448694229126, 0.21378099918365479, 0.3157123625278473, 0.5076043605804443, -0.03014559298753...
What's the best way to return a random line in a text file using C? It has to use the standard I/O library (`<stdio.h>`) because it's for Nintendo DS homebrew. **Clarifications:** * Using a header in the file to store the number of lines won't work for what I want to do. * I want it to be as random as possible (the b...
[ 0.13247370719909668, -0.20721988379955292, 0.615930438041687, 0.3024827241897583, -0.2879151701927185, 0.028633149340748787, 0.02470792457461357, -0.06618927419185638, 0.0029796564485877752, -0.51486736536026, -0.005363532807677984, 0.3899775445461273, -0.04928852245211601, 0.2784722149372...
to choose whether to keep that line or ignore it. For the first line, you want odds of 1:1 to keep; for the second, you want odds of 1:2, etc. ``` count = 0; while (fgets(line, length, stream) != NULL) { count++; if ((rand() * count) / RAND_MAX == 0) strcpy(keptline, line); } ``` I haven't verified t...
[ 0.367466002702713, -0.27467840909957886, 0.16719606518745422, -0.2571853697299957, 0.2317136824131012, 0.06556389480829239, 0.13159644603729248, -0.529977023601532, -0.11770284920930862, -0.43624556064605713, 0.12950018048286438, 0.6777101159095764, -0.1790439486503601, 0.15297728776931763...
reached the same conclusion myself. There are probably many ways to fix it, but this is the first that comes to mind: ``` if ((rand() / (float)RAND_MAX) <= (1.0 / count)) ```
[ 0.20621217787265778, 0.20963704586029053, 0.059280410408973694, -0.11384010314941406, 0.17799194157123566, -0.08908937126398087, 0.1565343588590622, -0.33164092898368835, -0.19544528424739838, -0.5028024315834045, 0.2294105887413025, 0.49989575147628784, -0.07933906465768814, 0.12866848707...
I have an undefined number of display context and each will display a texture. When I call glGenTextures I get the same name returned across all display contexts. Will this work? Even though they have the same name will they still store and display different textures? If not what should do to get around this? Getting t...
[ 0.03935319185256958, 0.24798868596553802, 0.7781051397323608, -0.04818525165319443, -0.27220818400382996, 0.17612385749816895, -0.04487771540880203, -0.16410823166370392, -0.301042765378952, -0.9794323444366455, 0.08719043433666229, 0.33971285820007324, 0.186918705701828, 0.312172919511795...
that (although most do). However, you could in theory also get any more or less "random" number, such for example an integer that increments for any kind of object (i.e. not just textures, but also buffers and shaders), or even a 32 bit pointer address in the driver's address space, or some other esotheric thing. There...
[ 0.23965543508529663, 0.10773836821317673, 0.3208950161933899, 0.33818551898002625, -0.1121186912059784, -0.04717416316270828, -0.10187307000160217, 0.1631426215171814, -0.261412113904953, -0.40828561782836914, -0.12736311554908752, 0.37916281819343567, -0.11792328953742981, 0.3574217259883...
same number (name) in a different context will usually be a different texture, or possibly no texture at all. So, if you do see the same texture in different context with the same texture name, then you either have shared contexts, or the driver is buggy. Note that if you use wglCreateContextAttribsARB, the second par...
[ -0.10976669937372208, -0.16862796247005463, 0.15630000829696655, 0.17913904786109924, -0.22036291658878326, -0.08320540934801102, 0.3342847228050232, 0.17301321029663086, -0.44776982069015503, -0.8553615808486938, -0.021752001717686653, 0.5664424896240234, -0.13986824452877045, 0.306584179...
Im having a problem with a final part of my assignment. We get in a stream of bits, etc etc, in the stream is an integer with the number of 1's in the text portion. I get that integer and its 24 which is correct, now i loop through the text data i get and i try to count all the 1's in there. But my proc is always retur...
[ -0.0017178145935758948, 0.2364150732755661, 0.47408047318458557, 0.07077659666538239, -0.20917867124080658, 0.3386833369731903, 0.48604878783226013, -0.26306766271591187, -0.36955374479293823, -0.285260945558548, 0.1052163764834404, 0.46868962049484253, -0.2493748813867569, -0.078097969293...
the number of ones in it. ``` sub AX,AX sub SI,SI mov bx,[bp+6] ;get message offset @@mainLoop: mov cx,8 mov dh,80h cmp byte ptr [bx + si],0 je @@endChecker @@innerLoop: test byte ptr [bx + si],dh jz @@zeroFound
[ 0.22809742391109467, 0.13655805587768555, 0.23923076689243317, 0.08887656033039093, 0.16124700009822845, 0.28171291947364807, 0.3141295909881592, -0.2812584340572357, -0.2405027151107788, -0.3498651683330536, -0.094419464468956, 0.33799344301223755, -0.2409021407365799, -0.0584376789629459...
inc AX @@zeroFound: shr bh,1 loop @@innerLoop @@continue: inc si jmp @@mainLoop ``` the rest of the proc is just push/pops. What im wanting this to actually do is use TEST to compare 100000000 to a byte, if its a 1 inc AX else
[ 0.4097953140735626, -0.07898373156785965, 0.3871992826461792, 0.3202821612358093, -0.19886735081672668, 0.1976250261068344, 0.05477546527981758, -0.09650344401597977, -0.06622020900249481, -0.14755789935588837, 0.15282322466373444, 0.3378765285015106, -0.26664140820503235, -0.0990354791283...
shift right the mask by 1 and loop a whole byte, than inc to next byte and do again. 'shr bh,1' should probably be 'shr dh,1', no?
[ 0.23976904153823853, -0.3010060787200928, 0.276723712682724, 0.07633934170007706, -0.376219779253006, 0.2270914614200592, 0.2513415217399597, -0.0026420699432492256, -0.18221955001354218, -0.21418853104114532, -0.19260242581367493, 0.0012121328618377447, -0.2636086344718933, 0.077705301344...
I'm tinkering with Silverlight 2.0. I have some images, which I currently have a static URL for the image source. Is there a way to dynamically load the image from a URL path for the site that is hosting the control? Alternatively, a configuration setting, stored in a single place, that holds the base path for the UR...
[ 0.7591677308082581, 0.14964230358600616, 0.4671754539012909, 0.05577270686626434, -0.15470603108406067, -0.28145572543144226, 0.28832417726516724, -0.12228307127952576, -0.13780830800533295, -0.5830109715461731, 0.07312198728322983, 0.46656879782676697, -0.350462406873703, 0.20519605278968...
What's the best way to pass data from one Windows Forms app (an office plugin) to another (exe written in C#) in C#? I'll take a wild stab at this and say you probably want the office app to *phone home* to your exe? In this context, the "exe" is the server and the office app is the client. If you're using .NET 3.0, W...
[ 0.5404350757598877, -0.15833017230033875, 0.5689876079559326, 0.11652786284685135, 0.1628352254629135, 0.005467740353196859, -0.036469507962465286, -0.15762273967266083, -0.17323260009288788, -0.9934470057487488, 0.09949023276567459, 0.5303065180778503, -0.4493303894996643, 0.0492510385811...
be defined in this assembly as well. This assembly is shared between the client and the server. See "[Designing Service Contracts](https://learn.microsoft.com/en-us/dotnet/framework/wcf/designing-service-contracts)" for more info. 2. "Service". This assembly is your "exe" and it will reference the contracts and define ...
[ 0.7776111960411072, -0.0527520626783371, 0.3054949939250946, -0.06077287346124649, -0.061950817704200745, 0.11838342249393463, 0.07379567623138428, -0.3973545730113983, -0.10031503438949585, -1.115337610244751, -0.25091075897216797, 0.3498002588748932, -0.2824791967868805, 0.06615067273378...
on the contracts. The client can be auto-generated using the svcutil.exe tool. Both the "exe" and the "plugin" will require configuration files that define the bindings. When you want to pass data between client and server, your client will create an object from the "Shared Contracts" assembly and pass it to the serv...
[ 0.802800178527832, -0.2859598994255066, 0.7795010209083557, 0.04423774406313896, -0.09738075733184814, -0.27152425050735474, -0.03496641665697098, -0.45259878039360046, -0.1922619491815567, -0.9326713681221008, -0.1398990899324417, 0.4931240379810333, -0.20951983332633972, 0.00984228402376...
I have a two way foreign relation similar to the following ``` class Parent(models.Model): name = models.CharField(max_length=255) favoritechild = models.ForeignKey("Child", blank=True, null=True) class Child(models.Model): name = models.CharField(max_length=255) myparent = models.ForeignKey(Parent) ``` How...
[ -0.07176881283521652, 0.17499534785747528, 0.1837386190891266, -0.3197556138038635, 0.1845627874135971, 0.4006080627441406, -0.10969112813472748, -0.053300641477108, -0.0005256857839412987, -0.7333187460899353, 0.1665724217891693, 0.3689899146556854, -0.1344287097454071, 0.6870099306106567...
constant, a callable or a Q object to restrict the allowable choices for the key. A constant obviously is of no use here, since it knows nothing about the objects involved. Using a callable (function or class method or any callable object) seems more promising. However, the problem of how to access the necessary infor...
[ 0.14682446420192719, -0.3188728094100952, 0.4196103513240814, -0.020851334556937218, -0.006313355639576912, -0.13368962705135345, -0.13714371621608734, -0.14128631353378296, -0.1894838511943817, -0.23629216849803925, 0.15487466752529144, 0.5688311457633972, -0.454332172870636, 0.2588625848...
this information in the thread locals. Next there is a class method in the model that reads the thread local variable and returns a list of ids to limit the choice of a foreign key field. ``` @classmethod def _product_list(cls): """ return a list containing the one product_id contained in the request URL, ...
[ -0.09115643054246902, -0.0715867280960083, 0.5790629386901855, 0.05495535954833031, 0.19732682406902313, -0.04731721803545952, -0.2333257794380188, 0.023032117635011673, -0.3068658709526062, -0.48180297017097473, -0.07014146447181702, 0.3528701364994049, -0.2592760920524597, 0.615399956703...
if id is not None: return [id] else: return Product.objects.all().values('pk').query ``` It is important to return a query containing all possible ids if none was selected so that the normal admin pages work ok. The foreign key field is then declared as: ``` product = models.ForeignKey( Prod...
[ 0.11157204210758209, 0.0543726347386837, 0.3531884253025055, -0.07611089944839478, 0.25383445620536804, 0.033267710357904434, -0.062027767300605774, -0.3488178849220276, -0.06789489090442657, -0.47279486060142517, -0.41231992840766907, 0.49658718705177307, -0.27475109696388245, 0.130453586...
a way to access "self" here.
[ -0.08848677575588226, -0.011831028386950493, -0.030833611264824867, 0.42523226141929626, -0.12785226106643677, 0.04955399036407471, 0.24567194283008575, -0.011845407076179981, -0.10122369229793549, -0.5285317897796631, 0.06814002245664597, 0.26060232520103455, 0.25411203503608704, 0.045769...
I'm just starting to learn C++ so excuse me for this simple question. What I'm doing is reading in numbers from a file and then trying to add them to an array. My problem is how do you increase the size of the array? For example I thought might be able to just do: ``` #include <iostream> using namespace std; int main...
[ 0.3049982190132141, -0.029125116765499115, 0.32640156149864197, -0.2974512279033661, -0.027585778385400772, 0.22995571792125702, 0.36147210001945496, -0.2019425332546234, -0.3499094247817993, -0.5273342728614807, -0.06870138645172119, 0.43497616052627563, -0.4788878560066223, -0.1047687977...
return 0; } ``` But this obviously just overwrites the value, 5, that I initially set to x[0] and so outputs 0,6. How would I make it so that it would output 5,6? Please realize that for the example I've included I didn't want to clutter it up with the code reading from a file or code to get numbers from a user. I...
[ 0.3020588755607605, 0.23450569808483124, 0.059860918670892715, -0.2768572270870209, -0.1610911339521408, 0.13109509646892548, 0.3213907480239868, -0.48720553517341614, -0.19408899545669556, -0.3701760768890381, 0.1619696021080017, 0.5293523669242859, -0.432202011346817, 0.04616812989115715...
respectively. Thanks for your help. You don't want to work with arrays directly. Consider using a `vector`, instead. Then, you can call the `push_back` function to add things to the end, and it will automatically resize the vector for you. ``` #include <iostream> #include <vector> int main() { double value; ...
[ 0.05024382099509239, -0.3565467596054077, 0.6362444162368774, -0.37774014472961426, 0.1603623479604721, 0.3380817770957947, -0.016698436811566353, -0.3999708890914917, -0.521208643913269, -0.6977152824401855, -0.051889851689338684, 0.7284895777702332, -0.5061408877372742, -0.20658493041992...
std::cout << values[i]; } } ```
[ -0.07751928269863129, 0.4022575616836548, 0.14662054181098938, -0.42125436663627625, 0.15868176519870758, -0.13285236060619354, 0.0700623095035553, 0.11772409081459045, 0.03433403745293617, -0.5307618975639343, -0.44122475385665894, 0.7378146648406982, -0.43161025643348694, 0.1751311272382...
I've used Slime within Emacs as my primary development environment for Common Lisp (or Aquamacs on OS X), but are there other compelling choices out there? I've heard about Lispworks, but is that [or something else] worth looking at? Or does anyone have tips to getting the most out of Emacs (e.g., hooking it up to the ...
[ 0.21010814607143402, 0.23125584423542023, 0.09100338071584702, -0.1437073051929474, 0.16287563741207123, -0.161848783493042, -0.13241930305957794, 0.2492201179265976, -0.4754834771156311, -0.34342697262763977, 0.0848759189248085, 0.6104233264923096, -0.33098486065864563, -0.323113948106765...
IDE](http://homepage.mac.com/svc/LispMovies/index.html) * [Video of Rainer Joswig using the LispWorks IDE to create a DSL](http://www.cl-http.org:8002/mov/dsl-in-lisp.mov) * [Blog post by Bill Clementson discussing IDE choices](http://bc.tech.coop/blog/041130.html) There are some flashier options out there, but I don't...
[ 0.4098900258541107, 0.0790427029132843, 0.15659788250923157, 0.42673635482788086, 0.06105653569102287, -0.3027980625629425, -0.08475451171398163, -0.05336796119809151, -0.10595233738422394, -0.4837389886379242, -0.10959189385175705, 0.6127151846885681, -0.5396701693534851, -0.3262548148632...
What's the best way to call a generic method when the type parameter isn't known at compile time, but instead is obtained dynamically at runtime? Consider the following sample code - inside the `Example()` method, what's the most concise way to invoke `GenericMethod<T>()` using the `Type` stored in the `myType` variab...
[ 0.2814198434352875, -0.1349426507949829, 0.11776357889175415, 0.019408218562602997, -0.07051228731870651, 0.11860048770904541, 0.35276710987091064, -0.29671674966812134, 0.018466241657733917, -0.3877620995044708, 0.2297612726688385, 0.4765235185623169, -0.6014938354492188, 0.34638598561286...
// What changes to call StaticMethod<T>()? Sample.StaticMethod<myType>(); // This also doesn't work } public void GenericMethod<T>() { // ... } public static void StaticMethod<T>() { //... } } ``` You need to use reflection to get the method to start with, then "co...
[ 0.25769785046577454, -0.1374509185552597, 0.29932743310928345, 0.012072110548615456, -0.19180941581726074, 0.049920983612537384, 0.2944556474685669, -0.5640226006507874, -0.07555890083312988, -0.1886524111032486, 0.05769594758749008, 0.43936437368392944, -0.5603911876678467, 0.257611572742...
= method.MakeGenericMethod(myType); generic.Invoke(this, null); ``` For a static method, pass `null` as the first argument to `Invoke`. That's nothing to do with generic methods - it's just normal reflection. As noted, a lot of this is simpler as of C# 4 using `dynamic` - if you can use type inference, of course. It...
[ 0.24531202018260956, -0.19933955371379852, 0.009530310519039631, -0.17691512405872345, -0.3800656795501709, -0.1830163449048996, 0.39324894547462463, -0.13326524198055267, 0.018943727016448975, -0.15115562081336975, 0.08286673575639725, 0.34143203496932983, -0.5607542991638184, 0.402889668...
Could you tell me, please, if it's possible to preview (or at least retroview, for example, in a kind of a log file) SQL commands which SQL Server Management Studio Express is about to execute (or has just executed)? In the past I used Embarcadero DBArtisan which shows SQL queries to be executed before actually runnin...
[ 0.31735387444496155, -0.32876554131507874, 0.14648039638996124, 0.15925510227680206, -0.14337584376335144, -0.2742333710193634, -0.008926816284656525, 0.06090002879500389, -0.203438401222229, -0.7047402262687683, 0.3645705282688141, 0.6266840100288391, -0.2707941234111786, -0.0420327186584...
there are two ways to do this. Most of the Dialog boxes in Management Studio allow you to generate a change script to file or clipboard which can be useful for peaking under the hood, as well as applying changes between development, staging and production servers. An alternate solution would be to run SQL Server Prof...
[ 0.30143609642982483, -0.2202589511871338, 0.33766046166419983, 0.21224769949913025, 0.11065921187400818, -0.19547967612743378, 0.020889973267912865, -0.17035850882530212, -0.211202010512352, -0.686939001083374, 0.21913094818592072, 0.6066696643829346, -0.19423098862171173, -0.0913127288222...
I am working on implementing tail for an assignment. I have it working correctly however I seem to be getting an error from free at random times. I can't see, to track it down to a pattern or anything besides it is consistent. For example if I call my program as "tail -24 test.in" I would get the the the incorrect ch...
[ 0.8159089088439941, 0.10353220999240875, 0.14839087426662445, 0.046705570071935654, -0.29900476336479187, -0.16495393216609955, 0.6253030300140381, 0.06377187371253967, -0.262963205575943, -0.47629380226135254, 0.44938772916793823, 0.44882604479789734, -0.2753085792064667, 0.16549898684024...
it for hours to no avail. Here is the offending code: lines is defined as a char\*\* and was malloc as: ``` lines = (char**) malloc(nlines * sizeof(char *)); void insert_line(char *s, int len){ printf("\t\tLine Number: %d Putting a %d line into slot: %d\n",processed,len,slot); if(processed > numlines -1){//cle...
[ 0.18238018453121185, -0.4103708565235138, 0.5986833572387695, -0.19905562698841095, -0.13670393824577332, 0.29904893040657043, 0.5100846290588379, -0.2637938857078552, -0.17092324793338776, -0.4537418484687805, -0.290394127368927, 0.05456971004605293, -0.5064835548400879, 0.393182307481765...
argument (i.e. "len") probably does not include the NUL terminator. When you call malloc to copy the line (i.e. "s") you need to allocate an extra byte for the string terminator: ``` *(lines + slot) = (char *) malloc((len + 1) * sizeof(char)); ```
[ -0.2961292862892151, -0.21252331137657166, 0.2087009996175766, -0.09153641760349274, -0.15697959065437317, 0.49240365624427795, 0.06654874235391617, -0.016403404995799065, -0.005676283035427332, -0.22329437732696533, -0.2145185023546219, 0.4521258771419525, -0.07887604832649231, -0.0048441...
I've already written a generator that does the trick, but I'd like to know the best possible way to implement the off-side rule. Shortly: [Off-side rule](http://en.wikipedia.org/wiki/Off-side_rule) means in this context that indentation is getting recognized as a syntactic element. Here is the offside rule in pseudoc...
[ 0.11962716281414032, 0.0011626521591097116, 0.3170631527900696, -0.11008165031671524, -0.17586423456668854, -0.16043756902217865, 0.14244318008422852, -0.16438385844230652, -0.11772435158491135, -0.4593380391597748, 0.10779402405023575, 0.2238708883523941, 0.007964914664626122, 0.000473575...
level = stack of indentation levels push 0 to level last_newline = none per each token if it is NEWLINE put it to last_newline and get next token if last_newline contains something extract new_level and parenthesis_count from last_newline - if newline was inside paren...
[ 0.04615814983844757, -0.03640934079885483, 0.4838692247867584, -0.1918354034423828, 0.10126633197069168, -0.19158148765563965, 0.21047759056091309, -0.4121682643890381, -0.0978962630033493, -0.6142966151237488, -0.0072988420724868774, 0.25875940918922424, -0.037092424929142, 0.026946557685...
- if new_level > level.top push new_level to level emit last_newline as INDENT token and clear last_newline - if new_level == level.top emit last_newline and clear last_newline - otherwise
[ -0.22403424978256226, -0.16990898549556732, 0.7134820818901062, -0.27160632610321045, 0.17023417353630066, -0.028804311528801918, 0.2145978957414627, -0.3650098443031311, 0.02489524707198143, -0.4770682156085968, -0.3988029360771179, 0.22562599182128906, 0.077047199010849, 0.09802697598934...
while new_level < level.top pop from level if new_level > level.top freak out, indentation is broken.
[ -0.1084466353058815, 0.11325617134571075, 0.5194142460823059, 0.11131074279546738, 0.16074919700622559, -0.049412209540605545, 0.443655788898468, 0.25511032342910767, -0.40114447474479675, -0.3405703902244568, -0.6125448346138, 0.16895508766174316, 0.03131776675581932, 0.4731944799423218, ...
emit last_newline as DEDENT token clear last_newline emit token while level.top != 0 emit token as DEDENT token pop from level comments are ignored before they are getting into the layouter layouter lies between a lexer and a parser ``` This layouter doesn't generate more ...
[ -0.2965652346611023, -0.21241675317287445, 0.5045177936553955, -0.19659332931041718, -0.012485519051551819, -0.1073194071650505, 0.2677179276943207, -0.5055925250053406, 0.06703817844390869, -0.7020928263664246, -0.2677568793296814, 0.2067619413137436, -0.2416747510433197, 0.04083901271224...
there's indentation coming up. Therefore parsing rules remain quite simple. It's pretty good I think but inform if there's better way of accomplishing it. While using this for a while, I've noticed that after DEDENTs it may be nice to emit newline anyway, this way you can separate the expressions with NEWLINE while ke...
[ 0.12028049677610397, 0.07107959687709808, 0.12961071729660034, 0.3369593918323517, -0.24411027133464813, 0.22118869423866272, 0.31269845366477966, -0.07573948800563812, -0.08626072108745575, -0.7511113882064819, 0.11089153587818146, 0.21898674964904785, 0.2686915695667267, -0.2652898430824...
quite similar to what Python does, for example, which seems like it ought to carry some weight. Converting NEWLINE NEWLINE INDENT to just INDENT before it hits the parser definitely seems like the right way to do things -- it's a pain (IME) to always be peeking ahead for that in the parser! I've actually done that ste...
[ 0.11752799898386002, -0.20883962512016296, 0.2875506281852722, -0.09523428976535797, -0.2974243462085724, -0.0014168296474963427, 0.20118582248687744, -0.12815047800540924, -0.13602662086486816, -0.8622046709060669, 0.18654513359069824, 0.5031539797782898, -0.14047938585281372, -0.24806804...
converted NEWLINE INDENT to just INDENT (or, actually, COLON NEWLINE INDENT to INDENT, since in this case all indented blocks were always preceded by colons), then the parser was the third stage on top of that. But it also makes a lot of sense to me to do things the way you've described them, especially if you want to ...
[ 0.005351451225578785, -0.2119108885526657, 0.4936234652996063, -0.008269216865301132, -0.2494933158159256, 0.12590281665325165, -0.05341297760605812, -0.09024199098348618, -0.10273540765047073, -0.8980079889297485, 0.07122501730918884, 0.7541425228118896, -0.1465928703546524, -0.3676905632...
about indentation rules, essentially leaving the parser to enforce them when needed -- the following needed to be valid in certain contexts, for instance: ``` this line introduces an indented block of literal text: this line of the block is indented four spaces but this line is only indented two spaces ``` whi...
[ 0.227741539478302, 0.3458672761917114, 0.029280856251716614, 0.22776871919631958, -0.1743462234735489, -0.09125795215368271, 0.3864717483520508, -0.04792194068431854, -0.0683872327208519, -0.5926723480224609, -0.04331546276807785, 0.18161728978157043, -0.0960066169500351, -0.24457229673862...
up being, which it doesn't seem like you'd want a tokenizer to do. In that case I tried a few different things and ended up just storing a counter in each NEWLINE token that gave the change in indentation (positive or negative) for the following logical line. (Each token also stored all trailing whitespace, in case it ...
[ 0.037993889302015305, -0.21144534647464752, 0.40441158413887024, -0.08984367549419403, -0.2773873507976532, 0.3901708722114563, 0.3451230227947235, -0.3129921853542328, -0.35372865200042725, -0.6192456483840942, -0.14188148081302643, 0.05811944603919983, -0.4605313539505005, 0.011185948736...
than just nesting INDENTs and DEDENTs, and might well have been hell with a complicated grammar that needed a fancy parser generator, but it wasn't nearly as bad as I'd feared, either. Again, no need for the parser to look ahead from NEWLINE to see if there's an INDENT coming up in this scheme. Still, I think you'd ag...
[ 0.2641276717185974, 0.07596197724342346, -0.18110080063343048, 0.2892782986164093, -0.05922280624508858, 0.00651944475248456, 0.5133545994758606, 0.12137997150421143, -0.2653159499168396, -0.4414433240890503, -0.013398663140833378, 0.2681623101234436, -0.06044500693678856, -0.2912633121013...
counter if you just wanted to be able to parse Python code, for example. The way you're doing things is almost certainly the right approach for your application and many others besides. Though if anyone else has thoughts on how best to do this sort of thing, I'd obviously love to hear them....
[ 0.5066027641296387, 0.042933378368616104, -0.29305383563041687, 0.05407921224832535, -0.19680416584014893, 0.15455855429172516, 0.286513090133667, -0.13440828025341034, -0.29859432578086853, -0.32223746180534363, -0.07024037837982178, 0.6382469534873962, 0.03086971864104271, -0.18511404097...
If I escape some code because I want it to display as the actual code in html (eg for an example code snippet), save it to the database and then pull it back to the editor (an html page), it is displayed as html, as opposed to the escaped text. My problem arises when I include a textarea tag in the text because it wil...
[ 0.1411459594964981, 0.04926686733961105, 0.1394377201795578, 0.023918533697724342, 0.06210805103182793, -0.11286706477403641, 0.7913764715194702, -0.18953078985214233, -0.20660234987735748, -0.5351441502571106, -0.47885289788246155, 0.20662325620651245, -0.4784645140171051, 0.0787467658519...
of the browser? -> So I need to escape the text (code and pre tags perhaps)? every time I want to make changes to it? Or am I doing something wrong? \*Note I am the only person using this and it is mostly just for learning, so I am not worried about the security aspect so much as the way in check I need to handle my h...
[ 0.3111412525177002, 0.14185641705989838, 0.4468650221824646, -0.18220333755016327, -0.16953346133232117, -0.1283663511276245, 0.598510205745697, -0.07545748353004456, -0.4446508586406708, -0.9426242709159851, -0.17469167709350586, 0.5679788589477539, -0.3323493003845215, 0.0119211710989475...
will only do those that are special in HTML, such as &, quotes, and < or > This is quite a major difference that can break some things and can also cause the result to be enormous when using htmlentities().
[ 0.32767435908317566, 0.035633087158203125, 0.2546936273574829, 0.19891615211963654, -0.22984877228736877, -0.1886013299226761, 0.5548387169837952, 0.07572349905967712, -0.31954559683799744, -0.6783179044723511, -0.49369847774505615, 0.3634262979030609, -0.23051422834396362, -0.350657939910...
I'm trying to read variables from a batch file for later use in the batch script, which is a Java launcher. I'd ideally like to have the same format for the settings file on all platforms (Unix, Windows), and also be a valid Java Properties file. That is, it should look like this: ``` setting1=Value1 setting2=Value2 ....
[ 0.18538010120391846, 0.05573771521449089, 0.3322959244251251, -0.009600440971553326, 0.058685995638370514, -0.23884455859661102, 0.012670463882386684, -0.09039154648780823, 0.05746439844369888, -0.8513294458389282, 0.2013065665960312, 0.893623948097229, -0.15939217805862427, -0.06798047572...
platforms. To clarify: I need to do this in the command line/batch environment as I also need to set parameters that cannot be altered from within the JVM, like -Xmx or -classpath. You can do this in a batch file as follows: ``` setlocal FOR /F "tokens=*" %%i in ('type Settings.txt') do SET %%i java -Dsetting1=%setti...
[ 0.003436341416090727, -0.2975158989429474, 0.27934977412223816, 0.04752736538648605, -0.01667678914964199, -0.14807169139385223, -0.19238930940628052, -0.1819625049829483, -0.2812388837337494, -0.7097283005714417, 0.17114685475826263, 0.41802603006362915, -0.2191060334444046, -0.1063379123...
Generate the Fibonacci sequence in the fewest amount of characters possible. Any language is OK, except for one that you define with one operator, `f`, which prints the Fibonacci numbers. Starting point: **~~25~~ 14 characters** in **Haskell**: ~~`f=0:1:zipWith(+)f(tail f)`~~ ``` f=0:scanl(+)1f ``` RePeNt, 9, 8 c...
[ 0.08239807188510895, -0.13803449273109436, 0.5277791619300842, 0.06796780973672867, 0.21559259295463562, 0.37322455644607544, 0.1015203669667244, -0.407351553440094, -0.37371763586997986, -0.13150878250598907, -0.5752623081207275, 0.4417095184326172, -0.6174846291542053, -0.169516220688819...
Stack ------- ----------- ----- 1 Push a 1 onto the stack
[ -0.4959332048892975, 0.011231242679059505, 0.31855085492134094, -0.0468524694442749, -0.03562748804688454, -0.11320328712463379, -0.11604751646518707, -0.3979934751987457, -0.30820268392562866, -0.14321213960647583, -0.19624502956867218, 0.04854618385434151, -0.15584301948547363, -0.049659...
1 ↓ Push last stack value 1 1 [ Start a do-while loop
[ -0.19763676822185516, -0.26048287749290466, 0.48761191964149475, -0.46319109201431274, -0.005067809950560331, -0.3725675046443939, 0.18028639256954193, -0.6402135491371155, 0.15034043788909912, -0.038168665021657944, -0.1456473469734192, 0.22904355823993683, -0.5721542835235596, -0.0963252...
1 1 2? Push a two, then pop the 2 and copy the last 2 stack 1 1 1 1 items onto the stack + Add on the stack
[ 0.4396970868110657, 0.1347900927066803, 0.5431029796600342, -0.0528770349919796, 0.008769970387220383, -0.03334107995033264, -0.12131006270647049, -0.4439014196395874, -0.07443458586931229, -0.2560186982154846, -0.17750506103038788, 0.31690049171447754, -0.2753886282444, 0.0641421824693679...
1 1 2 ↓£ Push last stack value then print it 1 1 2 1 Push a 1 onto the stack
[ 0.019456718116998672, 0.13811880350112915, 0.7076071500778198, -0.4868747889995575, -0.29321911931037903, -0.1505933701992035, -0.015284618362784386, -0.30338427424430847, 0.42122361063957214, 0.013879261910915375, -0.22346098721027374, 0.24918407201766968, -0.5624206066131592, 0.027833053...