text
stringlengths
0
30.5k
title
stringclasses
1 value
embeddings
listlengths
768
768
are an even number, it should be >180. If there are an even number of intersections, the numbers should be reversed. This should work for very complex surfaces, but they must be closed, or it breaks down.
[ -0.2823232114315033, -0.05592257156968117, 0.5965406894683838, -0.024426711723208427, -0.2557632327079773, 0.12902076542377472, 0.16104118525981903, -0.13124513626098633, -0.2856769263744354, -0.7004762887954712, -0.09754829853773117, 0.2653476893901825, -0.4669092297554016, -0.12644214928...
Someone recently told me, "In the past, Google never indexed PHP pages". I don’t believe that for several reasons. But I’m no SEO expert, or even a novice, so I wonder. Before I file that person under “unreliable”, I thought I’d ask the SO community: Is there anything to that? Thanks. Ridiculous, some argue (corre...
[ 0.3989446461200714, -0.01937820203602314, -0.02727667987346649, 0.1628236025571823, -0.5062402486801147, -0.33394911885261536, 0.1877807080745697, 0.48816272616386414, -0.49263858795166016, -0.029378950595855713, 0.14643193781375885, 0.5051004886627197, -0.09808798134326935, 0.328294456005...
I'd like to use LaTeX's `\tableofcontents` command (or some equivalent) to automatically generate a table of contents, but I'd also like to add a sentence or two to each line in the table of contents that describes what the referenced section is about. How can I do this? The `tocloft` package and its `\cftchapterprecis...
[ 0.2260696142911911, 0.2175753116607666, 0.400356262922287, 0.34057340025901794, -0.10109200328588486, -0.5899786353111267, -0.11993715167045593, 0.15817922353744507, -0.12903742492198944, -0.4185234010219574, -0.01490005198866129, 0.6178557276725769, -0.35859936475753784, 0.021933240815997...
In C#, I am trying to use <see cref="blah"/> to reference a method signature that contains the params keyword. I know this converts the parameter list to an array, but I can't even figure out how to refer to an array in a CREF attribute. I am finding nothing in my searches and no one I know has any idea, either. The co...
[ 0.487724632024765, 0.3786427080631256, 0.37671035528182983, -0.1153467446565628, -0.13066571950912476, -0.21350139379501343, 0.19777144491672516, -0.26614639163017273, -0.2798020839691162, -0.30831438302993774, -0.21044455468654633, 0.7131187915802002, -0.42500486969947815, -0.022956276312...
overview of XML Documentation comments. You can download the standard at: [<http://www.ecma-international.org/publications/standards/Ecma-334.htm>](http://www.ecma-international.org/publications/standards/Ecma-334.htm) Specifically, you'll want section E.3.1, starting on page 496. Similar content is also at MSDN (th...
[ 0.4230804741382599, 0.08398261666297913, 0.35678204894065857, 0.20005150139331818, -0.28013908863067627, -0.3192152678966522, 0.07004054635763168, -0.6165297031402588, -0.38574522733688354, -0.34405219554901123, -0.5227874517440796, 0.49006879329681396, -0.14527779817581177, 0.315130352973...
the 4th edition became section D.4.2 in the 5th edition. The previous versions of the ECMA-334 standard are available for download from the following page: <https://www.ecma-international.org/publications/standards/Ecma-334-arch.htm>
[ -0.236607626080513, 0.17624399065971375, 1.1792973279953003, -0.04517477750778198, -0.17759811878204346, -0.14926324784755707, 0.3344542384147644, -0.4146750271320343, -0.5275654792785645, 0.016944793984293938, -0.5350309014320374, 0.40824615955352783, -0.2914995849132538, 0.04946698993444...
A while back a post by Jon Skeet planted the idea in my head of building a `CompiledFormatter` class, for using in a loop instead of `String.Format()`. The idea is the portion of a call to `String.Format()` spent parsing the format string is overhead; we *should* be able to improve performance by moving that code outs...
[ 0.4927743077278137, -0.052209388464689255, 0.14978338778018951, -0.08966405689716339, -0.22893336415290833, -0.13725657761096954, 0.3332104980945587, -0.11183205991983414, -0.22406905889511108, -0.4346437156200409, 0.2334814965724945, 0.21271227300167084, -0.10530048608779907, 0.0619646832...
actually farms the work to `StringBuilder.AppendFormat()`). The code I came up with works, in that my results are accurate within my (admittedly limited) test data. Unfortunately, I still have one problem: performance. In my initial tests the performance of my code closely matches that of the normal `String.Format()`....
[ 0.4748002290725708, 0.01737087219953537, 0.32087695598602295, -0.19184067845344543, -0.2547284960746765, -0.010104788467288017, 0.6283120512962341, -0.3166852295398712, 0.0114259272813797, -0.6298652291297913, 0.10044030100107193, 0.5887526869773865, 0.08333390206098557, 0.0295648388564586...
what actually drive the performance, but I'd like to see if the smart people here can help improve things. Here is the relevant portion: ``` private class FormatItem { public int index; //index of item in the argument list. -1 means it's a literal from the original format string public char[] value; //literal...
[ 0.3051454424858093, -0.024849018082022667, 0.3736051917076111, 0.06659386307001114, -0.009618179872632027, -0.10265585780143738, -0.0326610691845417, -0.1240006610751152, -0.17272210121154785, -0.4607212245464325, -0.27550971508026123, 0.8417080044746399, -0.006732425186783075, 0.023873982...
should be at least 7 characters public bool justify; // {0,-7} would use opposite alignment } //this data is all populated by the constructor private List<FormatItem> parts = new List<FormatItem>(); private int baseSize = 0; private string format; private IFormatProvider formatProvider = null; private ICustomF...
[ 0.17909802496433258, -0.1461794227361679, 0.7648602724075317, 0.01833179034292698, -0.13088759779930115, 0.3397830128669739, 0.44932129979133606, -0.84987872838974, -0.28936901688575745, -0.27830368280410767, -0.12469471246004105, 0.43609708547592163, -0.016350938007235527, -0.277717292308...
var sb = new StringBuilder(baseSize); foreach (FormatItem fi in parts) { if (fi.index < 0) sb.Append(fi.value); else { //if (fi.index >= args.Length) throw new FormatException(Environment.GetResourceString("Format_IndexOutOfRange")); if (fi.index >= ar...
[ 0.02845706418156624, -0.3582085072994232, 0.5938279032707214, -0.5664594769477844, 0.09916519373655319, 0.16238552331924438, 0.5692905187606812, -0.915436863899231, 0.05893275886774063, -0.435143381357193, -0.48082342743873596, 0.50686115026474, -0.3429226875305176, -0.03490129113197327, ...
object arg = args[fi.index]; string s = null; if (customFormatter != null) { s = customFormatter.Format(fi.format, arg, formatProvider); } if (s == null)
[ -0.07495871186256409, -0.456903874874115, 0.6853717565536499, -0.12665130198001862, -0.12742751836776733, 0.20246204733848572, 0.3414928913116455, -0.5702571868896484, -0.25709909200668335, -0.3046746253967285, -0.36317458748817444, 0.6239556074142456, -0.4863211512565613, 0.18547834455966...
{ if (arg is IFormattable) { s = ((IFormattable)arg).ToString(fi.format, formatProvider); } else if
[ -0.1488993912935257, -0.44343703985214233, 0.7733919620513916, -0.32052528858184814, 0.3259390890598297, -0.0862608551979065, 0.12777560949325562, -0.59849613904953, -0.06390818953514099, -0.4630518853664398, -0.5430960655212402, 0.6986672282218933, -0.25429657101631165, -0.024108322337269...
(arg != null) { s = arg.ToString(); } } if (s == null) s = String.Empty; int pad
[ -0.5283918976783752, -0.3677665889263153, 0.6182814836502075, -0.43807411193847656, 0.013201775960624218, 0.14579156041145325, 0.3899601697921753, -0.3542589843273163, -0.2468281239271164, -0.31145164370536804, -0.42814159393310547, 0.543975830078125, -0.35380199551582336, 0.01603013835847...
= fi.width - s.Length; if (!fi.justify && pad > 0) sb.Append(' ', pad); sb.Append(s); if (fi.justify && pad > 0) sb.Append(' ', pad); } } return sb.ToString(); } //alternate implementation (for comparative testing) // my own test call String.Format() separately: I do...
[ 0.35410282015800476, -0.2590552568435669, 0.5530902147293091, -0.2610682249069214, 0.13675567507743835, 0.2936825454235077, 0.39318758249282837, -1.174543857574463, -0.28580838441848755, -0.2849336266517639, -0.21586009860038757, 0.3394278883934021, -0.22993361949920654, 0.1666661947965622...
Object[] args) { return String.Format(formatProvider, format, args); } ``` Additional notes: I'm wary of providing the source code for my constructor, because I'm not sure of the licensing implications from my reliance on the original .Net implementation. However, anyone who wants to test this can just make the ...
[ 0.26990461349487305, 0.19582651555538177, 0.4419250190258026, 0.005951576866209507, -0.19156156480312347, -0.1772879809141159, 0.30971500277519226, -0.13642890751361847, -0.25037646293640137, -0.5331199169158936, -0.14358961582183838, 0.6378899812698364, -0.3589629530906677, 0.138332307338...
better? ### [Update]: Hmm... something else I can try is adjusting my tests. My benchmarks were fairly simple: composing names to a `"{lastname}, {firstname}"` format and composing formatted phone numbers from the area code, prefix, number, and extension components. Neither of those have much in the way of literal se...
[ 0.21160809695720673, 0.0638902485370636, 0.24385426938533783, -0.08602693676948547, -0.04943562671542168, 0.19598771631717682, 0.42731568217277527, -0.1956578642129898, 0.0031453026458621025, -0.5964621901512146, 0.22783450782299042, 0.45039069652557373, -0.06760099530220032, -0.0909494459...
make it go faster. As long as performance is *no worse* than the base String.Format(), I've still created a strongly-typed interface which allows a program to assemble it's own "format string" at run time. All I need to do is provide public access to the parts list. Here's the final result: ------------------------ I ...
[ 0.1367960423231125, -0.2935234308242798, 0.5214138031005859, 0.05140998587012291, -0.05844471976161003, 0.3217562735080719, 0.19350770115852356, -0.1765274703502655, -0.25063928961753845, -0.7779937386512756, 0.21311309933662415, 0.650643527507782, 0.08535681664943695, -0.04581214860081673...
`String.Format`. This is an undeniable improvement. You might even be tempted to start using this as a no-brainer replacement for many `String.Format` situations. After all, you'll do no worse and you might even get a small performance boost: as much 14%, and that's nothing to sneeze at. Except that it is. Keep in min...
[ 0.6303563714027405, -0.035000286996364594, 0.2627972364425659, 0.07640542834997177, -0.3204878270626068, -0.1770528256893158, 0.48214611411094666, 0.09271591156721115, -0.3546830117702484, -0.6586165428161621, 0.014994282275438309, 0.5240398049354553, 0.09172480553388596, -0.16193182766437...
all, this omits one important alternative: you can create a new `StringBuilder` each time and manually handle your own formatting using raw `Append()` calls. With that technique my benchmark finished in *only 3.9 seconds.* That's a much greater improvement. --- In summary, if performance doesn't matter as much, you s...
[ 0.3601982891559601, -0.01804427243769169, 0.259002685546875, 0.09132680296897888, -0.28447991609573364, 0.05761843919754028, 0.6347280740737915, -0.3438408076763153, -0.08162043243646622, -0.8605594635009766, 0.08558202534914017, 0.5600728988647461, 0.08245605230331421, -0.1477158367633819...
Can I simply change the connection string to point from my Test DB to my Production DB when I go live with my website and DAL generated via Subsonic? When I try to push to my production servers the DAL still seems to be talking with my Test DB even though I have changed the connectionstring to a valid production DB t...
[ 0.44391077756881714, -0.006185624282807112, 0.24312859773635864, 0.03539610654115677, -0.08087120205163956, 0.050835296511650085, 0.10831591486930847, -0.3592167794704437, -0.4202094078063965, -0.4726749360561371, 0.19100171327590942, 0.5365015864372253, -0.15772534906864166, 0.15904998779...
seen times when it won't, you can then restart it in IIS or try editing the web.config locally) You shouldn't have to rebuild
[ 0.343011736869812, -0.15872398018836975, 0.28965747356414795, 0.15578152239322662, 0.23622649908065796, -0.20742562413215637, 0.5220959782600403, 0.40331897139549255, -0.3019648492336273, -0.9161278605461121, -0.11950378865003586, 0.5504787564277649, 0.16668616235256195, 0.2350852489471435...
I wonder if there are any suggestions for declarative GUI programming in Java. (I abhor visual-based GUI creator/editor software, but am getting a little tired of manually instantiating JPanels and Boxes and JLabels and JLists etc.) That's my overall question, but I have two specific questions for approaches I'm think...
[ 0.3287307918071747, 0.04866034910082817, 0.13745291531085968, 0.2025272250175476, -0.6665351390838623, -0.1889909952878952, -0.4201190173625946, -0.1409939080476761, -0.22577370703220367, -0.7496854066848755, 0.08341821283102036, 0.27700620889663696, -0.28696081042289734, -0.24444693326950...
has anyone invented a declarative syntax (like XUL) for XML for use with Java Swing? I suppose it wouldn't be hard to do, to create some code based on STaX which reads an XML file, instantiates a hierarchy of Swing elements, and makes the hierarchy accessible through some kind of object model. But I'd rather use someth...
[ 0.4456336796283722, 0.37393999099731445, 0.3041306436061859, 0.04707810655236244, -0.7601735591888428, -0.3087279498577118, 0.2093103528022766, -0.13809147477149963, -0.13739405572414398, -0.38585931062698364, -0.07131576538085938, 0.11831596493721008, -0.12136416137218475, -0.419061034917...
great answers here! (& I added #3 above) I'd be especially grateful for hearing any experiences any of you have had with using one of these frameworks for real-world applications. p.s. I did try a few google searches ("java gui declarative"), just didn't quite know what to look for. You might have a look at [javabuild...
[ 0.460160493850708, 0.30034005641937256, 0.36148619651794434, 0.25136709213256836, -0.24986261129379272, -0.07643638551235199, 0.24661006033420563, -0.36877205967903137, -0.33064964413642883, -0.6081031560897827, -0.058314114809036255, 0.15153472125530243, 0.15978193283081055, -0.0190982781...
name: myLabel2 text: My First Label - JLabel: name: myLabel2 text: My Second Label ``` Alternatively: ``` JFrame: name: myFrame title: My Frame content: - JLabel: {name: myLabel2, text: My First Label} - JLabel: {name: myLabel2, text: My Second
[ -0.17544366419315338, 0.20286503434181213, 0.38002511858940125, -0.026097485795617104, -0.34142357110977173, 0.10907486081123352, -0.1389201283454895, 0.016850456595420837, -0.01096993125975132, -0.8871134519577026, 0.09019740670919418, 0.17308589816093445, -0.2564743757247925, 0.058384828...
Label} ``` Or even: ``` JFrame(name=myFrame,title=My Frame): - JLabel(name=myLabel2, text=My First Label) - JLabel(name=myLabel2, text=My Second Label) ```
[ 0.03542832285165787, 0.39290472865104675, 0.47865208983421326, -0.045240119099617004, -0.007922722958028316, 0.024789370596408844, -0.05473873019218445, -0.029683833941817284, 0.008514775894582272, -0.8739581108093262, -0.02146882750093937, 0.2536758780479431, -0.2899884879589081, 0.354063...
I'm working on a large C++ system built with ant+[cpptasks](http://ant-contrib.sourceforge.net/cpptasks/index.html). It works well enough, but the build.xml file is getting out of hand, due to standard operating procedure for adding a new library or executable target being to copy-and-paste another lib/exe's rules (whi...
[ 0.588756799697876, 0.3173409104347229, 0.15860870480537415, 0.04127943515777588, -0.05180932581424713, -0.05836733803153038, 0.2209482192993164, 0.044976867735385895, 0.05112891271710396, -0.8064260482788086, 0.14665009081363678, 0.4059063792228699, -0.19647417962551117, -0.025462947785854...
own tags for commonly recurring patterns. Does anyone do that, or are there better ways ? you may be interested in: * [<import>](http://ant.apache.org/manual/Tasks/import.html) * [<macrodef>](http://ant.apache.org/manual/Tasks/macrodef.html) * [<subant>](http://ant.apache.org/manual/Tasks/subant.html) Check also this...
[ 0.5572472214698792, -0.26790720224380493, 0.018253929913043976, 0.11816911399364471, -0.0652129203081131, -0.26289090514183044, 0.23514454066753387, -0.19738176465034485, -0.6393138766288757, -0.6890258193016052, -0.15691260993480682, 0.1990967094898224, -0.5604419708251953, -0.37387299537...
If I have an array of image filenames, ``` var preload = ["a.gif", "b.gif", "c.gif"]; ``` and I want to preload them in a loop, is it necessary to create an image object each time? Will all the methods listed below work? Is one better? A. ``` var image = new Image(); for (i = 0; i < preload.length; i++) { imag...
[ 0.13554275035858154, -0.06662777811288834, 0.6047964096069336, -0.32000717520713806, -0.0006548707606270909, 0.1904880404472351, 0.4275003671646118, -0.7151665091514587, -0.34774723649024963, -0.5875945091247559, -0.3881904184818268, 0.6107527017593384, -0.4994520843029022, 0.1438994109630...
images[i].src = preload[i]; } ``` Thanks! **EDIT**: Actually, I just put it to the test, and Method A does not work as intended: Check it out: <http://www.rootspot.com/stackoverflow/preload.php> If you click on the 2nd image when the page is finished loading, it should appear instantaneously because it was preload...
[ 0.19044438004493713, -0.03017370030283928, 0.5900214314460754, 0.10052137821912766, -0.195967897772789, -0.18382684886455536, 0.28636297583580017, -0.23765906691551208, -0.48267680406570435, -0.7308503985404968, 0.02353944629430771, 0.5703601837158203, -0.31196925044059753, -0.239557087421...
I was probing around a bit in the realm of databases and hit the notion of having heterogeneous databases. I googled and found this - [link text](http://en.wikipedia.org/wiki/Heterogeneous_Database_System) My question is what kind of scenario would put this into practice and is it really useful? Is it just another thi...
[ 0.6124622225761414, 0.3470785319805145, -0.003751260694116354, 0.047915395349264145, -0.057310789823532104, -0.15549960732460022, -0.12494947016239166, 0.027339618653059006, -0.23752249777317047, -0.4940411150455475, 0.21998581290245056, 0.32489103078842163, 0.1995643824338913, 0.091665059...
an outside consultant handling a very specific conversion project, though, so I didn't get to see many of the issues involved in making it work well everywhere. I do remember that the single biggest hurdle I had to deal with was Oracle's lack of a simple autoincrement-style column and having to set up separate sequenc...
[ 0.6959531903266907, 0.34987035393714905, -0.21935907006263733, 0.21537090837955475, -0.2591951787471771, 0.28704285621643066, 0.10322962701320648, -0.1051686704158783, 0.10877782851457596, -0.17123809456825256, 0.35103368759155273, 0.738309919834137, 0.02316797338426113, -0.016705270856618...
(aside from a few common lookup tables). Just structure.
[ 0.36081328988075256, 0.16070076823234558, 0.023473545908927917, 0.30805155634880066, 0.012668890878558159, -0.3100341856479645, -0.02258019894361496, 0.16662196815013885, -0.6006154417991638, -0.6990759372711182, 0.04465677961707115, 0.15835517644882202, -0.04273389279842377, -0.2112138122...
Say I have an old class, dated from c# 1.1 and I would like to add more methods, fields to it. Now I am using 2005, and thus the most logical solution is to use partial classes. However, it seems that I have to pretend word partial to every class in a file where I define it. The problem: What if I cannot change the c...
[ 0.03840964660048485, 0.246601864695549, 0.009162262082099915, 0.012334531173110008, -0.11578790098428726, -0.11850011348724365, 0.281584769487381, -0.022410927340388298, -0.1928764134645462, -0.5904567241668701, 0.1042306050658226, 0.3238011598587036, -0.10423062741756439, 0.35332402586936...
involved classes, under the same namespace. This will tell the compiler that those are the parts of the same class that will be put together. Now, if you really cannot change the old classes, one thing you can do is to inherit your old class: ``` public class NewClass : OldClass ``` ...and as such you can extend th...
[ -0.026861634105443954, -0.39590683579444885, 0.29812735319137573, 0.25499117374420166, 0.11033288389444351, -0.3503657579421997, 0.07205388695001602, -0.1809907853603363, -0.35274821519851685, -0.4792441725730896, -0.04974362626671791, 0.8111256957054138, -0.5304863452911377, 0.23505748808...
public OldClass MyClass { get { return _oldClass; } set { _oldClass = value; } } } ``` ...or even a generic: ``` public class NewClass<T> where T: OldClass //applicable in both versions ``` The suggestion for extension methods will also work: ``` public void NewMethod1(this OldClass, string ...
[ -0.04805263131856918, -0.14567223191261292, 0.5033867955207825, -0.05973895639181137, 0.18981878459453583, -0.08942611515522003, 0.3416961133480072, 0.0012265219120308757, -0.2433379590511322, -0.8774002194404602, -0.28170764446258545, 0.484925776720047, -0.11731462925672531, 0.27715134620...
I am new to both django and python but I am beginning to get a grasp on things. I think. I have this problem and I can not seem to find an answer to it. (Though I assume it is really simple and the limiting factors are my google skills and lack of python/django knowledge) The scenario: a user can opt in to recieve t...
[ 0.38215357065200806, 0.18862950801849365, 0.25379636883735657, -0.29298463463783264, 0.42918235063552856, 0.07076922059059143, 0.03742508590221405, 0.3406621217727661, -0.24896372854709625, -0.46619194746017456, -0.13010013103485107, 0.5512534379959106, 0.17585498094558716, 0.0220319740474...
Store B - 2009-04-22 Store A - 2009-04-23 ``` Atm I am stuck with presenting the data first sorted by store then by date since I am obviously accessing the StoreEvents through the Store model. ``` Example: Store A - 2009-04-20 Store A - 2009-04-23 Store B - 2009-04-22 ``` So my question is: Is it p...
[ -0.10333295166492462, 0.2047179490327835, 0.32867172360420227, -0.15649913251399994, 0.11392124742269516, 0.3303731381893158, 0.1561119705438614, -0.12787337601184845, -0.2856023907661438, -0.5106737017631531, -0.20058733224868774, 0.767499566078186, -0.49075600504875183, 0.087599493563175...
store = models.ForeignKey(Store, related_name='events') class UserStore(models.Model): user = models.ForeignKey(User, related_name='stores') store = models.ForeignKey(Store, related_name='available_staff') ``` Edit: The following SQL does the trick but I still can't figure out how to do it in django: ``` S...
[ 0.026447376236319542, 0.082365982234478, 0.4872913956642151, -0.27958330512046814, 0.014056678861379623, -0.07395220547914505, 0.3518984317779541, -0.5558366775512695, -0.27380093932151794, -0.5245752930641174, 0.07647698372602463, 0.6363064050674438, -0.1497713029384613, 0.150520622730255...
What makes it hard to speed up dynamically typed languages when compared to statically typed languages . In other words what is inherent property of statically typed languages that make them easy to optimize for speed of execution ? When accessing attributes / methods in statically-typed languages, lookups can usually ...
[ -0.16125138103961945, 0.09003117680549622, 0.226874440908432, 0.09620603173971176, -0.19237665832042694, 0.16208016872406006, 0.01454838551580906, 0.03586738184094429, -0.2760939300060272, -0.5163233876228333, -0.13329385221004486, 0.5120112895965576, -0.5309133529663086, 0.009534095413982...
hash table. In some dynamic languages, like Python and Ruby, there may be additional lookups/method calls to implement dynamically generated attributes. All of these lookups are *very* hard to make fast. Python has one of the most well-tuned hash table implementations in the world, and JavaScript has had millions of d...
[ -0.18171577155590057, 0.05341916158795357, 0.062108397483825684, 0.02149224281311035, -0.3330145478248596, -0.12200739979743958, 0.18329888582229614, 0.15345460176467896, -0.26266562938690186, -0.6221790909767151, -0.16604842245578766, 0.5240707397460938, -0.44682881236076355, -0.207084104...
different ways to interact with variable lookups, which is nice in some circumstances, but makes optimization very hard. Other dynamic languages, such as Common Lisp and Smalltalk, can compete evenly with static languages in many use cases because dynamic lookups/modifications are more controlled.
[ -0.22327832877635956, -0.22809359431266785, 0.14996495842933655, 0.378811240196228, -0.2541571855545044, 0.01243259571492672, 0.06438102573156357, 0.1441829949617386, -0.3459283411502838, -0.6597287058830261, -0.31818467378616333, 0.7262285947799683, -0.6974552869796753, -0.338458418846130...
I am writing a macro in MS word. I need the macro to parse through a list of filenames, page numbersm and notes and filter out only the file names and page numbers. Each paragraph (line) in the document refers to a different file, so I am looping through For/Next statement. For each new line, I'm pulling out the fi...
[ -0.05547729507088661, 0.26968836784362793, 0.6420570611953735, -0.26461678743362427, 0.18942558765411377, 0.32813760638237, -0.05530380457639694, 0.23899224400520325, -0.19050419330596924, -0.7957482933998108, -0.12370502948760986, 0.26385462284088135, -0.25633591413497925, -0.037271618843...
built into a word document. I currently have the word document open with this code: ``` Dim oWord as Object Set oWord = CreateObject("Word.Application") oWord.Documents.Open "C:\document.doc" oWord.visible = true ``` This lets me successfully open the document but I need some help with figuring out how to output to...
[ 0.3106168508529663, 0.430238276720047, 0.6764206886291504, -0.13184748589992523, 0.08173463493585587, 0.08621237426996231, 0.5412318706512451, -0.5117396116256714, 0.035576336085796356, -0.8440558314323425, -0.2879927456378937, 0.5998916029930115, -0.25610804557800293, 0.057867538183927536...
app.Visible = True Set doc = app.Documents.Open("C:\test.doc") doc.Content.InsertAfter "Hello World" doc.Save doc.Close app.Quit End Sub ```
[ 0.15187014639377594, 0.33291730284690857, 0.6352499723434448, -0.09964828193187714, 0.30010420083999634, 0.18868473172187805, 0.6375827789306641, 0.004887937568128109, 0.01948700100183487, -0.6823483109474182, -0.6305976510047913, 0.736024796962738, -0.6510810852050781, 0.09740864485502243...
I keep getting a : > HibernateException: No > CurrentSessionContext configured! in my code. The only information other searches that returned is that the culprit is: ``` <property name="current_session_context_class">thread</property> ``` in my hibernate.cfg.xml. I do have that in my hibernate.cfg.xml file, and I...
[ 0.29836392402648926, 0.18843667209148407, 0.7172037959098816, -0.1838976889848709, 0.18685151636600494, -0.35496655106544495, 0.5764492750167847, 0.06777660548686981, -0.2583010196685791, -0.6870874166488647, 0.076674684882164, 0.34222301840782166, -0.23152390122413635, 0.3739202916622162,...
I have been able to get javascript intellisense working correctly for a 'class' prototype defined like this: ``` function GetCustomerList() { } GetCustomerList.prototype = { HEADER: { RETURN_CODE: 0, RETURN_MESSAGE: "", } , NUM_RECORDS: 0, START_RECORD: 0, END_RECORD: 0 };...
[ -0.07381356507539749, -0.15015845000743866, 0.1681123524904251, -0.09788443893194199, -0.1512424498796463, 0.021406883373856544, 0.14109736680984497, -0.13415493071079254, 0.08306173980236053, -0.9410492777824402, 0.022423794493079185, 0.5291345715522766, -0.39727258682250977, -0.173490270...
50; ``` With intellisense working perfectly. So intellisense works with complex nested types - great. However is it possible to get intellisense with an array of complex types? Example: ``` function Customer() Customer.prototype = { NAME: "", ADDRESS: "", ID: 0 }; function GetCustomerList() { } Get...
[ -0.27105292677879333, -0.29406216740608215, 0.22368521988391876, 0.024419480934739113, 0.17171449959278107, 0.17391031980514526, -0.01996784843504429, -0.12286311388015747, 0.13243527710437775, -0.7893781065940857, -0.1828833967447281, 0.25513434410095215, -0.32511022686958313, -0.00298381...
[ new CUSTOMER() ] }; ``` Where I have an array of the type 'CUSTOMER' which I have also defined a prototype for. I'd like to be able to type things like: ``` req.CUSTOMER[ 0 ].NAME ``` And have intellisense prompt me that 'NAME' is a property available for this array. Is this possible? **UPDATE:** As you have ...
[ -0.15054082870483398, -0.11994864046573639, 0.4142383635044098, -0.037850599735975266, 0.09074623882770538, -0.031128903850913048, -0.04721074178814888, 0.00451082456856966, -0.003700459375977516, -0.7140491008758545, -0.03930437192320824, 0.7544085383415222, -0.2842247188091278, 0.0624658...
create javascript file name it ***"customers.js***" and include the following: ``` function Customer() { /// <summary>This is my custom intellisense for the Customer type</summary> ///<field name="NAME" type="String">The Customer's name</field> ///<field name="ADDRESS" type="String">The customer's address<...
[ -0.02864864282310009, -0.0851418748497963, 0.21155376732349396, -0.27804678678512573, 0.035751841962337494, 0.20672640204429626, -0.4027879238128662, -0.06321976333856583, 0.18569600582122803, -0.6590754389762878, -0.09137849509716034, 0.28670814633369446, -0.09565704315900803, 0.082873284...
HEADER: { RETURN_CODE: 0, RETURN_MESSAGE: "" }, NUM_RECORDS: 0, START_RECORD: 0, END_RECORD: 0, CUSTOMERS: [new Customer()] }; ``` Then reference this file inside `<script src="customers.js"/>` or `/// <reference path="customer.js" />` inside another JS file. See how the intel...
[ 0.07515197992324829, -0.03779623284935951, 0.5047762989997864, -0.18356576561927795, 0.049357276409864426, 0.0863841250538826, -0.134634867310524, -0.013982894830405712, -0.2614346742630005, -0.569951593875885, -0.2715708613395691, 0.4553927481174469, -0.11170102655887604, 0.16007241606712...
Not sure what's happening with this, but here's my question. I have a Sql Server 2008 database that I need to be able to do full-text indexing/searching but when I try to setup my indices on the table, I get the following: [alt text http://docs.google.com/a/delorenzodesign.com/File?id=dgr4q2dh\_25sq4dnxd9\_b](http://d...
[ 0.18180403113365173, 0.34876370429992676, 0.0721360519528389, -0.13551896810531616, 0.012880184687674046, -0.04757057502865791, 0.501342236995697, 0.15548688173294067, -0.5003045797348022, -0.37552160024642944, 0.26704925298690796, 0.44668251276016235, -0.078447625041008, 0.116440504789352...
Second look turned up this page: [Administering Full-Text Search](http://msdn.microsoft.com/en-us/library/ms142557.aspx) And after reading the first bullet point (I've bolded the important stuff, for me at least)... > System management tasks such as managing the FDHOST Launcher service (MSSQLFDLauncher), **restartin...
[ -0.1999671310186386, -0.1415100246667862, 0.3101752698421478, 0.08150530606508255, -0.1280781626701355, -0.18426038324832916, 0.5934427380561829, -0.09607966989278793, -0.4261673390865326, -0.5714048743247986, -0.14118468761444092, 0.6176424026489258, 0.007986485958099365, -0.3244912922382...
I am setting up a web server for a client. They will be using a web app (PHP/LAMP) that I am building. The server will be sitting within their network locally. There will also be a MySQL database on the same server. The load on the server will only be 20-25 concurrent users, but uptime and performance is still very imp...
[ 0.47957396507263184, 0.1570964753627777, 0.6591986417770386, 0.045874353498220444, -0.09387890249490738, -0.07748421281576157, -0.07622995972633362, -0.0739460214972496, -0.2215241938829422, -0.7386229038238525, -0.032447826117277145, 0.3702811300754547, -0.07604814320802689, 0.05287475138...
of CPU, Cache and memory (size/type) to provide a relatively cheap solution, but still provide quality performance. To tell you the truth, hardware isn't the biggest factor, it's coding. If you develop your application correctly and optimally, then you should be able to run at least 100 users concurrently on a machine ...
[ 0.5134410858154297, 0.14871098101139069, 0.4983700215816498, 0.2666548788547516, 0.24858270585536957, -0.001038720947690308, 0.027980241924524307, -0.1756569892168045, -0.37762370705604553, -0.9276244044303894, -0.1601436734199524, 0.667452871799469, -0.14806786179542542, -0.07391586154699...
operating system without a GUI (Debian, Ubuntu, Fedora, etc. with no X-Window installed). These are servers, they shouldn't be wasting resources displaying pretty windows. Finally, like Trent said, RAID configuration is a great idea, but RAID is not a backup solution. If you have two of the same hard-drives, it is ver...
[ -0.1266186684370041, -0.0931912288069725, 0.18622195720672607, 0.37297770380973816, 0.20993772149085999, -0.5869704484939575, 0.04154093191027641, 0.4083797335624695, -0.28581681847572327, -0.9580784440040588, -0.34405964612960815, 0.8049541711807251, -0.3903079628944397, -0.15211628377437...
I have based many designs and frameworks that use C# Attributes over the past 4 or 5 years. But lately I see many people openingly discouraging their use or changing their frameworks to reduce the need or use of them. I found them to be a godsend but now I am starting to wonder what I am missing. To clarify: Use Co...
[ 0.6552697420120239, 0.189894437789917, 0.06726841628551483, 0.06165378913283348, -0.06726285815238953, -0.48591065406799316, -0.06955967843532562, 0.04953552037477493, -0.17144298553466797, -0.5891410708427429, -0.19090507924556732, 0.6100980043411255, -0.010349579155445099, 0.117424063384...
your database tables. I don't have any references to quote but I have read some backlash against adding another Attribute to the mix. But I feel over the three choices I just listed that Attributes still make the most sense. A Config file is harder to maintain and a common naming convention ties you to the implementat...
[ 0.611695408821106, 0.2197149693965912, 0.29070186614990234, 0.3642617166042328, -0.020628655329346657, -0.11228126287460327, 0.17006829380989075, -0.06446922570466995, -0.08936440944671631, -0.6663044691085815, 0.1034601554274559, 0.7247673869132996, -0.05494816601276398, 0.081518501043319...
talking about user visible attributes. In general, I would say that user visible attributes are not ideal. Most of the time they are used to embed some form of custom language on top of C#. DLINQ attributes are a good example of this. A better approach, from the consumer's perspective, would be to add first class su...
[ 0.34131211042404175, 0.14947344362735748, 0.2679121196269989, 0.33755236864089966, 0.0039712185971438885, -0.21708349883556366, 0.1466742902994156, 0.21710115671157837, -0.16523613035678864, -0.5229437351226807, -0.056091953068971634, 0.7363076210021973, -0.19226033985614777, -0.0728540495...
for most developers. The benefits just don't out weigh the costs. Perhaps someday C# will have meta-programing features, which will make doing that kind of thing easy. At the moment, however, that capability does not exist. This leaves you with 3 options: 1. Use attributes 2. Use a dynamic language, and generate co...
[ -0.017199261114001274, -0.14530296623706818, -0.20556089282035828, 0.4869875907897949, -0.436408132314682, -0.07694800943136215, 0.5147104263305664, -0.008438017219305038, -0.08986759185791016, -0.6183241605758667, -0.17098084092140198, 1.0343736410140991, -0.5069515109062195, -0.356629490...
The preview for a silverlight usercontrol in vs2008 is mostly useless to me and it takes forever to load. I spend a lot of time switching to XAML only and minimizing the preview for every Silverlight UserControl that I open. Is there a setting whereby I can tell VS2008 to by default open these in XAML-only mode? I foun...
[ 0.19676634669303894, 0.037287961691617966, 0.34121087193489075, -0.0439799539744854, -0.45646581053733826, -0.26805976033210754, 0.5148900747299194, -0.041220732033252716, -0.13425609469413757, -0.6572234034538269, 0.06591540575027466, 0.6865760684013367, -0.46120885014533997, 0.0908475443...
-- Miscellaneous. And then you will see "Always Open documents in full XAML view" That's the ticket. Saves so much time.
[ 0.40029534697532654, 0.030057132244110107, 0.7404898405075073, 0.65135657787323, 0.14165091514587402, -0.708565354347229, -0.1554354727268219, 0.5154094696044922, -0.25502604246139526, -0.6841154098510742, -0.37126046419143677, 0.4875333309173584, 0.10829220712184906, -0.09258749336004257,...
I have been writing unit tests using NUnit and Moq with my Silverlight code for some time now. One problem I keep running into has to do with DependencyObjects. If anything is derived from DependencyObject, then I can't instantiate it in my test. For instance, MouseEventArgs derives from DependencyObject. If I have co...
[ 0.4389674663543701, 0.10624945908784866, 0.09672439843416214, -0.1471427083015442, -0.19581487774848938, -0.11103443801403046, 0.1997431516647339, -0.09202498197555542, 0.058532070368528366, -0.5064938068389893, 0.49747925996780396, 0.6538087725639343, -0.4215696156024933, 0.19159758090972...
running. Any construction of a class that derives from DependencyObject throws an exception. Bummer. I do not use the [Silverlight Unit Test Framework](http://code.msdn.microsoft.com/silverlightut/), because it really isn't unit testing and requires a UI. I run need real, headless unit tests. Anyways, The best I have...
[ 0.27967217564582825, -0.22007966041564941, -0.048514239490032196, 0.32495588064193726, -0.10047987103462219, -0.13191217184066772, 0.2759459912776947, -0.01742284931242466, -0.01326757576316595, -0.6345998048782349, 0.18327227234840393, 0.6286060214042664, -0.255462646484375, -0.1052589640...
tied directly to SilverLight events and objects? The caveats of trying to test an application's logic through it's UI are well known anti-patterns and have given way to patterns that solve this problem in a more effective manner. Your UI really should only be concerned with UI events and pass any processing to another...
[ 0.40103211998939514, -0.14540281891822815, 0.17349255084991455, 0.4933151304721832, -0.38347336649894714, -0.2789352834224701, -0.010354802012443542, -0.2333066463470459, -0.2438960075378418, -0.19624845683574677, 0.06061319634318352, 0.14921775460243225, -0.6414033770561218, -0.0486754253...
more appropriate answer to your question would be that you need to refactor your code to use a patter such as MVC, MVP, or MVVM so that you can test your application logic independently of your UI layer.
[ 0.1736135482788086, 0.031858935952186584, 0.47526270151138306, 0.23960918188095093, -0.0392204225063324, -0.18901249766349792, 0.1377449780702591, -0.16156639158725739, -0.24111762642860413, -0.39517447352409363, -0.4078423082828522, 0.3395451605319977, -0.056519996374845505, -0.0109526589...
I'm trying to connect to Oracle from OS X. I have this file here: ``` /usr/local/oracle/network/admin/TNSNAMES.ORA ``` Online I've seen references to this file with the filename in both upper and lower case. Which is correct? The official documentation has it in lowercase: [Local Naming Parameters (tnsnames.ora)](ht...
[ 0.5228481292724609, 0.40738898515701294, -0.040970731526613235, -0.06702687591314316, 0.15263037383556366, 0.030760958790779114, -0.03980175778269768, 0.3002828359603882, -0.11855708807706833, -0.5318101048469543, 0.03428298607468605, 0.8130718469619751, -0.03147590160369873, 0.23655392229...
I am aware of the command to start the sphinx daemon manually. I use a rake task: "rake thinking\_sphinx:start" Is it possible to have it start whenever my rails application loads so I don't have to manually type in the command every time? You can configure daemon\_controller to do this: <http://blog.phusion.nl/2008/08...
[ -0.12137740850448608, -0.11694075912237167, 0.0046692416071891785, 0.004495757631957531, -0.36294183135032654, -0.1200132891535759, 0.3467138707637787, -0.06987845152616501, -0.3639664351940155, -0.9329204559326172, 0.2714209258556366, 0.19295695424079895, -0.30159464478492737, 0.164410665...
In the following example, I want to call a child batch file from a parent batch file and pass all of the remaining parameters to the child. ``` C:\> parent.cmd child1 foo bar C:\> parent.cmd child2 baz zoop C:\> parent.cmd child3 a b c d e f g h i j k l m n o p q r s t u v w x y z ``` Inside parent.cmd, I need to st...
[ -0.004666507709771395, 0.30849719047546387, 0.21696926653385162, -0.09672097861766815, 0.4530109763145447, 0.6878452897071838, -0.06296934932470322, -0.05171976611018181, 0.024812093004584312, -0.6911284327507019, -0.18863333761692047, 0.2303968369960785, -0.05556464195251465, 0.4244104325...
SHIFT will move the positional parameters down by 1, %\* still refers to the original parameters. Anyone have any ideas? Should I just give up and install Linux? `%*` will always expand to all original parameters, sadly. But you can use the following snippet of code to build a variable containing all but the first par...
[ 0.044396866112947464, -0.07124008238315582, 0.5707460045814514, -0.22844041883945465, -0.047346264123916626, 0.18876482546329498, 0.32789286971092224, -0.14358556270599365, -0.32511842250823975, -0.16510383784770966, -0.08703124523162842, 0.6269860863685608, -0.32781028747558594, -0.024827...
I think the crux of this issue is that I'm a `postfix` neophyte, but here goes. I'm using `postfix`'s `sendmail` on a 1&1 VPS account to post messages from a webserver (through PHP; contact forms, password resets, etc.). It's working fine, except mail cannot be sent to the local domain. That is, if the host is example...
[ 0.38890960812568665, 0.45301616191864014, 0.45245519280433655, -0.28285688161849976, -0.33537590503692627, 0.01387200690805912, 0.5342364311218262, 0.19889098405838013, -0.3280712962150574, -0.46652230620384216, -0.014222740195691586, 0.05027066171169281, -0.37896695733070374, 0.4632522165...
so redirecting x@example.com to x's server account isn't good for our case (through the host's web interface, we can set x@example.com to forward to x@gmail.com, which is what we're doing). Thanks for the help. `%*` will always expand to all original parameters, sadly. But you can use the following snippet of code to ...
[ 0.25223425030708313, 0.18865440785884857, 0.525776743888855, -0.03793560713529587, -0.3603017330169678, 0.15646955370903015, 0.45881468057632446, -0.21268542110919952, -0.2967449724674225, -0.3200089931488037, -0.01578493043780327, 0.45282527804374695, -0.444379597902298, 0.294784992933273...
Objects that derive from HashAlgorithm such as MD5CryptoServiceProvider have a Dispose() method, but it's private. Instead it has a Clear() method which "Releases all resources" used by it. WTF? Is this how to correctly dispose of a HashAlgorithm then? ``` var hasher = new MD5CryptoServiceProvider(); byte[] hashCod...
[ 0.1694578379392624, 0.044974666088819504, 0.04042315483093262, 0.11188114434480667, -0.1265144944190979, -0.5301070213317871, 0.26355281472206116, -0.20890212059020996, -0.20215429365634918, -0.40524017810821533, -0.3001777231693268, 0.4954056441783905, -0.44053956866264343, 0.391927212476...
parts of the BCL, such as `Close` for `System.IO.Stream`. Also, best practice here is to use a `using` block, which will automatically call the private `Dispose` method when it's finished.
[ 0.5590231418609619, -0.06904707103967667, -0.09667617827653885, -0.029825199395418167, 0.06968145072460175, -0.7082985639572144, -0.08669226616621017, 0.04409866780042648, -0.09379745274782181, -0.3459581732749939, -0.3966820240020752, 0.2589789927005768, -0.2566373646259308, 0.10255208611...
I want to convert a NHibernate CreateCriteria over to a [NHLambdaExtensions](http://code.google.com/p/nhlambdaextensions) criteria, but I'm getting errors that I don't know how to fix. The NHibernate criteria looks like this: ``` var departments = DepartmentService .CreateCriteria() .CreateAlias( "Goals", "go...
[ 0.08569835871458054, 0.3910357654094696, 0.5947925448417664, -0.06715746968984604, -0.04009025916457176, 0.27140605449676514, 0.05004292353987694, -0.18821047246456146, -0.1951766461133957, -0.6465238332748413, -0.16830743849277496, 0.3582162857055664, -0.5513601899147034, 0.40513056516647...
=> g.Company.Id == companyId ) .Add<Business.Goal>( g => g.Program.Id == programId ) .List<Business.Department>(); ``` The error I'm getting is "Could not resolve property Department of: Business.Department". The error obviously has to do with "g => g.Department", and there is nothing in the original NHiberna...
[ -0.14811520278453827, 0.19443055987358093, 0.3261360824108124, -0.12294294685125351, 0.17972706258296967, 0.17798994481563568, 0.06641592085361481, -0.22809530794620514, -0.3456067144870758, -0.35212618112564087, -0.3365444242954254, 0.4584139585494995, -0.3663787543773651, 0.4846964478492...
.Add<Business.Goal>( g => g.Company.Id == companyId ) .Add<Business.Goal>( g => g.Program.Id == programId ) .List<Business.Department>(); ``` Look for "Create Criteria Association With Alias" in [NHibernate Lambda Extensions (V1.0.0.0) - Documentation](http://nhlambdaextensions.googlecode.com/files/Nh...
[ 0.03974061459302902, 0.07421894371509552, 0.3134297728538513, 0.04384639486670494, 0.005706292111426592, 0.043391816318035126, 0.07176274061203003, -0.04090054705739021, -0.28443512320518494, -0.5312917828559875, -0.19756588339805603, 0.32160940766334534, -0.5282050371170044, 0.22452782094...
.Add<Business.Goal>( g => g.Program.Id == programId ) .List<Business.Department>(); ```
[ 0.16419966518878937, 0.1512167602777481, 0.5013416409492493, -0.34408724308013916, 0.020899320021271706, 0.21387512981891632, 0.09441790729761124, 0.07081644237041473, -0.375362753868103, -0.5397568345069885, -0.5348730087280273, 0.5532931685447693, -0.6409931182861328, 0.44449782371520996...
I have a servlet that write a pdf file as a ByteArrayOutputStream to the servlet's output stream. If I open the servlet URL the browser opens the file. But if occur an error on the servlet, the browser opens an empty pdf with an error message. Sending an error through the ServletResponse the browser opens the default e...
[ 0.014178106561303139, 0.2325734943151474, 0.5373274683952332, 0.053661562502384186, -0.26503702998161316, -0.20606687664985657, 0.3339253067970276, -0.137201726436615, 0.033689118921756744, -0.8290297985076904, -0.0736018493771553, 0.5222233533859253, -0.23084592819213867, 0.17289558053016...
docWindow = window.open('','title'); docWindow.document.open('application/pdf'); docWindow.document.write(response); docWindow.document.close(); }, onFailure: function(response) { alert(response); } }); ``` But, onSuccess opens a page with [o...
[ -0.042022768408060074, 0.14265228807926178, 0.9540916085243225, -0.4822566509246826, 0.21525394916534424, -0.09049133956432343, 0.49267563223838806, -0.30258163809776306, 0.002988536609336734, -0.6472283601760864, -0.7287954092025757, 0.7901981472969055, -0.5459746718406677, 0.344362050294...
a PDF file using JavaScript? Note: I'm assuming you're using the Prototype framework from the [`Ajax.Request`](http://www.prototypejs.org/api/ajax/request) call. The [response object](http://www.prototypejs.org/api/ajax/response) isn't meant to be written directly, it does however, have the `responseText` property whi...
[ -0.10957217961549759, -0.21691681444644928, 0.5481110215187073, -0.01068884041160345, -0.3818265199661255, -0.19932876527309418, 0.18954455852508545, -0.3540002107620239, -0.11915353685617447, -0.882531464099884, -0.4578394889831543, 0.5985973477363586, -0.32171228528022766, 0.007432652637...
document.write(response.responseText); docWindow.document.close(); }, onFailure: function(response) { alert(response); } }); ``` (Notice the added `.responseText`) **Edit:** Okay, so that didn't work... Try something like this: ``` new Ajax.Request('/pdfservlet', ...
[ -0.35868507623672485, -0.3469865918159485, 0.687497079372406, -0.03529684245586395, 0.03770773857831955, -0.27451932430267334, 0.27124595642089844, -0.14449891448020935, -0.08892211318016052, -0.7094414830207825, -0.322435587644577, 0.9463108777999878, -0.30428141355514526, -0.112937070429...
window.open('/pdfservlet'); }, onFailure: function(response) { alert(response); } }); ``` What this will do is create the ajax request, and if successful open it in a new window. Opening the new window should be fast and not actually require requesting the PDF again since the b...
[ -0.199040025472641, -0.2939070761203766, 0.6871135830879211, -0.004961722064763308, -0.2580392360687256, -0.4027065336704254, 0.2413368970155716, 0.036972299218177795, -0.06804121285676956, -1.0520615577697754, -0.5744781494140625, 0.5743904113769531, -0.21120280027389526, 0.09990840405225...
I have a `ChoiceField`, now how do I get the *label* when I need it? ``` class ContactForm(forms.Form): reason = forms.ChoiceField(choices=[("feature", "A feature"), ("order", "An order")], widget=forms.RadioSelect) ``` `form.cleaned_data[...
[ 0.22335021197795868, -0.044181566685438156, 0.39550670981407166, -0.19751551747322083, 0.3102678060531616, -0.08158572763204575, 0.1378576010465622, -0.2611069083213806, -0.01100962795317173, -0.6472783088684082, -0.3690367043018341, 0.8245441913604736, -0.13873237371444702, -0.13293220102...
only gives me the `feature` or `order` *values* or so. This may help: ``` reason = form.cleaned_data['reason'] reason = dict(form.fields['reason'].choices)[reason] ```
[ 0.30693352222442627, 0.019131269305944443, 0.18077650666236877, -0.05849383771419525, -0.027042632922530174, -0.17671766877174377, 0.23095299303531647, -0.3254259526729584, 0.06511176377534866, -0.2339905947446823, -0.28901880979537964, 0.6235271692276001, -0.28352800011634827, -0.27162441...
I have a set of call detail records, and from those records, I'm supposed to determine the average concurrent active calls per system, per hour (at a precision of one minute). If I query 7pm to 8pm, I should see the average concurrent calls for the hour (averaging the concurrent calls for each minute) within that hour ...
[ 0.18491758406162262, -0.0829763412475586, 0.7178399562835693, 0.12267059087753296, 0.12653905153274536, 0.11461380869150162, 0.5837457776069641, -0.08830545097589493, -0.564576268196106, -0.5461339950561523, -0.03939584270119667, 0.5589442849159241, -0.347649484872818, -0.00118712568655610...
this even more difficult is that it needs to span SQL 7.0 and SQL 2000 (some functions in 2000 aren't available in 7.0, such as GetUTCTime()), if I can just get 2000 working I'll be happy. What approaches to this problem can I take? ------------------------------------------- I thought about looping through minutes (...
[ 0.2807087004184723, -0.04386496543884277, 0.5100651979446411, 0.07309409230947495, -0.08827733248472214, -0.3588324189186096, 0.4794764518737793, -0.1990468055009842, -0.2447216510772705, -0.3320113718509674, 0.26643097400665283, 0.6568092703819275, 0.10517214238643646, 0.04490889981389046...
approach the problem. I tried to figure out a way to weight each call against particular minute that would tell me if the call was active during that minute or not, but couldn't come up with an effective solution. The data types here are the same as I have to query against. I don't have any control over the schema (o...
[ 0.21815139055252075, 0.2951439321041107, 0.2274400144815445, 0.04363267123699188, 0.2351582944393158, 0.27820825576782227, 0.12578119337558746, -0.25409021973609924, -0.2796272337436676, -0.5418489575386047, 0.06578215211629868, 0.4620378315448761, -0.35150355100631714, 0.17946888506412506...
dur int, system int, port int, ) --seconds is an stime value. It's the difference of seconds from UTC 1/1/1970 00:00:00 to the current UTC time, we use it as an identifier (like epoch). --time is the time the call was made. --date is the day the call was made. --dur is the duration of the call in seconds. --system...
[ -0.0031351109500974417, -0.22797241806983948, 0.635955810546875, 0.007986215874552727, -0.004986455664038658, 0.7138932347297668, 0.10468310117721558, -0.2555682957172394, -0.19600912928581238, -0.38807669281959534, 0.06550274044275284, 0.2004394829273224, -0.08693121373653412, 0.717645883...
dur, system, port) VALUES('1239924259','1924','20090416',90,1,102) INSERT INTO Records(seconds, time, date, dur, system, port) VALUES('1239923458','1910','20090416',891,2,1) INSERT INTO Records(seconds, time, date, dur, system, port) VALUES('1239924255','1924','20090416',99,2,42) INSERT INTO Records(seconds, time, date...
[ -0.16203634440898895, 0.3923053741455078, -0.06836489588022232, 0.2431751787662506, 0.4992673993110657, 0.8739334344863892, 0.30056232213974, -0.3058476448059082, -0.44676968455314636, -0.4482160210609436, -0.03260126709938049, 0.0907081887125969, 0.0006598132313229144, 0.7372404336929321,...
INTO Records(seconds, time, date, dur, system, port) VALUES('1239924447','1927','20090416',6,2,27) INSERT INTO Records(seconds, time, date, dur, system, port) VALUES('1239924342','1925','20090416',119,2,15) INSERT INTO Records(seconds, time, date, dur, system, port) VALUES('1239924397','1926','20090416',76,2,41) INSERT...
[ -0.13683483004570007, 0.28544965386390686, 0.1501765251159668, 0.11128182709217072, 0.09000524133443832, 0.5245890021324158, 0.18814682960510254, -0.27068251371383667, -0.4596177935600281, -0.568901777267456, -0.07940907031297684, 0.08488108217716217, 0.010396206751465797, 0.37667885422706...
number of seconds since midnight of the day of the call, that call occurred, by just taking s modulus the number of seconds in a day: `s % (60 * 60 * 24)`. ``` select *, s % (60 * 60 * 24) as start_secs_from_midnight, s % (60 * 60 * 24) + dur - 1 as end_secs_from_midnight, ; ``` We subtract one from `s + dur` becau...
[ 0.2168068289756775, -0.326147198677063, 0.7091647386550903, -0.016676193103194237, 0.33961015939712524, 0.2563192546367645, 0.2947707176208496, -0.18941622972488403, -0.27675020694732666, -0.4481298625469208, -0.2877952456474304, 0.3833562731742859, 0.10005495697259903, 0.42611852288246155...
record_mins_from_midnight as select *, floor( s / 60 ) % (60 * 24) as start_mins_fm, floor( ( s + dur - 1) / 60 ) % (60 * 24) as end_mins_fm from record ; ``` Now we create a table of minutes. We need 1440 of them, numbered from 0 to 1439. In databases that don't support arbitrary sequences, I *create an artificial...
[ 0.3034997284412384, 0.0032067405991256237, 0.5078559517860413, -0.05461996793746948, 0.5809720754623413, 0.43067482113838196, -0.008617691695690155, -0.33509108424186707, -0.23424233496189117, -0.44312483072280884, -0.10149353742599487, 0.3796561360359192, -0.014693823643028736, 0.49746122...
idz from artificial_range; ``` So to create a `minute` table: ``` create view minute as select id - 1 as active_minute from artificial_range where id <= 1440 ; ``` Now we just join `minute` to our record view ``` create view record_active_minutes as select * from minutes a join record_mins_from_...
[ 0.16555406153202057, -0.047879960387945175, 0.6159012913703918, -0.17459025979042053, 0.12631474435329437, 0.057867661118507385, -0.05520644038915634, -0.28458988666534424, -0.21218161284923553, -0.5278571248054504, -0.07135730236768723, 0.42256155610084534, -0.09421729296445847, 0.2203870...
minute". That is, a two second call that starts at 12:00:59 and ends at 12:01:01 by this definition occurs during two different minutes, but a two second call that starts at 12:00:58 and ends at 12:00:59 occurs during one minute. I did that because you specified "So, I need a way to check for a count of active calls f...
[ 0.22328892350196838, -0.18613125383853912, 0.7661625146865845, 0.0857987329363823, 0.2181341052055359, 0.047644924372434616, 0.4245499074459076, -0.09165023267269135, -0.3641737103462219, -0.4546692669391632, 0.050736818462610245, 0.18211065232753754, -0.37684956192970276, 0.24269588291645...
to or larger than minute granularity, we just group on that last view. To find average calls per hour we divide by 60 to turn minutes to hours: ``` select floor( active_minute / 60 ) as hour, count(*) / 60 as avg_concurent_calls_per_minute_for_hour from record_active_minutes group by floor( active_minute / 60 ) ;...
[ 0.301107794046402, 0.026956452056765556, 0.5354458093643188, -0.15379291772842407, 0.3906475305557251, 0.12579205632209778, 0.22384096682071686, -0.2031770795583725, -0.39829304814338684, -0.6847003698348999, -0.17043212056159973, 0.29112789034843445, -0.1437595933675766, 0.328338533639907...
can get a report that shows the average over all hours in the day: ``` create view record_active_minutes_all as select * from minutes a left outer join record_mins_from_midnight b on (a.active_minute >= b.start_mins_fm and a.active_minute <= b.end_mins_fm) ; ``` Then we again do our select, but ...
[ 0.1597357541322708, 0.12825606763362885, 0.6002431511878967, -0.159136101603508, 0.06878361105918884, 0.15799745917320251, 0.27661046385765076, -0.32987621426582336, -0.48775577545166016, -0.803602933883667, -0.168216735124588, 0.5358310341835022, -0.1714828759431839, 0.14741761982440948, ...
0.0000 | | 1 | 0.0000 | | 2 | 0.0000 | | 3 |
[ -0.2641516327857971, 0.25223106145858765, 0.4189170002937317, -0.24589961767196655, -0.07051774114370346, 0.1289709359407425, 0.3874216675758362, -0.642376720905304, 0.5127167701721191, -0.4401622712612152, -0.20431077480316162, 0.1628345549106598, -0.32518741488456726, 0.2763102352619171,...
0.0000 | etc.... ``` We can also index into this with a where. Unfortunately, the join means we'll have null values for the underlying `record` table where no calls exist for a particular hour, e.g., ``` select floor( active_minute / 60 ) as hour, count(*) / 60 as avg_concurent_calls_per_min from record_acti...
[ 0.21358686685562134, 0.2495623230934143, 0.4973384737968445, -0.19056084752082825, 0.31905606389045715, 0.27886444330215454, 0.11198084056377411, -0.05636139214038849, -0.4803154170513153, -0.6128993630409241, -0.26059311628341675, 0.23158130049705505, -0.039005815982818604, 0.507090687751...