text
stringlengths
0
30.5k
title
stringclasses
1 value
embeddings
listlengths
768
768
} [Test] public void CheckAlwaysTwo() { // simple example to show how to access F# function from C# int n = Zumbro.AlwaysTwo; Assert.AreEqual(2, n); }
[ 0.33395612239837646, -0.26105228066444397, -0.011734540574252605, 0.14564858376979828, 0.3160437345504761, -0.19234506785869598, 0.5483156442642212, -0.35297948122024536, 0.1502538025379181, -0.45956310629844666, -0.009547081775963306, 0.5841847658157349, -0.26566463708877563, 0.1098367944...
class Helper<T> { public static List<T> mkList(params T[] ar) { List<T> foo = List<T>.Nil; for (int n = ar.Length - 1; n >= 0; n--)
[ -0.251199334859848, -0.3098118305206299, 0.5119437575340271, -0.27676165103912354, -0.11221009492874146, 0.47398215532302856, 0.30817949771881104, -0.588887631893158, -0.4116900563240051, -0.3211117684841156, -0.3535940647125244, 0.43907928466796875, -0.6963188648223877, 0.0738259777426719...
foo = List<T>.Cons(ar[n], foo); return foo; } } [Test] public void foldl1() { int seed = 64;
[ 0.1771775186061859, -0.2189716398715973, 0.06161416321992874, -0.43305912613868713, 0.23592683672904968, 0.09913308173418045, 0.25359100103378296, -0.4479002058506012, 0.29805466532707214, -0.31647053360939026, -0.09799903631210327, 0.6302593946456909, -0.4189247786998749, 0.21412438154220...
List<int> values = Helper<int>.mkList( 4, 2, 4 ); FastFunc<int, FastFunc<int,int>> fn = FuncConvert.ToFastFunc( (Converter<int,int,int>) delegate( int a, int b ) { return a/b; } ); int result = Zumbro.foldl<int, int>( fn, seed, values); Assert.AreEqual(2, result); ...
[ 0.0039542317390441895, -0.6254784464836121, 0.529998242855072, -0.04992198199033737, 0.06692855060100555, 0.12463042885065079, 0.45034655928611755, -0.8264135122299194, -0.22326599061489105, -0.415128618478775, -0.24229326844215393, 0.36423102021217346, -0.24953149259090424, 0.246080458164...
public void foldl0() { string seed = "hi mom"; List<string> values = Helper<string>.mkList(); FastFunc<string, FastFunc<string, string>> fn = FuncConvert.ToFastFunc((Converter<string, string, string>)delegate(string a, string b) { throw new Exception("should n...
[ -0.04999670013785362, -0.36127737164497375, 0.408478319644928, -0.3074236214160919, 0.350320965051651, -0.15669409930706024, 0.41690897941589355, -0.3430652916431427, -0.002595998579636216, -0.3841916024684906, -0.36890530586242676, 0.4342964291572571, -0.42042919993400574, 0.3266226351261...
string result = Zumbro.foldl<string, string>(fn, seed, values); Assert.AreEqual(seed, result); } [Test] public void map() { FastFunc<int, int> fn = FuncConvert.ToFastFunc((Converter<int, int>)delegate(int a) { return a*a; });
[ -0.16630662977695465, -0.6885572075843811, 0.2708928883075714, -0.18657901883125305, 0.1760302186012268, -0.05855793133378029, 0.3714945912361145, -0.499645859003067, -0.029833436012268066, -0.4210471510887146, -0.350597620010376, 0.6044041514396667, -0.23724332451820374, 0.210415661334991...
List<int> vals = Helper<int>.mkList(1, 2, 3); List<int> res = Zumbro.map<int, int>(fn, vals); Assert.AreEqual(res.Length, 3); Assert.AreEqual(1, res.Head); Assert.AreEqual(4, res.Tail.Head); Assert.AreEqual(9, res.Tail.Tail.Head); } [Test]
[ 0.05819375440478325, -0.38442060351371765, 0.4921225607395172, -0.1290525645017624, -0.13588279485702515, 0.3322463929653168, 0.7191745042800903, -0.9319148659706116, -0.14088761806488037, -0.40825486183166504, -0.1731400042772293, 0.5572715401649475, -0.20039452612400055, 0.10970970988273...
public void ucase() { List<string> vals = Helper<string>.mkList("arnold", "BOB", "crAIg"); List<string> exp = Helper<string>.mkList( "ARNOLD", "BOB", "CRAIG" ); List<string> res = Zumbro.ucase(vals); Assert.AreEqual(exp.Length, res.Length); Assert.AreE...
[ -0.005832852330058813, 0.005696415901184082, 0.5976846218109131, -0.29649755358695984, 0.055765677243471146, 0.2518780827522278, 0.5561118125915527, -0.6688610911369324, -0.2347511649131775, -0.19256934523582458, -0.5108143091201782, 0.6414533257484436, -0.31415417790412903, 0.319617390632...
Assert.AreEqual(exp.Tail.Head, res.Tail.Head); Assert.AreEqual(exp.Tail.Tail.Head, res.Tail.Tail.Head); } } } ```
[ -0.32389891147613525, 0.02856028452515602, 0.5617104768753052, -0.04141728952527046, -0.23371274769306183, -0.27611836791038513, 0.5247259736061096, -0.4547533392906189, 0.3077467978000641, -0.1951214075088501, -0.21036118268966675, 0.8410308361053467, 0.02152642421424389, 0.03590294718742...
I am working on a client-server application that uses boost::serialization library for it's serialization needs. I need to serialize and deserialize polymorphic objects that does not seem to work. The documentation does say that it is supported but none of the related examples demonstrate what I'm trying to do here. ...
[ 0.3156191408634186, 0.15279769897460938, -0.05470388010144234, 0.12671029567718506, 0.0269317589700222, -0.14534500241279602, 0.2842893898487091, 0.011386340484023094, -0.18156710267066956, -0.6529347896575928, -0.057781416922807693, 0.6083388328552246, -0.5212990045547485, 0.2222500592470...
void serialize(boost::archive::polymorphic_iarchive & ar, const unsigned int file_version) { ar & data1; } void serialize(boost::archive::polymorphic_oarchive & ar, const unsigned int file_version){ ar & data1; }
[ -0.1323297768831253, 0.13245533406734467, 0.13588152825832367, -0.21408282220363617, 0.1635747253894806, 0.1858464628458023, 0.21692386269569397, -0.4048462212085724, -0.23504509031772614, -0.16411955654621124, -0.4054316282272339, 0.6537215113639832, -0.5301474928855896, -0.20265842974185...
public: base() {}; base(int _d) : data1(_d) {} virtual void foo() const {std::cout << "base" << std::endl;} }; class derived : public base { public: int data2; friend class boost::serialization::access; void serialize(boost::archive::polymorphic_iarchive & ar, ...
[ -0.1400737464427948, -0.04598173871636391, 0.3238121569156647, -0.08173803985118866, 0.20815320312976837, 0.12513630092144012, 0.08875015377998352, -0.22851012647151947, -0.03600286319851875, -0.05378169193863869, -0.37273362278938293, 0.624441921710968, -0.28720152378082275, 0.12220850586...
ar & boost::serialization::base_object<base>(*this) & data2; } void serialize(boost::archive::polymorphic_oarchive & ar, const unsigned int file_version){ ar & boost::serialization::base_object<base>(*this) & data2; } public: derived() {}; derived(int _b...
[ -0.15842129290103912, 0.2797949016094208, 0.47163185477256775, -0.45187172293663025, 0.05540762469172478, 0.360434353351593, 0.09192963689565659, -0.6393527984619141, -0.09481289237737656, 0.017224419862031937, -0.35534992814064026, 0.745042085647583, -0.5073971152305603, -0.09684156626462...
const {std::cout << "derived" << std::endl;} }; int main(int argc, char *argv[]) { // client const base *b1 = new derived(1, 2); std::ostringstream oss; boost::archive::polymorphic_text_oarchive oa(oss); oa << *b1; // server base *b2 = new derived(3, 4); std::istr...
[ -0.33402761816978455, -0.17238570749759674, 0.6875215768814087, -0.2717027962207794, -0.05035390332341194, 0.43905529379844666, 0.1013927087187767, -0.13054195046424866, -0.028362896293401718, -0.2843828499317169, -0.39641618728637695, 0.2621992826461792, -0.3305187523365021, 0.12821090221...
// prints 1, ok cout << b2->data1 << endl; // prints 4, why wasn't the derived class data written? cout << (dynamic_cast<derived*>(b2))->data2 << endl; return 0; } ``` Found a resolution. I had to export the derived class with the statement: ``` BOOST_CLASS_EXPORT(derived); ``` Posting s...
[ -0.2750393748283386, -0.09090917557477951, 0.43604832887649536, -0.023352768272161484, 0.013199398294091225, 0.12558665871620178, -0.0005611936212517321, -0.5663241147994995, -0.4036296308040619, -0.5002581477165222, -0.183503195643425, 0.435096800327301, -0.38732483983039856, -0.204406633...
void serialize(Archive & ar, const unsigned int file_version) { ar & data1; } public: base() {}; base(int _d) : data1(_d) {} virtual void foo() const {std::cout << "base" << std::endl;} }; class derived : public base { public: int data2; friend class boost::s...
[ -0.009648325853049755, -0.05389566347002983, 0.4365684986114502, -0.14424902200698853, 0.24825720489025116, 0.11888089776039124, 0.1293727457523346, -0.33138689398765564, -0.14270439743995667, -0.19379325211048126, -0.26528286933898926, 0.556495189666748, -0.38327473402023315, 0.2394561469...
Archive> void serialize(Archive & ar, const unsigned int file_version) { ar & boost::serialization::base_object<base>(*this); ar & data2; } public: derived() {}; derived(int _b, int _d) : base(_b), data2(_d) {} virtual void foo() const {std::cout << "derived" << st...
[ 0.05784054473042488, -0.05101707577705383, 0.30991414189338684, -0.346063494682312, 0.16523166000843048, 0.13496769964694977, 0.05918687954545021, -0.4718968868255615, -0.15624433755874634, -0.14455831050872803, -0.3729473650455475, 0.4337911903858185, -0.37114548683166504, 0.0344033986330...
client // Assign to base type std::unique_ptr<const base> b1(new derived(1, 2)); std::ostringstream oss; boost::archive::text_oarchive oa(oss); oa & b1.get(); // server // Retrieve derived type from base std::unique_ptr<base> b2; std::istringstream iss(oss.str());...
[ -0.28332364559173584, -0.11741602420806885, 0.4667242467403412, -0.2154143899679184, -0.05020466446876526, 0.5146877765655518, 0.10649088770151138, -0.18531890213489532, -0.22626425325870514, -0.23933523893356323, -0.5020173192024231, 0.19865581393241882, -0.376914918422699, 0.095093235373...
ia & temp; b2.reset(temp); } cout << b2->data1 << endl; cout << (dynamic_cast<derived*>(b2.get()))->data2 << endl; return 0; } ```
[ 0.16624684631824493, -0.02211063541471958, 0.16405481100082397, -0.184195876121521, 0.18595679104328156, 0.18527203798294067, 0.3085246682167053, -0.29264047741889954, -0.13062730431556702, -0.4269777238368988, -0.38242825865745544, 0.42443203926086426, -0.5983863472938538, 0.0387304760515...
I've trying to use Eclipse JDT AST parsing classes. After including the initial JAR, and sorting out a couple more dependencies, it is with 7+ JARs and I still having NoClassDefFoundError exceptions. This situation arises whenever I'm trying to test libraries with little or no documentation. Trial and error seems a ver...
[ 0.39952173829078674, 0.6564193367958069, 0.014823966659605503, -0.07227405905723572, -0.4357887804508209, 0.21208971738815308, 0.4423601031303406, -0.26182621717453003, -0.18390972912311554, -0.626891016960144, 0.26742231845855713, 0.40072768926620483, -0.07016628980636597, 0.2411174476146...
so far. Is there a better way? If you refer to this SO question [Finding unused jars used in an eclipse project](https://stackoverflow.com/questions/248589), you also have: **[ClassPathHelper](http://classpathhelper.sourceforge.net/)**, which can quickly focus on unresolved classes: ![unresolved](https://i.stack.imgu...
[ 0.22889754176139832, -0.027738671749830246, -0.0766386166214943, 0.09875507652759552, -0.00779855577275157, 0.09578809142112732, 0.1536538004875183, -0.27005085349082947, -0.3485877811908722, -0.712113618850708, 0.054607026278972626, 0.46958255767822266, -0.08367723971605301, -0.0763163119...
What is the advantage of local classes in Java or in any other language that makes use of this feature? They allow you to take logic out of the parent class and objectify it. This removes functionality from where it doesn't belong and puts it into its own class. But what if this new object is only needed for a short ti...
[ 0.02047779969871044, -0.2570108473300934, -0.22697171568870544, 0.2992563247680664, -0.0928298830986023, -0.19588257372379303, 0.125908762216568, -0.03097318299114704, -0.3209572434425354, -0.4231349527835846, 0.09889672696590424, 0.47350138425827026, -0.12134626507759094, 0.17140288650989...
I'm trying to write a static member function in C# or find one in the .NET Framework that will re-case a file path to what the filesystem specifies. Example: ``` string filepath = @"C:\temp.txt"; filepath = FileUtility.RecaseFilepath(filepath); // filepath = C:\Temp.TXT // Where the real fully qualified filepath in ...
[ 0.05634044110774994, -0.08895468711853027, 0.5530693531036377, -0.0849740281701088, -0.02473554015159607, -0.23688334226608276, 0.2937665283679962, -0.20807400345802307, -0.1766364723443985, -0.6880117058753967, -0.11849162727594376, 0.7328199148178101, -0.5201444625854492, 0.0685373395681...
= ""; try { result = Path.GetFullPath(filepath); DirectoryInfo dir = new DirectoryInfo(Path.GetDirectoryName(result)); FileInfo[] fi = dir.GetFiles(Path.GetFileName(result)); if (fi.Length > 0) { result = fi[0].FullName; } } catch (Exception) ...
[ 0.029823455959558487, -0.6930331587791443, 0.8985726833343506, -0.343189537525177, 0.4027293026447296, -0.07974288612604141, 0.3835544288158417, -0.3407890796661377, -0.17845399677753448, -0.3085964620113373, -0.32167086005210876, 0.7280586361885071, -0.22988159954547882, 0.080524973571300...
result = filepath; } return result; } ``` This is a pretty simple implementation that assumes that the file and directories all exist and are accessible: ``` static string GetProperDirectoryCapitalization(DirectoryInfo dirInfo) { DirectoryInfo parentDirInfo = dirInfo.Parent; if (null == parentDirInfo...
[ 0.023441791534423828, -0.4588301181793213, 0.7228760719299316, -0.22703756392002106, 0.33631300926208496, 0.01262358296662569, 0.12708328664302826, -0.22295831143856049, -0.04098837822675705, -0.6808671951293945, -0.4810123145580292, 0.5762313604354858, -0.42554008960723877, 0.408912032842...
DirectoryInfo dirInfo = fileInfo.Directory; return Path.Combine(GetProperDirectoryCapitalization(dirInfo), dirInfo.GetFiles(fileInfo.Name)[0].Name); } ``` There is a bug with this, though: Relative paths are converted to absolute paths. Your original code above did the same, so I'm assumin...
[ -0.08244101703166962, -0.3030906915664673, 0.46630731225013733, -0.13482722640037537, 0.24882008135318756, -0.3848249912261963, 0.16752654314041138, 0.013810739852488041, -0.04334867000579834, -0.6418850421905518, 0.1661231517791748, 1.009443759918213, -0.5801225304603577, 0.18326476216316...
In [this question](https://stackoverflow.com/questions/478616/why-in-c-is-queue-scrambling-the-data-in-its-elements), I asked about using queue's and threads in C#. I found that locking around the code that writes data to file resolved my issue. One of the [ansewerers](https://stackoverflow.com/users/20029/zach-scriven...
[ -0.2433852106332779, 0.10388974100351334, 0.263080894947052, 0.06194157153367996, -0.07712218165397644, 0.061169009655714035, -0.013066966086626053, -0.19568803906440735, -0.549530565738678, -0.054681431502103806, -0.26619070768356323, 0.1423802524805069, -0.44467613101005554, 0.0435208007...
b=a you throw away the reference to array b. b[1] and a[1] are now pointing at the same array.
[ 0.3106910288333893, 0.14675725996494293, -0.051774222403764725, -0.4460163712501526, -0.307521253824234, -0.15119358897209167, 0.32359927892684937, -0.40609508752822876, -0.10580293089151382, -0.31071746349334717, 0.03359926491975784, 0.335208922624588, -0.5567728281021118, 0.2224549651145...
I have a collection of legacy C code which I'm refactoring to split the C computational code from the GUI. This is complicated by the heavily recursive mathematical core code being K&R style declarations. I've already abandoned an attempt to convert these to ANSI declarations due to nested use of function parameters (j...
[ 0.29457607865333557, 0.25737789273262024, 0.14336863160133362, -0.11744563281536102, -0.14813251793384552, -0.3040260374546051, 0.1961127668619156, 0.033483367413282394, -0.007090833503752947, -0.7190688848495483, -0.09898567199707031, 0.5681176781654358, -0.27185267210006714, 0.2553545236...
Doxygen @callergraph markup so informative graphs are generated for individual functions. What I'd like to do beyond that is amalgamate these graphs so I can determine the narrowest boundary of functions exposed to the outside world. The original header files are no use - they expose everything as untyped C functions....
[ 0.5238888263702393, -0.02195175178349018, 0.28413233160972595, -0.12383247166872025, -0.17675338685512543, -0.12187977135181427, 0.44417229294776917, 0.1262962818145752, 0.1236414685845375, -0.7239531874656677, 0.29341429471969604, 0.49316129088401794, -0.8496256470680237, -0.0358721651136...
I'd be quite happy if someone could suggest an alternative analysis tool (free or relatively cheap) or technique using Doxygen's XML output to achieve the same goal. A callergraph amalgamated at the file level does have a certain appeal for client documentation rather than a plain list :-) In your Doxyfile, set ``` G...
[ 0.29291945695877075, 0.20149898529052734, 0.4727972447872162, -0.029129458591341972, 0.00730045884847641, -0.18589960038661957, -0.06017433479428291, -0.3787114918231964, -0.09682770818471909, -0.38753360509872437, -0.122733473777771, 0.6507775783538818, -0.4831721782684326, -0.26666417717...
prot="public" static="yes" const="no" explicit="no" inline="no" virt="non-virtual"> <type>svn_error_t *</type> <definition>svn_error_t * init_apr</definition> <argsstring>(apr_pool_t **ppool, int *argc, char const *const **argv)</argsstring> <name>init_apr</name> <!-- param and descript...
[ -0.3431071639060974, -0.17938588559627533, 0.8191707134246826, -0.045188967138528824, -0.20998406410217285, 0.5836730599403381, 0.09405361115932465, -0.6564287543296814, -0.24451091885566711, -0.41829872131347656, -0.19575129449367523, 0.4155350923538208, -0.2273697406053543, -0.2694628238...
memberdef/referencedby pair, you have a caller-callee relationship, which you can grab via XSLT: ``` <?xml version="1.0" encoding="utf-8"?> <xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:output method="text"/> <xsl:template match="/"> <xsl:apply-templates select...
[ -0.02639947459101677, -0.2910844087600708, 0.6003559231758118, -0.13936081528663635, -0.4205777943134308, -0.07589107751846313, -0.13897812366485596, -0.5899806618690491, -0.10502734035253525, -0.3294546902179718, -0.1471094787120819, 0.3237007260322571, -0.4801594018936157, 0.255327194929...
select="concat(./text(), ' calls ', $function-name, '&#xA;')"/> </xsl:for-each> </xsl:template> </xsl:stylesheet> ``` Which gives you a line per caller-callee like this: ``` main calls svn_error_t * init_apr(apr_pool_t **ppool, int *argc, char const *const **argv) ``` You'll want to tweak that XSLT an...
[ -0.2515001595020294, -0.175516277551651, 0.44903045892715454, -0.1521356850862503, -0.33640334010124207, 0.2344510704278946, -0.04396390542387962, -0.22411733865737915, -0.2950105369091034, -0.7298998236656189, -0.14325131475925446, 0.3075186312198639, -0.49435293674468994, -0.010229266248...
I want to make sure my local is matching the production environment closely and that means running IIS and not the ASP.NET development server that comes with Visual Web Developer express edition. What is the best way to do this? In Visual Studio you right-click the project, select Properties then Web and change it to u...
[ 0.5822450518608093, -0.16764582693576813, 0.21865522861480713, -0.06231425330042839, -0.13829216361045837, -0.2938264012336731, 0.256236732006073, -0.20257221162319183, -0.21461790800094604, -0.8817103505134583, 0.12703001499176025, 0.6458541750907898, -0.029442941769957542, 0.195746377110...
assume that it is.
[ 0.18737055361270905, 0.1411403864622116, -0.255880743265152, 0.09408415108919144, 0.25187984108924866, -0.2379806488752365, 0.023411372676491737, 0.3145178258419037, 0.34500986337661743, -0.46459007263183594, -0.3309239149093628, 0.6228287220001221, -0.06585845351219177, -0.266223132610321...
I'm on a Windows machine. This seems like it should be unnecessary, but when I do it, everything suddenly works. Is there something wrong with my path? Do I need to add something to it to avoid having to copy DLLs? In Visual Studio you right-click the project, select Properties then Web and change it to use Local IIS. ...
[ 0.6489039063453674, -0.12032702565193176, 0.40222635865211487, 0.00980793684720993, -0.011848715133965015, -0.38469675183296204, 0.45120343565940857, -0.31169256567955017, -0.2710041403770447, -0.9021652340888977, 0.14407627284526825, 0.541647732257843, 0.016332732513546944, 0.169646605849...
I assume that it is.
[ 0.3321509063243866, 0.37573376297950745, 0.14570236206054688, -0.19331736862659454, 0.3464583158493042, -0.11846242845058441, -0.06132160872220993, 0.26161423325538635, 0.021254319697618484, -0.30996447801589966, -0.0947352796792984, 0.35752272605895996, 0.22286656498908997, 0.141197666525...
Visual Studio has a way to import, export your color settings. Does Eclipse have something similar? I'm looking for the "perfect" color scheme in Eclipse that's easiest on the eyes. For me, that simply means a black background (so I'm not staring into a bright light bulb all day). Thanks The simplest way is to chang...
[ 0.6703298687934875, -0.2404160499572754, 0.26188257336616516, -0.0881257951259613, -0.24843809008598328, -0.08359399437904358, -0.09422129392623901, -0.057885121554136276, -0.15973342955112457, -0.8670276403427124, 0.12283434718847275, 0.8826045393943787, -0.11642379313707352, -0.258119523...
"`System Default`" and you can pick the color you want.
[ 0.5396528244018555, -0.4631042778491974, 0.25863832235336304, -0.05740195885300636, 0.6299043297767639, 0.06217723712325096, -0.15690219402313232, 0.31349438428878784, -0.29710617661476135, -0.69477379322052, -0.4239972233772278, 0.72541344165802, -0.3831055164337158, 0.022273778915405273,...
I have a grouped table view with textfields in the tableview. For the keyboard to not hide the textfields, in the textFieldShouldBeginEditing, I am calling the scrollToRowAtIndexPath method and setting the scroll position of the row being edited to the top of the tableview. The scrolling does happen, but as soon as th...
[ -0.18810433149337769, 0.2525153160095215, 0.8063235878944397, -0.3165934681892395, -0.1273876428604126, 0.12352100759744644, 0.16346880793571472, -0.19721882045269012, -0.23357465863227844, -0.8300038576126099, 0.07147009670734406, 0.6999543905258179, -0.10639460384845734, 0.15148450434207...
(bdate and zip) password2 works as expected.*** This is the code I am using to scroll to a particular row ``` if(textField == password2){ indPath = [NSIndexPath indexPathForRow:3 inSection:0]; [self.tableView scrollToRowAtIndexPath:indPath atScrollPosition:UITableViewScrollPositionTop animated:YES]; retur...
[ 0.3022285997867584, -0.0398125946521759, 0.5930412411689758, -0.1046857014298439, -0.15531305968761444, 0.14544308185577393, 0.3660220503807068, -0.26827991008758545, -0.0010293469531461596, -0.8635960817337036, 0.12114111334085464, 0.5288010239601135, -0.23292668163776398, -0.110908657312...
suspect what is going on is that the table view is rubber banding back, just like a webview in Safari does when you run pass its bounds. The most likely reason for this is that when you pop up the keyboard it is on top of the table view, but the table view has not physically contracted, thus all the UITableViewCells fi...
[ 0.2357378602027893, -0.027264418080449104, 0.5721158981323242, -0.08865134418010712, 0.1365780234336853, -0.3295404016971588, 0.1828804761171341, -0.06581321358680725, -0.4793832004070282, -0.49330639839172363, 0.20995521545410156, 0.395845890045166, -0.20033684372901917, 0.137774556875228...
the whole thing when the keyboard is displayed, if the bug goes away you want to write code that dynamically changes the size as the keyboard animates in and out.
[ 0.03892963379621506, -0.2681911289691925, 0.3087823688983917, 0.23777854442596436, 0.21039894223213196, 0.147857666015625, 0.05118370056152344, 0.231380894780159, -0.6153349280357361, -0.4982958436012268, 0.13065671920776367, 0.43218961358070374, -0.3450949788093567, 0.03532117232680321, ...
**I wish to write a windows app which does something when I become disconnected from the internet**. I was thinking of writing a very simple C#/Delphi app which simply polls every 20 seconds to see if I'm still connected. If I have to poll I'd really like a solution other than trying to download a web page from the ne...
[ 0.6072672009468079, 0.29203537106513977, 0.46945875883102417, 0.3327026665210724, -0.15575926005840302, 0.10501545667648315, 0.46326199173927307, 0.3024035394191742, -0.2958521246910095, -0.6460664868354797, -0.007338905707001686, 0.43863093852996826, 0.03973310813307762, 0.108444944024086...
**way to tell if you're online without downloading/connecting to a remote server** but I'm not sure how. Beware that connected to the Internet does not really mean anything: what if you are connected to your ISP, but the backbone is down, or all the sites you want to access are in a country that went off the grid like ...
[ 0.5466575622558594, -0.1624659299850464, 0.27813246846199036, 0.2981857359409332, 0.1574857234954834, -0.5132347941398621, 0.3652235269546509, 0.30561143159866333, -0.4107791781425476, -0.6210405230522156, 0.031558092683553696, 0.1540948897600174, -0.10600342601537704, 0.12098221480846405,...
me correctly I had a LAN Connection, but failed to detect that I had my ZoneAlarm firewall set to block "All Internet Activity", which means that you effectively lost all Internet connectivity. Delphi routine: ``` procedure IsConnected; var dwFlags: DWORD; begin if InternetGetConnectedState(@dwFlags, 0) then be...
[ -0.014162126928567886, 0.02748531475663185, 0.6351518034934998, -0.12094072997570038, 0.1032160148024559, -0.2561357617378235, 0.4169633686542511, -0.23123699426651, -0.3500978350639343, -0.7181136608123779, -0.24008579552173615, 0.3301575779914856, -0.15994219481945038, 0.189915269613266,...
ShowMessage('Connection thru Proxy') else if (dwFlags and INTERNET_CONNECTION_OFFLINE) = INTERNET_CONNECTION_OFFLINE then ShowMessage('Local system in offline mode') else if (dwFlags and INTERNET_CONNECTION_CONFIGURED) = INTERNET_CONNECTION_CONFIGURED then ShowMessage('Valid connection exist...
[ -0.1721075475215912, -0.119660884141922, 0.6110206842422485, -0.018871217966079712, 0.15469615161418915, -0.2471514642238617, 0.47839027643203735, 0.0315731018781662, -0.1860744059085846, -0.7471404075622559, -0.554639458656311, 0.15708103775978088, -0.32978588342666626, 0.3117302656173706...
I have a class that contains an array. I want this array to be set at the length of a constant: ``` // Entities.h class Entities { private: const int maxLimit; int objects[maxLimit]; int currentUsage; public: Entities();
[ 0.12336035072803497, -0.13086524605751038, 0.4265749752521515, 0.009452671743929386, 0.11057718843221664, -0.019101573154330254, 0.0744718462228775, -0.1121242493391037, -0.12081380188465118, -0.3193100094795227, -0.13354742527008057, 0.6728212237358093, -0.43764185905456543, 0.30725076794...
bool addObject(int identifier); void showStructure(); }; ``` The main problem I'm having is with the constructor. I thought: ``` // Entities.cpp Entities::Entities() : maxLimit(50) { currentUsage = 0; cout << "Entities constructed with max of 50" << endl; } ``` would hav...
[ 0.011849329806864262, 0.05960338935256004, 0.4429384469985962, -0.3847599923610687, -0.06106405705213547, 0.011643883772194386, 0.211600661277771, -0.44777706265449524, -0.13693039119243622, -0.45316818356513977, -0.049283094704151154, 0.5934940576553345, -0.27030274271965027, 0.0734562203...
can I initialise the `objects` array using the `maxLimit` const? I'm relatively new to classes in C++ but I have experience with Java. I'm mainly testing out this phenomenon of 'constness'. The array must have a constant length. I mean a length that is the same for all objects of that class. That is because the compile...
[ 0.2276831418275833, -0.1845996379852295, 0.1699608564376831, -0.044412821531295776, -0.13486063480377197, -0.24683529138565063, -0.017314016819000244, -0.16467341780662537, -0.26731762290000916, -0.38714781403541565, 0.0937279462814331, 0.7257291674613953, -0.45851823687553406, 0.022730536...
const int maxLimit = 50; int objects[maxLimit]; int currentUsage; public: Entities(); bool addObject(int identifier); void showStructure(); }; ``` And in the cpp file: ``` const int Entities::maxLimit; ``` I prefer to use an enumeration for that, be...
[ -0.06743956357240677, -0.22885234653949738, 0.6029113531112671, -0.13025861978530884, 0.12435594946146011, 0.05798967555165291, -0.062283825129270554, -0.15579867362976074, -0.23585544526576996, -0.34245479106903076, -0.4103754758834839, 0.4457392990589142, -0.35062214732170105, 0.05210014...
Entities { private: enum { maxLimit = 50 }; int objects[maxLimit]; int currentUsage; public: Entities(); bool addObject(int identifier); void showStructure(); }; ``` If you want to have a per-object size of the
[ 0.10521482676267624, -0.12459295988082886, 0.3125389516353607, 0.17253580689430237, 0.07199043035507202, 0.016892563551664352, 0.07824058085680008, -0.28297361731529236, -0.3212112486362457, -0.45399466156959534, -0.36248359084129333, 0.4470473527908325, -0.34580880403518677, 0.41037744283...
array, then you can use a dynamic array. `vector` is such one: ``` class Entities { private: const int maxLimit; std::vector<int> objects; int currentUsage; public: Entities(); bool addObject(int identifier); void showStructure(); }; //
[ 0.12460801750421524, -0.32873356342315674, 0.5082106590270996, 0.05993553251028061, -0.2136562168598175, 0.16023071110248566, -0.05136522278189659, -0.2436288595199585, -0.45448264479637146, -0.5294176936149597, -0.1661767065525055, 0.5586969256401062, -0.5359054207801819, 0.11724036931991...
Entities.cpp Entities::Entities(int limit) : maxLimit(limit), objects(limit), currentUsage(0) { cout << "Entities constructed with max of 50" << endl; } ``` Best is to do as much initialization in the initialization list as possible.
[ -0.02293522097170353, -0.04743591696023941, 0.5785303115844727, 0.25179287791252136, 0.28921493887901306, 0.044919371604919434, -0.22339046001434326, -0.25580012798309326, -0.3532369136810303, -0.43538951873779297, -0.11666464060544968, 0.3145928978919983, -0.11031568795442581, 0.148942053...
The files residing in .settings in a **Dynamic Web Project** are: ``` .settings/ |-- org.eclipse.jdt.core.prefs |-- org.eclipse.jst.common.project.facet.core.prefs |-- org.eclipse.jst.j2ee.ejb.annotations.xdoclet.prefs |-- org.eclipse.wst.common.component |-- org.eclipse.wst.common.project.facet.core.xml |-- org.eclip...
[ 0.474302738904953, -0.013857316225767136, 0.30154213309288025, 0.18821832537651062, -0.1321740746498108, -0.2616078853607178, 0.3480468988418579, 0.004095140378922224, -0.20649251341819763, -0.8217799663543701, -0.07445366680622101, 0.4300774335861206, -0.2936389446258545, 0.03396118059754...
down the Eclipse files as much as possible before I check them into version control. In case it helps I list the above files and their contents: **org.eclipse.jdt.core.prefs:** ``` #Mon Jan 26 03:01:22 CET 2009 eclipse.preferences.version=1 org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5 org.eclipse.jdt.cor...
[ -0.17107653617858887, 0.3723195493221283, 0.5542286038398743, -0.13717886805534363, -0.4648246169090271, 0.01569589599967003, 0.3154861330986023, -0.16903765499591827, -0.40229663252830505, -0.6323214769363403, 0.009138940833508968, 0.8307015299797058, -0.32295510172843933, -0.277530133724...
<property name="java-output-path"/> </wb-module> </project-modules> ``` **org.eclipse.wst.common.project.facet.core.xml:** ``` <?xml version="1.0" encoding="UTF-8"?> <faceted-project> <fixed facet="jst.java"/> <fixed facet="jst.web"/> <installed facet="jst.java" version="5.0"/> <installed facet="jst.web"...
[ -0.27313148975372314, 0.28729045391082764, 0.7200221419334412, -0.012359034270048141, -0.14042328298091888, 0.18118393421173096, 0.19103074073791504, -0.7514912486076355, -0.3584878742694855, -0.8264254927635193, -0.20429565012454987, 0.5969215631484985, 0.06162401661276817, 0.048446044325...
XDoclet annotation support](http://help.eclipse.org/ganymede/index.jsp?topic=/org.eclipse.jst.ejb.doc.user/topics/txdocletconf.html) * `org.eclipse.wst.common.component` is relate to the [deployment structure](http://dev.eclipse.org/newslists/news.eclipse.webtools/msg17655.html). * `org.eclipse.wst.common.project.facet...
[ 0.11957833170890808, -0.03915782272815704, 0.466166228055954, 0.16894643008708954, -0.11474543809890747, -0.23776519298553467, -0.004225229378789663, -0.3047938048839569, -0.06342344731092453, -0.5221230983734131, -0.3598538637161255, 0.4390370547771454, -0.35937002301216125, -0.0952772945...
+ method from an instance of the Window object. > > **,** > > The JSDT supports a configurable super type at the project level. Each .js or .html file within a project inherits all the fields and methods from the projects super type. By default the type is Global for standalone JavaScript projects and Window for...
[ -0.05246714502573013, -0.30317577719688416, 0.5133683085441589, 0.008531314320862293, -0.39188700914382935, 0.03556542471051216, 0.33712834119796753, -0.2204008549451828, -0.15793798863887787, -0.6500035524368286, -0.34945356845855713, 0.10284312069416046, -0.4792599081993103, 0.0517451912...
the Global Order/SuperType page change the Super Type to Window in the ECMA library.
[ -0.3767383098602295, -0.22063855826854706, 0.6605046391487122, 0.089634969830513, 0.13155880570411682, 0.06565225124359131, 0.15058909356594086, 0.1528356820344925, -0.26538193225860596, -0.9390215277671814, -0.45992788672447205, 0.04099000617861748, -0.42832455039024353, 0.272620022296905...
How can I get the Tab Control to place the tabs at the bottom of the control and not at the top Open the properties window go to property **Alignment** and set it to **Bottom**
[ 0.29293978214263916, -0.020983748137950897, 0.5336862206459045, 0.21721351146697998, 0.3979746699333191, -0.07790226489305496, 0.11158476769924164, -0.27221715450286865, -0.10736418515443802, -0.6446033120155334, 0.11464784294366837, 0.6493076086044312, -0.0024364267010241747, 0.2486107647...
This is good: ```py import string string.capwords("proper name") Out: 'Proper Name' ``` This is not so good: ```py string.capwords("I.R.S") Out: 'I.r.s' ``` Is there no string method to do capwords so that it accomodates acronyms? This might work: ``` import re def _callback(match): """ This is a simple c...
[ -0.09432454407215118, 0.34051960706710815, 0.8659361600875854, -0.21892698109149933, -0.16280411183834076, -0.2630963623523712, 0.0053750379011034966, -0.35040995478630066, -0.1089307963848114, -0.36309075355529785, -0.13086500763893127, 0.7943823337554932, -0.3710779547691345, -0.25856468...
return word else: return word.capitalize() def capwords(data): """ This function converts `data` into a capitalized version of itself. This function accomidates acronyms. """ return re.sub("[\w\'\-\_]+", _callback, data) ``` Here is a test: ``` print capwords("This is an IRS test.")...
[ 0.15270018577575684, 0.3540775179862976, 0.3030317723751068, -0.18554814159870148, 0.060516659170389175, -0.006945807486772537, 0.43632280826568604, -0.5496926307678223, 0.08564198762178421, -0.41907253861427307, -0.335256963968277, 0.5796491503715515, -0.282310426235199, 0.059221439063549...
The following GUI code is working in 99.99% of OS environments used by our customers: ``` jStatusDescription = new JTextArea(); jStatusDescription.setFont(new Font("Verdana", Font.PLAIN, 12)); jStatusDescription.setText("test"); <-- crashes ``` However, there are now 2 different customers both using Terminal se...
[ 0.005813027266412973, 0.0965479388833046, 0.7524821162223816, -0.177302747964859, 0.01629915088415146, -0.0005272839916869998, 0.32988086342811584, -0.1440236121416092, 0.11028608679771423, -0.8614052534103394, -0.09928230941295624, 0.9069747924804688, -0.4099962115287781, -0.0136628448963...
certain configurations of thin clients. I've not tried, but I guess you can copy the font files into the fonts directory of the JRE (assuming these are checked before the system/Windows directory). You might be able to put reda permission for the TTF file into the `lib/security/java.policy` file (can't remember how tha...
[ 0.2810627818107605, -0.07262583822011948, 0.4313960671424866, -0.1498403549194336, 0.12415643781423569, -0.11240272223949432, 0.22724519670009613, 0.22864477336406708, -0.6808693408966064, -0.830396294593811, -0.11876839399337769, 0.7471777200698853, -0.5677316188812256, 0.0488659366965293...
I am looking for a way to determine when a particular file has changed, through .NET. (What I ultimately want is functionality that makes a copy of the file as soon as it has changed.) How can this be done? ``` class Program { static void Main(string[] args) { FileSystemWatcher fsw = new...
[ 0.5884930491447449, -0.07324646413326263, 0.5705506801605225, -0.265471875667572, 0.33584919571876526, -0.09549092501401901, 0.25684428215026855, -0.0075853075832128525, -0.26139894127845764, -0.4828841984272003, -0.08640758693218231, 0.6706655025482178, -0.3913511633872986, 0.416618973016...
fsw.Deleted += new FileSystemEventHandler(fsw_Deleted); fsw.Renamed += new RenamedEventHandler(fsw_Renamed); fsw.Created += new FileSystemEventHandler(fsw_Created); fsw.EnableRaisingEvents = true; Console.ReadLine(); } static void fsw_Created(object sende...
[ -0.007430009078234434, -0.25115931034088135, 0.756533682346344, -0.10069219768047333, 0.21416249871253967, 0.12808068096637726, 0.49450886249542236, -0.21398837864398956, -0.004960204008966684, -0.5702305436134338, -0.5368083119392395, 0.6173295378684998, -0.4041516184806824, 0.39610952138...
Console.WriteLine("{0} was created", e.FullPath); } static void fsw_Renamed(object sender, RenamedEventArgs e) { Console.WriteLine("{0} was Renamed", e.FullPath); } static void fsw_Deleted(object sender, FileSystemEventArgs e) { Console.WriteLine...
[ -0.3991834223270416, -0.33344948291778564, 0.8271262645721436, -0.17254292964935303, 0.22582167387008667, 0.11818213760852814, 0.2789665460586548, 0.17367900907993317, 0.08539630472660065, -0.6019782423973083, -0.6115971803665161, 0.513194739818573, -0.42647358775138855, 0.3449913263320923...
} static void fsw_Changed(object sender, FileSystemEventArgs e) { Console.WriteLine("{0} was Changed", e.FullPath); } } ```
[ -0.044819559901952744, -0.17904305458068848, 0.6261794567108154, -0.21903817355632782, 0.40077507495880127, 0.024770017713308334, 0.3384568989276886, 0.08106294274330139, -0.029885437339544296, -0.48459622263908386, -0.25892120599746704, 0.6583265662193298, -0.41070958971977234, 0.28621461...
How do you handle slow operations in the Model-View-Presenter (or MVC or M-V-VM or whatever variant you are using)? When you have a slow operation in WinForms or SWT/JFace or whatever desktop framework you are using, you have to run it on a background thread to avoid completely locking up the application. Where do you...
[ 0.021872365847229958, -0.1477656066417694, 0.2605747878551483, 0.08733903616666794, -0.018888898193836212, 0.04760904982686043, 0.08683371543884277, 0.02263810485601425, -0.4290466606616974, -0.3122052550315857, 0.11638255417346954, 0.6503235101699829, -0.6184982657432556, 0.02200109139084...
come from a background thread. 2. Have the view call the presenter on the main thread. The presenter will then have to call back into the view when performing a slow operation, so that it can be run in the background. What do you usually do? **EDIT:** I just saw this article: <http://www.codeproject.com/KB/threads/Th...
[ 0.5411049127578735, -0.18086372315883636, 0.6236382126808167, -0.11292002350091934, 0.0034549925476312637, -0.06670399010181427, 0.171125590801239, 0.1269514411687851, -0.4883278012275696, -0.5971329808235168, 0.03933684155344963, 0.4618511199951172, -0.23930996656417847, 0.137262374162673...
This may be a generic OOP question. I wanted to do a generic comparison between an interface and an abstract class on the basis of their usage. ***When would one want to use an interface and when would one want to use an abstract class***? I wrote an article about that: [Abstract classes and interfaces](http://www.d...
[ 0.4621742367744446, -0.18372397124767303, 0.011816466227173805, 0.25839462876319885, -0.192136749625206, -0.19458657503128052, 0.030084915459156036, 0.1186084896326065, -0.16086938977241516, -0.7996124625205994, 0.3061753213405609, 0.5869512557983398, -0.0593373142182827, 0.201957955956459...
object can do.***
[ -0.0032269530929625034, -0.025994570925831795, 0.2909892201423645, 0.21243031322956085, -0.39570343494415283, 0.07158471643924713, 0.4499911665916443, -0.1034037321805954, -0.239803746342659, -0.40171587467193604, -0.09135160595178604, 0.5553725957870483, 0.003905288176611066, 0.1061082482...
Is there any way to achieve function overloading in C? I am looking at simple functions to be overloaded like ``` foo (int a) foo (char b) foo (float c , int d) ``` I think there is no straight forward way; I'm looking for workarounds if any exist. There are few possibilities: 1. printf style functions (type a...
[ 0.0910683423280716, -0.08279183506965637, 0.07717718183994293, -0.0728655606508255, -0.34906649589538574, -0.09625241905450821, 0.06509477645158768, -0.13253073394298553, -0.0670531764626503, -0.2888169288635254, -0.10715123265981674, 0.8246316313743591, -0.642160952091217, -0.305373638868...
I want to simulate N-sided biased die? ``` def roll(N,bias): '''this function rolls N dimensional die with biasing provided''' # do something return result >> N=6 >> bias=( 0.20,0.20,0.15,0.15,0.14,0.16,) >> roll(N,bias) 2 ``` A little bit of math here. A regular die will give each number 1-6 wit...
[ 0.43065309524536133, -0.29623156785964966, 0.006619010120630264, 0.08500149101018906, -0.25989678502082825, 0.521126389503479, -0.08114003390073776, -0.13897979259490967, -0.18607904016971588, -0.43083930015563965, 0.19325459003448486, 0.3967929184436798, -0.2293359637260437, 0.21714952588...
against all possible results of the die roll, 1 through 6. This is equal to choosing a number in `[0,1)` while dividing it into 6 sections: `[0,1/6)`, `[1/6,2/6)`, `[2/6,3/6)`, `[3/6,4/6)`, `[4/6,5/6)`, `[5/6,1)`. You are requesting a different distribution, which is biased. The easiest way to achieve this is to divi...
[ 0.4184776544570923, -0.031843189150094986, 0.12198282778263092, 0.04289458319544792, 0.13369520008563995, 0.5052868723869324, -0.10623013228178024, -0.5044152736663818, -0.237555131316185, -0.3773975968360901, 0.10346905142068863, 0.1737799197435379, -0.19204969704151154, 0.643632948398590...
of 6 equal-length parts but rather of 6 parts which differ in length according to the *bias* you gave them. Same goes for the mass distribution. Back to the question, depending on the language you are using, translate this back to your die roll. In Python, here is a very sketchy, albeit working, example: ``` import r...
[ 0.4736331105232239, -0.1378915011882782, -0.009507738053798676, -0.09430427104234695, -0.09722989797592163, 0.4317139685153961, -0.3367696702480316, -0.5405252575874329, -0.3111010491847992, -0.24303360283374786, 0.3813161253929138, 0.3653888702392578, -0.15923888981342316, 0.1349757313728...
sum += mass if randRoll < sum: return result result+=1 print(roll(sampleMassDist)) ```
[ 0.0833541676402092, -0.0471729040145874, 0.28804415464401245, -0.312930166721344, -0.07724568992853165, 0.28851285576820374, 0.05288415774703026, -0.8540672659873962, -0.14607563614845276, -0.16124047338962555, -0.12312287092208862, 0.17603331804275513, -0.3131595849990845, 0.0053296526893...
I will be using LLBLGen to generate a model, however I don't want to solve my design issues by just using whatever built-in inheritance tools it has. I want the model to make sense regardless of the OR/M tool. So, I have several different kinds of entities that can have addresses and each entity can have multiple addr...
[ 0.07314496487379074, -0.05779552087187767, 0.4072696566581726, 0.19287973642349243, 0.2037431299686432, 0.09309607744216919, -0.11400984972715378, -0.1070512980222702, -0.2120462954044342, -0.8195586204528809, -0.014642249792814255, 0.3734061121940613, -0.3665566146373749, 0.25830519199371...
> Company: [CompanyID, CompanyName, ...] > > > Employee: [EmployeeID, FirstName, ...] > > > AddressType: [AddressTypeID, AddressTypeName] (Say, Primary=1, Mailing=2, etc) > > > Address: [AddressID, AddressTypeID, EntityID, StreetAddress1, ...] : AddressTypeID=>AddressType, EntityID=>Entity The way this would wor...
[ 0.013023095205426216, 0.27294495701789856, 0.43484002351760864, 0.015301304869353771, 0.15878203511238098, 0.1309126764535904, -0.046699270606040955, -0.10331523418426514, 0.002705319318920374, -0.7654063105583191, -0.00859585590660572, 0.1697167009115219, -0.2329951673746109, 0.4915080070...
all the joins this would require. And even more so, I am a little concerned that this will be clunky in my ORM tool (LLBLGen). Option 2, this is sort of take on option 1. I think is probably worse, but including it just the same: > Tables: > > > EntityType: [EntityTypeID, EntityTypeName] (Say, Company=1, Employee=...
[ -0.2324855923652649, 0.10915593057870865, 0.5163349509239197, -0.08440892398357391, 0.02764493227005005, -0.0743650570511818, 0.0010090474970638752, -0.20674128830432892, -0.11181472986936569, -0.8179197311401367, -0.11219476163387299, 0.31826546788215637, -0.4444613754749298, 0.2159261405...
=>AddressType, EntityID=>Entity This would work similar to option 1, in that for a Company or Employee, an Entity record would be created first, setting the EntityType appropriately. Then, a Company or Employee record would be created, and the previously created Entity record's EntityID would be set on the Company or ...
[ -0.02939762733876705, -0.21723173558712006, 0.3501438796520233, 0.28929007053375244, -0.03298477455973625, -0.010799696668982506, -0.22734028100967407, -0.22558774054050446, -0.01447220891714096, -0.4529724419116974, -0.03056878224015236, 0.3899853527545929, -0.47452470660209656, 0.3369786...
a little worse. It has almost the same problems as the first but it also sort of makes the schema less intuitive, I think. In both cases, you'd need to use some Unique constraints, such as in the Company table (EntityID should be unique in the Company table). However, you'd need to do some other programmatic check to...
[ -0.22638094425201416, -0.3029656410217285, 0.3285522162914276, 0.18470853567123413, -0.09281608462333679, -0.34866228699684143, 0.18637286126613617, -0.33825522661209106, -0.1527206003665924, -0.6989781260490417, -0.13325676321983337, 0.8163205981254578, -0.42917579412460327, -0.1817941516...
Company: [CompanyID, CompanyName, ...] > > > Employee [EmployeeID, FirstName, ...] > > > AddressType: [AddressTypeID, AddressTypeName] (Say, Primary=1, Mailing=2, etc) > > > CompanyAddress: [CompanyAddressID, AddressTypeID, CompanyID, StreetAddress1, ...] : > AddressTypeID=>AddressType, > CompanyID=>Company > ...
[ 0.11895336955785751, 0.553569495677948, 0.39172735810279846, -0.10549308359622955, -0.13574516773223877, 0.15142187476158142, -0.0006060615414753556, 0.12839160859584808, -0.039474550634622574, -0.9390643239021301, 0.1375374048948288, 0.0673539862036705, -0.368974894285202, 0.4861466288566...
I don't think creating a table for everyone of these will scale very in terms of development. Also, I'm sure I could get my ORM to let me use code to treat all of the different addresses as the same base "Address" type but, again, I don't want to rely on tricks the ORM can do. So, is this Super-type/Sub-type thing a g...
[ 0.5461212396621704, 0.2317541539669037, -0.011073975823819637, 0.35253819823265076, 0.10043706744909286, 0.3269481956958771, 0.013359881937503815, -0.16748689115047455, -0.3833751976490021, -0.7284541726112366, 0.3344959616661072, 0.22048546373844147, 0.06624025106430054, 0.042939793318510...
`1/6`. This is referred to as [uniform distribution](https://en.wikipedia.org/wiki/Uniform_distribution_(continuous)) (the discrete version of it, as opposed to the continuous version). Meaning that if `X` is a random variable describing the result of a single role then `X~U[1,6]` - meaning `X` is distributed equally a...
[ 0.4337512254714966, -0.1722012758255005, 0.18926629424095154, 0.0703229159116745, -0.08990482240915298, 0.6478819847106934, -0.10646006464958191, -0.3416186273097992, -0.10657501965761185, -0.42143017053604126, -0.15559320151805878, 0.03792043775320053, -0.22583487629890442, 0.533473968505...
want. So in your case you would want to divide it into the following: `[0,0.2)`, `[0.2,0.4)`, `[0.4,0.55)`, `0.55,0.7)`, `[0.7,0.84)`, `[0.84,1)`. If you take a look at the [wikipedia entry](https://en.wikipedia.org/wiki/Uniform_distribution_(continuous)), you will see that in this case, the cumulative probability fun...
[ 0.48880112171173096, -0.30393341183662415, 0.036934755742549896, -0.11235611140727997, 0.194360613822937, 0.33629468083381653, -0.3796354830265045, -0.3175051510334015, -0.3925457298755646, -0.2591385841369629, 0.1593696027994156, 0.23971059918403625, -0.411346435546875, 0.1859643906354904...
0.15, 0.25, 0.15) # assume sum of bias is 1 def roll(massDist): randRoll = random.random() # in [0,1] sum = 0 result = 1 for mass in massDist: sum += mass if randRoll < sum: return result result+=1 print(roll(sampleMassDist)) ```
[ 0.18614453077316284, -0.12068096548318863, 0.1481340527534485, -0.10037974268198013, -0.10617329925298691, 0.32180196046829224, -0.1298813670873642, -0.5050050616264343, -0.2987445890903473, -0.4087253510951996, 0.06644458323717117, 0.375049889087677, -0.3624440133571625, 0.216602370142936...
1) I am in some directory 2) I want to find out how much free space is left there Is there a simple command that does this? I don't want to look in fstab or whatever, having to map the devices & mount points in my mind in order to determine how much free space I have left. Try `df -h` Better yet: `df -h .` or `df -h ...
[ 0.3992416262626648, 0.13312934339046478, 0.321266233921051, 0.201024129986763, 0.39925870299339294, -0.26945528388023376, 0.09049537032842636, 0.06919904053211212, -0.328156054019928, -0.6488673686981201, -0.1531156301498413, 0.5066604614257812, -0.3150154650211334, 0.06016358360648155, ...
Is there an API call to determine the size and position of window caption buttons? I'm trying to draw vista-style caption buttons onto an owner drawn window. I'm dealing with c/c++/mfc. Edit: Does anyone have a code example to draw the close button? I've found the function required to get the position of the buttons i...
[ -0.15935692191123962, -0.017592020332813263, 0.892113983631134, -0.14794373512268066, -0.17633353173732758, 0.0892176702618599, 0.10297589749097824, -0.21393750607967377, -0.18134933710098267, -0.6216420531272888, -0.14561475813388824, 0.7761504054069519, -0.1150958389043808, -0.3195090293...
I have an important Object which have loads of properties. Now few of the properties could have multiple values for example consider, A Channel Object having one or mulitple producers (Now our client think that there could be only few producers like mostly 1 or 2 ). The same issue exist with almost 7 properties. Now ...
[ 0.12080170959234238, -0.06265037506818771, 0.4422437846660614, 0.04613959416747093, -0.36815759539604187, 0.08897095173597336, 0.10993172228336334, -0.2449324131011963, -0.10838073492050171, -0.9361333847045898, 0.18622063100337982, 0.3538109064102173, -0.2839411497116089, 0.63928461074829...
8 > further tables to have this ability. > 2. Embed them as link/reference objects in domain but dont create the > seperate tables for them instead store > them as CSV format and let the DAL to > do the access/retrieval logic. Hence > saving the space and relations on DB > side as well as DAL side. But also > ha...
[ -0.24003618955612183, -0.12004689127206802, 0.5409384965896606, 0.07790786027908325, -0.3928874135017395, 0.04529793933033943, -0.059758417308330536, -0.33527427911758423, -0.2504259943962097, -0.6177210807800293, -0.16407181322574615, 0.2241591513156891, -0.357970267534256, -0.08418372273...
the issue the structure could be like that ``` Channel Name, (free text) Vanue, (free Text) ....... Producer1, Producer2...... (each producer is just a name) OpeningDay1,OpeningDay2,..... (each entry is just time slot) ``` etc I think you can combine both approaches to give a good overall result. Create sep...
[ 0.31313514709472656, 0.302097350358963, 0.43693581223487854, 0.12048423290252686, -0.2002820074558258, -0.17166876792907715, 0.19945615530014038, -0.36908867955207825, -0.23147615790367126, -0.6200910210609436, -0.0168010126799345, 0.4946514964103699, -0.1992601752281189, 0.643904089927673...
return a single entity 3) reduce your reliance on seperate persistance methods, CSV files etc. This approach is common with reference data tables, these values are typically small, 'slow changing' tables, that can be safely cached.
[ -0.12928862869739532, 0.10381316393613815, 0.1364629864692688, 0.23763829469680786, -0.18446217477321625, -0.01572633720934391, 0.0770171508193016, -0.2403343766927719, -0.2373601645231247, -0.3048938512802124, -0.3625553250312805, 0.29279622435569763, -0.4531973898410797, 0.13410897552967...
Currently I have a root-level repository set up for each project, like so: ``` Project1 Project2 Project3 Project5 Project5 ``` I'd like to reorganise this so that rather than a repository for each individual project, I just have one for each logical grouping, and then the projects would just be folders within those...
[ 0.3370412588119507, 0.2868536114692688, 0.013961819000542164, 0.16521267592906952, 0.06506898999214172, 0.004145038314163685, 0.19873593747615814, 0.08651094138622284, -0.5479737520217896, -0.5667629241943359, -0.17593148350715637, 0.028366107493638992, 0.07164865732192993, 0.4410970509052...
repository, and moving folders out of a repository into a new repository. It's only for personal stuff anyway, so it's not the end of the world if it's just a straight 'no' - but it would be nice to know so I'm not just banging my head against a wall :) You should be able to dump it, then reload it to a subdirectory o...
[ 0.2346697896718979, 0.011509966105222702, 0.2584584653377533, 0.26139745116233826, 0.25880447030067444, -0.22292035818099976, -0.005223656073212624, -0.08942587673664093, -0.405638724565506, -0.2793422043323517, -0.10178478062152863, 0.06779444962739944, 0.05204034224152565, 0.424800217151...
I would like to add reporting capabilities to a .NET application. My data source is just the data model of the application, i.e. a bunch of objects that may have been generated or loaded from anything (not necessarily from a database). The initial plan was to generate a report data XML file from these objects, and the...
[ 0.6207780838012695, 0.1734081208705902, 0.12584692239761353, 0.23432539403438568, -0.22746942937374115, -0.2894831895828247, -0.023315753787755966, 0.07898398488759995, 0.04168260842561722, -0.5297080278396606, 0.055675193667411804, 0.3826560378074646, -0.37390804290771484, 0.0929915159940...
can also take care of my reporting. Would it be a good idea to use this instead? Will it save work compared to the XML/XSLT approach? What limitations (if any) of the Microsoft Reporting framework am I likely to run into? A couple of things to consider. 1) Reporting Services are part of Sql Server, so you may have an ...
[ 0.49093690514564514, 0.1541694700717926, 0.30773070454597473, 0.323756605386734, -0.309741735458374, -0.5368967056274414, 0.06813877075910568, -0.15509580075740814, 0.0030362289398908615, -0.5680490732192993, 0.12394985556602478, 0.5570670366287231, -0.11017927527427673, -0.226888045668602...
Reporting services comes with a WYSIWYG editor to build reports. It's not perfect by any means, but a lot easier than hand crafting. 4) Using XSL to create XHTML can be real performance hit. XSL works on an entire XML Dom, and that maybe a big document if you're dealing with a multipage report. I'd expect Reporting Se...
[ 0.4199880063533783, 0.11868686228990555, 0.4040246307849884, 0.4749191701412201, -0.3919541835784912, -0.39660531282424927, 0.22067496180534363, -0.038416143506765366, -0.06462561339139938, -0.592223584651947, -0.03270885720849037, 0.576213002204895, -0.05607661232352257, -0.10694097727537...