text stringlengths 0 30.5k | title stringclasses 1
value | embeddings listlengths 768 768 |
|---|---|---|
marquee the area and click zoom. This then calculates the offsets into the image of the selected coordinates based on the original image size and the viewable image size. I send hese coords to the handler previously mentioned.I load the the url with query string of the srvice into an Image object, and handle onload. If... | [
0.21686960756778717,
0.06394314765930176,
1.1393108367919922,
-0.16207736730575562,
-0.03851659595966339,
-0.04050575941801071,
0.14273510873317719,
0.01832636445760727,
-0.01889883540570736,
-0.4625547230243683,
-0.022165698930621147,
0.6370890140533447,
-0.013572373427450657,
0.161508426... | |
understand your lazy requirement, but i need to say that writing this is actually quite easy to do to get the basics going. the hardest part you will find is doing a select box. But then even that can be as simple as tracking two click. Top left of the zoom select marque and bottom right. Or not having a select box at ... | [
0.3691338896751404,
0.11854720860719681,
0.31134867668151855,
0.2338232845067978,
0.10825890302658081,
-0.3836744725704193,
0.04897484555840492,
0.31505686044692993,
0.012541098520159721,
-0.29062962532043457,
0.21899284422397614,
0.7548049092292786,
-0.1313154250383377,
-0.381139785051345... | |
something useful. | [
0.2835221588611603,
0.02379952371120453,
-0.09199193865060806,
0.30495771765708923,
-0.09718232601881027,
-0.22237525880336761,
0.024798694998025894,
0.044767510145902634,
-0.19145798683166504,
-0.12948617339134216,
-0.09747433662414551,
0.15516014397144318,
-0.11521653831005096,
-0.149927... | |
Our team has a task system where we post small incremental tasks assigned to each developer.
Each task is developed in its own branch, and then each branch is tested before being merged to the trunk.
My question is: Once the task is done, who should define the **test cases** that should be done on this task?
Ideal... | [
0.31780171394348145,
0.002191268838942051,
-0.3032679557800293,
0.06299318373203278,
0.16112367808818817,
0.2034779042005539,
0.18751144409179688,
-0.06168322637677193,
-0.1352064311504364,
-0.5922213196754456,
-0.0509333536028862,
0.4146609306335449,
0.23001457750797272,
-0.27652165293693... | |
don't like having my QA people do it, is because I don't like the idea of them creating their own work. For example they might leave out things that are simply too much work to test, and they may not know the technical detail that is needed.
But likewise, the down part of developers doing the test cases, is that they... | [
0.7409160733222961,
0.3593958914279938,
-0.0901966542005539,
0.100026436150074,
0.08959456533193588,
0.1651972383260727,
0.23239214718341827,
0.21984529495239258,
-0.17137084901332855,
-0.43128007650375366,
0.16421949863433838,
0.3560512959957123,
0.024006623774766922,
0.010203477926552296... | |
test cases I mean the description of the individual QA tasks that should be done to the branch before it should be merged to the trunk. (Black Box)**
The Team.
---------
If a defect gets to a customer, it is ***the team's*** fault, therefore ***the team*** should be writing test cases to assure that defects don't reac... | [
0.34393060207366943,
0.29638272523880005,
-0.17215067148208618,
0.35030999779701233,
0.23462910950183868,
0.0387171171605587,
0.3573503792285919,
-0.1555626094341278,
-0.19502562284469604,
-0.5978835821151733,
-0.3348378837108612,
0.6207143664360046,
0.1567937433719635,
-0.1091081202030181... | |
invalid inputs. They need to provide at least the 'happy path' test case.
2. **The Developer(s)** will know the code. You suggest the developer may be best for the task, but that you are looking for black box test cases. Any tests that a developer comes up with are white box tests. That is the advantage of having devel... | [
0.38835409283638,
0.25835391879081726,
-0.08084705471992493,
0.37525060772895813,
0.10891097038984299,
-0.17796383798122406,
0.2901930809020996,
-0.19783960282802582,
-0.27833741903305054,
-0.5538175106048584,
-0.5026664733886719,
0.4673229157924652,
-0.09545887261629105,
0.060846097767353... | |
then *x*, but if *b* then *y*, except on Thursdays" – there are multiple test cases.
3. **The Testers (QA)** know how to test software. Testers are likely to come up with test cases that the PM and the developers would not think of – that is why you have testers. | [
0.788794219493866,
0.35178142786026,
-0.004527773708105087,
0.1669294685125351,
0.062113337218761444,
-0.06842496246099472,
0.172555610537529,
-0.16099652647972107,
0.007219069637358189,
-0.4016187787055969,
-0.14840707182884216,
0.492545485496521,
0.19797219336032867,
-0.07030042260885239... | |
I recently had a need to interpret a DEC 32-bit floating point representation. It differs from the IEEE floating point representations in the number of bits allocated to the exponent and mantissa.
Here's a description of a bunch of floating point formats:
<http://www.quadibloc.com/comp/cp0201.htm>
I managed to roll ... | [
0.18276767432689667,
0.1911579966545105,
0.239981546998024,
0.0902058556675911,
-0.3215756118297577,
-0.00641065975651145,
0.07819778472185135,
-0.1642652302980423,
-0.4237576127052307,
-0.23985855281352997,
0.18959569931030273,
0.4012199938297272,
-0.26034703850746155,
0.02668903768062591... | |
it looks like what you're looking for.
It's a C library rather than C++, but converting floating point data should work fine from extern "C" calls. | [
0.013187571428716183,
-0.01677068881690502,
0.24908842146396637,
0.21596455574035645,
0.1420115828514099,
-0.22957013547420502,
-0.27401846647262573,
0.12179869413375854,
-0.11367590725421906,
-0.29756036400794983,
0.08552629500627518,
0.37315526604652405,
-0.17216356098651886,
-0.02557206... | |
What's the best way of adding spaces between strings
```
myString = string.Concat("a"," ","b")
```
or
```
myString = string.Concat("a",Chr(9),"b")
```
I am using stringbuilder to build an XML file and looking for something efficient.
Thanks
Edit ~ Language VB.NET
Well, for a start, chr(9) is a tab character - y... | [
-0.09862682968378067,
0.060122016817331314,
0.411013126373291,
0.0005485001020133495,
0.09703732281923294,
0.15699902176856995,
-0.011654146946966648,
0.010667945258319378,
-0.09507111459970474,
-0.6269871592521667,
-0.1263902187347412,
0.604566216468811,
-0.473535418510437,
-0.25573128461... | |
against.
Far too many times, you optimize then find yourself having to change the code anyway, meaning that your optimization effort was wasted. | [
0.18440134823322296,
0.13052840530872345,
-0.03201347216963768,
0.056915588676929474,
0.2099132388830185,
0.22863759100437164,
0.28852346539497375,
-0.4563451111316681,
0.030687622725963593,
-0.6241254806518555,
0.24722442030906677,
0.48035928606987,
-0.39590948820114136,
0.036604572087526... | |
I got one big question.
I got a linq query to put it simply looks like this:
```
from xx in table
where xx.uid.ToString().Contains(string[])
select xx
```
The values of the `string[]` array would be numbers like (1,45,20,10,etc...)
the Default for `.Contains` is `.Contains(string)`.
I need it to do this instead: ... | [
0.28191077709198,
0.12460755556821823,
0.2996777296066284,
-0.010802987031638622,
-0.057429857552051544,
-0.038626980036497116,
-0.021655365824699402,
-0.2006751000881195,
-0.3022058308124542,
-0.47594043612480164,
0.0802682563662529,
0.5194674730300903,
-0.210364431142807,
0.0819322317838... | |
first. Actually a `List<int>` would be better if uid is also `int`. `List<T>` supports `Contains()`. Doing `uid.ToString().Contains(string[])` would imply that the uid as a string contains all of the values of the array as a substring??? Even if you did write the extension method the sense of it would be wrong.
**[ED... | [
0.3618333041667938,
-0.18431805074214935,
-0.04521721228957176,
-0.08754873275756836,
0.009121461771428585,
-0.23845629394054413,
0.12948499619960785,
-0.37353357672691345,
-0.3678564429283142,
-0.5816583037376404,
-0.12835659086704254,
0.6177767515182495,
-0.4077659249305725,
-0.161443710... | |
then just use `List<int>()` instead). This uses the chained method syntax, which I think is cleaner, and
does the conversion to int to ensure that the query can be used with more providers.
```
var uids = arrayofuids.Select(id => int.Parse(id)).ToList();
var selected = table.Where(t => uids.Contains(t.uid));
``` | [
0.19796359539031982,
-0.16409090161323547,
0.4648168385028839,
-0.19134068489074707,
0.08718973398208618,
-0.1583462953567505,
0.14400655031204224,
-0.43984100222587585,
-0.22320976853370667,
-0.7924642562866211,
-0.21177750825881958,
0.4825536608695984,
-0.4280654489994049,
0.259773045778... | |
I might be missing something obvious but is there a reference somewhere about what exceptions are thrown by functions in .NET and why the exception might be thrown?
As an example, I was recently trying out Linq in Visual C# 2008 and I was loading an XML file into an XDocument. It was only through testing that I reali... | [
0.4138258099555969,
0.18709783256053925,
0.0511724092066288,
0.01725548319518566,
-0.20548643171787262,
-0.45978689193725586,
0.12173625081777573,
0.10827343165874481,
-0.4200986921787262,
-0.6203293204307556,
0.26825588941574097,
0.4754459261894226,
-0.3669988512992859,
0.1221758127212524... | |
see things like a FileLoad exception and a PathTooLongException, and I can guess when they might be thrown but there could be others out there that might be thrown in some circumstance I haven't thought of yet.
The only solution I've got right now is just to catch the ones I know about and then catch the Exception ty... | [
0.4957719147205353,
0.09826572984457016,
0.006952672265470028,
0.2668306529521942,
0.05696744844317436,
-0.24349094927310944,
0.23285284638404846,
0.21661671996116638,
-0.563573956489563,
-0.567820131778717,
0.11052990704774857,
0.2882651388645172,
-0.20265331864356995,
0.12206678837537766... | |
I just blind? Is this information anywhere else?
EDIT: Some more specifics, right now I'm looking for the exceptions that might be thrown by the XDocument.Load(string) function. It looks like there is nothing relevant in the [online documentation](http://msdn.microsoft.com/en-us/library/bb343181.aspx) or the object br... | [
0.775091290473938,
0.40896421670913696,
-0.47533243894577026,
-0.1675100475549698,
-0.5643235445022583,
-0.17259560525417328,
0.5774844288825989,
-0.08491919934749603,
-0.23098835349082947,
-0.3218207359313965,
-0.08348346501588821,
0.4508962333202362,
-0.4339967370033264,
0.04663949087262... | |
C# in [this article/interview](http://www.artima.com/intv/handcuffsP.html). It's a good read.
From that article, Anders says:
> The concern I have about checked exceptions is the handcuffs they put on programmers. You see programmers picking up new APIs that have all these throws clauses, and then you see how convolu... | [
0.42023220658302307,
0.34984493255615234,
-0.12915293872356415,
0.014850983396172523,
-0.19287167489528656,
-0.4140806198120117,
0.34486785531044006,
-0.2964590787887573,
-0.47760552167892456,
-0.07149962335824966,
-0.0768921822309494,
0.3861744999885559,
-0.4242275357246399,
-0.0287953987... | |
exceptions possible within each namespace. | [
0.04449057579040527,
0.08218555152416229,
-0.29432305693626404,
-0.04316747933626175,
0.0994558334350586,
-0.23756760358810425,
0.19354933500289917,
0.16956891119480133,
-0.2855669856071472,
-0.6354500651359558,
-0.5344581604003906,
0.16732123494148254,
-0.3624162971973419,
-0.011746665462... | |
On an ASP.NET website, are static classes unique to each web request, or are they instantiated whenever needed and GCed whenever the GC decides to disposed of them?
The reason I ask is because I've written some static classes before in C# and the behavior is different than I would have expected. I would have expected ... | [
0.19584260880947113,
-0.2040269374847412,
0.09042580425739288,
0.22648602724075317,
-0.3824387490749359,
-0.01892516389489174,
0.17044170200824738,
0.010850443504750729,
-0.3730509281158447,
-0.3871462643146515,
-0.11475113034248352,
0.33423519134521484,
-0.2665293216705322,
-0.14248493313... | |
was already using a singleton class, however it was using a static instance and therefore was being shared between requests even if the users were different which in this case was a bad thing. Using `HttpContext.Current.Items` solves my problem perfectly. For anyone who stumbles upon this question in the future, here i... | [
-0.26029714941978455,
-0.3492344617843628,
0.22011490166187286,
0.16484485566616058,
-0.094203881919384,
-0.013051455840468407,
0.22766098380088806,
0.3096667528152466,
-0.5034013390541077,
-0.6667597889900208,
0.028146229684352875,
0.523088812828064,
-0.18920288980007172,
0.24955853819847... | |
{
IDictionary items = HttpContext.Current.Items;
if(!items.Contains("TheInstance"))
{
items["TheInstance"] = new GloballyAccessibleClass();
}
return items["TheInstance"] as GloballyAccessibleClass;
}
}
}
```
Your | [
-0.14338627457618713,
-0.24158026278018951,
0.2961297035217285,
-0.06782316416501999,
0.16027511656284332,
0.08296678215265274,
0.3883754014968872,
-0.12589174509048462,
-0.5257863998413086,
-0.5643269419670105,
-0.20138151943683624,
0.4953608512878418,
-0.33832645416259766,
0.388683050870... | |
static classes and static instance fields are shared between all requests to the application, and has the same lifetime as the application domain. Therefore, you should be careful when using static instances, since you might have synchronization issues and the like. Also bear in mind, that static instances will not be ... | [
0.06726992875337601,
-0.12663474678993225,
0.35953038930892944,
0.15331436693668365,
-0.11411125212907791,
-0.18499350547790527,
0.18695852160453796,
0.2840610146522522,
-0.4247515797615051,
-0.5396296977996826,
-0.08547275513410568,
0.3506600260734558,
-0.5191746950149536,
0.5197249650955... | |
by design meant to be a place to store stuff that you need througout the request. For nicer design and readability, you can use the Singleton pattern to help you manage these items. Simply create a Singleton class that stores its instance in `HttpContext.Current.Items`. (In my common library for ASP.NET, I have a gener... | [
0.49700286984443665,
-0.12837621569633484,
-0.08548621833324432,
0.25331732630729675,
-0.12939737737178802,
-0.18574100732803345,
0.14101606607437134,
0.004628835711628199,
-0.3248800039291382,
-1.0823662281036377,
0.07883906364440918,
0.16151945292949677,
-0.34748443961143494,
0.390668660... | |
What is code coverage and how do YOU measure it?
I was asked this question regarding our automating testing code coverage. It seems to be that, outside of automated tools, it is more art than science. Are there any real-world examples of how to use code coverage?
Code coverage is a measurement of how many lines/blocks... | [
0.8628219962120056,
-0.060533855110406876,
-0.1110425591468811,
0.5259416699409485,
-0.24497707188129425,
-0.1181626245379448,
0.14991766214370728,
-0.3521108627319336,
-0.40654250979423523,
-0.3961450755596161,
0.032864075154066086,
0.3717650771141052,
0.07341337949037552,
-0.282699465751... | |
only the percentage of the code that is executed, but also will allow you to drill into the data and see exactly which lines of code were executed during a particular test.
Our team uses [Magellan](http://research.microsoft.com/displayArticle.aspx?id=707) - an in-house set of code coverage tools. If you are a .NET sho... | [
0.5745391249656677,
0.19175033271312714,
0.06293130666017532,
0.0744289681315422,
-0.10792487859725952,
-0.1464395374059677,
-0.05377059802412987,
0.03981860354542732,
-0.4653528928756714,
-0.3198769688606262,
-0.10401291400194168,
0.6299494504928589,
0.17966718971729279,
-0.23436568677425... | |
don't know anything about it and can't give you a link.
As to how we use it - code coverage is one of our exit criteria for each milestone. We have actually three code coverage metrics - coverage from unit tests (from the development team), scenario tests (from the test team) and combined coverage.
BTW, while code co... | [
0.7556385397911072,
0.2542738616466522,
-0.06553422659635544,
0.10746501386165619,
0.06134631112217903,
-0.060320205986499786,
0.05293797701597214,
-0.21772868931293488,
-0.2864459455013275,
-0.47483769059181213,
-0.028954189270734787,
0.5106674432754517,
0.4058181047439575,
0.064603947103... | |
I'm experiencing what I believe is a circular dependency issue with my PHP application. Please let me know if this is incorrect. Here is the situation:
Two classes, LogManager and DBSession.
DBSession is used to interact with the database, and LogManager is used to log to files. Both are widely used in my application... | [
0.0513848215341568,
-0.09301086515188217,
-0.008136610500514507,
0.18366053700447083,
-0.24999605119228363,
-0.15401166677474976,
0.16738474369049072,
-0.03280593454837799,
-0.2672114968299866,
-0.7182440161705017,
0.22998061776161194,
0.48081889748573303,
-0.3631124198436737,
0.3087793588... | |
also log to a database table, rather than a text file. Naturally, my preference is to re-use existing classes, but I soon realized this brought about an interesting situation.
DBSession already requires an instance of LogManager for construction. If I want to re-use the DBSession class in LogManager, it will now requi... | [
0.21049395203590393,
0.08700326830148697,
-0.008615007624030113,
0.07164130359888077,
-0.14693567156791687,
-0.3492014408111572,
0.3750404715538025,
-0.003782822284847498,
-0.24772724509239197,
-0.8015009164810181,
0.023162126541137695,
0.6361237168312073,
-0.5603381991386414,
0.1408721208... | |
= new DbSession($logManager);
$logManager->add(new FileLog($filename) );
$logManager->add(new DBLog($dbSession) );
```
Where of course FileLog and DBLog share a common interface.
This is an application of the Observer pattern, where add() is the "subscribe" operation, and FileLog/DBLog are the observers of logging ev... | [
0.29488226771354675,
-0.017498178407549858,
0.36714547872543335,
-0.29995954036712646,
-0.034635987132787704,
-0.23384790122509003,
0.381049782037735,
-0.2377368062734604,
-0.3090524673461914,
-0.7268890738487244,
-0.15816213190555573,
0.5921304821968079,
-0.5958826541900635,
-0.0092168953... | |
I need to hide (make private) the `-init` method of my class in Objective-C.
How can I do that?
Objective-C, like Smalltalk, has no concept of "private" versus "public" methods. Any message can be sent to any object at any time.
What you can do is throw an `NSInternalInconsistencyException` if your `-init` method is ... | [
0.23998086154460907,
0.05036430060863495,
-0.01515561155974865,
-0.02015179768204689,
0.11822779476642609,
-0.2714873254299164,
0.621036171913147,
0.05239618569612503,
0.13938011229038239,
-0.2881157100200653,
-0.15306739509105682,
0.5217022895812988,
-0.4869159460067749,
0.141798928380012... | |
is not a valid initializer for the class Foo"
userInfo:nil];
return nil;
}
```
The other alternative — which is probably far better in practice — is to make `-init` do something sensible for your class if at all possible.
If you're trying to do this because you're trying to "ensu... | [
-0.02000429481267929,
0.056380681693553925,
-0.01955723762512207,
-0.08683156967163086,
0.15824651718139648,
-0.3669815957546234,
0.24424651265144348,
0.12380136549472809,
0.12484285980463028,
-0.30121561884880066,
-0.3405585289001465,
0.6787155270576477,
-0.41004055738449097,
-0.049895577... | |
of creating singletons. It's virtually always unnecessary and is just adding complication for no real significant advantage.
Instead, just write your code such that your `+sharedWhatever` method is how you access a singleton, and document that as the way to get the singleton instance in your header. That should be all... | [
0.5541161298751831,
0.2485426813364029,
-0.3966580927371979,
0.3623390197753906,
-0.03710455074906349,
-0.2682580351829529,
0.2817068099975586,
0.2464100867509842,
-0.2286309152841568,
-0.6757296919822693,
0.007384520955383778,
0.6086192727088928,
-0.26861080527305603,
0.09528643637895584,... | |
Does anyone know of a faster decimal implementation in python?
As the example below demonstrates, the standard library's decimal module is ~100 times slower than `float`.
```py
from timeit import Timer
def run(val, the_class):
test = the_class(1)
for c in xrange(10000):
d = the_class(val)
d ... | [
0.46460703015327454,
-0.007983373478055,
-0.07927107065916061,
-0.044425420463085175,
0.07743585109710693,
0.005836553871631622,
0.28811758756637573,
-0.24166494607925415,
0.019392048940062523,
-0.27315518260002136,
-0.030099906027317047,
0.5621522665023804,
-0.06262382119894028,
-0.137907... | |
d ** test
str(d)
abs(d)
if __name__ == "__main__":
a = Timer("run(123.345, float)", "from decimal_benchmark import run")
print "FLOAT", a.timeit(1)
a = Timer("run('123.345', Decimal)", "from decimal_benchmark import run; from decimal import Decimal")
print "DECIMAL", a.timeit(1)
``... | [
0.450432687997818,
0.15302731096744537,
0.009641836397349834,
-0.2444104552268982,
-0.0628080889582634,
0.14182284474372864,
0.15061074495315552,
-0.23590074479579926,
0.1242908388376236,
-0.5117080807685852,
0.028000470250844955,
0.3499167561531067,
-0.051042210310697556,
-0.0918613895773... | |
Some of the requirements (restrictions) for such a ui framework/toolkit are:
* No single vendor lock down
* Ability for real time data visualization
* Good initial widgets
* Good dash boarding capabilities
* cross platform
* Good development/debug environment
* No flash
It's a pity you can't/won't use Flash. Else I co... | [
0.09429652988910675,
-0.23275244235992432,
0.4183110296726227,
0.37379294633865356,
-0.31372541189193726,
-0.3959706723690033,
0.2660329341888428,
-0.2368524819612503,
0.08708420395851135,
-0.9585291743278503,
-0.17386943101882935,
0.4623446464538574,
-0.07598993927240372,
-0.3171613514423... | |
file IO, ... | [
-0.011012705974280834,
0.14692874252796173,
0.05005074292421341,
0.13713376224040985,
0.293039470911026,
0.07075124979019165,
-0.2690894305706024,
0.08736692368984222,
-0.36984094977378845,
-0.438097208738327,
-0.1688987761735916,
0.19989919662475586,
-0.44190356135368347,
0.03061105310916... | |
When you run something similar to:
```
UPDATE table SET datetime = NOW();
```
on a table with 1 000 000 000 records and the query takes 10 seconds to run, will all the rows have the exact same time (minutes and seconds) or will they have different times? In other words, will the time be when the query started or whe... | [
0.3062114119529724,
-0.09915042668581009,
0.42887911200523376,
-0.14261385798454285,
0.11191960424184799,
0.06435544043779373,
0.3829585909843445,
-0.14419050514698029,
-0.1672898530960083,
-0.5510602593421936,
-0.0146194938570261,
0.23118644952774048,
-0.11442027240991592,
0.3167027831077... | |
the routine or triggering statement began to execute.) This differs from the behavior for SYSDATE(), which returns the exact time at which it executes as of MySQL 5.0.13. " | [
0.1736719161272049,
-0.361234575510025,
0.564060389995575,
-0.3105011582374573,
0.3444480001926422,
-0.17924576997756958,
0.6577575206756592,
-0.0878010168671608,
0.013771072030067444,
-0.24557526409626007,
-0.36678454279899597,
0.4695853590965271,
-0.21205000579357147,
0.00314399227499961... | |
Several of my ajax applications in the past have used GET request but now I'm starting to use POST request instead. POST requests seem to be slightly more secure and definitely more url friendly/pretty. Thus, i'm wondering if there is any reason why I should use GET request at all.
I generally set up the question as th... | [
0.19390253722667694,
-0.2201879769563675,
0.34819427132606506,
0.049928952008485794,
-0.47496581077575684,
-0.15945526957511902,
0.22537654638290405,
0.5026603937149048,
-0.4221961796283722,
-0.7478766441345215,
-0.03291734308004379,
0.12345937639474869,
-0.025663062930107117,
0.1765120327... | |
what they are; it's trivial to fake a POST request by a user to a page. Making it a POST request, however, prevents web accelerators or reloads from re-triggering the action accidentally.
As AJAX, there is one more consideration: if you are returning JSON with callback support, be very careful not to put any sensitive... | [
0.29130929708480835,
-0.005057038739323616,
0.07416842132806778,
0.1873711794614792,
-0.29037219285964966,
-0.12042149156332016,
0.46262314915657043,
0.12647666037082672,
-0.3745186924934387,
-0.5384895205497742,
-0.24070775508880615,
0.2809343636035919,
-0.1501125693321228,
0.083111859858... | |
I have the following template
```
<h2>one</h2>
<xsl:apply-templates select="one"/>
<h2>two</h2>
<xsl:apply-templates select="two"/>
<h2>three</h2>
<xsl:apply-templates select="three"/>
```
I would like to only display the headers (one,two,three) if there is at least one member of the corresponding template. How do I... | [
0.3015575110912323,
0.1974903643131256,
0.24866487085819244,
-0.11192115396261215,
-0.45278000831604004,
0.1874637007713318,
0.029200846329331398,
-1.0853543281555176,
-0.11649443954229355,
-0.7928350567817688,
0.2401648461818695,
0.3335036337375641,
-0.48434650897979736,
-0.03590823709964... | |
that looks like more work to me... only useful if drawing a header is complex... for a simple `<h2>...</h2>` I'd be tempted to leave it inline.
If the header title is always the node name, you could simplifiy the template by removing the "$header" arg, and use instead:
```
<xsl:value-of select="name($header[1])"/>
`... | [
0.24139145016670227,
0.025873245671391487,
0.12083461880683899,
-0.025415698066353798,
0.02479243278503418,
-0.35589975118637085,
0.15495805442333221,
-0.10702059417963028,
-0.12166137993335724,
-0.4228280186653137,
-0.11828315258026123,
0.550652801990509,
-0.3910832107067108,
0.1535651534... | |
I'm playing around with the [`<canvas>`](http://developer.mozilla.org/en/HTML/Canvas) element, drawing lines and such.
I've noticed that my diagonal lines are antialiased. I'd prefer the jaggy look for what I'm doing - is there any way of turning this feature off?
For images there's now [`context.imageSmoothingEnabled... | [
0.3963567614555359,
-0.19848452508449554,
0.5377281904220581,
-0.12063982337713242,
-0.51263028383255,
-0.13063234090805054,
0.20903104543685913,
-0.17721977829933167,
-0.1268952637910843,
-0.4881483316421509,
0.08222132921218872,
0.5430954098701477,
-0.3429984450340271,
0.1407915502786636... | |
[Ryan Delucchi](https://stackoverflow.com/users/9931/ryan-delucchi) asked [here](https://stackoverflow.com/questions/194698/how-to-load-a-jar-file-at-runtime#194712) in comment #3 to [Tom Hawtin](https://stackoverflow.com/users/4725/tom-hawtin-tackline)'s answer:
> why is Class.newInstance() "evil"?
this in response ... | [
-0.008423252031207085,
0.3249351382255554,
-0.033981505781412125,
-0.2065305858850479,
-0.17165721952915192,
-0.04790991544723511,
0.4940337538719177,
-0.24281379580497742,
-0.37302860617637634,
-0.11990998685359955,
-0.13836655020713806,
0.4086744785308838,
-0.6740049719810486,
0.31401306... | |
can defeat the checked exceptions system. | [
0.18336039781570435,
0.09857042133808136,
0.054128725081682205,
0.2960740923881531,
0.3638395667076111,
-0.4253719449043274,
0.34793224930763245,
-0.12591823935508728,
-0.11309250444173813,
-0.6492996215820312,
-0.43423306941986084,
0.2250635325908661,
-0.14979583024978638,
-0.102723181247... | |
I'd like to read whole content of a text file to a `std::string` object with c++.
With Python, I can write:
```
text = open("text.txt", "rt").read()
```
It is very simple and elegant. I hate ugly stuff, so I'd like to know - what is the most elegant way to read a text file with C++?
Thanks.
There are many ways, yo... | [
0.13036900758743286,
0.19788482785224915,
0.5342971086502075,
-0.2776608169078827,
0.02142011933028698,
-0.05186443030834198,
0.37278255820274353,
-0.20618367195129395,
0.027795590460300446,
-0.7257934212684631,
-0.28522253036499023,
0.7424150109291077,
-0.344692587852478,
-0.0303607676178... | |
(contents, size);
file.close();
//... do something with it
delete [] contents;
}
```
Into std::string:
```
std::ifstream in("file.txt");
std::string contents((std::istreambuf_iterator<char>(in)),
std::istreambuf_iterator<char>());
```
Into vector<char>:
```
std::ifstream in("file.txt");
std::vect... | [
-0.11125653237104416,
-0.14888033270835876,
0.801189124584198,
-0.28748196363449097,
0.3693791329860687,
0.12981581687927246,
0.1737445443868637,
-0.18915875256061554,
-0.42226624488830566,
-0.9240010380744934,
-0.3261808156967163,
0.8241870999336243,
-0.5630955696105957,
-0.28803849220275... | |
I am interested in what methods of logging is frequent in an Oracle database.
Our method is the following:
We create a log table for the table to be logged. The log table contains all the columns of the original table plus some special fields including timestamp, modification type (insert, update, delete), modifier's ... | [
0.5047835111618042,
0.18918493390083313,
0.20849737524986267,
0.2888827323913574,
0.5055409073829651,
0.13388265669345856,
-0.1792750060558319,
-0.3270241916179657,
-0.24916784465312958,
-0.25188717246055603,
0.13692383468151093,
0.2366870939731598,
-0.21310150623321533,
0.1422204524278640... | |
it has some drawbacks:
* Introduction of a new column in the original table does not automatically involves log modification.
* Log modification affects log table and trigger and it is easy to mess up.
* State of a record at a specific past time cannot be determined in a straightforward way.
* ...
What other possibil... | [
0.22539372742176056,
0.44544556736946106,
0.11285926401615143,
0.014094861224293709,
-0.09486047923564911,
-0.21810975670814514,
0.36395686864852905,
-0.1606822907924652,
-0.6713219881057739,
-0.2589379847049713,
0.24123887717723846,
0.4149574041366577,
-0.19296158850193024,
0.014098131097... | |
built-in feature called Fine Grain Auditing (FGA). In a nutshell you can audit everything or specific conditions. What is really cool is you can 'audit' selects as well as transactions. Simple command to get started with auditing:
```
audit UPDATE on SCOTT.EMP by access;
```
Think of it as a 'trigger' for select sta... | [
0.40504372119903564,
-0.06767459213733673,
0.30411896109580994,
-0.020838500931859016,
-0.09258206188678741,
-0.3709707260131836,
-0.03889454901218414,
-0.1779947429895401,
-0.38470590114593506,
-0.5954112410545349,
0.09605710208415985,
0.6008685231208801,
-0.32991135120391846,
0.093540459... | |
audit trail records this action. You can see the trail by issuing:
```
select timestamp,
db_user,
os_user,
object_schema,
object_name,
sql_text
from dba_fga_audit_trail;
TIMESTAMP DB_USER OS_USER OBJECT_ OBJECT_N SQL_TEXT
--------- ------- ------- ------- -------- ----------------------
22-OCT-08 BANK... | [
0.14212197065353394,
0.2144952416419983,
0.38907545804977417,
0.020188231021165848,
-0.04579814150929451,
-0.23679432272911072,
0.0666121244430542,
-0.5813341736793518,
-0.26231011748313904,
0.06643158197402954,
0.04254554584622383,
0.2523737847805023,
-0.11603418737649918,
-0.070944644510... | |
I have read (or perhaps heard from a colleague) that in .NET, TransactionScope can hit its timeout and then VoteCommit (as opposed to VoteRollback). Is this accurate or hearsay? I couldn't track down information on the web that talked about this issue (if it IS an issue), so I wonder if anyone has any direct experience... | [
0.09606128931045532,
0.11123088002204895,
0.4955459237098694,
0.02592446282505989,
-0.034326616674661636,
-0.6761322617530823,
0.04606182500720024,
-0.038992248475551605,
-0.34460631012916565,
-0.5009645819664001,
-0.12325078248977661,
0.7228927612304688,
-0.32624706625938416,
-0.119177557... | |
Unbind;` in the connection string.
It isn't actually doing a vote commit - the transaction (and any early operations) has rolled back, but any subsequent operations (still inside the `TransactionScope`) can get performed in the nul-transaction, i.e. auto-commit. | [
-0.339390367269516,
-0.4743722379207611,
0.22796475887298584,
-0.057708535343408585,
0.07996692508459091,
-0.13979749381542206,
-0.09731509536504745,
0.009864947758615017,
-0.3199942111968994,
-0.17642728984355927,
-0.46493786573410034,
0.2972429096698761,
-0.25101661682128906,
0.203762650... | |
Using web forms I know that you can only have one ASP.NET form on a page. I've done some implementations where I've used Javascript to add other forms to a page to support things like logon controls (that post back to Logon.aspx instead of the current page). I'm wondering if the single form per page is still present in... | [
0.6793859601020813,
-0.18715925514698029,
0.6136906743049622,
0.15398216247558594,
-0.2803279459476471,
-0.18286967277526855,
0.14960631728172302,
-0.15775328874588013,
-0.6322246193885803,
-0.8210663199424744,
0.06604073941707611,
0.36500227451324463,
-0.3973214030265808,
-0.1962635219097... | |
you want. | [
0.4794689118862152,
0.12549293041229248,
0.007568861823529005,
0.13595490157604218,
0.10265374928712845,
0.1415954977273941,
-0.024044539779424667,
-0.04408174753189087,
-0.3290270268917084,
-0.5497962832450867,
0.01157386414706707,
0.5012245178222656,
-0.25591665506362915,
0.2200277745723... | |
I am writing a compiler in F# and I want to be able to access the [unmanaged metadata COM interfaces](http://msdn.microsoft.com/en-us/library/ms404384.aspx) in the .net runtime. Before anybody mentions it, *Reflection.Emit is not suitable for my purposes*, nor do I want to use any other method than the metadata COM int... | [
0.23571465909481049,
0.1562272161245346,
0.07947838306427002,
0.03757420554757118,
-0.15069934725761414,
-0.09537141770124435,
0.3063821494579315,
0.09012507647275925,
-0.2090703696012497,
-0.912490963935852,
0.10081684589385986,
0.39746493101119995,
-0.19413788616657257,
-0.03611262887716... | |
advance to anybody who can help me with this rather cryptic query!
**Update:** I have now got this sorted by writing explicit COM references using the interface GUIDs!
I found a possible solution by myself in this MSDN article: [ClickOnce Deployment and Security](http://msdn.microsoft.com/en-us/library/76e4d2xw.aspx).... | [
0.12040625512599945,
-0.05948644503951073,
0.4500810503959656,
0.10646281391382217,
0.2640150785446167,
-0.24106179177761078,
0.07923532277345657,
-0.1525343507528305,
-0.2558010220527649,
-0.7065030336380005,
-0.1990196406841278,
0.6302503943443298,
-0.1850098818540573,
-0.022667298093438... | |
be to try using **ASP.NET form-based authentication** to authenticate the user. However, ClickOnce does not support forms-based authentication because it uses persistent cookies; these present a security risk because they reside in the Internet Explorer cache and can be hacked. Therefore, if you are deploying ClickOnce... | [
0.09695849567651749,
-0.06963448226451874,
0.33029159903526306,
0.06381133198738098,
-0.0005336726317182183,
-0.1147201731801033,
0.25803688168525696,
-0.04387078806757927,
-0.005491670221090317,
-0.6395671367645264,
-0.3603881597518921,
0.43473049998283386,
-0.5784246325492859,
0.07497592... | |
of the URL used to start the application:
```
http://servername.adatum.com/WindowsApp1.application?username=joeuser
```
By default, query-string arguments are disabled. To enable them, the attribute **trustUrlParameters must be set in the application's deployment manifest**. This value can be set from Visual Studio ... | [
0.2693781554698944,
0.07329939305782318,
0.6464422941207886,
-0.030507877469062805,
-0.15064574778079987,
-0.3044310212135315,
0.45832425355911255,
-0.11822787672281265,
0.13510148227214813,
-0.7637915015220642,
-0.37860700488090515,
0.5601699948310852,
-0.23182860016822815,
0.297741651535... | |
could allow a malicious user to manipulate your application into executing arbitrary commands.
*Note: Query-string arguments are the only way to pass arguments to a ClickOnce application at startup. You cannot pass arguments to a ClickOnce application from the command line.* | [
-0.02472568303346634,
-0.2234317511320114,
0.24765875935554504,
0.15957783162593842,
0.07116474956274033,
0.022181648761034012,
0.4947046637535095,
0.17372766137123108,
-0.23331573605537415,
-0.4270685911178589,
-0.0025117069017142057,
0.47030818462371826,
-0.3581802248954773,
0.2515384256... | |
Basically, I have a class with 2 methods: one to serialize an object into an XML file and another to read an object from XML.
Here is an example of synchronized part from the method that restores an object:
```
public T restore(String from) throws Exception {
// variables declaration
synchronized (fro... | [
0.253930926322937,
-0.2623753249645233,
0.3748530447483063,
0.15138030052185059,
-0.0724577009677887,
-0.045747026801109314,
0.03178049623966217,
-0.28892946243286133,
-0.10114037245512009,
-0.23425085842609406,
0.018986016511917114,
0.5709974765777588,
-0.4962337613105774,
0.3152412176132... | |
new FileInputStream(from)));
restoredItem = decoder.readObject();
decoder.close();
} catch (Exception e) {
logger.warning("file not found or smth: " + from); | [
0.16294629871845245,
-0.4096739888191223,
0.5796899795532227,
-0.1881932020187378,
0.5669170618057251,
-0.012003450654447079,
0.5261746644973755,
-0.3196945786476135,
-0.2751392126083374,
-0.38416558504104614,
-0.6366692185401917,
0.5032007098197937,
-0.5929197669029236,
0.3550915420055389... | |
throw new Exception(e);
}
}
// try to cast it
}
```
A similar approach is taken when serializing an object. Now, when I create a unit test which in turn creates 10 threads with each thread trying to serialize and instantly read either a Boolean or a String it would fail showing that ClassC... | [
0.3858242332935333,
-0.0950920432806015,
0.15341554582118988,
-0.0486624538898468,
0.024617914110422134,
-0.2842578887939453,
0.5264508128166199,
-0.10368258506059647,
-0.31216150522232056,
-0.5931853652000427,
-0.15500755608081818,
0.5578894019126892,
-0.4016404449939728,
0.24798683822155... | |
in a single-threaded environment). If you've stayed with me down to this point :), here are the 2 issues I need your help on:
1. does it make sense to synchronize on a string argument passed to method (considering there's a string pool in java)? BTW, I've tried synchronizing on the XMLSerializer class itself with resu... | [
0.1921473741531372,
0.07891751825809479,
0.29164400696754456,
0.0449177585542202,
-0.04452914372086525,
-0.10130391269922256,
0.24763886630535126,
-0.6736213564872742,
-0.2044614851474762,
-0.623704195022583,
0.05850127711892128,
0.45219525694847107,
-0.47814372181892395,
-0.16355498135089... | |
String(sb.toString());
String b = new String(sb.toString());
a == b; //false
a.equals(b); //true
a.intern() == b.intern(); //true
```
Since you want to synchronize on the same monitor, you'd want the intern().
2.
You'd probably not want to synchronize on a String since it may synchronized on somewhere else, inside y... | [
0.11656291037797928,
-0.014530123211443424,
0.489425927400589,
-0.1475440114736557,
0.14102189242839813,
-0.03741797059774399,
0.4033823311328888,
-0.6840885877609253,
0.07204928994178772,
-0.6509413123130798,
0.17334851622581482,
0.3790768086910248,
-0.5886519551277161,
0.0029629503842443... | |
(sync map{ syncKey = map.get(new ID(from)); if syncKey==null create and put new key} sync{syncKey}).
3.
Then again, I'd ditch synchronize all together and use the java.util.concurrent.locks.Lock instead, in the same setup as above only with the lock attached to the ID. | [
-0.022488517686724663,
-0.20468521118164062,
0.3753986358642578,
-0.19146521389484406,
-0.09350775927305222,
-0.11623882502317429,
0.5354350209236145,
-0.5162107348442078,
0.15345847606658936,
-0.6179384589195251,
0.1332186907529831,
0.39235052466392517,
-0.5873774886131287,
0.158894851803... | |
Does my question make sense? Using either Vim or Emacs, you come to understand that the interface exposes the code's representation of the state of the file you are editing in the buffer, the file is the on-disk storage you can fill a buffer from or write a buffer to. All these things a programmer would know, but when ... | [
0.4666917026042938,
0.22116024792194366,
0.2622120976448059,
0.29030901193618774,
-0.025250719860196114,
-0.07177530229091644,
0.09857397526502609,
0.020035142078995705,
-0.17314568161964417,
-0.720162034034729,
-0.003424209775403142,
0.5191988945007324,
-0.10634084790945053,
0.17033050954... | |
idea to do it or not. Vim and Emacs are our two oldest editors in common use today, and they share this behavior. I know of no new editor that does the same. When did editors stop doing this and why?
For starters, Emacs uses plenty of buffers that aren't associated with any file. Any time you open a directory, read you... | [
0.2629060447216034,
-0.11584120243787766,
0.1062810942530632,
0.32514816522598267,
0.21302813291549683,
-0.12251631170511246,
-0.24226053059101105,
0.24267594516277313,
-0.36251384019851685,
-0.3150240182876587,
0.06064573675394058,
0.4337746798992157,
-0.4563941955566406,
0.19527976214885... | |
for Vim.
New applications that *only* edit files make no distinction because every screen or window or tab directly represents a file. More capable applications like Emacs and Vim are a lot more flexible in that respect. | [
0.23615336418151855,
-0.13346326351165771,
0.3624971807003021,
0.24252957105636597,
-0.11881524324417114,
-0.2851382791996002,
-0.010344111360609531,
0.08746916055679321,
-0.43573448061943054,
-0.8821202516555786,
-0.14790581166744232,
0.4862329065799713,
-0.33200812339782715,
0.3031362295... | |
I noticed a good while back that Wikipedia links to a [Javascript implementation](http://pajhome.org.uk/crypt/md5/) of different hash functions. Also found [Clipperz Crypto](http://www.clipperz.com/open_source/javascript_crypto_library). Even Mozilla implements a [crypto object](http://developer.mozilla.org/en/JavaScri... | [
0.3338888883590698,
0.28573888540267944,
0.19236759841442108,
0.1365322470664978,
-0.06660247594118118,
-0.36137014627456665,
0.1629963219165802,
-0.03013431280851364,
-0.23438990116119385,
-0.5201246738433838,
-0.07475264370441437,
0.5050255060195923,
-0.5200806260108948,
-0.1792573481798... | |
there. | [
-0.34406402707099915,
0.13237859308719635,
0.15138545632362366,
-0.025611957535147667,
-0.15302276611328125,
-0.2760849893093109,
0.2597753703594208,
0.45711207389831543,
-0.5010767579078674,
-0.2419733703136444,
0.045016393065452576,
0.02034604363143444,
0.31741517782211304,
0.28810474276... | |
What to use for a medium to large python WSGI application, Apache + mod\_wsgi or Nginx + mod\_wsgi?
Which combination will need more memory and CPU time?
Which one is faster?
Which is known for being more stable than the other?
I am also thinking to use CherryPy's WSGI server but I hear it's not very suitab... | [
0.037930600345134735,
-0.05823339521884918,
-0.06356079131364822,
0.13964144885540009,
-0.09857846796512604,
-0.1951817125082016,
0.21052303910255432,
0.04106536880135536,
-0.27305203676223755,
-0.560303807258606,
0.08664469420909882,
0.4375266134738922,
-0.2645806670188904,
-0.23829704523... | |
nginx is an event driven system underneath, it has behavioural characteristics which are detrimental to blocking applications such as is the case with WSGI based applications. Worse case scenario is that with multiprocess nginx configuration, you can see user requests be blocked even though some nginx worker processes ... | [
-0.3641652762889862,
-0.20191524922847748,
0.2185877561569214,
-0.01858343370258808,
-0.3518722355365753,
-0.13725769519805908,
0.4324074983596802,
0.2825748920440674,
-0.47527679800987244,
-0.6120897531509399,
-0.004643058869987726,
0.2739272117614746,
-0.7095195651054382,
0.1756409257650... | |
As the question states - is there a good tool out there which lists methods an unmanaged DLL exports? I would like it to list COM methods and interfaces too.
For DLLs, use the Dependency Viewer ([depends.exe](http://technet.microsoft.com/en-us/library/cc738370.aspx)).
For COM objects, use [oleview.exe](http://www.micr... | [
0.263475239276886,
-0.07325634360313416,
0.45289188623428345,
0.18001334369182587,
0.05042218416929245,
-0.006561580114066601,
-0.12362706661224365,
-0.11211620271205902,
-0.379242479801178,
-0.9591037034988403,
-0.30272942781448364,
0.5187742114067078,
-0.2836931347846985,
0.2416923046112... | |
I got a problem like this (this is html/css menu):
Eshop | Another eshop | Another eshop
Client wants it work like this:
User comes to website, clicks on Eshop. Eshop changes to red color with red box outline. User decides to visit Another eshop, so Eshop will go back to normaln color without red box outline, and an... | [
0.0542774423956871,
-0.03694227337837219,
0.5484628081321716,
-0.0019223337294533849,
-0.20005109906196594,
0.14100150763988495,
0.44252774119377136,
0.06084112823009491,
-0.39431846141815186,
-0.7650502920150757,
-0.03940315172076225,
0.4235803484916687,
-0.682316780090332,
0.024579100310... | |
outline-color:red;
outline-width:10px;
}
```
Now you could use Javascript (in this example using [jQuery](http://jquery.com)) in the click-event-handler:
```
$('.red').removeClass('red'); // removes class red from all items with class red
$(this).addClass('red'); // adds class red to the clicked item
```
Anoth... | [
0.14031125605106354,
-0.3280400037765503,
0.3537033200263977,
-0.1752481758594513,
-0.1708640456199646,
0.09504582732915878,
-0.06981578469276428,
-0.24662721157073975,
-0.08672420680522919,
-0.5211216807365417,
-0.2704695463180542,
0.508699357509613,
-0.34113427996635437,
-0.1725663840770... | |
I am taking my first steps programming in Lua and get this error when I run my script:
```
attempt to index upvalue 'base' (a function value)
```
It's probably due to something very basic that I haven't grasped yet, but I can't find any good information about it when googling. Could someone explain to me what it mea... | [
0.13034966588020325,
0.24544216692447662,
0.10523785650730133,
-0.16110855340957642,
-0.08069919049739838,
-0.13992829620838165,
0.13521111011505127,
0.0785754919052124,
-0.1716221421957016,
-0.49503982067108154,
0.08120594918727875,
0.39307254552841187,
-0.33357760310173035,
0.14187414944... | |
MessageBox.Show has forms like MessageBox.Show( ownerWindow, .... ).
What do I gain by assigning a owner window?
A message box is a modal form, which means that its parent window is disabled until the message box is dismissed.
If a Show() overload is called that does not take an owner identifier, then a parent form i... | [
0.11895159631967545,
-0.15848113596439362,
0.32636308670043945,
-0.17478521168231964,
-0.31412333250045776,
-0.42914843559265137,
0.2754133343696594,
-0.026799259707331657,
-0.30218470096588135,
-0.6985613703727722,
-0.21441607177257538,
0.4034356474876404,
-0.5227464437484741,
0.378498315... | |
is chosen as the parent.
Other threads may create message boxes with no parent form. This could be a bad situation, because it could sit behind the active window, and the user will not even know it is there until they close the program. To avoid this, you could pass the handle of the application's main window to the S... | [
0.6282870173454285,
-0.09265810996294022,
0.29867884516716003,
0.056351132690906525,
-0.13967619836330414,
-0.1949089616537094,
0.16450431942939758,
0.29003313183784485,
-0.03305347263813019,
-0.5743528604507446,
-0.009773488156497478,
0.17789660394191742,
-0.2752072513103485,
0.5331698656... | |
(I did say that I couldn't find anything in the documentation!)
I'd have to go back and look at the code to make sure, but I think the message boxes that I used to lose behind the main form may have actually been custom message box forms, in which case my experience is faulty, and you never ever have to supply a paren... | [
0.4396607279777527,
0.08891027420759201,
0.16060438752174377,
0.0891694650053978,
-0.017619868740439415,
-0.13926327228546143,
0.5464009046554565,
0.542421281337738,
-0.322258323431015,
-0.3695787787437439,
0.04105822369456291,
0.49331873655319214,
-0.009580741636455059,
0.3579792976379394... | |
I have a python module that makes use of a huge dictionary global variable, currently I put the computation code in the top section, every first time import or reload of the module takes more then one minute which is totally unacceptable. How can I save the computation result somewhere so that the next import/reload do... | [
0.08828854560852051,
0.2322903275489807,
0.33555811643600464,
0.005414281040430069,
-0.025864873081445694,
0.14693747460842133,
0.1630472093820572,
0.1997162401676178,
-0.1905532032251358,
-0.6988250017166138,
0.2250581979751587,
0.7052060961723328,
-0.1368059664964676,
0.1571408212184906,... | |
clarify: the code in the body of a module is *not* executed every time the module is imported - it is run only once, after which future imports find the already created module, rather than recreating it. Take a look at sys.modules to see the list of cached modules.
However, if your problem is the time it takes for the... | [
0.791470468044281,
-0.09942669421434402,
-0.1463518887758255,
0.08040157705545425,
0.1880921721458435,
-0.3748670518398285,
0.10540103167295456,
0.05753936618566513,
-0.2576163411140442,
-0.4156884551048279,
-0.2109781801700592,
0.7429479360580444,
-0.3667515218257904,
-0.23126401007175446... | |
in your interface, the shelve module may be your best option - this puts a pretty transparent interface between the dbm modules that makes them act like an arbitrary python dict, allowing any picklable value to be stored. Here's an example:
```
# Create dict with a million items:
import shelve
d = shelve.open('path/to... | [
-0.37394294142723083,
-0.36948129534721375,
0.44466131925582886,
-0.1420741230249405,
-0.23057615756988525,
0.07670900970697403,
0.2776503562927246,
-0.16441869735717773,
-0.09519600868225098,
-0.7750234603881836,
-0.12248682230710983,
0.467777818441391,
-0.16058874130249023,
0.05301124602... | |
a real dict, and it **will** still take a long time to load if you do something that requires all the keys (eg. try to print it), but may solve your problem. | [
0.15379558503627777,
-0.09561417996883392,
0.36314284801483154,
0.2968083918094635,
-0.05722048506140709,
-0.32489094138145447,
0.421292245388031,
-0.04405592009425163,
0.14635616540908813,
-0.5178053975105286,
-0.39948955178260803,
0.546566903591156,
-0.17737498879432678,
-0.3789003789424... | |
So, I can create an input button with an image using
```
<INPUT type="image" src="/images/Btn.PNG" value="">
```
But, I can't get the same behavior using CSS. For instance, I've tried
```
<INPUT type="image" class="myButton" value="">
```
where "myButton" is defined in the CSS file as
```
.myButton {
backgro... | [
0.18556472659111023,
-0.14914466440677643,
0.6313182711601257,
-0.24340671300888062,
-0.08008170872926712,
0.5322636961936951,
-0.1270657330751419,
-0.10797932744026184,
-0.45996618270874023,
-0.8530885577201843,
-0.09889400005340576,
0.29285284876823425,
-0.3540261387825012,
0.09041013568... | |
them for a background image for other parts of the page (just as a check). I found examples on the web of how to do it using JavaScript, but I'm looking for a CSS solution.
I'm using Firefox 3.0.3 if that makes a difference.
If you're wanting to style the button using CSS, make it a type="submit" button instead of typ... | [
0.34475111961364746,
-0.06478249281644821,
0.7023680210113525,
-0.010630096308887005,
-0.1855042278766632,
0.20677155256271362,
-0.022464027628302574,
-0.1912931501865387,
-0.4262332618236542,
-0.8495935797691345,
0.03763887658715248,
0.603438675403595,
-0.4665287137031555,
-0.205995783209... | |
submits the form. | [
0.3670348823070526,
0.41595223546028137,
0.716587483882904,
-0.08940387517213821,
0.5008031725883484,
-0.14003029465675354,
0.0666683241724968,
-0.18087978661060333,
0.31230640411376953,
-0.2330923080444336,
-0.25942033529281616,
-0.03406073525547981,
0.42984622716903687,
0.110317803919315... | |
I have a string(char\*), and i need to find its underlying datatype such as int, float, double, short, long, or just a character array containing alphabets with or with out digits(like varchar in SQL).
For ex:
```
char* str1 = "12312"
char* str2 = "231.342"
char* str3 = "234234243234"
char* str4 = "43... | [
0.0959075540304184,
0.31253087520599365,
0.11936955899000168,
-0.23297001421451569,
-0.03055815026164055,
0.28504154086112976,
0.30831393599510193,
-0.38931387662887573,
0.11622988432645798,
-0.5522206425666809,
-0.22806459665298462,
0.1788007766008377,
-0.24968351423740387,
0.044415351003... | |
atoi(str1)
float no2 = atof(str2)
long no3 = atol(str3)
double no4 = strtod(str4)
char* varchar1 = strdup(str5)
```
---
Clarifying a bit more...
I have a string and its contents could be alphabets and/or digits and/or special characters. Right now, I am able to parse string and
1. Identify if it contains only di... | [
-0.014072803780436516,
0.1729089319705963,
0.34407466650009155,
-0.13892513513565063,
-0.2997799217700958,
0.4572356641292572,
0.46639540791511536,
-0.37585437297821045,
-0.09099003672599792,
-0.32065820693969727,
-0.06904298812150955,
0.4453539550304413,
-0.1162625327706337,
-0.3597251772... | |
string into float or double ( **Same question here**)
4. other. leave it as a string
In C (not in C++), I would use a combination of strtod/strol and max values from <limits.h> and <float.h>:
```
#include <stdlib.h>
#include <stdio.h>
#include <limits.h>
#include <float.h>
/* Now, we know the following values:
... | [
0.09197378903627396,
-0.29942917823791504,
0.41145941615104675,
-0.24933074414730072,
0.1798715591430664,
0.28222256898880005,
0.06331577152013779,
-0.26042160391807556,
-0.0021576066501438618,
-0.26260942220687866,
-0.02661452814936638,
0.4429803788661957,
-0.24437545239925385,
0.00399518... | |
union_)
{
char * endptr ;
long lValue ;
double dValue ;
*enum_ = TNaN ;
/* integer value */
lValue = strtol(string_, &endptr, 10) ;
if(*endptr == 0) /* It is an integer value ! */
{
if((lValue >= CHAR_MIN) && (lValue <= CHAR_MAX)) /* is it a char ? */
{
*enum_ = TChar ;
... | [
0.16746008396148682,
-0.17867469787597656,
0.7240307927131653,
-0.3850334584712982,
0.33958175778388977,
0.5167806148529053,
0.24669823050498962,
-0.3781619966030121,
-0.048069730401039124,
-0.32085275650024414,
-0.32001447677612305,
0.48588722944259644,
-0.26474058628082275,
0.35946550965... | |
(char) lValue ;
}
else if((lValue >= SHRT_MIN) && (lValue <= SHRT_MAX)) /* is it a short ? */
{
*enum_ = TShort ;
union_->TShort_ = (short) lValue ;
}
else if((lValue >= LONG_MIN) && (lValue <= LONG_MAX)) /* is it a long ? */
{ | [
0.24877306818962097,
-0.43998539447784424,
0.512418806552887,
-0.5476998686790466,
0.38171783089637756,
0.4175557494163513,
0.29619890451431274,
-0.2899625301361084,
0.02765888161957264,
-0.36672013998031616,
-0.3038996160030365,
0.5892752408981323,
-0.10352881997823715,
0.1616794764995575... | |
*enum_ = TLong ;
union_->TLong_ = (long) lValue ;
}
return ;
}
/* real value */
dValue = strtod(string_, &endptr) ;
if(*endptr == 0) /* It is an real value ! */
{
if((dValue >= -DBL_MAX) && (dValue <= DBL_MAX)) /* is it a double ? */
{
*enum_ = TDouble ; | [
0.2861269414424896,
-0.4195629954338074,
0.4451625943183899,
-0.49431920051574707,
0.07227233797311783,
0.3421001434326172,
0.516927182674408,
-0.6746659874916077,
0.041296832263469696,
-0.44431889057159424,
-0.26406195759773254,
0.602859377861023,
-0.22137491405010223,
0.2159823477268219,... | |
union_->TDouble_ = (double) dValue ;
}
return ;
}
return ;
}
void studyValue(const char * string_)
{
MyEnum enum_ ;
MyUnion union_ ;
whatIsTheValue(string_, &enum_, &union_) ;
switch(enum_)
{
case TChar : printf("It is a char : %li\n", (long) union_.TChar_) ; break ;
... | [
0.4632225036621094,
-0.27391424775123596,
0.4553508460521698,
-0.5387959480285645,
0.3232627213001251,
0.16723990440368652,
0.43195974826812744,
-0.439750999212265,
0.03666386753320694,
-0.33817192912101746,
-0.5077196359634399,
0.26975351572036743,
-0.22619768977165222,
0.3327046632766723... | |
;
case TLong : printf("It is a long : %li\n", (long) union_.TLong_) ; break ;
case TDouble : printf("It is a double : %f\n", (double) union_.TDouble_) ; break ;
case TNaN : printf("It is a not a number : %s\n", string_) ; break ;
default : printf("I really don't know : %s\n", strin... | [
0.21355412900447845,
-0.06274322420358658,
0.16398152709007263,
-0.23925749957561493,
0.3360862135887146,
0.03750757873058319,
0.5805065631866455,
-0.07871749997138977,
-0.19845212996006012,
0.042137108743190765,
-0.5837381482124329,
0.5009618401527405,
-0.2975810468196869,
0.1072325557470... | |
;
studyValue("-25") ;
studyValue("30000") ;
studyValue("-30000") ;
studyValue("300000") ;
studyValue("-300000") ;
studyValue("25.5") ;
studyValue("-25.5") ;
studyValue("25555555.55555555") ;
studyValue("-25555555.55555555") ;
studyValue("Hello World") ;
studyValue("555-55-55") ;
ret... | [
-0.10791720449924469,
-0.059988707304000854,
0.517946720123291,
-0.2358461320400238,
0.15183605253696442,
0.4945259392261505,
0.7195968627929688,
-0.11629193276166916,
-0.04132729768753052,
-0.7523047924041748,
-0.4609799385070801,
0.19611746072769165,
0.06222004070878029,
0.51581293344497... | |
a double : -25555555.555556
[Hello World] is a not a number
[555-55-55] is a not a number
```
Sorry for my rusty C.
:-)
So, in substance, you after the call of whatIsTheValue, you retrieve the type through the MyEnum enum, and then, according to the value in this enum, retrieve the right value, correctly typed, fro... | [
0.4998292922973633,
0.1330685019493103,
0.40068748593330383,
-0.08352497965097427,
0.0034242882393300533,
0.13369716703891754,
0.31442388892173767,
-0.08420057594776154,
-0.08310892432928085,
-0.19748201966285706,
0.018953345715999603,
0.10308485478162766,
-0.20401610434055328,
0.288979262... | |
a double, I would not bother.
Note, too, that there is a catch, as 25.0 could be both real and an integer number. My comparing "dValue == (double)(long)dValue", I guess you should know if is an integer, again, not taking into account the usual precision problems coming witb binary real numbers used by computers. | [
0.20850509405136108,
0.047808609902858734,
-0.10982713848352432,
-0.23835094273090363,
-0.3736693561077118,
0.08952561020851135,
0.20750154554843903,
-0.0699349194765091,
-0.20980162918567657,
-0.34431466460227966,
0.06173661723732948,
0.4785397946834564,
-0.019226670265197754,
0.090596675... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.