text
stringlengths
0
30.5k
title
stringclasses
1 value
embeddings
listlengths
768
768
I have a small list of checkboxes (see below), and I noticed I can use an input element with type="reset" and it will uncheck all the boxes. I know using the input would be better than an "onClick" event of the link, because I wouldn't be relying on JavaScript, but for this example I have both. ``` <a onclick="javasc...
[ -0.08114199340343475, 0.09205920994281769, 0.1924845427274704, -0.0770549550652504, -0.18472746014595032, 0.08467761427164078, 0.1408691704273224, -0.5423869490623474, -0.32025471329689026, -0.7516415119171143, -0.235483318567276, 0.4707392156124115, -0.5388834476470947, -0.203130796551704...
loops through all "input" elements of the form "myList" with type="checkbox" and set the value to "0" or something. Also, what is the correct "cross-browser" way of doing this? I assume there is no HTML form way of doing this like the reset? (I couldn't find one.) Yeah, you'd use JS. ``` for(var ix = 0; ix < document...
[ 0.2975199222564697, -0.23291170597076416, 0.09809644520282745, -0.03532760962843895, 0.21832208335399628, -0.09222349524497986, 0.584075391292572, -0.026418859139084816, -0.2914244532585144, -0.4401474893093109, -0.05155215412378311, -0.06397821009159088, -0.7215780019760132, 0.00388012197...
I am changing the DNS of a domain to point to a new server. What is the best way to handle this to make sure the transition goes as smoothly as possible, specially pertaining to email? Ideally I would like their current emails to not be lost. I believe they are just using webmail at the moment. Thanks! You didn't prov...
[ 0.6990966796875, -0.010100866667926311, 0.3109341561794281, 0.2396126240491867, 0.14643219113349915, -0.030238106846809387, 0.248691588640213, 0.22620713710784912, -0.41775864362716675, -0.7595751881599426, 0.16065607964992523, 0.15460525453090668, -0.03790315240621567, 0.4726637303829193,...
anything different when the DNS changed. If they are all using webmail, you'll need to run some scripts to move their mail to the new provider. If you're worried about losing incoming email when you change mail servers -- don't! The sending mail servers will queue mail for redelivery. The only trick is that you need t...
[ 0.648705780506134, -0.320441871881485, 0.5496276021003723, 0.32610970735549927, -0.12085792422294617, -0.06600772589445114, 0.34425047039985657, -0.10598143935203552, -0.6006978154182434, -0.5644854307174683, -0.032747551798820496, 0.472128301858902, -0.4033605456352234, 0.1875727921724319...
I want my application to fill in a single field in a form that exists as an black-and-white image file. The form always starts as the same paper version, but by the time my application gets it from my users, it may have been scanned or faxed more than once. Because of that, the field I need is not in the same place in ...
[ 0.6427334547042847, 0.2160712331533432, 0.4611305892467499, 0.08853626996278763, 0.2987648844718933, -0.02250763401389122, -0.10232071578502655, -0.0020989193581044674, -0.06847406178712845, -0.7420334219932556, -0.20059943199157715, 0.08963564038276672, -0.3169161081314087, 0.247393757104...
I have only 200 dpi of resolution. The text is always big enough for a human to read, but I'm skeptical about OCR. I have some budget so I do not need a free solution ... let's just say $2000. That said, I am considering 1. Get an OCR solution to find the text label on the field I need. I do not think I have the res...
[ 0.35857707262039185, 0.3833358883857727, 0.3724221885204315, 0.26800817251205444, 0.08219291269779205, -0.0023299958556890488, 0.16244347393512726, 0.16380836069583893, 0.10562057048082352, -0.8852209448814392, 0.11781653016805649, 0.6168610453605652, 0.1349381059408188, -0.134280890226364...
to recognize the edges of the form. From there, I could get the relative position of the field I need. I'm thinking of the dashed line my scanner software puts around the image of a small document. Is that a known algorhthm or is there an available solution? 3. Some other way to recognize the field I need. Attempts to ...
[ 0.32198092341423035, 0.1697428822517395, 0.33811041712760925, 0.15183091163635254, -0.24980570375919342, 0.05494716018438339, 0.01474506314843893, 0.11776644736528397, 0.10149899870157242, -0.929669201374054, 0.2158682942390442, 0.3517366647720337, -0.016577444970607758, -0.159863069653511...
always the same, but may be shifted, scaled, or slightly rotated due to photocopying/faxing. In that case, your problem is one of *image registration*: find the optimal rigid transformation that makes a form from a user line up with your "model" form, in which you know the location of the field of interest. Once you kn...
[ 0.2637416124343872, -0.408202588558197, 0.4315171539783478, 0.4794812500476837, 0.1765533685684204, 0.1111462414264679, -0.25802701711654663, 0.004060203209519386, -0.46970537304878235, -0.6701412200927734, -0.162705197930336, 0.39615556597709656, -0.288125604391098, 0.10440359264612198, ...
you need to do is fit a rectangle around the contents of the user's form. Coordinate descent should work. You will need some tolerance for noise (junk outside the form).
[ 0.3548193871974945, 0.013885041698813438, 0.3130822777748108, 0.15959686040878296, 0.24741831421852112, -0.27045726776123047, 0.05684264376759529, -0.5491994023323059, 0.024244079366326332, -0.8392413258552551, -0.019542742520570755, 0.19249963760375977, -0.17335441708564758, -0.3007595241...
First of all, the static keyword. I've read several articles and past threads on here covering the static keyword. I haven't found many scenarios listed of when I should use it. All I know is it doesn't create an object on the heap which tells me it would be good from a performance point of view for an object used a l...
[ 0.20887985825538635, -0.15977731347084045, -0.20650899410247803, 0.2453092485666275, -0.3833392560482025, -0.17922279238700867, 0.21352677047252655, 0.28361842036247253, -0.2772786021232605, -0.49592137336730957, 0.21504229307174683, 0.6695967316627502, -0.408235639333725, 0.36705523729324...
of 2+2 but I can't get an answer (missing a few fundamental and simple pieces of knowledge). Lastly, on the topic of thread safety, what should I look for in my code to get an idea of thread safety? I have posted this in VB.NET too because I don't think different languages (C#/VB.NET) will have different rules. Than...
[ 0.28593671321868896, -0.07671906054019928, 0.17401914298534393, 0.014607901684939861, -0.20605410635471344, -0.48797279596328735, 0.13975171744823456, 0.06403960287570953, -0.2954288125038147, -0.06438186764717102, 0.07667414098978043, 0.4008091390132904, -0.4196459650993347, 0.01247834507...
use the same data for each object of that type. For example String.Format() is a static method of the String class. You call it in your code without creating a String instance. Likewise, Math.Pi would be a class variable. But something like a length method doesn't make any sense unless it acts upon a specific instanc...
[ 0.17050381004810333, -0.11273109912872314, -0.09855694323778152, 0.13207381963729858, -0.20901472866535187, -0.20921306312084198, 0.1685227006673813, -0.06658855080604553, -0.18078754842281342, -0.3486135005950928, 0.05131638050079346, 0.36407843232154846, -0.5901157259941101, 0.3683241009...
only reference static variables and call static methods, as it doesn't have an object with which to reference non-static members. In C, the static keyword denotes file scope linkage. A top-level static variable or function does not get its name exported to other compiled object code. So two files can declare static va...
[ -0.009414782747626305, -0.04107286036014557, 0.3128006160259247, 0.10972093045711517, -0.45206210017204285, -0.45335233211517334, 0.08798827230930328, 0.14263379573822021, -0.2904725670814514, -0.36472904682159424, -0.3857462704181671, 0.6347026228904724, -0.7777035236358643, 0.04699872806...
the function. For example, you could use one to count the number of times the function has been called. Static variables in C# also have this property, but you don't declare them within the method as in C, just within the class.
[ 0.13311557471752167, -0.20434540510177612, -0.016719864681363106, 0.05662320926785469, -0.3743736445903778, -0.348376601934433, 0.025044584646821022, -0.1471429169178009, -0.2691563069820404, -0.09615544974803925, -0.031666308641433716, 0.6648332476615906, -0.3985998332500458, 0.1224841326...
I'm hoping there are some fellow doctrine users out there. Here is a simplified YAML of my relationships: ``` Collection: columns: id: { type: integer(4), notnull: true, primary: true, autoincrement: true } name: { type: string(255), notnull: true, unique: true } relations: Items: ...
[ 0.1577267348766327, 0.1272604763507843, 0.13553380966186523, 0.10413365811109543, -0.007377733942121267, 0.270630806684494, 0.25519269704818726, -0.24913690984249115, -0.38311824202537537, -0.2610706388950348, -0.2018018364906311, 0.5961315631866455, -0.10210634022951126, 0.253410011529922...
foreignType: many Item: columns: id: { type: integer(4), notnull: true, primary: true, autoincrement: true } name: { type: string(255), notnull: true } CollectionItem: columns: id: { type: integer(4), notnull: true, primary: true, autoincrement: true } collection_id: { type: integer(4) } ...
[ -0.30721691250801086, 0.06734306365251541, 0.08629714697599411, -0.057933736592531204, -0.10018845647573471, 0.53022301197052, -0.04194118455052376, -0.18111993372440338, -0.1444263458251953, -0.253767192363739, -0.2501748204231262, 0.3898771107196808, -0.5190001726150513, 0.34412652254104...
foreignAlias: CollectionItem foreignType: one ``` I want a collection to be able to hold many copies of the same item, but when I use the generated classes to load items like so: ``` $collection = Doctrine::getTable('Collection')->find(1); $items = $collection->Items; ``` $items doesn't contain my duplicates...
[ 0.10321333259344101, 0.36792680621147156, 0.33729586005210876, 0.04309631139039993, 0.026130422949790955, 0.28068503737449646, -0.05112577602267265, -0.2519511878490448, -0.2676950693130493, -0.476216197013855, 0.041958559304475784, 0.40740129351615906, -0.39750367403030396, 0.417994976043...
making specific dql queries instead but does anyone know if there is simple setting somewhere to allow the Items collection to have duplicates? you have to change the hydration mode to HYDRATE\_SCALAR: > This hydration mode creates a > flat/rectangular result set that can > contain duplicate data. ``` $res = $q->ex...
[ 0.19204936921596527, 0.03847169503569603, 0.3653268814086914, 0.16786685585975647, -0.34366142749786377, -0.181260347366333, 0.2661045491695404, -0.648867130279541, -0.40323010087013245, -0.34848085045814514, -0.24833817780017853, 0.5103994011878967, -0.4341334104537964, 0.294880747795105,...
I am needing to insert a bunch of similar records into a table, and was wondering if there was a nice/easy way to do this. I know it would be easy to just build a big string, but I was hoping I could find a more graceful way to do this. The `SqlBulkCopy` class has `WriteToServer` methods which write multiple records....
[ 0.2608596682548523, 0.1513129621744156, 0.09520211815834045, 0.20736387372016907, -0.19316653907299042, -0.14477190375328064, 0.10981684923171997, -0.02114407904446125, -0.0567023903131485, -0.5728778839111328, 0.29373884201049805, 0.3485346734523773, -0.2903163731098175, 0.291177690029144...
implement the `IDataReader` interface). There might be a simpler way than implementing `IDataReader` (i.e. by using one of the other `SqlBulkCopy.WriteToServer` methods).
[ 0.21875861287117004, -0.19959743320941925, 0.17490586638450623, 0.26634153723716736, -0.2675437033176422, -0.37302032113075256, 0.21902157366275787, -0.18465130031108856, 0.2680132985115051, -0.58540278673172, -0.03375912830233574, 0.5546036958694458, -0.4864450693130493, -0.11945879459381...
Where I work, we have a large codebase of C code that we build using Visual Studio 2005. It's separated into a variety of projects, including several static libraries. There are two solutions we primarily use, Full Debug (which turns off optimizations entirely), and Debug (we selectively optimize around 20% of files, w...
[ 0.2723744213581085, 0.40310004353523254, -0.19351454079151154, -0.17546673119068146, 0.1146818995475769, 0.17990896105766296, 0.2707565724849701, -0.1452532559633255, -0.08829513937234879, -0.5075979232788086, -0.11011286079883575, 0.6133237481117249, -0.3528163731098175, -0.02399483323097...
adding manual precompiled headers into our code base, but ran into the problem that the optimization setting of the precompiled header must match that of the C file. So, for our Debug build I need to make two precompiled headers, one optimized and one not. I would then set the project to use the nonoptimized one, and g...
[ 0.6024277210235596, -0.05561927333474159, 0.01971086673438549, 0.23179370164871216, 0.08264156430959702, -0.09683161973953247, 0.005750860087573528, -0.359964519739151, -0.05752214416861534, -0.5459492206573486, -0.04510083049535751, 0.8543614745140076, -0.3184839189052582, -0.026460487395...
entire configuration) that would make things a lot easier. Also, if I could somehow craft a macro statement for the precompiled header location ($(confname)/$(valueofparameteroptimized).pch or something) that would also solve it. Or, if those aren't possible, what solutions do people create adhoc for dealing with setti...
[ 0.019101012498140335, -0.0245582927018404, 0.3876970112323761, 0.622852623462677, 0.05148104205727577, -0.13934823870658875, 0.06346143782138824, 0.13998347520828247, -0.3651336133480072, -0.45894137024879456, 0.0057658664882183075, 0.722359836101532, 0.00002510524427634664, 0.131310075521...
would be 3D games and online games (particularly massively online games). The complication in 3D games comes from taking a model of a world and rendering it in 3D and to have it behave in a "realistic" (within the rules of the world) way. Creating a visual and auditory environment from that isn't actually that hard. I...
[ 0.07557255774736404, 0.1282053142786026, -0.0762770026922226, 0.5930516123771667, 0.14016415178775787, -0.10187406092882156, 0.23643137514591217, 0.1484316885471344, -0.05057857185602188, -0.7197263240814209, -0.09157215803861618, 0.6725806593894958, -0.1558295488357544, -0.204510644078254...
make a performance algorithm that'll generate realistic looking trees that's actually worth a lot of money). So games have naturally gotten better (visually) over the years as computing and graphics power has increased. Now some game programmers have made real innovations in this field that have (rightly) earnt them a...
[ 0.8835445046424866, 0.6217202544212341, -0.2647230923175812, 0.2889190912246704, 0.017247274518013, 0.058386459946632385, -0.2009083777666092, 0.030773013830184937, -0.40050700306892395, -0.39660903811454773, -0.08059486746788025, 0.8669064044952393, 0.27705833315849304, -0.285838991403579...
be 30-50+ artists. Content isn't complex (from a software point of view). It's just time consuming. As for online games, I remember when Everquest came out and people raved about how hard it was. Bzzzt, wrong. For those (like myself) who were familiar with the development of MUDs (mutli-user dungeons) through the 90s ...
[ 0.7448119521141052, 0.2578803598880768, -0.00964245107024908, 0.19429875910282135, -0.09378562867641449, 0.28642478585243225, 0.27059561014175415, 0.05971387401223183, -0.2845246195793152, -0.9323057532310486, 0.07383838295936584, 0.8392221331596375, 0.017355626448988914, -0.06367386877536...
knows how many Vista has. Or what about the Linux kernel? Now in government, the military and the private sector you'll find other applications that have literally thousands of man years invested in them.
[ 0.431013286113739, 0.22618041932582855, 0.13490372896194458, 0.5575008392333984, 0.23942047357559204, -0.1510888785123825, -0.036970678716897964, 0.8696866035461426, -0.3495476245880127, -0.33450770378112793, 0.17391328513622284, 0.64217209815979, 0.12242328375577927, 0.2926833927631378, ...
Is there a function like `GETDATE()` in Sql Server 2005 that let's you get the max possible date? I do not want to find the highest date in a table. I want to get the max possible date that sql server will be able to store. Basically, I want an expiration date of never The [documentation](http://msdn.microsoft.com/e...
[ -0.003408320713788271, -0.292030394077301, 0.8862082958221436, -0.007273269351571798, -0.04053690284490585, -0.0004619181854650378, 0.2953439950942993, 0.15890376269817352, -0.3606889545917511, -0.1421305388212204, 0.06918933242559433, 0.10644759982824326, 0.19220037758350372, 0.3787034749...
I'm trying to create an animated ambient abstract background for my game. I'm picturing something very similar to what Winamp has when you turn on it's visualization plug-in. Here's a link to some [screenshots](http://www.nullsoft.com/free/milkdrop/screenshots.html). I can handle tweaking the idea once I get somethin...
[ 0.8678102493286133, 0.0910428836941719, 0.1204712837934494, -0.0653209313750267, -0.07762791961431503, -0.00403692526742816, 0.06607503443956375, 0.28134703636169434, -0.05398786813020706, -0.751606822013855, 0.30013662576675415, 0.6048195958137512, -0.0816623866558075, 0.18516436219215393...
you want already. When a `PropertyModel` is queried for its value, it looks in two places: * If a "getter" method exists for the given property, the `PropertyModel` calls the getter to retrieve the property's value. Specifically, the `PropertyModel` looks for a method named `get<Property>`, where `<Property>` is the p...
[ 0.21460658311843872, -0.11696647852659225, 0.5409814119338989, -0.06451790034770966, 0.22688700258731842, 0.03602742776274681, -0.15427491068840027, -0.15696091949939728, -0.12256204336881638, -0.6702211499214172, -0.4657471179962158, 0.7178031206130981, -0.1207277923822403, 0.149501621723...
field is found, the `PropertyModel` returns the field's value. Note that the `PropertyModel` will check private and protected fields in addition to public fields for a match. In your case, the property expression used in the `PropertyModel` constructor is `"password"`, so the `PropertyModel` will first look for a meth...
[ -0.17846240103244781, -0.353615403175354, 0.2782839238643646, 0.1765153706073761, 0.01068989560008049, -0.42627736926078796, 0.06269232928752899, -0.06459914147853851, 0.03632644563913345, -0.6294506788253784, -0.4692658483982086, 0.8599297404289246, -0.361984521150589, 0.0526701845228672,...
For example, f you accidentally typed `getPasssword` (with 3 s's), the `PropertyModel` won't find it, and will fallback to returning the private field. --- **EDIT** If you don't like `PropertyModel`'s default behavior, you can create a subclass of `PropertyModel` that will prevent Wicket from trying to read/write to...
[ 0.1117975264787674, -0.13972651958465576, 0.0332099013030529, 0.15275681018829346, -0.11065687239170074, -0.40133431553840637, 0.35151422023773193, -0.061883922666311264, -0.27630415558815, -0.7325016856193542, -0.12468256801366806, 0.6633439660072327, -0.3486521542072296, 0.18925878405570...
* */ public class BeanPropertyModel extends PropertyModel { public BeanPropertyModel(Object modelObject, String expression) { super(modelObject, expression); } @Override public Object getObject() { if(getPropertyGetter() == null) fail("Missing getter"); return supe...
[ 0.01291727740317583, -0.31172794103622437, 0.3096434473991394, -0.14302211999893188, 0.1570965051651001, -0.02192787639796734, 0.33861052989959717, -0.21023714542388916, -0.337625116109848, -0.4286949634552002, -0.5128268599510193, 0.6583583354949951, -0.5174636840820312, 0.158650144934654...
setObject(Object modelObject) { if(getPropertySetter() == null) fail("Missing setter"); super.setObject(modelObject); } private void fail(String message) { throw new WicketRuntimeException( String.format("%s. Property expression: '%s', class: '%s'.",
[ 0.00925082340836525, -0.538787305355072, 0.22813624143600464, -0.06809290498495102, 0.24200798571109772, -0.037718579173088074, 0.7175599932670593, -0.26430001854896545, -0.09550146013498306, -0.46260160207748413, -0.47387808561325073, 0.5075663924217224, -0.5403969883918762, 0.11917319893...
message, getPropertyExpression(), getTarget().getClass().getCanonicalName())); } } ```
[ -0.27554523944854736, -0.3989391028881073, 0.4627334475517273, -0.1456781029701233, 0.2686671316623688, 0.01264117006212473, 0.3546409606933594, 0.1871962547302246, -0.21907509863376617, -0.5470060706138611, -0.547283947467804, 0.9254801869392395, -0.5204598307609558, 0.06551165878772736, ...
I'm a bit of a database novice, so pardon my naivety here. I have following sql statement: ``` SELECT DISTINCT dbo.tb_user.familyName, dbo.user_email.email FROM dbo.tb_user INNER JOIN dbo.user_email ON (dbo.tb_user.id = dbo.user_email.userID) ``` This returns records where an email address exists. What I would l...
[ 0.04698105901479721, 0.49890387058258057, 0.23444204032421112, -0.3514608144760132, -0.04496784508228302, 0.12528933584690094, 0.16120949387550354, -0.24524377286434174, 0.012872033752501011, -0.6156870722770691, -0.03970949351787567, 0.11130545288324356, -0.3547569513320923, 0.60454523563...
I'm trying to find a good reference to help me convert this TSQL statement to Linq: EXAMPLE: ``` SELECT * FROM Categories WHERE ProductID IN (SELECT ProductID FROM ProductCategories WHERE CatID = 23) ``` I can't find anywhere that references how to do the WHERE "IN" part. While it's not *exactly* a TSQL to LINQ ref...
[ 0.22704331576824188, 0.11003140360116959, 0.3225698471069336, 0.058887507766485214, -0.23025155067443848, -0.2155493050813675, 0.023651329800486565, -0.3268245458602905, -0.24315746128559113, -0.37001168727874756, -0.17353962361812592, 0.15672211349010468, -0.04607170447707176, 0.271493434...
I am wanting to implement automated testing, using the Microsoft testing framework in Visual Studio, for my software development projects. I have created some tests, and all in all, it's pretty easy to use. What are some **better practices** for **testing business objects**, more specifically ones that read and write ...
[ 0.8498667478561401, 0.4864165782928467, -0.3685432970523834, 0.007504283916205168, -0.13941587507724762, 0.08779966831207275, 0.32873111963272095, -0.008804108016192913, 0.07380203902721405, -0.4742847979068756, 0.286793053150177, 0.519775927066803, -0.04930002614855766, -0.096763059496879...
the AddUser method, do I add the User, check my tests, and then delete the User? Do you test each of the CRUD methods in a single test method? Lastly, what about the individual business rules like verifying strings are of the correct size, start dates are less than end dates, the CustomerId is a correct Customer and ...
[ 0.4437984526157379, 0.41207611560821533, 0.38797786831855774, 0.22169892489910126, -0.10928215086460114, 0.01128880400210619, 0.031783316284418106, 0.11726018786430359, -0.060289908200502396, -0.4779680669307709, 0.43483006954193115, 0.5800334215164185, -0.17079709470272064, 0.185730651021...
my objects. It would take some serious refactoring to make this testable with mock objects. I'm going to look into this. Though, at some point, I *do* want to test the database interaction ... when using a mock database, where/when would you actually test the database communication? One other question ... is it best t...
[ 0.41761982440948486, 0.475999116897583, 0.3159308433532715, 0.009615213610231876, -0.35718315839767456, 0.09125811606645584, 0.26160818338394165, -0.04952787980437279, -0.2727024257183075, -0.5369703769683838, 0.13523268699645996, 0.49634596705436707, -0.21155773103237152, 0.09870046377182...
That is probably the cleanest way, because you avoid the complexity of a real DB, and really only test your business logic. If you cannot avoid combining business rules and DB access into one class (probably a problematic design, but sometimes hard to avoid), then you have to test against a DB. There pretty much the ...
[ 0.4456730782985687, 0.092137411236763, -0.3432469367980957, 0.3189632296562195, -0.09721822291612625, -0.33062753081321716, 0.5328917503356934, -0.25842806696891785, -0.08923770487308502, -0.35953500866889954, -0.17349332571029663, 0.5730368494987488, -0.36228904128074646, 0.09305460005998...
the same data. One test will accidentally change data, and other tests will mysteriously fail. I've done that and regretted it... Each test really must stand on its own. To do all this, I strongly recommend some kind of DB testing framework. These help you to clean the DB, load necessary data, and compare query result...
[ 0.5200656652450562, 0.1394214928150177, -0.07344647496938705, 0.009677502326667309, -0.27488967776298523, -0.13600687682628632, 0.2630140483379364, -0.3901381194591522, 0.13990096747875214, -0.7747170925140381, -0.01974872499704361, 0.5001159310340881, -0.2532914876937866, -0.0665920674800...
I'm planning to work on some hobby Java projects. I've done some small-scale projects, so I'm familiar with the language itself and building a GUI with Swing. I'd like to make my work a little less ad-hoc and perhaps find some tools that might be useful out in the real world. NetBeans now comes bundled with the [Swing...
[ 0.6606951355934143, 0.09596654027700424, 0.08412842452526093, -0.17959848046302795, -0.3107169568538666, -0.14088407158851624, -0.008911375887691975, -0.15026992559432983, -0.36074718832969666, -0.47329241037368774, -0.11904124915599823, 0.304145872592926, -0.08509859442710876, -0.17140333...
of the API completely undocumented and there's virtually no documentation on how to use it. There are only two questions in the FAQ, the mailing lists are all but dead, and I can't even tell if the project is being actively developed or if it's been abandoned. I've managed to get up and running with it based largely on...
[ 0.3223413825035095, 0.24677833914756775, 0.0982978343963623, -0.29903775453567505, 0.06047750636935234, -0.23241348564624786, 0.6902589797973633, 0.025918668136000633, -0.39862746000289917, -0.4023759663105011, -0.08655526489019394, 0.3813653886318207, -0.1474137306213379, 0.11852392554283...
the moment, and am not looking for J2EE frameworks like Spring and Hibernate. The [basic principles](http://butunclebob.com/ArticleS.UncleBob.PrinciplesOfOod) for creating a good desktop are the same for creating web or enterprise applications. So the core of Spring or other frameworks such as [OSGi](http://felix.apach...
[ 0.20810478925704956, -0.1199597641825676, 0.22248360514640808, 0.01971147023141384, -0.3583894670009613, -0.1591421663761139, -0.09449253231287003, -0.1530042439699173, -0.39652201533317566, -0.4774758517742157, -0.01297140121459961, 0.4197619557380676, -0.15812988579273224, 0.028441812843...
on RCP* I see some people are recommending Eclipse RCP or Netbeans. I've done quite a bit of Eclipse RCP development and for certain classes of applications, it's great. However, the learning curve is *very* steep and the feature set may be way more than you need. Keep that in mind for any framework you investigate.
[ 0.6915525794029236, 0.11934081465005875, -0.19863693416118622, 0.11657994985580444, -0.4287751019001007, -0.38837215304374695, 0.14465980231761932, 0.3142765164375305, -0.151851087808609, -0.5361874103546143, 0.19735196232795715, 0.7751259803771973, -0.06813086569309235, -0.175772100687026...
Is c# compiled to machine code, or is it compiled into a platform independent intermediate code? I am looking at an app that needs to be ported to a single language, and we would like to port it to a portable/fast platform. From what I understand, Java tends to be a little faster than C#, but not enough for it to real...
[ 0.1730501353740692, 0.02672354131937027, -0.19305676221847534, 0.13646313548088074, -0.2920885980129242, -0.27143797278404236, -0.005054821725934744, 0.13995765149593353, -0.35389357805252075, -0.5758346319198608, 0.14047826826572418, 0.7405344843864441, -0.42647960782051086, -0.5217897295...
because of optimizations that the JIT compiler can make. They generally are an order of magnitude faster than languages that are normally purely interpreted, like Perl or Python. You specifically mentioned C#, but I bring up Java because it is better supported cross-platform, which you also specifically mention. Thank...
[ 0.44986581802368164, 0.04171763360500336, -0.27521684765815735, 0.0951499342918396, -0.46272891759872437, -0.2345111072063446, 0.4136652648448944, 0.1462780386209488, -0.3258070647716522, -0.6521329283714294, -0.08691894263029099, 0.539138674736023, -0.2103668600320816, -0.1776877045631408...
and is fairly aggressive about pushing new features. Java has the exact opposite problem where Sun is very conservative about pushing new features, causing it to lack some of the nice features that C# has, like properties and closures.
[ -0.38510051369667053, -0.04213834926486015, -0.015515713021159172, -0.07005251944065094, -0.5338563919067383, -0.15242506563663483, 0.18131542205810547, 0.17726443707942963, -0.24577978253364563, -0.3893876075744629, 0.09480904042720795, 0.4245350956916809, -0.25608235597610474, -0.0081178...
What's the best approach for reading in XML data and building a query to insert the values into a SQL Server DB? Anyone have a best approach for this type of scenario? Personally, I use a DataSet.ReadXML(). Then it places all the data into DataTables in the DataSet and then is much easier to loop through and manipulat...
[ 0.3547661006450653, 0.0868760421872139, 0.1472400277853012, 0.27164700627326965, 0.007520238868892193, -0.27154168486595154, -0.06216198205947876, 0.1302700638771057, -0.07222870737314224, -0.4725079834461212, 0.18063583970069885, 0.4828003942966461, -0.12507103383541107, 0.025874176993966...
Lately my queries before caching into memcache have been taking forever to process! In this example, it took 10 seconds. All I am trying to do is get the 10 most recent hits in this case. I am getting the feeling that it loads all 125,592 rows then only returns 10, am I right? ``` # User@Host: root[root] @ localhost...
[ -0.2837750315666199, 0.1851557344198227, 0.6835256218910217, -0.20794789493083954, -0.2044733464717865, 0.158078134059906, 0.3670617640018463, -0.1971575766801834, -0.4494709372520447, -0.87694251537323, 0.008694679476320744, 0.5762409567832947, -0.26727569103240967, 0.008714299649000168, ...
0 Rows_sent: 1 Rows_examined: 128879 SELECT count(DISTINCT(ip_address)) AS count_distinct_ip_address FROM `hits` WHERE (campaign_id = 30); ``` When running the query the phpMyAdmin, it takes 1.3395 seconds. Although just doing a `SELECT * FROM hits` only takes 0.0001 seconds. I find it very odd that returning all of...
[ -0.41813424229621887, 0.10866774618625641, 0.6868460178375244, -0.2728011906147003, -0.34655359387397766, 0.26094111800193787, 0.25788596272468567, -0.6524410843849182, -0.3252086043357849, -0.6292600631713867, -0.06662170588970184, 0.16614454984664917, -0.0939776822924614, 0.0358775220811...
default CURRENT_TIMESTAMP, `ip_address` varchar(15) NOT NULL, `campaign_id` int(11) NOT NULL, PRIMARY KEY (`id`), KEY `campaign_id` (`campaign_id`), KEY `ip_address` (`ip_address`) ); ``` It seems your `campaign_id` index has low selectivity, i. e. there are lots of records with this value. Ordering so many...
[ -0.14580361545085907, -0.09089193493127823, 0.4988533556461334, -0.07518813759088516, -0.03194053843617439, 0.06333820521831512, -0.03057621419429779, -0.10507100075483322, -0.3520914614200592, -0.7276507616043091, -0.1516505628824234, 0.5380039811134338, -0.44211113452911377, 0.1253813803...
need a complete scan on whole `campaign_id = 30` anyway, be it `TABLE SCAN` or `INDEX SCAN`. In fact, the `TABLE SCAN` can be even faster: ``` SELECT count(DISTINCT(ip_address)) AS count_distinct_ip_address FROM `hits` WHERE IFNULL(campaign_id, campaign_id) = 30; ``` If it is not, you may create an index on `(camp...
[ -0.13560804724693298, -0.14019012451171875, 0.7734171748161316, 0.04216282069683075, -0.19134335219860077, -0.11912558227777481, -0.13168120384216309, -0.5838025808334351, -0.3078741729259491, -0.6383261680603027, -0.09307343512773514, 0.4311443567276001, -0.24423767626285553, -0.074340671...
ip_address ) i ) o ``` The trick here is simple: we don't need the result, just a count, so there is no need in scanning for actual values. Index scan will suffice. Unfortunately, despite what MySQL documentation says [**here**](http://dev.mysql.com/doc/refman/5.1/en/loose-index-scan.html) on loose index scans, th...
[ -0.021236063912510872, 0.1300303339958191, 0.4414134621620178, 0.013513567857444286, -0.14596182107925415, -0.13545535504817963, 0.13860325515270233, -0.5767134428024292, -0.23219554126262665, -0.7324841022491455, -0.08964479714632034, 0.48408642411231995, -0.4455154538154602, 0.1199493780...
subquery. In the first field we set the variable to `0` when the previous `ip_address` (stored in the variable) equals to the current one; otherwise we set it to `1`. In the second field we assign the current value of `ip_address` to the variable. Finally we retrieve the `SUM` on the first field which will of course ...
[ -0.2770928144454956, -0.17954927682876587, 0.6382476687431335, 0.03429010510444641, 0.038529425859451294, -0.028186021372675896, -0.15147089958190918, -0.33795738220214844, -0.11972243338823318, -0.17949658632278442, -0.16709618270397186, 0.06776487082242966, -0.3699379861354828, 0.3888507...
I'm creating a program for end-users, that's already written using MySQL and some OpenOffice.org Star Basic Macros. I was wondering if there was an open source single user database that would be easy enough for the average Joe to install, (or that I could write a macro to install it for him...) The [OpenOffice.org Base...
[ 0.531989336013794, 0.2866911292076111, 0.09997651726007462, 0.08384977281093597, -0.2026551067829132, -0.15989229083061218, 0.1458691507577896, 0.30091604590415955, -0.009095930494368076, -0.5731810927391052, -0.08928417414426804, 0.6329042315483093, -0.33282971382141113, -0.13504949212074...
design and query**. A simple, single-user database library that needs no install is [SQLite](http://en.wikipedia.org/wiki/SQLite), that had been considered by the openoffice team. It is used in many mainline applications, e.g. [Mozilla Firefox](http://en.wikipedia.org/wiki/Mozilla_Firefox).
[ 0.41379204392433167, 0.13436377048492432, 0.1890294998884201, 0.006285260431468487, -0.03257886692881584, -0.36457720398902893, -0.05446206405758858, -0.17243055999279022, -0.29816052317619324, -0.6323314309120178, -0.43121179938316345, 0.37991708517074585, -0.7189409732818604, -0.11461711...
While executing an `INSERT` statement with many rows, I want to skip duplicate entries that would otherwise cause failure. After some research, my options appear to be the use of either: * `ON DUPLICATE KEY UPDATE` which implies an unnecessary update at some cost, or * `INSERT IGNORE` implies an invitation for other k...
[ 0.47648948431015015, 0.2878464162349701, -0.13160867989063263, 0.024825507774949074, 0.23394103348255157, 0.14104463160037994, 0.46938857436180115, 0.1881154626607895, -0.49116504192352295, -0.4254865348339081, -0.14390069246292114, 0.6383242607116699, -0.40815258026123047, 0.1283218413591...
be inserted if it results in a duplicate key. But the statement won't generate an error. It generates a warning instead. These cases include: * Inserting a duplicate key in columns with `PRIMARY KEY` or `UNIQUE` constraints. * Inserting a NULL into a column with a `NOT NULL` constraint. * Inserting a row to a partitio...
[ 0.051246900111436844, -0.1027911901473999, 0.011239396408200264, -0.022941336035728455, 0.44841209053993225, -0.07206001877784729, 0.24607057869434357, -0.08504325151443481, -0.2905420660972595, -0.5497543811798096, -0.3657176196575165, 0.5140261650085449, -0.5657716989517212, 0.1026150807...
use cascading foreign keys) or else prevent the `REPLACE`. * Triggers that fire on `DELETE` are executed unnecessarily. * Side effects are propagated to replicas too. **correction:** both `REPLACE` and `INSERT...ON DUPLICATE KEY UPDATE` are non-standard, proprietary inventions specific to MySQL. ANSI SQL 2003 defines ...
[ 0.26178041100502014, 0.24899853765964508, 0.22074580192565918, -0.03934386745095253, 0.14952930808067322, -0.2593178153038025, 0.2212628722190857, -0.14512217044830322, -0.06601198017597198, -0.3073709309101105, -0.022447044029831886, 0.5138183236122131, -0.5942658185958862, 0.340578079223...
*generated*, but it is not used in the changed row. See demonstration below, tested with Percona Server 5.5.28. The configuration variable `innodb_autoinc_lock_mode=1` (the default): ``` mysql> create table foo (id serial primary key, u int, unique key (u)); mysql> insert into foo (u) values (10); mysql> select * fro...
[ -0.20897136628627777, -0.11869289726018906, 0.5176228284835815, 0.03991946950554848, 0.09684417396783829, 0.11147017031908035, -0.005461755208671093, -0.31911882758140564, -0.2605096995830536, -0.5596831440925598, -0.005156069528311491, 0.5141867995262146, -0.3591989278793335, 0.2130264043...
update u = 20; mysql> select * from foo; +----+------+ | id | u | +----+------+ | 1 | 20 | +----+------+ mysql> show create table foo\G CREATE TABLE `foo` ( `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT, `u` int(11) DEFAULT NULL, PRIMARY KEY (`id`), UNIQUE KEY `u` (`u`) ) ENGINE=InnoDB AUTO_INCREMENT=...
[ -0.2634448707103729, 0.005703778471797705, 0.5937545299530029, -0.34461286664009094, 0.15845081210136414, 0.04715002328157425, 0.17180785536766052, -0.48954716324806213, -0.05752800777554512, -0.5979833602905273, -0.30746203660964966, 0.7336698770523071, -0.46864598989486694, 0.05681688711...
storing a new auto-increment id: ``` mysql> select * from foo; +----+------+ | id | u | +----+------+ | 1 | 20 | +----+------+ mysql> replace into foo (u) values (20); mysql> select * from foo; +----+------+ | id | u | +----+------+ | 3 | 20 | +----+------+ ```
[ -0.2304820567369461, 0.09828732907772064, 0.4817032814025879, -0.1984563171863556, -0.02142750471830368, 0.3889414072036743, 0.25092193484306335, -0.561210572719574, -0.09566618502140045, -0.35712817311286926, -0.2633627653121948, 0.7225909233093262, -0.47408100962638855, -0.09551055729389...
I'm planning on making my existing application into an [RTD server](http://support.microsoft.com/kb/285888). The application is currently written in C++ and while I will eventually port it to C#/Mono I want to be able to add the RTD functionality with C++. I have found a few sample pieces of code (the MSVCRTDServer...
[ 0.43609175086021423, 0.10634173452854156, 0.4289493262767792, -0.1272267997264862, -0.4011401832103729, -0.08842042088508606, 0.26300644874572754, 0.11113233864307404, -0.24599319696426392, -0.7318211197853088, 0.17175409197807312, 0.7747521996498108, -0.27542322874069214, 0.32727745175361...
the existing app has an MFC GUI. EDIT: The intended use is taht the existing GUI app will be running - no need for clients of the COM/RTD interface to launch the app. (Although I won't deny that would be nice) Basically i want to implement the IRTDServer interface with my own data - so that Excel (or other apps) ca...
[ 0.21312110126018524, -0.04114162176847458, 0.9196853637695312, -0.1138702929019928, -0.0031737685203552246, -0.08958164602518082, 0.25840532779693604, -0.042182087898254395, -0.06961479038000107, -0.8350496292114258, -0.2939818501472473, 0.9872123599052429, -0.386409729719162, -0.105334781...
to create a COM object and register it so that clients can "see" it. I am not sure how to add a COM object to an exe and have that COM object implement an existing/pre-definfed interface. EDIT I started a bounty on this so I could get code samples. Apparently I am too lazy and stupid (or maybe it is just the hyper a...
[ 0.5316528081893921, 0.1723153442144394, -0.13811850547790527, 0.07761652767658234, -0.1280088722705841, 0.49373379349708557, 0.15026812255382538, -0.191374734044075, -0.23499473929405212, -0.5184556245803833, 0.3996162414550781, 0.29977089166641235, -0.5519452095031738, 0.1604667454957962,...
of threads running and turn it into an RTD server (that has the same UI) All that cocreate and CoThisandthat, etc. Where do I put that code in my exe? How do I extend/implement the IRTD stuff? A before and after of a sample MFC hello world app (dialog based) is going to get the accepted answer. 1. Before app with a...
[ 0.29741916060447693, -0.11952893435955048, 1.013413429260254, -0.1266690492630005, -0.07567642629146576, 0.009564395993947983, 0.04619322344660759, -0.4844076633453369, -0.1967657208442688, -0.8413885831832886, -0.339769572019577, 0.6295983791351318, -0.45310351252555847, -0.07115364819765...
studio and otherwise to create step 2 from step 1. ( IDL, etc other files created. ) Ideally this is provided for VS2008, but any version would work. Thanks. **EDIT:** Dude, I have not touched MFC since year 2000. I was hoping to stay that way for the rest of my life. :-) Anyway... Aparently, the wizards have evolve...
[ 0.5483971238136292, -0.0016229564789682627, 0.5602109432220459, 0.005773874931037426, -0.4762898087501526, -0.49243906140327454, 0.3712189495563507, -0.13163919746875763, -0.3071897029876709, -0.7177907228469849, 0.08848769962787628, 0.8484911918640137, -0.19032905995845795, 0.002675148891...
Class... In the dialog, choose ATL Simple Object. You will get a warning that ATL support will be added to the project. 3. A new wizard will open with options for the new ATL object. You should be done. Frankly, I don't see any reason to post here a wizard-generated code. But if you have further questions on particul...
[ 0.4107462763786316, -0.1030934676527977, 0.29784491658210754, 0.15972140431404114, -0.24506781995296478, -0.48021894693374634, 0.5127042531967163, 0.131153866648674, -0.10185647010803223, -0.6988999843597412, -0.18524864315986633, 0.631119966506958, -0.0968666672706604, 0.1372508555650711,...
can add the RTD interface to it. You will need to both inherit from the interface and add it to the `COM_INTERFACE_MAP`. Since the RTD interface is an `IDispatch` interface, you will have to inherit your class from IDispatchImpl<> and to add IDispatch to the `COM_INTERFACE_MAP` using [`COM_INTERFACE_ENTRY2`](http://msd...
[ -0.16952747106552124, -0.21132682263851166, 0.6395920515060425, 0.09755575656890869, -0.13735680282115936, -0.2824956178665161, -0.07822668552398682, -0.3093186318874359, 0.09139744937419891, -1.138717532157898, -0.1637418419122696, 0.7786267995834351, -0.28340306878089905, 0.1673397868871...
I stumbled upon this blog post that has the [C++ definitions of the two RTD interfaces](http://weblogs.asp.net/kennykerr/archive/2008/10/29/excel-rtd-server-in-c.aspx). You probably already have them, but I thought I'd add it for completeness sake. --- The easiest way would be to create new ATL EXE project through th...
[ 0.8124518990516663, 0.11039262264966965, 0.4907061457633972, 0.1859053373336792, 0.15838228166103363, 0.11292152851819992, 0.007852728478610516, -0.19842389225959778, -0.34641167521476746, -0.9011458158493042, -0.015997374430298805, 0.25031721591949463, 0.06998475641012192, 0.1917286217212...
and STA](http://www.codeproject.com/KB/COM/CCOMThread.aspx?fid=140250&df=90&mpp=25&noise=3&sort=Position&view=Quick&select=2664830) * [How to compile ATL code with /clr](http://msdn.microsoft.com/en-us/library/ms235211.aspx) **EDIT:** If you just need to know how to register an object in your EXE with COM, so client a...
[ 0.10727422684431076, 0.04347663372755051, 0.4398726522922516, -0.042255550622940063, -0.1672961711883545, 0.3840440511703491, 0.1485159993171692, -0.3035692870616913, -0.33762869238853455, -0.5672620534896851, -0.23242820799350739, 0.49483567476272583, -0.3598310649394989, 0.03071207739412...
you are doing custom marshalling * if your app has UI, you will have to modify the shutdown logic, so that when the user closes the UI, the app does not exit untili the last COM reference to your objects has been released as well **EDIT 2:** I'd still suggest you look at the ATL out-of-proc sample and at the skeleton ...
[ 0.6485626697540283, -0.060419268906116486, 0.48516711592674255, 0.09279466420412064, -0.07674314826726913, -0.1495763212442398, 0.1850026249885559, -0.2830403745174408, -0.4478560984134674, -0.41867801547050476, -0.3055628836154938, 0.47847995162010193, -0.09386424720287323, 0.074905507266...
to check for a particular command line argument - **/embedded**. If that argument is present, it means the app is being launched by COm in response to a CoCO call. The app might choose to not show its UI at this point. Whether the app shows the UI or not, it has to register the class factories for any COM objects it p...
[ 0.5298787951469421, 0.07163842022418976, 0.30522972345352173, -0.13031229376792908, 0.013998925685882568, -0.018339160829782486, 0.2607155740261078, 0.13023506104946136, -0.2919888198375702, -0.40827903151512146, -0.4630003273487091, 0.5449612736701965, -0.3825438320636749, 0.2176247239112...
on any object AddRef and decreased on any object Release). However, the app should not shutdown itself, if it detected that the user interacted with its UI. in such case, the shutdown is deferred until the user explicitly closes the last UI (To make that detection easier, the app usually does not show its UI until the ...
[ 0.035282038152217865, -0.29558998346328735, 0.7811927795410156, 0.08708320558071136, 0.11017278581857681, -0.13737814128398895, 0.5991690158843994, 0.05099240690469742, -0.4297962486743927, -0.5526077151298523, -0.5439677238464355, 0.3677122890949249, -0.13259422779083252, 0.12996019423007...
however, there are COM references, the app should hide the UI, but continue running until the last reference is released. If the app has reached a point at which it will shutdown, it should revoke all class factory registrations.
[ 0.5011460781097412, 0.03123101219534874, 0.46094590425491333, 0.21011629700660706, 0.2910909354686737, 0.001480484614148736, 0.4796304404735565, 0.11875276267528534, -0.06558772921562195, -0.4138375520706177, -0.4092438519001007, 0.2522851228713989, -0.3004768490791321, 0.2927888035774231,...
I am developing various components, and regularly run into the need to have a property that has a "one-to-many" relationship, component-to-property-member. The components are often visual components, but not always, and sometimes need to be registered with the IDE (i.e. use the Property Inspector), but not always. I fi...
[ 0.6121183633804321, 0.14535270631313324, 0.3939613103866577, 0.2333119809627533, 0.13413509726524353, -0.07700280845165253, -0.08017422258853912, -0.4773993194103241, -0.09052573144435883, -0.6532387733459473, 0.006121477577835321, 0.3468891382217407, 0.20277918875217438, 0.239048451185226...
are properties, you can descend from TCollection, and then the IDE and Object Inspector will automatically provide support for them via the TCollection Property editor.
[ 0.46871089935302734, 0.017113327980041504, 0.3706659972667694, 0.3819998800754547, 0.07251585274934769, -0.34434860944747925, -0.01877252385020256, -0.352764755487442, -0.14705690741539001, -0.46551448106765747, -0.2682042419910431, 0.6393386721611023, 0.0004451247223187238, 0.303797900676...
Is there a library for converting strings in as3 into the application/x-www-form-urlencoded format? Specifically, I am looking for the same functionality as the java URLEncoder <http://java.sun.com/javase/6/docs/api/java/net/URLEncoder.html> Unfortunately, as3's escape and encodeURIComponent functions don't do it. Fo...
[ 0.03490006923675537, 0.16826599836349487, 0.5161290168762207, -0.21542032063007355, -0.19693900644779205, 0.20431232452392578, 0.1914273351430893, -0.7510398030281067, -0.3819020092487335, -0.4704543948173523, -0.4746975600719452, 0.5357899069786072, -0.29352572560310364, -0.19901558756828...
[**mx.utils.URLUtil.objectToString()**](http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/mx/utils/URLUtil.html#objectToString()) > > > You typically use this method to convert > an ActionScript object to a String > that you then append to the end of a > URL. By default, invalid URL > characters are ...
[ -0.4328847825527191, 0.153282031416893, 0.3895154297351837, -0.1037062257528305, -0.053366806358098984, 0.28739044070243835, 0.18420463800430298, -0.7622758746147156, -0.1033918485045433, -0.4196726977825165, -0.651852548122406, 0.030557185411453247, -0.5303345918655396, -0.024621557444334...
where most nonalphanumeric > characters are replaced with % > hexadecimal sequences. Here's an example showing the usage and output of all four approaches: ``` import mx.utils.URLUtil; private function test():void { var url:String = "http://www.google.com/search?"; var s:String = "here is my search query"; ...
[ -0.06350178271532059, 0.12574204802513123, 0.5187562108039856, -0.1915060430765152, 0.24516165256500244, 0.36312708258628845, 0.3101540505886078, -0.46684911847114563, -0.08564794063568115, -0.5458875298500061, -0.35936108231544495, 0.36388951539993286, -0.35985618829727173, 0.253929585218...
the same result (just as JavaScript's own encodeURIComponent() does): ``` // http://www.google.com/search?q=here%20is%20my%20search%20query ``` I agree the plus signs are easier on the eyes, though! To swap them out manually: ``` trace(url + "q=" + escape(s).split("%20").join("+")); ``` But if there's an ActionSc...
[ 0.27100658416748047, -0.0529085211455822, 0.5111242532730103, -0.18361841142177582, 0.10797864198684692, 0.011084102094173431, 0.22221064567565918, -0.31805282831192017, -0.07633080333471298, -0.6649730205535889, -0.22070381045341492, 0.3964497447013855, -0.246750608086586, -0.316280245780...
I am wondering how to do this in a functional programming language. Maybe F# or Haskell. Can someone show me an example without using any function calls except for `find` and `rfind`? This function finds the next slash using `i` as the num of `slash` (<0 for backwards). ``` size_t findSlash(const char *sz, size_t i...
[ -0.00691960658878088, -0.09207421541213989, 0.3565698266029358, -0.27951332926750183, 0.08786842972040176, 0.24629878997802734, 0.2382104992866516, -0.18389327824115753, -0.27523863315582275, -0.8714759349822998, 0.05195624381303787, 0.3626006841659546, -0.1750440150499344, 0.1193340718746...
a = s.rfind("\\", pos); b = s.rfind("/", pos); } else { a = s.find("\\", pos); b = s.find("/", pos); } if (a==-1u)
[ -0.4670366942882538, -0.1867879033088684, 0.2470676600933075, -0.5279494524002075, 0.19344928860664368, 0.24463962018489838, 0.11442814022302628, -0.43255504965782166, -0.05287555232644081, -0.5788291096687317, -0.7334396839141846, 0.2695169150829315, -0.3306262195110321, -0.08454844355583...
{ if (b==-1u) return pos; c = b; } else if (b==-1u) c = a; else
[ -0.15728089213371277, 0.01049868855625391, -0.040818341076374054, -0.3139824867248535, 0.024246828630566597, 0.2835979163646698, 0.04494188725948334, -0.2796335220336914, -0.1678345948457718, -0.14453962445259094, -0.6301915049552917, 0.38099488615989685, -0.24470315873622894, -0.253315508...
c = min(a, b); pos = c+1; } return c; } ``` In first, your code is broken. `size_t` is unsigned type and never can be `i<0`. In second, your code is ugly std library misuse and ineffective. There should be used regular expression library or such or use handcrafted scanner. Resulting code is far cleane...
[ 0.3590731918811798, 0.10866702347993851, 0.44895443320274353, -0.2984207570552826, -0.1293199509382248, 0.0037534350994974375, 0.5364959239959717, -0.21051964163780212, -0.11013776063919067, -0.6271348595619202, -0.07638467848300934, 0.7733624577522278, -0.3255443871021271, 0.1527076065540...
= sz; if (i<0) { for(;*s;s++); for(;;s--){ if(s<sz) return -1; if((*s == '/') || (*s == '\\')) if(! ++i) break; } } else { for(;;s++){
[ -0.0435817651450634, -0.16309431195259094, 0.4817703366279602, -0.37025022506713867, 0.43479326367378235, 0.022071169689297676, 0.74491947889328, -0.5028470754623413, -0.22214965522289276, -0.3731677234172821, -0.9389858245849609, 0.2206551730632782, -0.24403950572013855, 0.098283082246780...
if(! *s) return -1; if((*s == '/') || (*s == '\\')) if(! i--) break; } } return s-sz; } ``` I haven't used to write Haskell or F# but for example below code in Erlang should state as example how to do it in functional language: ``` findslash(L, I) when is_list(L), is_integ...
[ -0.3360901176929474, -0.05630948767066002, 0.6143242716789246, -0.4347001016139984, 0.22388334572315216, -0.3313884437084198, 0.3954457938671112, -0.13842381536960602, -0.16194243729114532, -0.5849428176879883, -0.18597210943698883, 0.5749140977859497, -0.24941246211528778, -0.138468012213...
if I<0 -> case findslash(lists:reverse(L), -1*I - 1, 0) of none -> none; X -> length(L) - X - 1 end; I>=0 -> findslash(L, I, 0) end. findslash([H|_], 0, X) when H=:=$/; H=:=$\\ -> X; findslash([H|T], I,
[ -0.407176673412323, -0.09855146706104279, 0.6830982565879822, -0.4174218475818634, 0.20669063925743103, 0.21586453914642334, 0.2128671556711197, -0.41487056016921997, -0.049274343997240067, -0.5929824709892273, -0.4645759165287018, 0.3250746428966522, -0.17931528389453888, 0.05226872116327...
X) when H=:=$/; H=:=$\\ -> findslash(T, I-1, X+1); findslash([_|T], I, X) -> findslash(T, I, X+1); findslash([], _, _) -> none. ``` My attempt in Haskell with error checking and keeps laziness for i>=0: ``` findSlash :: String -> Int -> Maybe Int findSlash str i | i < 0 = reversed (_findSlash (reverse str) (-...
[ -0.5035792589187622, -0.0663665309548378, 0.6674701571464539, -0.3463190495967865, 0.04629692807793617, 0.22474578022956848, 0.439644992351532, -0.19491587579250336, -0.05405401811003685, -0.3826391100883484, -0.49225640296936035, 0.5415299534797668, -0.2950371205806732, -0.019590292125940...
(x:xs) i n | x == '/' || x == '\\' = if i==0 then Just n else _findSlash xs (i-1) (n+1) | True = _findSlash xs i (n+1) _findSlash []
[ -0.18140512704849243, -0.10029182583093643, 0.4527795612812042, -0.3419339060783386, 0.30818799138069153, -0.03206978365778923, 0.25432172417640686, -0.3512636125087738, -0.1519155502319336, -0.34117159247398376, -0.42065849900245667, 0.5790354609489441, -0.3633905053138733, 0.014924537390...
_ _ = Nothing ```
[ 0.2857787311077118, 0.8491252660751343, 0.19238443672657013, -0.2110747992992401, -0.12607303261756897, -0.32702943682670593, 0.4965624213218689, 0.1394912153482437, -0.28644779324531555, -0.13866324722766876, -0.24485699832439423, 0.30112746357917786, -0.3128888010978699, 0.35142618417739...
We have the application, which used to download the firmware to external device. We used to release our SW as a zip file. Some of the users directly running the application from the zip file. So the application extracting to windows TEMP folder and running. That time windows firewall or anti virus software blocking t...
[ 0.4730604887008667, 0.006982420105487108, 0.8375238180160522, 0.12903644144535065, 0.2716948091983795, -0.4501267969608307, 0.37937435507774353, -0.14539265632629395, -0.0009410121128894389, -0.5412082672119141, -0.36108458042144775, 0.5675444006919861, -0.2522933781147003, 0.4771301746368...
from the temp folder."); ```
[ 0.4420953392982483, 0.16764116287231445, 0.22709888219833374, 0.10303530842065811, 0.39633235335350037, -0.25938981771469116, 0.059862472116947174, 0.270113080739975, 0.04374247416853905, -0.2751670777797699, -0.66422438621521, 0.5371569395065308, -0.35009726881980896, 0.03177499771118164,...
If not what is a good friendly java framework for newcomers? I want to build something like twitter. You can go a very long way with just servlets and JDBC. Consider JSPs using JSTL as an added nicety. But I'd bet that if your web site consists of more than a page or two delivering database content to the browser, yo...
[ 0.6651236414909363, 0.22628234326839447, 0.02096659317612648, 0.4199564456939697, -0.1705482304096222, -0.2557888329029083, 0.12838882207870483, 0.35593369603157043, -0.21821753680706024, -0.6796073913574219, 0.029870958998799324, 0.5470474362373352, -0.142960786819458, 0.1447928100824356,...
If you have to maintain a site and keep it going, eventually it's likely that you'll reach the conclusion that there are patterns ripe for capturing. Who knows? Maybe you'll decide as a result of your experience that you want to take a crack at solving the web framework problem, too. Whatever you do, I think having di...
[ 0.7548122406005859, -0.1543005108833313, 0.21624279022216797, 0.26840266585350037, 0.016100170090794563, -0.41398367285728455, 0.5390937924385071, 0.08091729879379272, -0.5895183682441711, -0.7513972520828247, -0.12411311268806458, 0.20141054689884186, -0.2513161599636078, 0.03760363534092...
don't let it leak out into others. You can have reusable components that will survive your first efforts. If you decide to switch to a web framework you'll just snap these layers into place and off you go. I wrote my first significant web site without any frameworks - just straight servlets, JSPs and JDBC. It gave me ...
[ 0.7016416192054749, 0.14869573712348938, -0.2603955566883087, 0.2416841685771942, -0.07131948322057724, -0.3325262665748596, 0.19245903193950653, 0.41678541898727417, -0.12194449454545975, -0.5892437100410461, 0.12500841915607452, 0.3409889340400696, -0.18297113478183746, 0.005963081959635...
I'm using PHP and xPath to crawl into a website I own (just crawl the html not going into the server) but I get this error: > Catchable fatal error: Object of class > DOMNodeList could not be converted to > string in C:\wamp\www\crawler.php on > line 46 I already tried echoing just that line to see what I was gett...
[ 0.3088984489440918, 0.4231417775154114, 0.22480963170528412, -0.08839717507362366, -0.28435876965522766, -0.019376466050744057, 0.7318087816238403, 0.22701868414878845, -0.30013370513916016, -0.8483562469482422, 0.3452472388744354, 0.3917507827281952, -0.22760871052742004, 0.30394166707992...
working with an HTML instead of a XML...so I have no idea what's wrong...here's my code... ``` <?php $html = file_get_contents('http://miurl.com/mipagina#0'); // create document object model $dom = new DOMDocument(); // load html into document object model @$dom->loadHTML($html); // create domxpath instance $xPath = n...
[ 0.049848899245262146, -0.05284837633371353, 0.550686240196228, -0.07033105939626694, 0.17419959604740143, 0.06505799293518066, 0.46004199981689453, -0.5594534277915955, -0.2913696765899658, -0.654965341091156, -0.21953022480010986, 0.8011905550956726, -0.39617544412612915, -0.1705365478992...