text stringlengths 0 30.5k | title stringclasses 1
value | embeddings listlengths 768 768 |
|---|---|---|
new TimeSpan(0, 0, 0, 0, 0);
r3d.Duration = new TimeSpan(0,0,0,1,0);
r3d.KeyFrames.Add(new SplineRotation3DKeyFrame(new AxisAngleRotation3D(new Vector3D(1,0,0),1)));
r3d.KeyFrames.Add(new SplineRotation3DKeyFrame(new AxisAngleRotation3D(new Vector3D(1, 0, 0), 37)));
r3d.Name = "r3d";
Storyboard.SetTargetName(r3d, "De... | [
-0.014343165792524815,
-0.37768393754959106,
1.0043426752090454,
-0.0569266639649868,
0.10718576610088348,
0.42588695883750916,
-0.006161245983093977,
-0.15484945476055145,
-0.4496065676212311,
-0.6184204816818237,
-0.670832097530365,
0.4610213339328766,
0.14834386110305786,
0.444510817527... | |
I have an List values with a ResourceKey and a Caption, these values are both strings. The Resource is the name of an actual resource defined in a resource dictionary. Each of these ResourceKey Icons are Canvas's.
```
<Data ResourceKey="IconCalendar" Caption="Calendar"/>
<Data ResourceKey="IconEmail" Caption="Email"/>... | [
0.11564148962497711,
-0.10308976471424103,
0.7824708819389343,
-0.05536884069442749,
-0.21863098442554474,
0.36640435457229614,
-0.18889130651950836,
-0.31669434905052185,
-0.2440723180770874,
-0.9824140071868896,
0.10385444015264511,
0.6191443204879761,
0.018309567123651505,
-0.0344099700... | |
<RowDefinition Height="*" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<Button Content="{Binding ResourceKey}" Template="{StaticResource RoundButtonControlTemplate}"/>
<TextBlock Grid.Row="1" Margin="0,10,0,0" Text="{Binding Caption}" HorizontalAlignmen... | [
-0.11523453891277313,
-0.2531646192073822,
1.003157615661621,
-0.16805650293827057,
-0.21099573373794556,
0.3972070515155792,
-0.32223275303840637,
-0.7602198123931885,
-0.3727114498615265,
-0.7181294560432434,
0.24111737310886383,
0.3355155885219574,
0.2838466167449951,
0.0585698410868644... | |
tried every permutation with binding staticresource etc.
I am open to alternatives, I know it may be easier to just have an image and set the source property.
Thanks
After having a little think I ending up using a `ValueConvertor` like so:
```
class StaticResourceConverter : IValueConverter
{
public object Conve... | [
0.24924539029598236,
-0.13870869576931,
0.448127806186676,
-0.32490643858909607,
-0.1057882085442543,
-0.050121743232011795,
0.3029853403568268,
-0.16296052932739258,
-0.11610809713602066,
-0.6909187436103821,
0.10293600708246231,
0.6905784606933594,
-0.5716778635978699,
0.3874348998069763... | |
throw new Exception("The method or operation is not implemented.");
}
}
```
and the binding on the button becomes
```
<Button Content="{Binding ResourceKey, Converter={StaticResource resourceConverter}}" />
``` | [
-0.25206291675567627,
-0.24452395737171173,
0.41619205474853516,
-0.2685950994491577,
0.1194368451833725,
-0.06680919229984283,
0.153716579079628,
-0.3147694766521454,
-0.2465691715478897,
-0.532331645488739,
-0.47890952229499817,
0.4041009545326233,
-0.43252748250961304,
0.246391832828521... | |
I am trying to get my Django app (NOT using Google app engine) retrieve data from Google Contacts using Google Contacts Data API. Going through [authentication documentation](http://code.google.com/apis/accounts/docs/AuthSub.html) as well as [Data API Python client docs](http://code.google.com/apis/contacts/docs/1.0/de... | [
0.03676442429423332,
0.16858913004398346,
0.29562270641326904,
-0.028522614389657974,
-0.1992998570203781,
-0.022418921813368797,
0.5901553630828857,
-0.40820038318634033,
-0.031192896887660027,
-0.600799024105072,
0.019232815131545067,
0.6232690215110779,
-0.17283478379249573,
-0.22626160... | |
'Content-Type': 'application/x-www-form-urlencoded',
'Authorization': 'AuthSub token=' + authsub_token,
'User-Agent': 'Python/2.6.1',
'Host': 'https://www.google.com',
'Accept': 'text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2',
'Connectio... | [
0.006951119285076857,
0.09649558365345001,
0.6277502179145813,
0.2435186803340912,
-0.14661692082881927,
0.08132710307836533,
0.08058079332113266,
0.16887591779232025,
-0.1399058997631073,
-0.641366183757782,
-0.7473488450050354,
0.2796706259250641,
-0.36273354291915894,
0.2371786087751388... | |
'keep-alive',
}
req = urllib2.Request(url, None, headers)
response = urllib2.urlopen(req)
```
this gives me a different error:
HTTP Error 302: The HTTP server returned a redirect error that would lead to an infinite loop. The last 30x error message was: Moved Temporarily
What am I doing wrong here? I'd ... | [
0.5441901087760925,
0.0699748694896698,
0.3385675549507141,
-0.07437664270401001,
0.14248929917812347,
0.11697561293840408,
0.6220390796661377,
-0.3439452648162842,
-0.2335735559463501,
-0.5803360939025879,
-0.0717083066701889,
0.5073011517524719,
-0.2530263662338257,
0.11735166609287262,
... | |
all the sample code shown in this document, is available in the Python client library distribution, under the directory `samples/contacts/contacts_example.py`.
>
>
> The sample client performs several operations on contacts to demonstrate the use of the Contacts Data API.
Hopefully it will point you in the right dir... | [
0.5591709613800049,
0.22163045406341553,
0.04443851858377457,
0.1356450319290161,
0.3990922272205353,
0.12135662138462067,
-0.18487566709518433,
-0.16455255448818207,
-0.09288311004638672,
-0.47905054688453674,
0.15087153017520905,
0.28400495648384094,
-0.1420784592628479,
-0.2313621342182... | |
I can think of a few hacks using ping, the box name, and the HA shared name but I think that they are leading to data leakage.
Should a box even know its part of an HA cluster or what that cluster name is? Is this more a function of DNS? Is there some API exposed for boxes to join an HA cluster and request the id of ... | [
0.4477801024913788,
0.02535264752805233,
-0.17535100877285004,
0.17209568619728088,
-0.2135806381702423,
-0.32136908173561096,
0.3465447723865509,
-0.06922733783721924,
-0.29937294125556946,
-0.49797454476356506,
0.05819535627961159,
0.12863509356975555,
-0.40783625841140747,
0.33973127603... | |
pager and on the inactive node I want to send an email. Pushing the determination into the alerting layer moves the same problem elsewhere.
**EASY SOLUTION:** Polling the server from an external agent that connects through the network makes any shell game of who is the active node a moot point. To clarify this the onl... | [
0.3890945315361023,
0.04188815876841545,
0.5071680545806885,
0.0780925452709198,
-0.002442848403006792,
-0.015149950049817562,
0.19049713015556335,
-0.1275302767753601,
-0.3082626760005951,
-0.7317487001419067,
0.010230669751763344,
0.48745566606521606,
-0.3632190525531769,
0.0037487659137... | |
some hardware box, then it can be hard to determine if a certain box is a master or slave. That will depend on a specific solution really... As long as you can add a custom script to the supervisor, you should be ok - for example the controller can ping a daemon on the master server every second. In the alerting script... | [
0.45925217866897583,
-0.3300047814846039,
0.3987802267074585,
0.45739394426345825,
0.21971654891967773,
-0.3343995213508606,
0.27519550919532776,
-0.2987369894981384,
-0.4458853006362915,
-0.872559130191803,
-0.25036948919296265,
0.406025230884552,
-0.2653171420097351,
0.12151461094617844,... | |
brain occurs, you can end up with both slaves or both masters, so your alerting software will be wrong in both cases. Gadgets that can ensure only one live node (STONITH and others) could help.
On the other hand, in the second scenario, if the HA software works on both hosts properly, you should be able to obtain the ... | [
-0.08074314147233963,
-0.18031902611255646,
0.1615385115146637,
0.28890740871429443,
0.28277960419654846,
0.18516072630882263,
0.28702661395072937,
-0.08124922215938568,
-0.3254198729991913,
-0.8554285764694214,
-0.033003706485033035,
0.22007806599140167,
-0.1917385458946228,
0.27862903475... | |
when the state changes. Heartbeat offers both.
I wouldn't worry about the edge cases like a split brain though. Almost any situation when you lose connection between the clustered nodes will be more important than the stuff that happens on the separate nodes :)
If the thing you care about is really logging / alerting... | [
0.3017219603061676,
-0.2872982621192932,
0.37306153774261475,
0.22295856475830078,
0.0729404091835022,
-0.05479138717055321,
0.44265976548194885,
0.1323743462562561,
-0.35737118124961853,
-0.6178889274597168,
0.05281616002321243,
0.3883152902126312,
-0.1547641158103943,
0.08226972818374634... | |
power, you won't get any alert. A redundant pair of independent monitors can save you from that.
I'm not sure why you mentioned DNS - due to its refresh time it shouldn't be a source of any "real-time" cluster information. | [
0.3178160488605499,
-0.22993211448192596,
0.30704909563064575,
0.31371447443962097,
-0.007933363318443298,
-0.36768364906311035,
0.09950163960456848,
0.23069216310977936,
-0.4856779873371124,
-0.5227119326591492,
-0.07711227238178253,
0.6424189805984497,
-0.2264958769083023,
0.084438174962... | |
I have a drop-down/multi-level CSS menu on a page. The menu however doesn't appear over a flash chart I have. **The apparent fix seems to be to put wmode:transparent (or opaque), but that doesn't work for me.** I have also tried setting the z-level in the CSS to very high values (2000) but that doesn't work either.
In... | [
0.19949516654014587,
0.2301614135503769,
0.445045530796051,
-0.20395569503307343,
-0.2406889647245407,
-0.09945519268512726,
0.36157551407814026,
-0.005292612127959728,
-0.43644705414772034,
-0.7793774604797363,
0.16264739632606506,
0.4773028790950775,
-0.5154100656509399,
-0.0043793083168... | |
(This doesn't currently show the z-index attempt to fix.)
The wmode tag has not been set correctly.
Here is the correct code:
```
<object width="100%" height="100%" style="visibility: visible;" id="chart" data="/ofc-library/open-flash-chart.swf" type="application/x-shockwave-flash"><param value="transparent" name="wm... | [
-0.038910090923309326,
0.16402682662010193,
0.540861964225769,
-0.010996411554515362,
-0.282219260931015,
-0.1644928753376007,
0.32358384132385254,
-0.7586351633071899,
-0.251952201128006,
-0.39976170659065247,
-0.2068065106868744,
0.6584175229072571,
-0.013462049886584282,
-0.033861510455... | |
I'm doing some image processing, and I need to find some information on line growing algorithms - not sure if I'm using the right terminology here, so please call me out on this is needs be.
Imagine my input image is simply a circle on a black background. I'd basically like extract the coordinates, so that I may draw ... | [
0.5469034314155579,
-0.15928106009960175,
0.17669574916362762,
0.09711898863315582,
-0.21059231460094452,
0.04483157396316528,
0.06437365710735321,
0.058262068778276443,
-0.21782328188419342,
-0.7051973938941956,
0.2784097194671631,
0.12330722063779831,
-0.2648574709892273,
0.1568980067968... | |
a data type where by I have say a class called Line, and various different Point objects (containing X/Y coordinates).
```
class Line
{
Point points[];
}
class Point
{
int X, Y;
}
```
And this is how I'd like to use it...
```
Line line;
for each pixel in image
{
if pixel should be added to line
{
... | [
-0.06235630065202713,
-0.2597633898258209,
0.4020330011844635,
0.2512969970703125,
-0.17422138154506683,
0.16399870812892914,
-0.1794084757566452,
-0.11118501424789429,
-0.06805982440710068,
-0.8047206997871399,
-0.08222848176956177,
0.14933936297893524,
-0.4291512966156006,
0.144362241029... | |
if I'm interpreting you right, but the standard way is to use a [Hough transform](http://en.wikipedia.org/wiki/Hough_transform). It's a two step process:
1. From the given image, determine whether each pixel is an edge pixel (this process creates a new "binary" image). A standard way to do this is [Canny edge-detectio... | [
0.0828147679567337,
-0.3915562629699707,
0.14844612777233124,
0.09994179010391235,
-0.20281028747558594,
-0.08742824196815491,
0.23569095134735107,
-0.44217973947525024,
0.1658298224210739,
-0.7571608424186707,
-0.023595068603754044,
0.4280148148536682,
-0.08652231097221375,
-0.04102936014... | |
actually gives you a gradient also (not just the magnitude). So if you pick an edge pixel and follow along (or against) that vector, you'll find the next edge pixel. Keep going until you don't hit an edge pixel anymore, and there's your boundary. | [
-0.06685411930084229,
-0.6556374430656433,
0.8064032196998596,
0.2586120367050171,
-0.23206454515457153,
-0.04670901969075203,
0.127153679728508,
-0.016285540536046028,
-0.20891042053699493,
-0.6805749535560608,
0.35318121314048767,
0.1756664216518402,
-0.10234372317790985,
0.1561533361673... | |
I do not have much experience in table design. My goal is to create one or more product tables that meet the requirements below:
* Support many kinds of products (TV, Phone, PC, ...). Each kind of product has a different set of parameters, like:
+ Phone will have Color, Size, Weight, OS...
+ PC will have CPU, HDD, ... | [
0.7771749496459961,
0.364677369594574,
0.4395298361778259,
0.03293902054429054,
0.074981689453125,
0.40778395533561707,
-0.29760196805000305,
-0.12121821939945221,
-0.13380824029445648,
-0.5612771511077881,
0.13848136365413666,
0.5458582043647766,
-0.1693137288093567,
0.33906203508377075,
... | |
[Single Table Inheritance](http://martinfowler.com/eaaCatalog/singleTableInheritance.html): one table for all Product types, with enough columns to store all attributes of all types. This means *a lot* of columns, most of which are NULL on any given row.
* [Class Table Inheritance](http://martinfowler.com/eaaCatalog/cl... | [
0.22818180918693542,
0.3356174826622009,
0.05487737059593201,
-0.18155623972415924,
-0.24108615517616272,
0.7254724502563477,
-0.1216229796409607,
-0.4305363893508911,
-0.33874276280403137,
-0.5319753289222717,
-0.1812918782234192,
0.1573377549648285,
-0.602739155292511,
0.2397584617137909... | |
stores a BLOB of semi-structured data, in XML, YAML, JSON, or some other format. This BLOB allows you to store the attributes specific to each product type. You can use fancy Design Patterns to describe this, such as Facade and Memento. But regardless you have a blob of attributes that can't be easily queried within SQ... | [
0.4085102379322052,
0.23102723062038422,
0.49961841106414795,
0.00495292479172349,
0.11097218096256256,
0.22778697311878204,
-0.7481639385223389,
-0.052116673439741135,
-0.27467846870422363,
-0.46114712953567505,
-0.11244415491819382,
-0.17835287749767303,
-0.3860960602760315,
0.3031369447... | |
but many people use it anyway. This is the "Properties Pattern" mentioned by another answer. See other questions with the [eav tag](https://stackoverflow.com/questions/tagged/eav) on StackOverflow for some of the pitfalls.
I have written more about this in a presentation, [Extensible Data Modeling](http://www.slidesha... | [
0.4065331220626831,
0.21758128702640533,
0.5251694321632385,
0.0975489392876625,
-0.2621978521347046,
-0.3722395598888397,
0.22220160067081451,
-0.2836630642414093,
-0.2396836280822754,
-0.5222735404968262,
-0.016029376536607742,
0.7658641934394836,
-0.21033820509910583,
-0.307670742273330... | |
way to ensure that attribute names are spelled consistently.
* No way to put a foreign key on the values of any given attribute, e.g. for a lookup table.
* Fetching results in a conventional tabular layout is complex and expensive, because to get attributes from multiple rows you need to do `JOIN` for each attribute.
... | [
0.009135858155786991,
-0.051569417119026184,
0.15529672801494598,
0.35981807112693787,
-0.0002569257630966604,
-0.22369542717933655,
0.46343937516212463,
-0.20787771046161652,
-0.3211500346660614,
-0.8392952680587769,
-0.12006723880767822,
0.46206212043762207,
-0.1101694256067276,
-0.28452... | |
the OP's question about product types, it's much simpler to create a table per product type for product-specific attributes, so you have some consistent structure enforced at least for entries of the same product type.
I'd use EAV only if *every row* must be permitted to potentially have a distinct set of attributes. ... | [
0.13034509122371674,
0.162586972117424,
0.4979167580604553,
-0.010085323825478554,
0.23032163083553314,
-0.27618128061294556,
-0.12739719450473785,
-0.14943094551563263,
-0.6093055009841919,
-0.7410613298416138,
-0.11868838965892792,
0.8502197861671448,
-0.6133231520652771,
-0.063496664166... | |
even when using special [JSON functions](https://dev.mysql.com/doc/refman/8.0/en/json-functions.html) to support them. It takes a lot more storage space to store JSON documents, versus storing in normal rows and columns.
Basically, none of these solutions are easy or efficient in a relational database. The whole idea ... | [
-0.08405207097530365,
0.1128210723400116,
0.32734718918800354,
0.49462640285491943,
-0.11103130131959915,
0.03253006562590599,
0.23070791363716125,
-0.002700041513890028,
-0.365415096282959,
-0.6215253472328186,
-0.20607683062553406,
0.6523237824440002,
-0.2462698519229889,
-0.057693365961... | |
one solution that is "best" because any of the solutions might be best for a given application. | [
-0.36392614245414734,
0.021338842809200287,
0.11205480992794037,
0.41965994238853455,
0.28799259662628174,
0.07101309299468994,
0.2456575185060501,
0.10154463350772858,
0.17403751611709595,
-0.8749441504478455,
-0.3422314524650574,
0.25856825709342957,
-0.20497755706310272,
-0.030480884015... | |
I am looking for a way to identify quoted text in emails. The goal is to add something along the lines of Gmails "show quoted text" feature to my web app which involves a mail handler bot.
There are similar questions on stackoverflow, but they are asking for an algorithm. I could implement this if I have to, but I wou... | [
0.6409670114517212,
0.20711657404899597,
0.5044251084327698,
0.20011839270591736,
-0.19087573885917664,
-0.21495746076107025,
0.18635040521621704,
-0.29566267132759094,
0.1122712790966034,
-0.49487051367759705,
0.2382788211107254,
0.6910905241966248,
-0.2402743697166443,
-0.184093862771987... | |
additions such as "On May 10th, 2008 at 6:35 PM Brandon wrote:"
A python library would be super magically awesome ideal, but I don't expect to get that lucky. A simple command line tool which can do this would pretty close to ideal, but I don't expect to that that lucky either. I'd gladly settle on a well known good i... | [
0.3213045597076416,
-0.10005310922861099,
0.4190390110015869,
-0.0005411302554421127,
0.024250371381640434,
-0.34457919001579285,
0.32903674244880676,
0.27789872884750366,
-0.31106892228126526,
-0.4693726599216461,
0.18040378391742706,
0.5662122964859009,
-0.10924558341503143,
0.1284075230... | |
construction kit".
Just following up on an email I received regarding this question.
Sup has a pretty easy to understand/extract/translate bit of logic for accomplishing this. I ported the relevant functions to Python and tweaked it for my purposes.
Sup is terminal-based mail client written in Ruby: <http://sup.rubyf... | [
0.15897202491760254,
-0.18114455044269562,
0.05485597625374794,
-0.18103843927383423,
-0.19255110621452332,
0.3391817510128021,
0.2858414053916931,
0.18575100600719452,
0.10431073606014252,
-0.7245679497718811,
-0.3295901119709015,
0.3106844127178192,
-0.29407283663749695,
-0.1146036535501... | |
The pickle module seems to use string escape characters when pickling; this becomes inefficient e.g. on numpy arrays. Consider the following
```
z = numpy.zeros(1000, numpy.uint8)
len(z.dumps())
len(cPickle.dumps(z.dumps()))
```
The lengths are 1133 characters and 4249 characters respectively.
z.dumps() reveals som... | [
-0.15171025693416595,
-0.3820878565311432,
0.23916888236999512,
-0.13015654683113098,
-0.21652604639530182,
0.42496275901794434,
-0.1436355859041214,
-0.32119274139404297,
-0.478537380695343,
-0.2372552752494812,
0.07592030614614487,
0.27712979912757874,
0.05889276787638664,
-0.02353222854... | |
Protocol formats 1 and 2 (and 3 but that's for py3k) are binary and should be more space conservative. | [
-0.04192076995968819,
-0.20291633903980255,
0.32532456517219543,
0.20040906965732574,
-0.1743592768907547,
-0.37184983491897583,
0.1597888022661209,
0.020548341795802116,
-0.15175428986549377,
-0.5414391756057739,
-0.33033567667007446,
0.2501355707645416,
-0.3590768575668335,
-0.3143022358... | |
I need to provide secure communication between various processes that are using TCP/IP sockets for communication. I want both authentication and encryption. Rather than re-invent the wheel I would really like to use SSL and the SslStream class and self-signed certificates. What I want to do is validate the remote proce... | [
0.22713452577590942,
0.4464057385921478,
0.19738063216209412,
0.18600912392139435,
-0.061616990715265274,
-0.2567766606807709,
-0.017313463613390923,
0.0189104862511158,
-0.17022468149662018,
-0.47972676157951355,
0.046889010816812515,
0.5574085116386414,
-0.01941300556063652,
0.4298029243... | |
In addition to makecert.exe, it looks like [this link](http://blogs.msdn.com/dcook/archive/2008/11/25/creating-a-self-signed-certificate-in-c.aspx) shows a way to automatically generate self-signed certificates, so that's a start.
I've looked at the AuthenticateAsServer and AuthenticateAsClient methods of SslStream. Y... | [
0.3782036602497101,
0.1035849004983902,
0.16256403923034668,
0.1081257238984108,
-0.08117594569921494,
-0.40152856707572937,
0.4955190420150757,
0.06303722411394119,
-0.34912556409835815,
-0.5669544339179993,
0.043020907789468765,
0.09887993335723877,
0.04838113859295845,
-0.02436680346727... | |
this code to generate a .pfx certificate file:
```
byte[] c = Certificate.CreateSelfSignCertificatePfx(
"CN=yourhostname.com", //host name
DateTime.Parse("2000-01-01"), //not valid before
DateTime.Parse("2010-01-01"), //not valid after
"mypassword"); //password to encrypt key file
... | [
-0.07940038293600082,
0.27063819766044617,
0.7837109565734863,
-0.0473150759935379,
0.21181713044643402,
-0.19047661125659943,
0.21138769388198853,
-0.4725401699542999,
-0.0782199576497078,
-0.5586823225021362,
-0.13468849658966064,
0.3709712624549866,
-0.10919331759214401,
0.2738544642925... | |
new X509Certificate2(
@"testcert.pfx",
"mypassword");
```
**Step 3:** Putting it together
* I based it on [this very simple SslStream example](http://leastprivilege.com/2005/02/28/sslstream-sample/)
* You will get a compile time error about the SslProtocolType... | [
0.03961844742298126,
-0.3326520621776581,
0.5256269574165344,
-0.0004691208596341312,
-0.14670905470848083,
-0.1880524605512619,
0.46797266602516174,
-0.2404438704252243,
-0.3261326253414154,
-0.8430184125900269,
-0.10607608407735825,
0.2756158113479614,
-0.5580993890762329,
0.051111429929... | |
all with the suggested replacements.
* I replaced this line in the Server Program.cs file with the line from Step 2:
X509Certificate cert = getServerCert();
* In the Client Program.cs file, make sure you set serverName = yourhostname.com (and that it matches the name in the certificate)
* In the Client Program.cs, the... | [
0.08060205727815628,
0.31064850091934204,
0.7095189094543457,
-0.07258383929729462,
0.06830780953168869,
-0.11846991628408432,
0.6107730865478516,
0.05221431702375412,
-0.25882023572921753,
-0.7954367399215698,
-0.19974228739738464,
0.39173099398612976,
-0.20969685912132263,
0.381720185279... | |
for this, and I check that certificate.GetPublicKeyString() is equal to the public key that I have on file for that server. If it matches, I return True from that function. That seems to work.
**Step 4:** Client Authentication
Here's how my client authenticates (it's a little different than the server):
```
TcpClien... | [
-0.08397071063518524,
0.045450419187545776,
0.9608264565467834,
-0.09641821682453156,
0.10108537971973419,
-0.12725301086902618,
0.6753254532814026,
-0.5627564787864685,
-0.15904350578784943,
-0.6191580295562744,
-0.14814408123493195,
0.6373527646064758,
-0.017093408852815628,
0.2638997733... | |
sslStream.AuthenticateAsClient(
serverName,
certs,
SslProtocols.Default,
false); // check cert revokation
}
catch (AuthenticationException)
{
authenticationPassed = false;
}
if (authenticationPassed)
{
//do stuff
}
```
The CertificateValidationCallback is the same as in the ser... | [
-0.20693285763263702,
-0.08486664295196533,
0.4015630781650543,
0.06423185765743256,
-0.05534517392516136,
-0.32907283306121826,
0.6046229600906372,
-0.25149399042129517,
-0.10738594084978104,
-0.5537050366401672,
-0.07873576134443283,
0.3507157564163208,
-0.13331933319568634,
0.1570271551... | |
collection):
```
static X509Certificate CertificateSelectionCallback(object sender,
string targetHost,
X509CertificateCollection localCertificates,
X509Certificate remoteCertificate,
string[] acceptableIssuers)
{
return localCertificates[0];
}
``` | [
-0.12629547715187073,
-0.027131536975502968,
0.43474453687667847,
0.17078208923339844,
-0.01697402074933052,
-0.05074921250343323,
0.3184592127799988,
-0.08196478337049484,
-0.13342879712581635,
-0.3223835825920105,
-0.3722362518310547,
0.46503666043281555,
-0.24104109406471252,
0.41578167... | |
I'm looking for real world examples of some bad side effects of code coverage.
I noticed this happening at work recently because of a policy to achieve 100% code coverage. Code quality has been improving for sure but conversely the testers seem to be writing more lax test plans because 'well the code is fully unit tes... | [
0.565168559551239,
0.3889462947845459,
-0.2849774956703186,
0.18911342322826385,
-0.16223765909671783,
-0.17738911509513855,
0.7044380903244019,
0.057618118822574615,
-0.35686033964157104,
-0.439551442861557,
0.20719671249389648,
0.6352141499519348,
-0.05290338024497032,
0.0716184377670288... | |
spent.
If anyone has other negative side effects of having a code coverage policy please share. I'd like to know what kind of other 'problems' are happening out there in the real-world.
Thanks in advance.
EDIT: Thanks for all the really good responses. There are a few which I would mark as the answer but I can only ... | [
0.7653893232345581,
0.10715096443891525,
-0.31554457545280457,
0.5685759782791138,
-0.09367067366838455,
-0.043949998915195465,
0.11711378395557404,
0.004417814314365387,
-0.35616764426231384,
-0.4279713034629822,
-0.10472892969846725,
0.6139322519302368,
0.15299445390701294,
-0.1712468266... | |
stuff works as a priority. Coverage figures have no notion of the 'importance' of code, nor the quality of tests.
In my experience, many of the most important tests you will ever write are the tests that barely add any coverage at all (edge cases that add a few extra % here and there, but find loads of bugs).
The p... | [
0.6474530100822449,
0.2623211145401001,
0.08461343497037888,
0.4918305277824402,
-0.039418164640665054,
-0.2143298089504242,
0.5004646182060242,
-0.06798749417066574,
-0.2351350337266922,
-0.24485936760902405,
-0.09740164875984192,
0.46359357237815857,
0.23727457225322723,
-0.0834459513425... | |
then that's fantastic, but in most situations the extra effort is just not worth it.
Furthermore, people start obsessing/fiddling with numbers rather than focussing on the quality of the tests. I've seen badly written tests that have 90+% coverage, just as I've seen excellent tests that only have 60-70% coverage.
Ag... | [
0.7154281139373779,
0.26370397210121155,
-0.06798014044761658,
0.2663218379020691,
-0.04631636291742325,
-0.30690625309944153,
0.3879068195819855,
0.13344314694404602,
-0.38158711791038513,
-0.7604756355285645,
0.12633328139781952,
0.4365197718143463,
0.17721307277679443,
-0.16292120516300... | |
I was thinking about creating a Web app that would let people enter text (using SSL connection) and it would be encrypted before saving to the DB. The goal would be to have it so that only users could decrypt it.
You could have the users enter the key along with their data, and enter it again when they want to see the... | [
0.4846958518028259,
0.22020484507083893,
0.04748593643307686,
0.11522313952445984,
-0.10003944486379623,
-0.23067307472229004,
0.48473066091537476,
-0.02287285588681698,
0.09575162827968597,
-0.4740464687347412,
0.12238521128892899,
0.5364044308662415,
-0.2693500518798828,
0.26639786362648... | |
possible to do it without either having the user enter the key every time or storing the key, but is there some way that I'm not thinking of? Like maybe generating a key from information only the user knows? Something involving cookies?
From an information security perspective, this only makes sense if the encryption/d... | [
0.39965733885765076,
0.03492297977209091,
-0.10830328613519669,
0.36148378252983093,
0.36744147539138794,
-0.30582502484321594,
0.5669507384300232,
-0.20937307178974152,
-0.11904693394899368,
-0.5068827867507935,
-0.3269343972206116,
0.6292654275894165,
0.02617705799639225,
-0.281963616609... | |
mind if you have a lot of users and decide to do encryption/decryption on the server.
\* or a Java applet, but that's so 90's. Silverlight or Flash could potentially work, too. | [
0.6523352265357971,
0.00604283669963479,
0.03390837088227272,
0.3725578784942627,
0.5205073356628418,
-0.3538365662097931,
-0.030609218403697014,
0.4901280701160431,
-0.2389158308506012,
-0.30575329065322876,
0.13413092494010925,
0.5849577784538269,
-0.04153837263584137,
-0.130560144782066... | |
The user id on your connection string is not a variable and is different from the user id (can be GUID for example) of your program. How do you audit log deletes if your connection string's user id is static?
The best place to log insert/update/delete is through triggers. But with static connection string, it's hard ... | [
0.20810839533805847,
0.037629202008247375,
0.22446681559085846,
0.24423639476299286,
-0.0062735783867537975,
-0.2994833290576935,
0.18222689628601074,
0.01745327189564705,
-0.41148605942726135,
-0.5967456698417664,
0.15256686508655548,
0.6238261461257935,
-0.25223928689956665,
0.2271311879... | |
can't put my logic into the stored procedures. | [
0.42292267084121704,
0.36609184741973877,
-0.0636090636253357,
0.012576540000736713,
0.2411768138408661,
0.08509597182273865,
0.4647499918937683,
-0.08421023935079575,
0.06484196335077286,
-0.18426471948623657,
0.21165034174919128,
0.19733209908008575,
0.08563649654388428,
0.10202360153198... | |
Hi my question is this. Suppose you have an interface that defines how a converter would be implemented. This interface could have a method loadDocument() and another convert(). Now suppose we want to have multiple converters, ConvertHTML2DOC, ConvertXML2HTML e.t.c you get the idea.
Suppose you get the two formats you... | [
0.3546951413154602,
-0.0028628797736018896,
0.3010484278202057,
0.21562795341014862,
-0.3600974977016449,
-0.16685044765472412,
-0.09236171096563339,
-0.41636359691619873,
-0.09248697012662888,
-0.43354207277297974,
0.15601594746112823,
0.5858057141304016,
-0.24582645297050476,
0.123866744... | |
I wrote a little example of what I mean. In my example I have 2 classes P1 and P2 that share an interface. I also create 50000 of them to show of the speed differences. As it turns out the normal invocation is slightly faster, but I think that in a complex example such as the one i mentioned in the beginning, the benef... | [
0.4838307201862335,
0.12265884876251221,
-0.13396614789962769,
-0.12531185150146484,
0.011559516191482544,
0.25652533769607544,
0.4194738566875458,
-0.25366389751434326,
-0.00854718592017889,
-0.6877092719078064,
0.2240309715270996,
0.34294605255126953,
-0.4594045579433441,
-0.016087749972... | |
Random r = new Random();
Date test1start = new Date();
for (int i = 0; i<= 50000; i++){
Printable p = (Printable)Class.forName("P"+(r.nextInt(2)+1)).newInstance();
System.out.println(p.getString());
}
Date test1stop = new Date();
Date test2start = new Date();
for (int... | [
0.10392708331346512,
-0.6036480069160461,
0.4697745442390442,
-0.14215800166130066,
0.18906591832637787,
0.3675784468650818,
0.030904754996299744,
-0.4453577995300293,
-0.4281390309333801,
-0.5629357695579529,
-0.24420952796936035,
0.3893745243549347,
-0.22325222194194794,
0.24383938312530... | |
if (r.nextInt(2) == 0 ) {
p = new P1();
} else {
p = new P2();
}
System.out.println(p.getString());
}
Date test2stop = new Date();
System.out.println("Test with 'Class' invocation took "+(test1stop.getTime()-test1start.getTime())+" milliseconds.");
Sy... | [
0.08546733856201172,
-0.7020002007484436,
0.5228692889213562,
-0.25908637046813965,
0.35604122281074524,
-0.021764032542705536,
0.40629127621650696,
-0.4647471606731415,
0.0015329932793974876,
-0.3498874008655548,
-0.4861469864845276,
0.49512186646461487,
-0.030853282660245895,
0.046610806... | |
invocation took "+(test2stop.getTime()-test2start.getTime())+" milliseconds.");
} catch (Exception e) {
}
}
}
interface Printable {
public String getString();
}
class P1 implements Printable {
public String getString(){
return "1";
}
}
class P2 implements Printable {
public String getString(){
... | [
-0.116379015147686,
-0.2838561236858368,
0.2165624499320984,
0.17993974685668945,
-0.10108306258916855,
-0.34928542375564575,
0.27816399931907654,
-0.2502819001674652,
0.11272745579481125,
-0.4121176600456238,
-0.24127286672592163,
0.7014979720115662,
-0.4965837895870209,
-0.31873956322669... | |
generation based on reflection information).
I would however suggest one addition to the design - the introduction of a common domain model (CDM) that is targeted by all translators. Say that you have formats A, B and C an that you need to support transformation between each - you get all the permutations:
* A -> B
*... | [
0.1962588131427765,
-0.1820533573627472,
0.3969041407108307,
0.26474785804748535,
-0.1258944720029831,
0.06457185000181198,
0.128396138548851,
-0.19822455942630768,
-0.07600492238998413,
-0.8965826630592346,
-0.37741759419441223,
0.4630359709262848,
-0.2143743634223938,
0.07769931107759476... | |
*exporter*. The importer converts a format to the common domain model (CDM) while an export converts the from the CDM to some format.
As an example, we decompose the conversion from A to B into the following:
* A --> CDM (this is an import)
* CDM --> B (this is an export)
Now when you want to add a new format you ne... | [
0.2844421863555908,
-0.02173149771988392,
0.2122456133365631,
-0.20689360797405243,
-0.3885800242424011,
-0.3048778772354126,
-0.0012105823261663318,
0.0042693219147622585,
-0.08768849074840546,
-0.5745272636413574,
-0.0032109664753079414,
0.8727717995643616,
-0.6294753551483154,
0.1790559... | |
a registry of importer factories and a registry of exporter factories. | [
0.4751832187175751,
0.18512868881225586,
-0.022845136001706123,
-0.14723536372184753,
0.28133195638656616,
0.5624648332595825,
-0.3905356228351593,
-0.15778717398643494,
-0.617141842842102,
-0.2374655306339264,
-0.22413340210914612,
0.16764318943023682,
-0.08768212795257568,
0.493670463562... | |
I've read a few papers from Kahan tonight, and his [famous rant](http://www.cs.berkeley.edu/~wkahan/JAVAhurt.pdf) against Java. Before I dive into the JVM spec, did anything change since the initial rant on this front? For example:
* setting rounding mode
* accessing the flags
* getting more precision for free
* ... ?... | [
0.2827396094799042,
0.3462004065513611,
-0.17662999033927917,
0.13010342419147491,
-0.02046193554997444,
-0.21666143834590912,
-0.10376989096403122,
-0.18587711453437805,
-0.5831236839294434,
-0.5364916920661926,
-0.2753930985927582,
0.13656553626060486,
0.08794263005256653,
0.392539352178... | |
I will explain the question by example:
In zend framework, when you want to add a functionality to the view class, you can use what is called a Helper class.
A helper class is a class that has one method (Same as name of class) that becomes available in each of the views (by reflection the helper method is wrapped b... | [
0.29471221566200256,
-0.20112344622612,
-0.19388984143733978,
0.1664918065071106,
-0.27483415603637695,
-0.18449732661247253,
0.20409449934959412,
-0.305996835231781,
-0.0745195671916008,
-0.5327804684638977,
-0.006621221546083689,
0.5521872043609619,
0.02751053310930729,
-0.03847137466073... | |
Helper per method I want to add to the view (Each in a different file), I will write one helper with a list of C style functions (i.e. not class static methods, real functions) which can be used only in the View class (as View helpers are include only in the View).
So, this is mixing some procedural with OO, but the p... | [
-0.07538216561079025,
-0.1872413456439972,
0.26943087577819824,
0.19374127686023712,
-0.24145303666591644,
0.06678975373506546,
0.11162710189819336,
-0.06876695901155472,
-0.0944773405790329,
-0.5352473855018616,
-0.10976916551589966,
0.659441351890564,
-0.383896142244339,
-0.2260313481092... | |
OO, except in this small matter,
So, should I stick to a single paradigm or mix them?
first: OOP is a subset of structured programming, which is a subset of procedural, so you're not going so far 'paradigm-wise' as you imply. ("paradigm", what an ugly and overused word)
second: OOP, is a design style, not a languag... | [
0.1324075311422348,
0.20361129939556122,
0.02876553125679493,
0.1431756168603897,
-0.3211634159088135,
-0.06970520317554474,
0.07405555248260498,
0.21129339933395386,
-0.22610172629356384,
-0.26747027039527893,
0.02120194025337696,
0.4074592888355255,
-0.1488427221775055,
-0.57266211509704... | |
be "anti-OOP".
fourth: yeah, OOP is one of the best design styles out there, but there's no virtue on 'staying true to a vision'. after all, they're all tools in your toolchest. if the OOP constructs of your language of choice can't deliver what you need for this specific instance, then use other tricks to make it wor... | [
0.6141270399093628,
0.03224676102399826,
-0.03418852016329765,
0.17307904362678528,
-0.32058650255203247,
0.09677520394325256,
0.6767852902412415,
0.1818440556526184,
0.18738757073879242,
-0.3564322590827942,
-0.24280796945095062,
0.7429453730583191,
-0.33699384331703186,
-0.16592995822429... | |
The standard template for ASP.NET MVC (and MVC in general) seems to be *{controller}/{action}/{id}*, however, on a project i'm currently working on i'm not sure if that is an appropriate structure. If for example I had an application that controlled a car, to me it would make more sense to me to have the structure belo... | [
0.2695731222629547,
-0.22540949285030365,
0.5046162605285645,
0.38195109367370605,
-0.09669969975948334,
0.005329987965524197,
-0.3092595934867859,
-0.2429671287536621,
-0.3157925605773926,
-0.36569535732269287,
-0.20234961807727814,
0.3449482321739197,
-0.25348901748657227,
0.170553520321... | |
the current speed (could be /ESX-121/Speed also)
/ESX-121/Turn/Left
/ESX-121/Speed/Set/90
/ESX-121/Power/Off
```
If this followed the default pattern it would be something like below:
```
/Power/On/ESX-121
/Speed/Set/ESX-121/100
/Speed/Current/ESX-121 -- get the current speed (could be /Speed/ESX-121 also)
/Turn/Lef... | [
-0.013673482462763786,
-0.11914332211017609,
0.905488908290863,
0.41799867153167725,
0.22161896526813507,
0.21946056187152863,
-0.1797717958688736,
-0.04324011504650116,
0.05762087553739548,
-0.6338011622428894,
0.04373396188020706,
0.8495678305625916,
0.3229735791683197,
0.041691236197948... | |
Do you think this is an acceptable solution, or is there a better way for this to be structured?
There is a big problem, from a "philosophical" point of view.
You seem to be using GET requests for pretty much everything, such as setting speed.
The idea behind REST is that access to the ESX-121 resource gives you a rep... | [
0.2103007435798645,
-0.26190850138664246,
0.584280788898468,
0.7170125246047974,
-0.03329359367489815,
0.026423068717122078,
-0.09789073467254639,
0.12954172492027283,
-0.1632302850484848,
-0.8370147347450256,
0.07467927038669586,
0.5529966354370117,
0.23410801589488983,
-0.034377399832010... | |
its speed. Under ASP.net MVC you would POST a form for that.
What you are trying to do is to apply a SOAP service way of modeling (geared towards operations, or verbs) to a REST service, which is not really the idea.
It can be difficult to "get" the REST way of doing things, and it can go against everything you have ... | [
0.089057557284832,
-0.3976142406463623,
0.2222851812839508,
0.35139715671539307,
-0.1515800803899765,
-0.05346280708909035,
0.14253544807434082,
-0.1361970156431198,
-0.18664418160915375,
-0.6511899828910828,
-0.05966847017407417,
0.41532954573631287,
-0.11178148537874222,
-0.1828243881464... | |
update), DELETE (delete).
EDIT: Thanks to marxidad for correcting me on what each verb should map to. | [
-0.5681539177894592,
-0.16454383730888367,
0.4424111843109131,
0.17515185475349426,
-0.22677165269851685,
0.5303978323936462,
0.401288241147995,
-0.04749932512640953,
-0.3062352240085602,
-0.6922357678413391,
-0.34482553601264954,
0.25928670167922974,
-0.0979960709810257,
-0.38608872890472... | |
I Have the following code which is called inline as below also. The problem is the alert never fires. In firebug i can see that data is filled with my object, but still the alert doesn't fire. Any ideas?
```
function update(s_arrive) {
$.post("../base/getDestInfo.asp", { "dest": s_arrive }, function(data) { alert(... | [
0.17359234392642975,
0.2214038372039795,
0.8657927513122559,
-0.23050902783870697,
-0.23679304122924805,
-0.08411574363708496,
0.6841350197792053,
-0.33890777826309204,
0.06761665642261505,
-0.72918301820755,
-0.19916285574436188,
1.0651365518569946,
-0.393654465675354,
-0.1895147860050201... | |
of view.
You seem to be using GET requests for pretty much everything, such as setting speed.
The idea behind REST is that access to the ESX-121 resource gives you a representation of its current state, in your case its speed, its direction, if it's on etc.
POSTing some representation of the car at its URL will effec... | [
0.3119349777698517,
-0.3609496057033539,
0.828931987285614,
0.4952124357223511,
-0.05755789577960968,
0.11145489662885666,
-0.0720520168542862,
0.04435122758150101,
-0.15415708720684052,
-0.9926483035087585,
-0.03724769130349159,
0.7209003567695618,
0.16765069961547852,
0.0111650750041008,... | |
towards operations, or verbs) to a REST service, which is not really the idea.
It can be difficult to "get" the REST way of doing things, and it can go against everything you have been doing i you were using SOAP services, but it is important to keep those principles in mind.
In theory, you URL describes a resource, ... | [
-0.3003673553466797,
-0.333573579788208,
0.42377597093582153,
0.129054456949234,
-0.06192256882786751,
0.6119436621665955,
0.2032974511384964,
-0.08506598323583603,
-0.23665575683116913,
-0.609092652797699,
0.09555014222860336,
0.35216888785362244,
0.10712900012731552,
-0.2729727327823639,... | |
Some of my http request has 'space' in URL, but it is not recognized by iPhone. I have to change 'space' to '%20' whenever there is a 'space' in the url. Now I have to send a message typed by the user to the server and it can have as many 'spaces' as the user like. It looks like I have to replace them all.(stringByRepl... | [
0.03270314633846283,
0.15902742743492126,
0.3933134973049164,
-0.09231273084878922,
-0.06240345537662506,
0.4226740002632141,
0.3686966001987457,
0.08814846724271774,
-0.4150179326534271,
-0.7310657501220703,
-0.22139973938465118,
0.21333050727844238,
-0.2216346561908722,
0.036015551537275... | |
[originalUrl
stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
```
If you want to understand how URL encoding works, take a look at this [URL](http://www.w3schools.com/TAGS/ref_urlencode.asp). | [
0.10666898638010025,
-0.12908229231834412,
0.35279351472854614,
-0.07549355924129486,
-0.22464363276958466,
-0.31398680806159973,
0.1859598308801651,
-0.06209120899438858,
-0.26725566387176514,
-0.38606739044189453,
-0.3260030448436737,
0.28436750173568726,
-0.290044903755188,
0.2757543921... | |
I am having problems closing out a C# windows form app. It will currently just give me a blank form with no title or anything. **I need to find a way to close this little unknown window.**
I Have 2 form pages one for a login screen and one for the actual app. All being run by a program.cs file.
**program.cs**
```
.... | [
0.18154773116111755,
0.2186679244041443,
0.6684644818305969,
-0.34873083233833313,
0.07140561193227768,
0.09630317986011505,
0.5785319209098816,
0.11550979316234589,
-0.28331246972084045,
-0.888637363910675,
-0.2674574851989746,
0.49793821573257446,
-0.3517649471759796,
0.1847657412290573,... | |
new Login();
DialogResult a = LoginForm.ShowDialog();
if(LoginForm.ValidLogin == 1) {
InitializeComponent();
} else {
Application.Exit(); //FAIL
}
}
```
You can see that the first the program.cs file calls PROG1.cs which calls an instance of login.cs. If you insert a valid login the l... | [
0.09454715251922607,
-0.109706349670887,
0.8955402374267578,
-0.2695649564266205,
0.08041179180145264,
-0.11579520255327225,
0.309958815574646,
-0.17022472620010376,
-0.41224509477615356,
-0.8774808049201965,
-0.38812002539634705,
0.3129054307937622,
-0.5394471883773804,
0.4106193780899048... | |
it does not Initialize the form and will try to close the form. This will just leave me the uninitialized form instead of closing it out. If I do a this.close() instead it will give me a runtime error.
Any Ideas?
Put the InitializeComponent call back at the top where it used to be. An attempt to use uninitialized vari... | [
0.05897200480103493,
-0.03132208064198494,
0.36144691705703735,
-0.24453838169574738,
0.17476120591163635,
-0.2363431304693222,
0.510818600654602,
0.12869243323802948,
0.02355235256254673,
-0.7138837575912476,
-0.3876786231994629,
0.4269067645072937,
-0.3540721833705902,
0.1626474708318710... | |
close itself. | [
-0.113910011947155,
0.2069953829050064,
0.174236461520195,
-0.32910242676734924,
-0.5644013285636902,
-0.11072513461112976,
0.340879887342453,
0.2687866687774658,
0.007424003444612026,
-0.4500403106212616,
-0.14282971620559692,
0.19950087368488312,
-0.23853206634521484,
0.19217410683631897... | |
I'm propositioning NHibernate for a project we're doing at my company and I'd like to know if NHibernate can be optimized to only retrieve specific columns on a table when using the Criteria query language.
For example. Let's say I have a table with 30 columns on it and this is mapped to an object using NHibernate tha... | [
0.08083616942167282,
-0.05412386357784271,
0.2485242784023285,
0.1683647334575653,
-0.3578253388404846,
0.06731819361448288,
-0.15947102010250092,
-0.25007396936416626,
-0.15618062019348145,
-0.7780182361602783,
0.4485667645931244,
0.31624269485473633,
-0.47263509035110474,
0.1011132076382... | |
constructor for each combination of fields I'd like to selectively retrieve. This could be a huge pain from a maintenance standpoint since I won't catch missing constructors till runtime.
I like the Criteria query language since it produces parametrized SQL instead of straight SQL queries from HQL. I see there is an "... | [
0.33078163862228394,
0.1477554589509964,
-0.0043788752518594265,
-0.039766985923051834,
-0.3415614068508148,
-0.08682192862033844,
0.23163332045078278,
-0.4533924460411072,
-0.2779637277126312,
-0.571429967880249,
0.17539137601852417,
0.5481984615325928,
-0.4272975027561188,
0.082310691475... | |
.SetProjection(Projections
.ProjectionList()
.Add(Projections.Property("Id")))
.List();
```
I end up with the variable `list` just being ints, I'd prefer to have my full Task object but with all the fields set to their default values. Is this even possible? Everything... | [
0.29704970121383667,
-0.3199160397052765,
0.20794709026813507,
-0.122813381254673,
-0.04043835401535034,
-0.050621941685676575,
0.016178544610738754,
-0.40560492873191833,
-0.2459515780210495,
-0.45187845826148987,
-0.07794871926307678,
0.6631150245666504,
-0.6018542051315308,
-0.123564220... | |
projections. Simply project only the properties you wish to use and only those will be included in the select clause of the compiled query.
<http://nhibernate.info/doc/nh/en/index.html#querycriteria-projection>
**Update to edit**
There are several ways to accomplish this, with some limitations however. 1) The NHiber... | [
0.2985116243362427,
-0.36378854513168335,
0.688062310218811,
0.05813000723719597,
-0.08367159962654114,
0.0009232217562384903,
-0.3284585773944855,
-0.4070471227169037,
-0.17377030849456787,
-0.7755827903747559,
-0.042908791452646255,
0.7079220414161682,
-0.3037627935409546,
0.244946599006... | |
map those projections to an actual class. The limitation to this method is that any properties that you map must have a setter in the POCO class, this can be a protected setter but it must have a setter.
You can also do this with linq as well in an a slightly different fashion
```
var list = session.CreateCriteria(t... | [
-0.013234411366283894,
-0.5478762984275818,
0.4324447214603424,
0.08520182967185974,
0.238813579082489,
0.010093444027006626,
-0.3540622591972351,
-0.42075115442276,
-0.20966912806034088,
-1.0255461931228638,
0.013614215888082981,
0.5883662700653076,
-0.4240257740020752,
-0.117757804691791... | |
= (string) l[0], ID = (Guid) l[1]});
```
This is simply using linq to map the indexed list that is ouput into a new instance of the Task class. The same limitation as above applies except that this is a bit more severe in that all the properties mapped must have a public setter because that is what linq uses to do fi... | [
-0.017766088247299194,
-0.10310119390487671,
0.27326086163520813,
-0.13424313068389893,
0.11840473115444183,
-0.21283315122127533,
0.05851857736706734,
-0.11198935657739639,
-0.17695367336273193,
-0.7229070067405701,
0.061793696135282516,
0.742381751537323,
-0.2992726266384125,
0.089781589... | |
I have a mapping along the lines of this.
```
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2" namespace="Model.Entities" schema="etl" assembly="Model" default-lazy="false">
<class name="Model.Entities.DataField, Model" table="mdm_field">
<id name="FieldId" column="field_id" type="int">
<generator cla... | [
-0.066077321767807,
0.15096478164196014,
0.39394065737724304,
-0.27484625577926636,
-0.12461312115192413,
-0.04867471754550934,
0.03264349326491356,
-0.38642698526382446,
-0.09952748566865921,
-0.9332979917526245,
0.11094202101230621,
0.6022771596908569,
-0.1883072853088379,
0.368239343166... | |
configure the mapping to work with this situation so it will not die on this situation.
Ok, I found the answer. Add the
```
not-found="ignore"
```
attribute to the property `KeyField`:
```
<many-to-one name="KeyField" not-found="ignore" class="Model.Entities.Key, Model" column="field_id" />
``` | [
-0.09643925726413727,
0.00989131536334753,
0.3104192018508911,
0.08811057358980179,
0.21220943331718445,
-0.10984279960393906,
0.036873117089271545,
-0.2487914115190506,
-0.06683243066072464,
-0.5001169443130493,
-0.015986038371920586,
0.7267588973045349,
-0.23449698090553284,
0.1766836941... | |
Is there a difference between the terms Entity and Object?
Generally speaking, an *entity* is an abstract concept that's typically represented by a table in a database schema. The term *object* usually refers to in-memory data structures. An object that represents an entity may be called an *entity object* (often mappe... | [
-0.006153176538646221,
0.20660734176635742,
0.2664259374141693,
0.4165002107620239,
0.06856448203325272,
-0.1471521109342575,
-0.21721187233924866,
0.27310749888420105,
-0.360571950674057,
-0.595504105091095,
-0.33038565516471863,
0.13564705848693848,
-0.26579898595809937,
0.35842233896255... | |
For example, ther can be a *Customer* **entity type** that can map to a single *Customer* database table or it may also extend to a *CustomerPreferences* table as well. Using the EntityProvider, you can access entites, as if they were just rows in database tables, using eSQL. The EDM model is also known as the *concept... | [
-0.01506809238344431,
-0.16120564937591553,
0.7122330665588379,
0.4862559139728546,
-0.28347504138946533,
-0.09352527558803558,
-0.26653704047203064,
-0.0370732918381691,
-0.2498757690191269,
-0.7298389673233032,
-0.21513202786445618,
0.4309704303741455,
0.019870923832058907,
0.31900328397... | |
I have approximately 30 variadic functions. Each one accepts a path as the final argument, e.g.:
```
bool do_foo(struct *f, int q, const char *fmt, ...)
```
In each function, I have to check that the expanded format is less then or equal to a certain size. So, I find myself copy / pasting the same chunk of code to c... | [
0.017827089875936508,
0.20052410662174225,
0.4930771589279175,
-0.3253284692764282,
-0.16589075326919556,
0.40024998784065247,
0.37533038854599,
-0.5871375799179077,
0.1426502913236618,
-0.4757347106933594,
-0.054994408041238785,
0.8351912498474121,
-0.2530961334705353,
-0.0558806769549846... | |
size, or newly initialized string on failure, which could be checked against NULL. The checks also have to determine if the string is an absolute or relative path, which influences the safe size of the string. It's a lot of duplicate code and it's starting to smell.
Is there a way that I can pass the contents of the e... | [
0.32791322469711304,
-0.11446690559387207,
0.47400936484336853,
0.014295032247900963,
-0.14458397030830383,
0.1734652817249298,
0.3752889931201935,
-0.18997099995613098,
-0.12314002960920334,
-0.6113598942756653,
-0.09877278655767441,
0.725784957408905,
-0.3045474886894226,
0.1585020869970... | |
sure that nothing else existed. It seems to me the compiler understands where the variadic arguments begin, so I was just curious if I could tell it to pass them along.
You can't, you can only pass the arguments as a `va_list`. See the [comp.lang.c FAQ](http://c-faq.com/varargs/handoff.html).
In general, if you're wri... | [
-0.03410974517464638,
-0.18426282703876495,
0.35326439142227173,
-0.1342041790485382,
-0.25435224175453186,
0.3585064113140106,
0.19791924953460693,
-0.184561088681221,
-0.23553593456745148,
-0.30576759576797485,
-0.22875802218914032,
0.7572227120399475,
-0.3607022762298584,
0.087109424173... | |
return. There's no need for code duplication between the two versions of the function, since one calls the other. | [
-0.2969262897968292,
-0.18851517140865326,
0.15901590883731842,
-0.13253621757030487,
-0.22461555898189545,
-0.023018641397356987,
0.05670148879289627,
0.015130050480365753,
0.32414713501930237,
-0.3393651247024536,
-0.509094774723053,
0.7553681135177612,
-0.3679889142513275,
-0.2068241983... | |
I'm writing a module and want to have a unified exception hierarchy for the exceptions that it can raise (e.g. inheriting from a `FooError` abstract class for all the `foo` module's specific exceptions). This allows users of the module to catch those particular exceptions and handle them distinctly, if needed. But many... | [
0.5491710305213928,
0.2452581226825714,
0.11255953460931778,
-0.25059226155281067,
-0.07749626040458679,
-0.23289379477500916,
0.3902464807033539,
-0.187764510512352,
-0.25324827432632446,
-0.5143341422080994,
-0.1759612113237381,
0.3620184659957886,
-0.337769478559494,
-0.0942497178912162... | |
further up the propagation hierarchy by whatever catches the exception. But I don't want to lose the existing type, message, and stack trace; that's all useful information for someone trying to debug the problem. A top-level exception handler is no good, since I'm trying to decorate the exception before it makes its wa... | [
0.09914702922105789,
0.1763545572757721,
0.18424275517463684,
-0.09890657663345337,
-0.13040079176425934,
-0.30036160349845886,
0.6649646759033203,
-0.2179296761751175,
-0.19588197767734528,
-0.4511546790599823,
-0.16175192594528198,
0.6219862103462219,
-0.5539290308952332,
0.0967729389667... | |
type, nor modify the message.
Python's [PEP 3134](http://www.python.org/dev/peps/pep-3134/) “Exception Chaining and Embedded Tracebacks” discusses a change accepted in Python 3.0 for “chaining” exception objects, to indicate that a new exception was raised during the handling of an existing exception.
What I'm trying... | [
0.2952060401439667,
0.14108669757843018,
0.09784583002328873,
-0.35910335183143616,
-0.13581472635269165,
-0.42716100811958313,
0.39497703313827515,
-0.15122252702713013,
-0.22131195664405823,
-0.261445015668869,
-0.2688375413417816,
0.6844014525413513,
-0.6934473514556885,
-0.094984225928... | |
as exc:
raise ValueError("Bad grape") from exc
```
The caught exception (`exc`, a KeyError) thereby becomes part of (is the “cause of”) the new exception, a ValueError. The “cause” is available to whatever code catches the new exception.
By using this feature, the `__cause__` attribute is set. The built-in excep... | [
0.21765781939029694,
0.2053305059671402,
-0.02831404097378254,
-0.4283214807510376,
-0.02525133080780506,
-0.10297347605228424,
0.34126052260398865,
-0.23534570634365082,
-0.5734108090400696,
-0.1063067689538002,
-0.2094729244709015,
0.4826297163963318,
-0.305732786655426,
-0.0817106515169... | |
I really want to know, how to secure a firebird database from being opened by any user but from the application it self. If I distribute a desktop application with a single file Firebird database (not embedded), how to protect the database from being copied to another machine running Firebird with known sysdba password... | [
0.49285808205604553,
0.2743931710720062,
0.2199850231409073,
0.14573164284229279,
0.34064817428588867,
-0.37062978744506836,
0.13806670904159546,
-0.2025967538356781,
-0.30007052421569824,
-0.15065549314022064,
-0.05678428336977959,
0.5581484436988831,
-0.09421872347593307,
0.2741886377334... | |
I use other database like mySQL or PostgreSQL?
PS: I use Delphi 2006 to develop the GUI.
You are missing the point when thinking about the password to the Firebird database - the server is open source, so there's no way to do what you want. The user can simply recompile the server with password checking commented out... | [
0.31658464670181274,
0.3594479262828827,
0.17899824678897858,
-0.0218316949903965,
-0.12056680768728256,
0.022655166685581207,
0.1220581978559494,
-0.021039187908172607,
0.06702763587236404,
-0.7766354084014893,
0.15903982520103455,
0.5466341972351074,
-0.4525359272956848,
-0.1633305996656... | |
the standard server executables won't be able to access the data in the database.
* Write only encrypted data to the file, so that it doesn't matter that access to the database is possible.
Both are of course not fool-proof either, as a determined cracker can simply use your own application to get at the data. Having ... | [
0.3792169690132141,
0.2951876223087311,
0.03651762381196022,
0.24751588702201843,
0.1488693356513977,
-0.36750516295433044,
0.5159866213798523,
-0.15136270225048065,
-0.4215531647205353,
-0.24650810658931732,
-0.39042818546295166,
0.7214642763137817,
-0.18850360810756683,
0.073701925575733... | |
[this answer](https://stackoverflow.com/questions/536328/how-can-i-increase-memory-security-in-delphi/537826#537826), for more information on this topic.
BTW: this is something that can be done whatever database engine you choose, to answer the last part of your question. | [
0.24749380350112915,
0.11373497545719147,
0.22874140739440918,
0.10196203738451004,
0.172848641872406,
-0.3060166835784912,
0.08167459070682526,
-0.059553660452365875,
-0.3274557888507843,
-0.3403415381908417,
-0.26364865899086,
0.21383759379386902,
0.1927729845046997,
-0.03714126721024513... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.