text stringlengths 0 30.5k | title stringclasses 1
value | embeddings listlengths 768 768 |
|---|---|---|
I have string that I want to chop to array of substrings of given length n. I am not interested in remainder (if length of string cannot be divided by n without remainder)
```
let ChopString (myString : string) n =
let res =
seq{
for i = 0 to myString.Length / n - 1 do
yield(... | [
-0.028773033991456032,
-0.23206201195716858,
0.17602697014808655,
-0.3124844431877136,
-0.043064579367637634,
0.1391340047121048,
0.2436390072107315,
-0.5209515690803528,
-0.11094041913747787,
-0.44416970014572144,
-0.3188556134700775,
0.5685572624206543,
0.023418933153152466,
0.1667747199... | |
}
|> Seq.to_array
res
```
This is the best I could do. It looks ugly to me.
Is there nicer/shorter version of this, maybe without for loop?
`stringInstance.[start..end]` is much more readable than `String.sub`. Here's what I came up with:
```
let chop (input : string) len =
seq { for ... | [
-0.07360569387674332,
-0.26138001680374146,
-0.046029333025217056,
-0.1448565274477005,
-0.207468181848526,
0.19146601855754852,
0.0778568908572197,
-0.27056190371513367,
-0.39207881689071655,
-0.43906453251838684,
-0.0024678490590304136,
0.7102876305580139,
-0.1815449297428131,
-0.2963960... | |
do yield input.[start..start + len - 1] }
|> Seq.toArray
```
Or you can use:
```
let chop (input : string) len =
Array.init (input.Length / len) (fun index ->
let start = index * len
input.[start..start + len - 1])
``` | [
-0.22011597454547882,
-0.4674277901649475,
-0.06156615540385246,
0.025478798896074295,
-0.3319401144981384,
0.23590785264968872,
-0.057316526770591736,
-0.23676171898841858,
-0.3488781452178955,
-0.22858509421348572,
-0.275673508644104,
0.6894973516464233,
0.019697993993759155,
-0.38068321... | |
Everyone uses source-code control to manage versions (right?) and this provides some level of backup. There are times, however, when your local copy is out of sync with the repository. Moreover, some sandbox-type projects may not have yet ;-) made it into SCC.
**EDIT**: I have multiple projects in my projects director... | [
0.5326184034347534,
0.2072034478187561,
0.1753586381673813,
0.12184832990169525,
0.31165194511413574,
-0.3205699920654297,
0.40580809116363525,
0.25989872217178345,
-0.6203587651252747,
-0.642585277557373,
-0.2396012842655182,
0.5235593318939209,
-0.21314086019992828,
0.17068162560462952,
... | |
a backup and syncing as necessary from SCC.
What backup strategies, other than source code control, do you use to keep your code safe?
A similar question can be found at <https://stackoverflow.com/questions/38388/organization-wide-backup-strategy>, but I'm more interested in hearing others' personal strategies if you... | [
0.4305170178413391,
-0.03865944966673851,
0.2668253779411316,
0.2919451594352722,
0.3052487075328827,
-0.2957659065723419,
0.3196065425872803,
0.04585307836532593,
-0.2714107930660248,
-0.4604186713695526,
-0.39194226264953613,
0.9022250771522522,
-0.07292768359184265,
-0.36576980352401733... | |
I have some settings I need in a Javascript file -- servers to connect to -- that changes based on my environment. For `development`, `test`, and `staging`, I want to use the staging servers; for `production`, the production servers. I already have the settings in Ruby (configured in my `environment/xyz.rb` files). So ... | [
0.7286202311515808,
0.05629567801952362,
0.3542705774307251,
-0.04163608327507973,
0.11774404346942902,
0.16822631657123566,
0.0528087392449379,
-0.22283726930618286,
0.039303820580244064,
-0.9108164310455322,
0.16584061086177826,
0.47101107239723206,
-0.0577024444937706,
0.190756484866142... | |
task that generates the correct version from the template and places a static file in the `public/javascripts` directory. Has anyone tried something like this? What did you use for rendering? Where did you put the template file and the rendering code?
Or is it better to just keep the dynamic version and cache it in pr... | [
0.1851731240749359,
-0.260064035654068,
-0.10446489602327347,
-0.140337735414505,
-0.293651819229126,
0.036544233560562134,
0.1974969208240509,
-0.2564895749092102,
-0.3485063314437866,
-0.7930883169174194,
0.20237812399864197,
0.5487129092216492,
-0.3316618800163269,
-0.05257106199860573,... | |
in my `"lib"` directory called `"constants.rb"`. This file has a few if statements that switch based on environment (development, test, staging, or production) that switch out the values of the ip addresses that I need to attach to. It is peppy enough for my purposes on the behemoth of a machine that I have the applica... | [
0.5594406127929688,
0.18118493258953094,
0.027357613667845726,
-0.029592294245958328,
0.14669878780841827,
0.1736050397157669,
-0.1307886689901352,
-0.11064279824495316,
0.10145547240972519,
-0.6460826992988586,
0.08696465939283371,
0.5109719038009644,
-0.3215077221393585,
0.09611743688583... | |
= "10.16.8.44" ## The is the shared IP address
end
``` | [
-0.10027605295181274,
0.16963958740234375,
0.27864521741867065,
-0.02246454916894436,
0.38508331775665283,
-0.17903533577919006,
0.2016957551240921,
0.4042798578739166,
0.12268027663230896,
-0.5510373115539551,
-0.191647469997406,
0.05063283070921898,
-0.3649296462535858,
0.828867733478546... | |
I know that WPF 3.5 SP1 supports a `StringFormat` in a binding, but can Silverlight do the same? I thought it could, but damned if I can make it work!
Here's a snippet of my XAML:
```
<TextBlock Text="{Binding StartTime, StringFormat=t}" />
```
It compiles OK, but I get a runtime error when it gets to the browser..... | [
0.2461954951286316,
0.10347703844308853,
0.5453832149505615,
-0.24530673027038574,
-0.3904537558555603,
-0.46337756514549255,
0.23879849910736084,
-0.41856181621551514,
-0.2018050104379654,
-0.5142290592193604,
0.12104056030511856,
0.6264187097549438,
-0.4719637930393219,
-0.01495557185262... | |
WPF. | [
0.27158957719802856,
-0.158391073346138,
0.013768450357019901,
-0.15183357894420624,
-0.3038884103298187,
-0.33697667717933655,
-0.12267795950174332,
-0.33846163749694824,
-0.21971449255943298,
-0.36361342668533325,
-0.3199364244937897,
0.09585151821374893,
-0.03689093515276909,
0.31865009... | |
What is the most efficient way to display the last 10 lines of a very large text file (this particular file is over 10GB). I was thinking of just writing a simple C# app but I'm not sure how to do this effectively.
Read to the end of the file, then seek backwards until you find ten newlines, and then read forward to th... | [
0.2822337746620178,
-0.2324739545583725,
0.49625396728515625,
0.09349667280912399,
-0.11837458610534668,
0.1380680799484253,
-0.011270873248577118,
-0.03062564879655838,
-0.3604174256324768,
-0.7855502963066101,
0.089909628033638,
0.3517976403236389,
-0.22420497238636017,
-0.40544116497039... | |
last `numberOfTokens` in the file located at `path` encoded in `encoding` where the token separator is represented by `tokenSeparator`; the result is returned as a `string` (this could be improved by returning an `IEnumerable<string>` that enumerates the tokens).
```
public static string ReadEndTokens(string path, Int... | [
-0.33622342348098755,
-0.31999585032463074,
0.47771769762039185,
-0.09754228591918945,
-0.008817554451525211,
0.176710844039917,
0.09681166708469391,
-0.4616326689720154,
-0.3135724365711212,
-0.4933403730392456,
-0.3728273808956146,
0.23875416815280914,
-0.016388840973377228,
0.1497372984... | |
for (Int64 position = sizeOfChar; position < endPosition; position += sizeOfChar) {
fs.Seek(-position, SeekOrigin.End);
fs.Read(buffer, 0, buffer.Length);
if (encoding.GetString(buffer) == tokenSeparator) {
tokenCount++;
if (tokenCount == numberOfToke... | [
-0.43155714869499207,
-0.38551104068756104,
0.2621007561683655,
-0.21527503430843353,
0.2802838385105133,
0.3894071578979492,
0.19842544198036194,
-0.3823625445365906,
-0.23180420696735382,
-0.4387396275997162,
-0.32245126366615295,
0.13033749163150787,
-0.10054957121610641,
0.163693398237... | |
byte[] returnBuffer = new byte[fs.Length - fs.Position];
fs.Read(returnBuffer, 0, returnBuffer.Length);
return encoding.GetString(returnBuffer);
}
} | [
-0.13073945045471191,
-0.10148680210113525,
0.3971531391143799,
-0.3985363245010376,
0.19008444249629974,
0.21910104155540466,
0.12027823179960251,
-0.33389392495155334,
-0.2200802117586136,
-0.4704824388027191,
-0.4284426271915436,
0.5010556578636169,
-0.3195408582687378,
0.19910173118114... | |
}
// handle case where number of tokens in file is less than numberOfTokens
fs.Seek(0, SeekOrigin.Begin);
buffer = new byte[fs.Length];
fs.Read(buffer, 0, buffer.Length);
return encoding.GetString(buffer);
}
}
``` | [
0.012988924980163574,
-0.14104892313480377,
0.28694310784339905,
-0.1320534348487854,
0.2652071714401245,
0.11972611397504807,
0.09922979027032852,
-0.2792167663574219,
-0.2364446520805359,
-0.5440486669540405,
-0.1635003536939621,
0.36288198828697205,
-0.11016366630792618,
0.1449532359838... | |
How can i convert an array of bitmaps into a brand new image of TIFF format, adding all the bitmaps as frames in this new tiff image?
using .NET 2.0.
Start with the first bitmap by putting it into an Image object
```
Bitmap bitmap = (Bitmap)Image.FromFile(file);
```
Save the bitmap to memory as tiff
```
MemoryStre... | [
0.23337240517139435,
-0.09182369709014893,
0.834027886390686,
-0.08952214568853378,
-0.15343722701072693,
0.5005162358283997,
0.2818448841571808,
-0.8774391412734985,
-0.11513741314411163,
-0.8968084454536438,
-0.1731032133102417,
0.28828659653663635,
-0.3383086323738098,
-0.18688724935054... | |
Encoder.SaveFlag,
(long)EncoderValue.FrameDimensionPage);
EncoderParameter CompressionEncodeParam = new EncoderParameter(
Encoder.Compression, (long)EncoderValue.CompressionNone);
EncoderParams.Param[0] = CompressionEncodeParam;
EncoderParams.Param[1] = SaveEncodeParam;
tiff.SaveAdd(/* next image as tiff - d... | [
0.10608594119548798,
0.0179218091070652,
0.6954473853111267,
-0.20689086616039276,
0.09068763256072998,
0.3605057895183563,
0.1566130369901657,
-0.6066293120384216,
-0.18810242414474487,
-0.9515495896339417,
-0.16469033062458038,
0.30103179812431335,
-0.018148567527532578,
-0.0103917000815... | |
Why do most C programmers name variables like this:
```
int *myVariable;
```
rather than like this:
```
int* myVariable;
```
Both are valid. It seems to me that the asterisk is a part of the type, not a part of the variable name. Can anyone explain this logic?
They are EXACTLY equivalent.
However, in
```
int *my... | [
-0.13578630983829498,
0.055972468107938766,
-0.05545903369784355,
-0.02692020684480667,
-0.5432091355323792,
-0.31588172912597656,
0.009652046486735344,
0.06314387917518616,
-0.020496338605880737,
-0.3088575601577759,
-0.13747097551822662,
0.6792046427726746,
-0.37311381101608276,
0.375765... | |
I'm playing around with Project Euler's [Problem 220](http://projecteuler.net/index.php?section=problems&id=220), and I'm a little confused about the Wikipedia article on the topic, [Dragon Curve](http://en.wikipedia.org/wiki/Dragon_curve). On the topic of calculating the direction of the nth turn without having to dra... | [
-0.5065805315971375,
0.019585512578487396,
0.35482314229011536,
-0.23659300804138184,
-0.369302898645401,
0.22837413847446442,
0.11701549589633942,
-0.5732372403144836,
-0.14131568372249603,
-0.37587448954582214,
0.05895758420228958,
0.29213252663612366,
-0.04580960422754288,
-0.0850207358... | |
turn is L.
>
>
> For example, to determine the direction of turn 76376:
>
>
>
> ```
> 76376 = 9547 x 8.
> 9547 = 2386x4 + 3
> so 9547 mod 4 = 3
> so turn 76376 is L
>
> ```
* Is there a clever way to figure out if n **can** be expressed as k2^m, apart from checking divisibility by successive powers of 2?
* What ... | [
-0.49412181973457336,
-0.13937115669250488,
0.44279539585113525,
-0.2801770865917206,
-0.19801707565784454,
0.2977588474750519,
-0.15380096435546875,
-0.25218603014945984,
-0.1679452657699585,
-0.6013017296791077,
-0.07321536540985107,
0.12110638618469238,
-0.03713935986161232,
-0.05105458... | |
of the question.)
m is the number of zero bits at the least significant end of the number.
The simplest algorithm is to divide by 2 as long as the number is even,
but you could also use binary search to speed it up.
All integers can be expressed in this way. | [
-0.24555657804012299,
-0.11906491219997406,
0.21192333102226257,
-0.11943062394857407,
0.051611319184303284,
0.1359906941652298,
0.26352813839912415,
-0.5236305594444275,
-0.21984292566776276,
-0.2776346802711487,
-0.11715053021907806,
0.24331071972846985,
-0.3027394711971283,
0.0598622672... | |
I've got a sql query (using Firebird as the RDBMS) in which I need to order the results by a field, EDITION. I need to order by the contents of the field, however. i.e. "NE" goes first, "OE" goes second, "OP" goes third, and blanks go last. Unfortunately, I don't have a clue how this could be accomplished. All I've eve... | [
0.12922267615795135,
0.46333426237106323,
0.08555935323238373,
-0.07428789138793945,
-0.16984087228775024,
0.0751785859465599,
0.03687158226966858,
-0.20108965039253235,
-0.22592991590499878,
-0.28237462043762207,
-0.22781117260456085,
0.34645816683769226,
-0.22140371799468994,
0.147704795... | |
first. The query is rather large and I was really hoping to learn possibly a more effecient way of doing this:
example:
```
SELECT * FROM RETAIL WHERE MTITLE LIKE 'somethi%' AND EDITION='NE'
UNION
SELECT * FROM RETAIL WHERE MTITLE LIKE 'somethi%' AND EDITION='OE'
UNION
SELECT * FROM RETAIL WHERE MTITLE LIKE 'someth... | [
0.3254220187664032,
0.11395001411437988,
0.2723138928413391,
0.004611004143953323,
0.0926419347524643,
0.38125112652778625,
-0.34464383125305176,
-0.12373269349336624,
-0.0891677662730217,
-0.5663531422615051,
-0.1740199476480484,
0.5144083499908447,
-0.14164774119853973,
0.330167591571807... | |
Any simple, but secure script available for **Flash > MySQL DB** integration? I need something for a Login DB.
Exchanging variables with **PHP** is nice and easy, but obviously insecure.
**via Remoting?** I've got the [Flash 8 remoting components installed](http://blog.vixiom.com/2007/04/17/actionscript-20-flash-remo... | [
0.047677893191576004,
0.2064329832792282,
0.15005610883235931,
0.10096340626478195,
-0.14694388210773468,
-0.2562839090824127,
0.4307328462600708,
-0.4217328131198883,
-0.3082745373249054,
-0.5242800116539001,
-0.16337496042251587,
0.35361403226852417,
-0.3851318061351776,
-0.3550119996070... | |
solution more viable, although offering only basic protection for a high-security Login Database. **See also:** SO: [1](https://stackoverflow.com/questions/190461/a-simple-medium-securelogin-protocol), [2](https://stackoverflow.com/questions/46415/), [3](https://stackoverflow.com/questions/73947/), Adobe: [4](http://ww... | [
-0.06373637169599533,
0.05419798195362091,
0.6855893731117249,
0.19479171931743622,
0.07649026066064835,
-0.3957856297492981,
0.5762438774108887,
-0.24006451666355133,
-0.24259042739868164,
-0.5653737783432007,
-0.3080056607723236,
0.79198157787323,
-0.30008307099342346,
-0.373988866806030... | |
think, as Ristonj suggested that it is best that you use the URLRequest class.
What I usually do is pass on the current php session ID to the applet so that I can include this and the user IP in the initial applet request. On the server I check if the ip/session are actually active in the session table and match. If ... | [
0.4435557425022125,
-0.02435331419110298,
0.28078925609588623,
0.023719005286693573,
0.013074847869575024,
-0.09906534105539322,
0.24853526055812836,
-0.01739903725683689,
-0.2023465633392334,
-0.6414577960968018,
0.3018522262573242,
0.48630291223526,
-0.09146592766046524,
0.12860120832920... | |
have to store PHP scripts on the server, but it is more difficult to get the source for these than just being able to decompile the applet and extract everything :)
I like to keep all program logic that is potentially dangerous on the server only, NOT in the applet. | [
0.30897393822669983,
0.4813838005065918,
0.10392434895038605,
0.09415008127689362,
0.03625830262899399,
-0.3276034891605377,
0.4834357500076294,
-0.07187584787607193,
0.08238759636878967,
-0.45890599489212036,
0.1746453493833542,
0.547683835029602,
-0.09234573692083359,
-0.1579472422599792... | |
I have been programming in Python, PHP, Java and C for a couple or years now, and I just finished reading Hackers and Painters, so I would love to give LISP a try!
I understand its totally diferent from what i know and that it won't be easy. Also I think (please correct me if I'm wrong) there's way less community and ... | [
0.30352017283439636,
0.22372663021087646,
-0.15783216059207916,
0.10253290832042694,
-0.1740623265504837,
-0.16759568452835083,
0.33068397641181946,
0.47119253873825073,
-0.2124725878238678,
-0.6933309435844421,
0.2829115390777588,
0.6432604193687439,
-0.14476825296878815,
-0.3296996355056... | |
development, and I know that's not so common so... I know it's good to plan my learning before picking the first book or tutorial and spending lots of time on something that may not be the best way!
Thank you all for your answers!
**edit:** I read Practical Common Lisp and was: ... long, hard, interesting and defini... | [
0.12499510496854782,
0.038992974907159805,
0.24420957267284393,
0.21928079426288605,
-0.09022139012813568,
0.24215549230575562,
0.12346246838569641,
0.1476411074399948,
-0.18945276737213135,
-0.6126013994216919,
0.15183867514133453,
0.5762421488761902,
0.07578890770673752,
-0.3157438933849... | |
its worth it) if you decide lisp(or scheme or whatever dialect) is not what you where looking for, you will still have a very fun new way of thinking about recursion!
Try reading [Practical Common Lisp](http://www.gigamonkeys.com/book/), by Peter Seibel. | [
0.23573705554008484,
-0.08665817230939865,
0.14416998624801636,
-0.1259736865758896,
0.025734391063451767,
0.10986212641000748,
0.20322546362876892,
-0.1035754606127739,
-0.2565622627735138,
-0.24906741082668304,
0.12588588893413544,
0.46661874651908875,
-0.43348899483680725,
-0.7452438473... | |
What is the ".pfx" extension used for in .NET?
Why does it ask for a password when the solution is being built?
A file containing an encrypted private key. It's probably being used for code signing the application (so the user knows who created the program and hence if they can trust it).
You can probably see it bein... | [
0.48713433742523193,
-0.1397952437400818,
0.10756680369377136,
0.31967291235923767,
0.20194759964942932,
-0.3439716696739197,
0.06540121883153915,
0.06159763038158417,
-0.208845317363739,
-0.34937041997909546,
-0.14777772128582,
0.24693706631660461,
-0.1364009827375412,
0.05059636011719704... | |
I have a Class see below, when i am trying to query it from another page it not linking e.g. if i put "var Notes = HandhedNotes.GetNotesByLinkIDJoin();" when i look at Notes theres not links there. I think its due to the IQuerable maybe I should be using something elese??
```
namespace WebSys
{
public partial class ... | [
0.09395469725131989,
0.19406552612781525,
0.6482709050178528,
0.08955398201942444,
-0.12952373921871185,
0.06304860860109329,
0.08747311681509018,
-0.09838517010211945,
0.11506293714046478,
-1.0899747610092163,
0.20717036724090576,
0.5012409090995789,
0.09899552166461945,
0.484036803245544... | |
x in db.HandheldNotes
join t in db.Employees on x.By equals t.EmployeeNo
orderby x.DateAdded
select new
{ | [
0.20531773567199707,
-0.14512617886066437,
0.4903336465358734,
0.14696215093135834,
0.11642974615097046,
0.0927991047501564,
0.15360218286514282,
-0.19079743325710297,
0.21207498013973236,
-0.8118157386779785,
-0.10200274735689163,
0.3595697283744812,
0.0900760218501091,
0.5505681037902832... | |
DateRaised = x.DateAdded,
Note = x.Note,
TypeID = x.TypeID,
EmployeeID = t.Forenames + " " + t.Surname | [
0.027456915006041527,
-0.025111529976129532,
0.4247715473175049,
-0.30777668952941895,
0.27649232745170593,
0.09673638641834259,
0.11597472429275513,
0.004234802443534136,
-0.21121542155742645,
-0.27186593413352966,
-0.05342957004904747,
-0.13340908288955688,
-0.22718475759029388,
0.184509... | |
};
return (IQueryable)Note;
}
}
```
}
A file containing an encrypted private key. It's probably being used for code signing the application (so the user knows who created the program and hence if they can trust it).
You can probably see it being used by right-clicking on the project, getting Properties,... | [
0.2234928458929062,
-0.02663225494325161,
-0.006283114198595285,
0.13791079819202423,
0.3260730803012848,
-0.28047865629196167,
0.12517455220222473,
0.08393863588571548,
0.10876189917325974,
-0.5282057523727417,
-0.17391209304332733,
0.5315809845924377,
-0.21813346445560455,
0.040789041668... | |
I have a factory that builds the objects with longest lifetime in my application. These have types, lets say, `ClientA` and `ClientB`, which depend on `Provider` (an abstract class with many possible implementations), so both clients have a reference to Provider as member.
According to the command-line arguments, the ... | [
0.3708323538303375,
0.27878135442733765,
0.5735665559768677,
-0.7114008069038391,
0.09881144016981125,
0.7898828387260437,
0.24289171397686005,
-0.24020367860794067,
-0.2778252363204956,
-0.7554993629455566,
-0.06700903922319412,
0.4430560767650604,
-0.6932308673858643,
0.35789456963539124... | |
return app.run();
}
```
And the `buildApp` method is basically this:
```
App AppFactory::buildApp()
{
Provider* provider = NULL;
if (some condition)
{
provider = new ProviderX();
}
else
{
provider = new ProviderY();
}
ClientA clientA(*provider);
ClientB clientB(... | [
0.13580049574375153,
0.19316592812538147,
0.6677651405334473,
-0.5326290726661682,
-0.16809791326522827,
0.6425221562385559,
0.6075731515884399,
-0.39984211325645447,
-0.27883028984069824,
-0.7896819710731506,
-0.6307879090309143,
0.6049983501434326,
-0.8275178670883179,
0.136277437210083,... | |
provider object (because it was constructed with "`new`").
How can I improve this design to make sure that the destructor of the provider is called?
EDIT: To clarify, my intention is that both clients, the provider and the App object to share the same lifetime. After all answers, I now think both clients and the prov... | [
0.3955983817577362,
0.1589493453502655,
0.5325219035148621,
-0.1557033658027649,
0.22422799468040466,
0.09323443472385406,
0.22147785127162933,
-0.21726371347904205,
-0.18384017050266266,
-0.8282032012939453,
-0.06718511134386063,
0.5545133948326111,
-0.4397367835044861,
0.4154247045516968... | |
condition)
{
provider.reset(new ProviderX());
}
else
{
provider.reset(new ProviderY());
}
ClientA clientA(provider);
ClientB clientB(provider);
App app(clientA, clientB);
return app;
}
```
Assuming the app object owns the clients, and the clients all share the on... | [
0.08105426281690598,
-0.1591486781835556,
0.6380109786987305,
-0.4228316843509674,
0.47529101371765137,
0.6944052577018738,
0.27806219458580017,
-0.3140387535095215,
-0.31242242455482483,
-0.8914520144462585,
-0.5176229476928711,
0.5307130217552185,
-0.6694414615631104,
0.17450086772441864... | |
provider object, the object won't be freed.
The best would be to not copy clientA and clientB, and not copy app by returning it by value, but move the clients into the app, and move the app itself into the returned object. That will be possible with the upcoming C++ version. But currently, either you make them pointe... | [
0.281154990196228,
-0.07693281024694443,
0.46533510088920593,
0.02362830564379692,
0.042382970452308655,
0.19895531237125397,
-0.1422281414270401,
-0.029587682336568832,
-0.21569448709487915,
-0.6300806999206543,
-0.1657608449459076,
0.5106574892997742,
-0.638363778591156,
0.29688823223114... | |
I've created a new J2SE project in NetBeans, and I can run it from the IDE, but when I try to run it using Ant on the command line, I get the following problem:
<snip>
```
run:
[java] Exception in thread "main" java.lang.NoClassDefFoundError: IndexBuilder
[java] Java Result: 1
```
<snip>
Based on the sni... | [
0.11270273476839066,
0.1306033432483673,
0.01676788553595543,
-0.3173128366470337,
-0.13136447966098785,
-0.32505014538764954,
0.3621600270271301,
0.024493025615811348,
-0.2909112274646759,
-0.8262202143669128,
0.24660181999206543,
0.27172043919563293,
-0.4199099838733673,
0.26876592636108... | |
is because ${javac.classpath} and all the other properties are not being properly populated. That is why your code runs from within the Netbeans context. Netbeans is setting those properties for you.
To answer your original question of how do you go about getting it to run from the command line, you need to either se... | [
0.3369787335395813,
0.14509719610214233,
0.14399901032447815,
0.01763100177049637,
0.10667960345745087,
-0.27846476435661316,
0.5416144132614136,
-0.31734099984169006,
-0.10659415274858475,
-0.7776656150817871,
0.14444005489349365,
0.4198301136493683,
-0.20035001635551453,
0.20274251699447... | |
on how to invoke Ant from the command line. | [
0.21944890916347504,
0.250275194644928,
-0.30182337760925293,
0.10280999541282654,
-0.2165418267250061,
0.21165290474891663,
0.05229269713163376,
-0.1447189748287201,
0.25463351607322693,
-0.33424514532089233,
-0.13851608335971832,
0.1608678102493286,
-0.060521166771650314,
-0.077102430164... | |
What's the difference between the following two pieces of HTML (apologies if there are any typos as I'm typing this freehand)?
Using jQuery:
```
<script type="text/javascript">
$(document).ready(function() {
$("#clickme").click(function() {
alert("clicked!");
});
});
</script>
<a ... | [
0.04537156596779823,
-0.10959092527627945,
0.38699090480804443,
-0.17092390358448029,
-0.2514921724796295,
-0.12281756848096848,
-0.11570443212985992,
-0.38434505462646484,
-0.27590328454971313,
-0.5558284521102905,
-0.22259443998336792,
0.6344479918479919,
-0.3066718280315399,
-0.19605962... | |
have them triggered in the order in which they were registered:
```
<script type="text/javascript">
$(document).ready(function() {
$("#clickme").click(function() {
alert("clicked!");
});
$("#clickme").click(function() {
alert("I concur, clicked!");
});
})... | [
0.24931499361991882,
-0.3068161606788635,
0.48722583055496216,
-0.23205260932445526,
0.2659014165401459,
-0.2227676808834076,
0.08814956992864609,
-0.3268013000488281,
-0.07723461836576462,
-0.30899709463119507,
-0.6104555130004883,
1.0311251878738403,
-0.46492698788642883,
-0.153986334800... | |
registry-driven system. In the vanilla document structure, without a system like jQuery in place, there can only be one `onClick` event. | [
-0.061868708580732346,
-0.20176656544208527,
0.14889243245124817,
0.5004114508628845,
-0.017248617485165596,
-0.34760284423828125,
0.02395874820649624,
0.21589864790439606,
-0.1415146440267563,
-0.586316704750061,
-0.1574346125125885,
0.3388110399246216,
-0.3272504210472107,
0.313519656658... | |
I was wondering what everyone thinks of this. Is the code easy to follow? Or is there a better way to do this? By the way, this is how I am currently doing validation at the moment with ASP.NET MVC. I can follow it, but I am the one who wrote it. For some reason SO is removing the line breaks between the validators.
... | [
0.5927737355232239,
0.33838391304016113,
0.44671154022216797,
-0.1584838628768921,
-0.04866764321923256,
-0.48334231972694397,
0.35516223311424255,
-0.17207443714141846,
-0.19836658239364624,
-0.20687325298786163,
0.05334385484457016,
0.4847274422645569,
-0.20612074434757233,
0.20154048502... | |
=> x.Name)
.LengthBetween(
Config.Member.NameMinLength,
Config.Member.NameMaxLength,
Resources.Errors.LengthBetweenNotValid.Fmt(
Resources.Titles.Name, | [
0.14332778751850128,
0.08489976823329926,
0.27758505940437317,
-0.021294089034199715,
0.23951859772205353,
-0.07275359332561493,
0.43569955229759216,
-0.34336909651756287,
-0.4071252644062042,
-0.16852688789367676,
-0.327417254447937,
0.5112530589103699,
-0.01767457276582718,
0.43838045001... | |
Config.Member.NameMinLength,
Config.Member.NameMaxLength))
.Characters(Resources.Errors.CharactersNotValid.Fmt(Resources.Titles.Name));
validation.Add(x => x.EmailAddress).Email(
Resources.Errors.EmailNotValid.Fmt(
Resources.Titles.EmailAddress));
... | [
-0.20818185806274414,
0.42007049918174744,
0.6619157195091248,
0.08286373317241669,
0.10503742098808289,
0.44765999913215637,
0.2776077687740326,
-0.5343108773231506,
-0.13014213740825653,
-0.5352784395217896,
-0.29494237899780273,
0.45441627502441406,
-0.012650668621063232,
0.124215438961... | |
Resources.Errors.CompareNotValid.Fmt(
Resources.Titles.VerifyEmailAddress,
Resources.Titles.EmailAddress));
validation.Add(x => x.PassWord).LengthGreaterThan(
Config.Member.PassWordMinLength,
Resources.Errors.LengthGreaterThanNotValid.Fmt(
... | [
0.10801234096288681,
0.34641823172569275,
0.48772791028022766,
0.06326659023761749,
0.2529270648956299,
0.04281897470355034,
0.6086514592170715,
-0.5651445984840393,
-0.21442772448062897,
-0.3517615795135498,
-0.25098034739494324,
0.6071172952651978,
0.028546452522277832,
0.356036156415939... | |
Config.Member.PassWordMinLength));
validation.Add(x => x.VerifyPassWord).Equal(
x => x.PassWord,
Resources.Errors.CompareNotValid.Fmt(
Resources.Titles.VerifyPassWord,
Resources.Titles.PassWord));
return validation;
}
```
I'll vote yes on pu... | [
0.11501041054725647,
0.2718662917613983,
0.5996527075767517,
-0.08375289291143417,
0.14778833091259003,
0.16824166476726532,
0.7103067636489868,
-0.6795360445976257,
0.02070358768105507,
-0.34091752767562866,
0.06323879212141037,
0.5827332139015198,
-0.11606747657060623,
0.1846945285797119... | |
- the formatting is inconsistent and there isn't a comment in sight.
Pragmatically one can follow what you're doing with a little effort though. | [
0.634801983833313,
0.0747455433011055,
-0.12202485650777817,
0.22687512636184692,
-0.39218854904174805,
-0.3094020187854767,
0.10766604542732239,
0.13735181093215942,
-0.003096806351095438,
-0.4008418619632721,
-0.042931776493787766,
0.39745989441871643,
0.1011326014995575,
-0.045899178832... | |
I have two report parameters that were set up automatically when I created their associated datasets. They are ReportID and CompanyID. The user selects a Company Name from a list box and a Report Name from another list box. The standard SELECT ID, Name FROM TableName query was used to fill the respective list boxes. Th... | [
0.2975218594074249,
0.20501947402954102,
0.46589553356170654,
-0.023814473301172256,
-0.06411321461200714,
0.007222304120659828,
-0.4049772322177887,
-0.07019488513469696,
-0.09050838649272919,
-0.6505213379859924,
0.19177913665771484,
0.47441422939300537,
-0.2368384301662445,
0.2617419064... | |
just before hitting the View Report button. I set up two new parameters, ReportName and CompanyName; marked them as hidden and set their default values to the appropriate datasets. The problem is that the header always shows the first name from the list, not the name the user selected. My question is, how do I place th... | [
0.4209076464176178,
-0.10374727100133896,
0.4101552963256836,
-0.273007869720459,
0.060066673904657364,
0.24161776900291443,
-0.07572435587644577,
-0.03033173270523548,
-0.08942078799009323,
-0.688149094581604,
0.11286679655313492,
0.7026705145835876,
-0.13651472330093384,
0.31753042340278... | |
the farm he wants from a ComboBox. I show the selected farm in the header of the report using this expression:
```
=Parameters!Farm.Label
```
"Label" is the "display text" (FarmName in this case) for the farm that the user selected. | [
0.6233499050140381,
-0.15459920465946198,
0.1433587670326233,
-0.27143871784210205,
0.21947059035301208,
0.24549327790737152,
-0.07447929680347443,
-0.2998272180557251,
0.0803752988576889,
-0.7517052292823792,
-0.15797708928585052,
0.5243476033210754,
-0.26695558428764343,
0.22313986718654... | |
I worked for a company that had both Java and .NET implementations of an application. The app allowed for end-user customization of processing and business rules using scripts. The Java version supported JavaScript using the [Rhino engine](http://www.mozilla.org/rhino/). The .NET app required VBScript. I would like to ... | [
0.5859289765357971,
0.112918421626091,
-0.16576580703258514,
-0.022980207577347755,
-0.3870936334133148,
-0.02510378509759903,
0.17658165097236633,
-0.13569843769073486,
-0.3356216251850128,
-0.4082361161708832,
0.2584458887577057,
0.6644603610038757,
-0.39038312435150146,
-0.1757135987281... | |
implementation of JavaScript, which is a full .NET language.
EDIT: it turns out the question is a [duplicate](https://stackoverflow.com/questions/172753/embedding-javascript-engine-into-net-c). Some specific suggestions: use [Managed JScript](http://blogs.msdn.com/jscript/archive/2007/05/07/introducing-managed-jscript... | [
0.03238260746002197,
-0.12288030982017517,
0.08161120861768723,
-0.3143850564956665,
0.081029511988163,
-0.14181619882583618,
0.5709927082061768,
-0.0625498965382576,
-0.4415907561779022,
-0.8526130318641663,
-0.306359201669693,
0.36329278349876404,
-0.8472721576690674,
-0.2385653853416443... | |
I naively imagined that I could build a suffix trie where I keep a visit-count for each node, and then the deepest nodes with counts greater than one are the result set I'm looking for.
I have a really really long string (hundreds of megabytes). I have about 1 GB of RAM.
This is why building a suffix trie with counti... | [
-0.02663949690759182,
-0.031006114557385445,
0.07576663792133331,
0.11206928640604019,
-0.17491976916790009,
0.1743023544549942,
0.44088122248649597,
-0.26548513770103455,
-0.052115172147750854,
-0.7361118197441101,
0.30774104595184326,
0.07796791195869446,
0.13676628470420837,
0.208021968... | |
makes the suffix tree very expensive, consuming about ten to twenty times the memory size of the source text in good implementations. The suffix array reduces this requirement to a factor of four, and researchers have continued to find smaller indexing structures.
And that was wikipedia's comments on the tree, not tri... | [
0.07255128771066666,
-0.12317074090242386,
0.1596643626689911,
0.10421247035264969,
-0.4199954569339752,
0.2146621197462082,
0.5083174109458923,
-0.003744246670976281,
-0.2725885212421417,
-0.4789153039455414,
0.1472325176000595,
0.1640092432498932,
0.032654162496328354,
0.19845050573349,
... | |
;-) )
The effective way to do this is to create an index of the sub-strings, and sort them. This is an O(n lg n) operation.
[BWT](http://en.wikipedia.org/wiki/Burrows%E2%80%93Wheeler_transform) compression does this step, so its a well understood problem and there are radix and [suffix](http://en.wikipedia.org/wiki/Su... | [
-0.24837204813957214,
-0.0106274439021945,
0.2115269899368286,
-0.0038329537492245436,
-0.16060063242912292,
0.02284754440188408,
0.20691728591918945,
-0.3260793685913086,
-0.003945799078792334,
-0.7786529660224915,
-0.34691375494003296,
0.31878504157066345,
-0.12074466049671173,
0.0007536... | |
its common substring with its neighbours is O(n). | [
-0.7132701873779297,
-0.03915010020136833,
0.431689977645874,
-0.41472309827804565,
-0.39615002274513245,
0.42604556679725647,
-0.05517522990703583,
-0.14997757971286774,
-0.13802719116210938,
-0.2474130541086197,
-0.2624695599079132,
-0.0484960675239563,
0.11432287096977234,
-0.0852305814... | |
I'm several layers/levels above the people involved in the project I'm about to describe.
The general requirement is for a web based issue management system. The system is a small part of a much larger project.
The lead pm has a tech pm who is supposed to handle this portion of the project. The lead pm asked me if i... | [
0.20738950371742249,
0.1925843060016632,
0.3553980886936188,
0.2279232144355774,
0.30190691351890564,
-0.17303913831710815,
-0.11828692257404327,
-0.03641890734434128,
-0.1965607851743698,
-0.21108612418174744,
-0.43710288405418396,
0.460317999124527,
0.16343580186367035,
-0.31879475712776... | |
look. I'm looking at the system and I'm thinking...
* a new app was developed in cold fusion!?!?
* the app has **extremely** poor data validation
* the app data validation page navigates away from the data entry form
* the app help page navigates away from the form
* the db schema was not discussed between the develop... | [
0.3466961085796356,
0.21595770120620728,
0.45466548204421997,
0.19459287822246552,
-0.08217684924602509,
0.1655975878238678,
0.3880368769168854,
-0.2261086106300354,
-0.14014007151126862,
-0.49309155344963074,
-0.07213081419467926,
0.28836485743522644,
-0.26113006472587585,
-0.050939746201... | |
pm does not know what the dbms is...
* there is a tech pm and she does not know what a dbms is...
* the lead pm has wanted to fire the tech pm for a long time, but the tech pm is protected...
* the lead pm suggested that the exact functionality desired exists in several proprietary projects (several of which are open s... | [
0.1795235127210617,
0.06082034483551979,
0.3786064088344574,
0.32886019349098206,
0.13786275684833527,
-0.014369591139256954,
-0.14897294342517853,
-0.5065145492553711,
-0.029723266139626503,
-0.07129129022359848,
-0.1722489446401596,
0.740544319152832,
-0.4402503967285156,
0.1867939233779... | |
and then fire all of them?
* download and configure bugtracker/bugzilla for them and then go have a beer to forget my sorrows?
and isn't it SOP for the db schema to be discussed and rigorously thought through very early in the project?
EDIT:
I used to work with a wide variety of clients with disparate levels of tech... | [
0.5627643465995789,
0.4699609577655792,
-0.0013744186144322157,
0.13545113801956177,
-0.21195359528064728,
-0.0384887233376503,
0.29715484380722046,
-0.001123536960221827,
-0.12100426107645035,
-0.3318401873111725,
0.005331880412995815,
0.597793459892273,
-0.2945176362991333,
-0.0997494831... | |
realize we were talking about the schema. In most of the projects I've been directly involved in, the data is the most important part of the system. Thoroughly hashing out the schema/domain model has been critical in getting to a good understanding of the system and what things can be done and reported on. I have high ... | [
0.7759798765182495,
0.18311557173728943,
-0.08830087631940842,
0.3917040228843689,
0.17307953536510468,
-0.26159998774528503,
-0.04007117077708244,
0.41655558347702026,
-0.37918320298194885,
-0.07403046637773514,
0.154110848903656,
0.20247574150562286,
0.2549836039543152,
0.149982511997222... | |
university... the dev and tech pm are long time employees - they are not inexperienced. I find it especially sad when I know intelligent and hard-working people who are jobless and people like these are employed.
When I was younger, I would report this type of ineptitude up the chain and expect appropriate action. No... | [
0.3472204804420471,
0.23436623811721802,
0.5530879497528076,
-0.045495178550481796,
0.08820492774248123,
-0.1947995275259018,
0.2733522355556488,
0.321774959564209,
-0.10494672507047653,
-0.5869163870811462,
-0.22188213467597961,
0.5400416254997253,
0.4178699851036072,
0.5449375510215759,
... | |
stakeholders except under special circumstances, where the stakeholders are all "database savvy".
So how can you discuss the DATA without discussing the DB Schema? This is the primary use that I've found for Entity-Relationship (ER) diagrams, and the ER model in general. A lot of database designers tend to treat ER as... | [
0.36378955841064453,
0.18000051379203796,
0.16656279563903809,
0.4272199869155884,
-0.2206597626209259,
-0.16310302913188934,
-0.045477546751499176,
-0.3246604800224304,
-0.23429079353809357,
-0.285383939743042,
0.2848258912563324,
0.9256449937820435,
0.05025757476687431,
-0.00934124737977... | |
middle. This junction box holds foreign keys that link the junction box to the participants in the many to many relationship.
In ER, when applied strictly, junction boxes are unnecessary in many to many relationships. You just indicate the relationship as a line, and indicate the possibility of "many" at both ends of... | [
-0.33862704038619995,
-0.09606847167015076,
0.4465107321739197,
0.46838057041168213,
0.037930186837911606,
-0.07751452177762985,
-0.08023534715175629,
-0.19328176975250244,
0.0760098397731781,
-0.7667201161384583,
-0.14927111566066742,
0.1486482173204422,
-0.3552113473415375,
0.32827383279... | |
harmful redundancy in it, but that's largely serendipity and not the result of careful planning.
The "entities" and "relationships" in a stakeholder oriented ER diagram should only include entities that are understood by the subject matter experts, and not include entities or relationships that are added in the cours... | [
0.07956329733133316,
0.238084614276886,
0.40920066833496094,
0.23933768272399902,
0.2111368328332901,
-0.0991051122546196,
0.058620940893888474,
-0.21152979135513306,
-0.004168892279267311,
-0.46341925859451294,
0.0049807229079306126,
0.824537456035614,
-0.2399936318397522,
-0.027298180386... | |
can take on. Some values stored in databases, like foreign keys, should be left out of discussions with most stakeholders.
Stakeholders who understand the data generally have an intuitive grasp of these concepts, although the terms "entity", "relationship", "attribute", and "domain", may be unfamiliar to them. Stakeho... | [
0.11276600509881973,
0.05372415482997894,
0.21532092988491058,
0.46790269017219543,
0.26715582609176636,
-0.07099469751119614,
0.10230406373739243,
-0.4133857488632202,
-0.14715415239334106,
-0.6503596901893616,
-0.10292232036590576,
0.9267114996910095,
0.16586032509803772,
-0.187818542122... | |
fill out, my suggestion is that you try to keep them away from computers, if that's still possible.
It's possible to turn a well built ER diagram into a moderately well built relational schema by a fairly mechanical process. A more creative design process might result in a "better" schema that's logically equivalent.... | [
0.47404617071151733,
0.4684966504573822,
0.10037964582443237,
0.14840543270111084,
0.3033774197101593,
-0.1535096913576126,
-0.06803769618272781,
-0.09646648168563843,
-0.21360908448696136,
-0.6920663714408875,
0.029967498034238815,
0.7049825191497803,
-0.15462860465049744,
-0.066302366554... | |
I have a C++ Windows application that can be extended by writing C++ plugins, using an API that is exposed by the application. There is also one plugin that translates the C++ API to Python (e.g. plugins can be written in Python).
I want to allow users to write plugins in C# in addition to C++ and Python. Since I'm no... | [
0.4960026741027832,
0.21698832511901855,
0.09510897845029831,
-0.05704408884048462,
0.04014252498745918,
-0.14646542072296143,
-0.03008299507200718,
0.17649637162685394,
-0.2272435873746872,
-0.6803830862045288,
-0.0015119649469852448,
0.7905175089836121,
-0.20952852070331573,
0.0583815909... | |
in order to achieve this?
There are a couple of prior posts that may help you out:
* [Interfacing using a simple API](https://stackoverflow.com/questions/285551/how-to-add-a-simple-api-to-my-c-application-for-access-by-labview#285574)
* [Communicating between C++ and C# via DLL interface](https://stackoverflow.com/que... | [
0.4238731563091278,
-0.1474086344242096,
0.2616266906261444,
0.12966151535511017,
-0.057211749255657196,
-0.07322394102811813,
0.36722809076309204,
-0.30225038528442383,
-0.21490873396396637,
-0.5471618175506592,
0.03736496344208717,
0.43849480152130127,
-0.0772683322429657,
-0.03242941200... | |
I have created an installation package using Wix which installs a Windows service on the user's machine. Currently, the files are being installed to [%ProgramFiles%\APLICATIONNAME].
Is this a future proof way of structuring an installation folder?
Should I be installing to [%ProgramFiles%\APLICATIONNAME\VERSION\_NUMBE... | [
0.1242499127984047,
0.34897202253341675,
0.43308088183403015,
-0.13795408606529236,
0.030034059658646584,
0.034368570894002914,
0.5535278916358948,
0.11468782275915146,
-0.2769105136394501,
-0.8237484693527222,
-0.2946799397468567,
0.6740163564682007,
-0.4711854159832001,
0.023010935634374... | |
want to allow side by side installs of different versions. But with all of this it should ultimately be up to the user where the installed files end up. | [
0.593250572681427,
-0.06176252290606499,
0.16417311131954193,
0.26086223125457764,
0.21933527290821075,
-0.3123345375061035,
0.2153472751379013,
-0.035343196243047714,
-0.03516468033194542,
-0.5408425331115723,
0.019072096794843674,
0.4606899917125702,
-0.13125167787075043,
0.0694945901632... | |
Using in-process session state is evil when it comes to scaling web applications (does not play well with clusters, bombs out when server recycles).
Assuming you just need to keep a small amount of information in the session state, what is the downside of using encrypted cookie items for this purpose rather than speci... | [
-0.0029723611660301685,
-0.02299550361931324,
0.036846451461315155,
0.2546955943107605,
-0.19401657581329346,
-0.34324225783348083,
0.4545004665851593,
-0.049589984118938446,
-0.293192982673645,
-0.8366717100143433,
-0.008638392202556133,
0.4516105353832245,
-0.03974516689777374,
-0.036539... | |
is an excellent approach for simple, scalable, and robust sessions.
Of course the quality of your crypto is important, and that is often something that often proves tricky to get right, but it's possible to do.
I disagree with some of the other posters:
Any replay attack that can be launched against an encrypted cook... | [
0.2406408190727234,
-0.033450160175561905,
-0.236214742064476,
0.23460803925991058,
-0.1742846518754959,
-0.4178917109966278,
0.6497830152511597,
0.08880829811096191,
-0.3634517788887024,
-0.26177236437797546,
-0.1531907618045807,
0.6000333428382874,
-0.02662934549152851,
-0.01121981441974... | |
Has anyone created HTML microformats for video and video overlays including:
* Video File
* Links with timecode (start/end) and screen region
Thanks,
Michael
There is an assertion: "I'm asserting that this constructor will never be called". So, indeed, `AssertionError` is correct here. | [
0.2940557301044464,
0.3183768093585968,
0.3633488118648529,
0.12507928907871246,
-0.022179365158081055,
-0.2793465554714203,
0.33063095808029175,
0.06195405498147011,
-0.30232465267181396,
-0.2994985580444336,
-0.03898540511727333,
0.4934826195240021,
-0.2954263389110565,
0.151901662349700... | |
I was having a conversation with a co-worker and the subject of null came up. He was telling me that in .NET behind the scenes it is just a really small number. I always thought that the object just didn't have a pointer to any memory on the heap but i wasn't sure either way.
So i'm hoping the community can clear it u... | [
0.16735538840293884,
0.009858248755335808,
-0.531552255153656,
0.06124069541692734,
-0.2904995083808899,
-0.10465513169765472,
0.17960050702095032,
0.22275850176811218,
-0.31610026955604553,
-0.3763885200023651,
0.16782233119010925,
0.06616427004337311,
-0.5763294696807861,
0.4065874516963... | |
null indicator. An instance of a nullable type has two public read-only properties: **HasValue** of type bool, and **Value** of the nullable type’s underlying type.
**HasValue** is true for a non-null instance and false for a null instance.
So when **HasValue** is true, the **Value** property returns the contained ... | [
-0.10699908435344696,
0.1530722975730896,
0.07396651059389114,
-0.11419641971588135,
-0.1690736562013626,
-0.1463286131620407,
0.4828795790672302,
0.13478679955005646,
0.09588133543729782,
-0.5926175117492676,
-0.3106229603290558,
0.24122804403305054,
-0.43388739228248596,
0.21880677342414... | |
For example:
`sizeof(char*)` returns 4. As does `int*`, `long long*`, everything that I've tried. Are there any exceptions to this?
The guarantee you get is that `sizeof(char) == 1`. There are no other guarantees, including no guarantee that `sizeof(int *) == sizeof(double *)`.
In practice, pointers will be size 2 on ... | [
0.22077810764312744,
0.18021515011787415,
0.18991635739803314,
-0.09981813281774521,
0.13512331247329712,
0.06173834949731827,
0.43390703201293945,
-0.29145652055740356,
-0.5853196978569031,
-0.4129101037979126,
-0.17830699682235718,
0.6736837029457092,
-0.1388268768787384,
-0.178289920091... | |
I can't seem to get it to "work". Perhaps I'm not even testing it correctly. I've got a <%= DateTime.Now.ToString() %> line in my aspx page. I've tried setting caching declarativly like this
```
<%@ OutputCache VaryByParam="SchoolId" Duration="180" Location="Server" NoStore="false" %>
```
I've also tried setting it ... | [
0.1436149775981903,
0.10428739339113235,
0.5038595199584961,
-0.16707199811935425,
0.026026973500847816,
-0.08558705449104309,
0.5330374240875244,
-0.05821363255381584,
-0.11317883431911469,
-0.6348707675933838,
0.11429417878389359,
0.31633999943733215,
-0.04050265997648239,
0.227732226252... | |
I'm writing an algorithm in PHP to solve a given Sudoku puzzle. I've set up a somewhat object-oriented implementation with two classes: a `Square` class for each individual tile on the 9x9 board, and a `Sudoku` class, which has a matrix of `Square`s to represent the board.
The implementation of the algorithm I'm using... | [
-0.029746968299150467,
0.12406982481479645,
0.24526247382164001,
0.10213993489742279,
-0.4197508692741394,
0.309583455324173,
-0.07340925186872482,
-0.2934792935848236,
-0.07681811600923538,
-0.5981589555740356,
-0.033148083835840225,
-0.19984829425811768,
-0.20346197485923767,
0.060860686... | |
on the rest of the unsolved squares.
Usually, this process of "constant propagation" doesn't solve the board entirely, but it does solve a sizable chunk. The second tier will then kick in. This parses each unit (or 9 squares which must all have unique number assignments, e.g. a row or column) for the "possible" values... | [
-0.15940845012664795,
0.1553293913602829,
0.34665390849113464,
0.020820798352360725,
0.02650940790772438,
0.10136795043945312,
0.1485862284898758,
-0.4862799346446991,
-0.25173643231391907,
-0.4829356074333191,
-0.5699922442436218,
0.32409101724624634,
-0.32230669260025024,
0.1841989755630... | |
// All squares in same row, col, and box
private $number; // Assigned value (0 if not assigned)
private $possibles; // String of possible numbers (1-9)
public function __construct($name, $p = 0) {
$this->name = $name;
$this->setNumber($p);
if ($p == 0) {
$this->possibles = "123456789";... | [
-0.1708502173423767,
-0.09181235730648041,
0.17925505340099335,
0.07782135158777237,
0.21627168357372284,
0.291644811630249,
0.07723540812730789,
-0.605765163898468,
-0.2937331199645996,
-0.5843535661697388,
-0.5195388793945312,
0.281482994556427,
-0.4595443308353424,
0.059719882905483246,... | |
described in the second tier above), the second tier will concatenate all the strings of "possibles" into a single string. It will then search through that single string for any unique character values - values which do not repeat themselves. This will indicate that, within the unit of squares, there is only one square... | [
-0.03666434437036514,
0.10673414915800095,
0.2021942138671875,
0.19955573976039886,
0.010526741854846478,
0.03727276250720024,
0.04055483639240265,
-0.6079344749450684,
-0.06668704748153687,
-0.7482130527496338,
-0.24889294803142548,
0.2526018023490906,
-0.09559711813926697,
0.074840180575... | |
by the numbers 1-9, and I could increment the value at the corresponding index by 1 for each possible-value of that number that I find, then scan the array again for any values of 1, but this seems extremely inefficient, requiring two linear scans of an array for each unit, and in a Sudoku puzzle there are 27 units.
Th... | [
0.20608823001384735,
0.23994728922843933,
0.35197821259498596,
0.07305149734020233,
-0.006911258213222027,
0.13166256248950958,
0.1884758621454239,
-0.6147682666778564,
-0.4115599989891052,
-0.4015774130821228,
-0.11923645436763763,
0.05533136799931526,
-0.34718215465545654,
0.250356912612... | |
$unique[] = chr($c);
}
print join("", $unique) . "\n";
```
Prints: "56789" | [
0.081626757979393,
0.2993147671222687,
0.16138200461864471,
-0.21284721791744232,
0.3171725869178772,
-0.002432547975331545,
-0.13545136153697968,
-0.1765768676996231,
-0.33972808718681335,
-0.073033906519413,
-0.14292758703231812,
0.2628675699234009,
-0.5199604630470276,
0.374166429042816... | |
Can the WCF runtime be made to instantiate a service via an IoC container rather than via its usual process? (Also, given a potential clash between the container's lifestyle configuration for the type and the service's InstanceContextBehavior, would this approach be a terrible idea?)
I'm aware that I might be asking t... | [
0.06640768051147461,
-0.15779581665992737,
0.16992312669754028,
0.08883491158485413,
-0.07479069381952286,
-0.426479309797287,
0.40610480308532715,
-0.29442906379699707,
-0.06961178779602051,
-0.6259266138076782,
-0.28265827894210815,
0.29599395394325256,
-0.28473952412605286,
0.0331245549... | |
to approach this, so I would also be curious to hear other recommended approaches.
Yes, heres implementations using both ObjectBuilder and Spring.NET (and more if you follow the links!):
<http://www.infoq.com/news/2008/01/wcf-di>
Can't comment on lifestyle and instance context behavior interaction though.
As for mor... | [
0.6887524724006653,
0.05405409634113312,
-0.09272574633359909,
-0.02027488499879837,
-0.5053629279136658,
-0.10755288600921631,
0.663110077381134,
-0.4534865915775299,
-0.3876536190509796,
-0.5235515832901001,
-0.017200281843543053,
0.4600401222705841,
-0.30383527278900146,
0.1953775882720... | |
My marketing department, bless them, has decided to make a sweepstakes where people enter over a webpage. That is great but the information isn't stored to a DB of any sort but is sent to an exchange mail box as an email. Great.
My challenge is to extract the entry (and marketing info) from these emails and store them... | [
0.6275597810745239,
0.42640331387519836,
0.3701344132423401,
-0.004914420191198587,
-0.0506662055850029,
0.08880829811096191,
0.26730799674987793,
0.22871223092079163,
0.017377516254782677,
-0.6261078119277954,
0.26084887981414795,
0.49637162685394287,
0.3539828658103943,
0.087300576269626... | |
through them all but was hoping for a much more elegant solution. Can I programmatically access an exchange mailbox, read all the emails and then save that data?
There's lots of different ways to get at the messages in an exchange mailbox, but since it seems this is something you're only going to want to run once to ex... | [
0.47960397601127625,
0.041408099234104156,
0.2319953739643097,
0.2274349182844162,
0.022397764027118683,
0.20602676272392273,
0.1367391049861908,
0.05418039485812187,
-0.22284013032913208,
-0.6406843066215515,
0.3165905177593231,
0.3423583209514618,
-0.23124068975448608,
0.0539684742689132... | |
You can then write a text file with just the stuff you want. | [
0.51124507188797,
-0.02712715044617653,
-0.015341497957706451,
0.22771212458610535,
0.0701974555850029,
-0.24754540622234344,
-0.06647088378667831,
0.29479190707206726,
-0.16679705679416656,
-0.5205888152122498,
-0.16183598339557648,
0.5338032245635986,
-0.018741236999630928,
-0.1342829763... | |
When using ActionLink to render data from database which has HTML tags
```
(ie <p>)
```
incorporated in it, ActionLink escapes the tags. What is the best way to handle this?
[ffmpeg](http://www.ffmpeg.org/) is probably your best bet, there is even a [php module](http://ffmpeg-php.sourceforge.net/) of it.
ffmpeg -... | [
0.23568663001060486,
-0.22189436852931976,
0.4908182621002197,
0.038176294416189194,
-0.24474558234214783,
-0.0766521468758583,
0.1262444108724594,
-0.32019394636154175,
-0.4638230800628662,
-0.6569124460220337,
0.11188414692878723,
0.619845986366272,
-0.4518188536167145,
-0.14438684284687... | |
Given the following xml fragment:
```
<Problems>
<Problem>
<File>file1</File>
<Description>desc1</Description>
</Problem>
<Problem>
<File>file1</File>
<Description>desc2</Description>
</Problem>
<Problem>
<File>file2</File>
<Description>desc1</Description>
</Problem>
</Problems>
``... | [
0.1529187262058258,
0.019944453611969948,
0.10770019143819809,
0.1953705996274948,
-0.30869367718696594,
0.08893761038780212,
0.3990378677845001,
-0.7947728633880615,
-0.22693075239658356,
-1.104721188545227,
-0.07442918419837952,
0.46498459577560425,
0.11820230633020401,
0.068317085504531... | |
do it, using the Muenchean method. Google 'xslt muenchean' for more info from smarter people. There might be a clever way, but I'll leave that to others.
One note, I avoid using capitals at the start of xml element names, eg 'File', but that's up to you.
```
<?xml version="1.0"?>
<xsl:stylesheet version="1.0" xmlns:x... | [
0.28874924778938293,
-0.31705161929130554,
0.3742043673992157,
0.19185040891170502,
-0.15642531216144562,
-0.20518441498279572,
0.362862765789032,
-0.09865836799144745,
-0.11181119829416275,
-0.4736737012863159,
-0.24542421102523804,
0.8600338101387024,
-0.0806046798825264,
-0.523553431034... | |
<xsl:apply-templates select="Problems"/>
</body>
</html>
</xsl:template>
<xsl:template match="Problems">
<xsl:for-each select="Problem/File[generate-id(.) = generate-id(key('files', .))]">
<xsl:sort select="."/>
<h1>
<xsl:value-of select="."/>
... | [
-0.42723482847213745,
-0.13744747638702393,
0.47892019152641296,
-0.1795334368944168,
-0.10695243626832962,
-0.133592888712883,
-0.03932517021894455,
-0.9410503506660461,
-0.20798854529857635,
-0.6401705741882324,
-0.4846985340118408,
0.2987096607685089,
-0.5197545886039734,
-0.47664198279... | |
<xsl:apply-templates select="../../Problem[File=current()/text()]"/>
</xsl:for-each>
</xsl:template>
<xsl:template match="Problem">
<p>
<xsl:value-of select="Description/text()"/>
</p>
</xsl:template>
</xsl:stylesheet>
```
The idea is, key each File element using it's t... | [
0.31469422578811646,
-0.14436110854148865,
0.31570932269096375,
-0.09623120725154877,
-0.07596950978040695,
-0.2266414612531662,
-0.039753977209329605,
-0.7374212145805359,
-0.07336514443159103,
-0.5376086235046387,
-0.21151600778102875,
0.669492781162262,
-0.3176916241645813,
-0.138524696... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.