text stringlengths 0 30.5k | title stringclasses 1
value | embeddings listlengths 768 768 |
|---|---|---|
I know this is a vague question, especially since I am not providing any code, but I am developing a .Net 2.0 application, and we have a WebRequest which posts data to an internally built API.
The strange thing happens on our 3rd (and always the 3rd) subsequent request which fails at the GetRequestStream() method of t... | [
0.40778854489326477,
-0.05537380278110504,
0.5323082804679871,
0.12548448145389557,
0.003104600589722395,
-0.5580801963806152,
0.378031849861145,
0.17449401319026947,
-0.3674975633621216,
-0.19977150857448578,
0.08044760674238205,
0.18123221397399902,
-0.30169251561164856,
0.48654928803443... | |
We've tried on several machines - all of which have the same problem. Has anyone ever had this problem before, or does anyone have any sugestions about how to debug (since the response object doesn't yeild anything, or at least nothing useful).
This usually happens if you're not disposing the WebResponse. There's a lim... | [
0.057349346578121185,
0.03221984952688217,
0.3676601052284241,
-0.018649965524673462,
0.16114415228366852,
-0.2818373739719391,
0.14661498367786407,
-0.07146197557449341,
-0.5175364017486572,
-0.7803769707679749,
0.00943602155894041,
0.4805244505405426,
-0.31951451301574707,
0.362796604633... | |
(and dispose it)
using (WebResponse response = request.GetResponse())
{
// Stuff with the response
}
``` | [
0.18842604756355286,
-0.18019594252109528,
0.40712183713912964,
0.03549859672784805,
0.23354090750217438,
-0.5203532576560974,
0.2194036990404129,
-0.3293190598487854,
-0.20502455532550812,
-0.5651815533638,
-0.6061038970947266,
0.38507676124572754,
-0.37897607684135437,
0.2878827750682831... | |
I have a web application running on port :80, and I have an Axis web service that is part of that web application. As such, the service is running on port :80 as well.
However, for security reasons our client has asked us to change the web service port to 8080 so that they can allow access only to that port for remote... | [
0.3908116817474365,
0.17444682121276855,
0.5945524573326111,
0.12423322349786758,
0.09903264045715332,
0.10525858402252197,
0.32706281542778015,
0.07719293981790543,
-0.15314602851867676,
-0.5812081694602966,
0.17574003338813782,
0.974001407623291,
-0.3123718202114105,
0.4767707288265228,
... | |
web app?
As I've said in my comment, our web application is hosted on Oracle AS 10g with an Oracle Web Cache server sitting in front of it. Oracle Web Cache is based on Apache httpd, so it has virtual host support and URL rewriting (although it is not present under these terms).
I've managed to solve the problem by:
... | [
0.5290078520774841,
0.25456681847572327,
0.5362449288368225,
0.005821222439408302,
-0.1290796399116516,
0.20772123336791992,
0.21635007858276367,
0.15272998809814453,
-0.1432330459356308,
-0.5995880365371704,
0.018992511555552483,
0.6181532144546509,
-0.4031914472579956,
0.2630442678928375... | |
listen on another port by itself. I guess it was unreasonable to expect from Axis to provide this functionality as it is only a servlet hosted in a servlet container, and it's container's job to provide the connector/transport layer.
Anyway... thanks for all who offered their help, I appreciate it. | [
0.5622746348381042,
-0.06926873326301575,
0.3800574839115143,
0.33158212900161743,
-0.25984063744544983,
0.026477472856640816,
0.06544646620750427,
0.33863723278045654,
-0.27567484974861145,
-0.38726651668548584,
0.26270586252212524,
0.6892383694648743,
-0.23356927931308746,
0.494017928838... | |
I've been given the task of optimizing HTML emails for different email/webmail clients. I used to test the HTML file by doing a trick in Outlook Express, to make it send the raw HTML, but Microsoft seems to have stopped supplying Outlook Express now (I think "Live Mail" is supposed to replace it).
So my question is, i... | [
0.5482121706008911,
0.09201835840940475,
0.1919933259487152,
-0.11597458273172379,
0.0003062282921746373,
0.1613541543483734,
0.16919957101345062,
0.1288481205701828,
-0.11460226774215698,
-0.5541059970855713,
0.30311349034309387,
0.38350164890289307,
-0.21650105714797974,
-0.2695954144001... | |
I need to iterate through the fields on a table and do something if its value does not equal its default value.
I'm in a trigger and so I know the table name. I then loop through each of
the fields using this loop:
```
select @field = 0, @maxfield = max(ORDINAL_POSITION) from
INFORMATION_SCHEMA.COLUMNS where TABLE_NA... | [
0.1719827651977539,
0.0056068445555865765,
0.5455641746520996,
-0.0122027937322855,
0.31214743852615356,
-0.05404506251215935,
0.29632341861724854,
-0.6531607508659363,
-0.17778818309307098,
-0.5631023645401001,
-0.025808103382587433,
0.6266241073608398,
-0.18097124993801117,
0.08281364291... | |
I need but I can't see how to then compare the 2. Because
I don't have the field name as a constant, only in a variable, I can't see
how to get the value out of the 'inserted' table (remember I'm in a trigger)
in order to see if it is the same as the default value (held now in
@ColDefault as a varchar).
Seems to work n... | [
0.389750212430954,
0.021806256845593452,
0.19146625697612762,
-0.08888532966375351,
-0.3171582818031311,
0.038065265864133835,
0.3101183772087097,
0.05460311844944954,
-0.07648416608572006,
-0.6438086628913879,
0.23084625601768494,
0.5654860734939575,
-0.31439730525016785,
0.18811433017253... | |
all the dependencies in the plugin.xml wizard. Now all the Lucene plugins are visible.
* Selected version 1.4.xx and changed the properties to set a max version up to 1.5
* Added the other plugin dependencies
* Changed build path: removed old jar, added plugin dependency Lucene 1.4.3
* Recalculated Run configuration. T... | [
0.23388172686100006,
-0.14988133311271667,
0.8667795062065125,
-0.12285255640745163,
-0.21156154572963715,
-0.09008113294839859,
0.2975558936595917,
0.19969920814037323,
0.0811367854475975,
-0.9268247485160828,
-0.19717417657375336,
0.789365291595459,
-0.20251867175102234,
0.07683291286230... | |
I feel like I'm running around in circles. I can't seem to make up my mind as to what the right repository pattern is using [LINQ to SQL](http://en.wikipedia.org/wiki/Language_Integrated_Query#LINQ_to_SQL). If you're familiar with [Rob Conery's](http://blog.wekeroad.com/) [MVC Storefront](http://www.codeplex.com/mvcsam... | [
0.38357990980148315,
0.024528315290808678,
0.3209854066371918,
-0.03499618545174599,
-0.03598082438111305,
-0.1576661616563797,
-0.010723401792347431,
-0.33549967408180237,
-0.37114280462265015,
-0.14717978239059448,
-0.22391195595264435,
0.5657146573066711,
-0.3969697058200836,
0.35184529... | |
string Name {get;set;}
public IList<Address> Addresses {get;set;}
}
}
//Linq-Generated Class - severly abbreviated
namespace SqlRepository
{
public class Customer
{
public int Id {get;set;}
public string Name {get;set;}
public EntitySet<Address> {get;set;}
}
}
//Cus... | [
0.02077736146748066,
-0.07050790637731552,
0.3558020293712616,
-0.03539304435253143,
-0.28899529576301575,
0.19366270303726196,
0.0974283367395401,
-0.3839257061481476,
0.11521107703447342,
-0.4460133910179138,
-0.3014260232448578,
0.3417353630065918,
-0.4248301684856415,
0.488836765289306... | |
is the Linq-To-Sql datacontext
public IQueryable GetCusomters()
{
return
from c in _db.Customers
select new Customer // This is the wrapper class not the gen'd one
{ | [
-0.1725555956363678,
-0.19724445044994354,
0.5628238320350647,
0.27324703335762024,
0.06613314151763916,
0.011842156760394573,
-0.09610358625650406,
-0.07323615252971649,
0.22801190614700317,
-0.21819165349006653,
-0.11027418076992035,
0.6427038311958313,
-0.39362436532974243,
0.2620938718... | |
Id = c.Id,
Name = c.Name,
Addresses = new LazyList(c.Addresses)
};
}
```
What is the advantage of doing it this way (using a wrapper class), as opposed to | [
0.21096321940422058,
-0.1695028394460678,
-0.048806678503751755,
-0.06411945819854736,
0.1244342178106308,
-0.413391649723053,
-0.0903235375881195,
-0.2827149033546448,
-0.10729164630174637,
-0.40852275490760803,
-0.21824878454208374,
0.6798070073127747,
-0.29945898056030273,
0.12967845797... | |
the way Mike Hadlow suggests in *[Using the IRepository pattern with LINQ to SQL](http://mikehadlow.blogspot.com/2008/03/using-irepository-pattern-with-linq-to.html)* in his version of IRepository<T> where he just returns the DTO objects from the repository?
Where should the business logic be enforced and checked? Is ... | [
0.06748379021883011,
-0.028232434764504433,
0.11842001974582672,
0.1750563234090805,
-0.21452827751636505,
-0.35855892300605774,
-0.051687102764844894,
-0.25670507550239563,
-0.15194784104824066,
-0.35476651787757874,
-0.03790036961436272,
0.4405440092086792,
-0.46401312947273254,
0.111426... | |
whatnot, but where it shines is as a [DAL](http://en.wikipedia.org/wiki/Data_access_layer).
The idea behind an ORM is this. You have your SQL database, and your domain objects. To design a database properly, you are going to do things (like normalization) that logically don't translate into a properly designed object ... | [
0.5922703146934509,
-0.19019709527492523,
0.16392382979393005,
0.4015355706214905,
-0.009025723673403263,
-0.3469434380531311,
-0.04246358945965767,
-0.22919729351997375,
-0.03955608978867531,
-0.36699873208999634,
-0.012568974867463112,
0.4590838849544525,
-0.2276272475719452,
0.193138569... | |
of your application. When your application needs a Customer object, it shouldn't have to know whether it is coming from SQL Server, MySQL, an XML file, or ASP.NET Membership. Once you have that de-coupling, any changes you make to your persistence story have no effect on the rest of your application.
With that in mind... | [
0.32716527581214905,
0.08986293524503708,
0.5827818512916565,
0.33141592144966125,
0.28999391198158264,
0.00744179543107748,
-0.22448788583278656,
-0.15898817777633667,
-0.30423569679260254,
-0.05661522224545479,
-0.28728070855140686,
0.2549600303173065,
-0.417043000459671,
0.3134335279464... | |
refactor his domain model without worrying about his persistence story, and he can refactor his database without worrying about rippling effects through his application. He could also start coding on business logic before deciding on questions like what ORM to use, or even where to store his data.
If he were to use a ... | [
0.04262031242251396,
0.07069108635187149,
0.35861778259277344,
0.31623658537864685,
-0.19454316794872284,
-0.2167120724916458,
-0.005975715350359678,
-0.2587122321128845,
-0.01187220960855484,
-0.5788733959197998,
-0.014105343259871006,
0.3579573631286621,
-0.19723954796791077,
0.138959884... | |
is also a good illustration of why the additional complexity of NHibernate can be important. He could have saved himself a lot of code by going with something built to handle that sort of scenario, rather than doing it all manually. | [
0.20402391254901886,
0.15354959666728973,
-0.44533807039260864,
0.08837317675352097,
0.0951077789068222,
-0.13761858642101288,
0.2391759306192398,
-0.39629611372947693,
-0.1743389070034027,
-0.3852703273296356,
0.13247475028038025,
0.646980881690979,
-0.549837589263916,
0.19712570309638977... | |
Apologies if I get the terminology wrong. How do I define a constraint in MSSQL Server 2005 to enforce uniqueness in one column depending on another column?
E.g. considering the last two columns:
```
1 A 1
2 A 2
3 A 2 <- Disallow because '2' has already appeared alongside 'A'
4 B 1
5 B 2... | [
-0.4905416965484619,
0.2624317407608032,
0.2835652530193329,
-0.1478688269853592,
-0.44575339555740356,
-0.0897408127784729,
0.41514885425567627,
-0.20414678752422333,
-0.47417593002319336,
-0.2592902183532715,
-0.010155083611607552,
0.35880014300346375,
-0.3135818541049957,
-0.04817706346... | |
UNIQUE (field1, field2)
)
``` | [
-0.33372166752815247,
0.09557096660137177,
-0.05666757747530937,
-0.16050733625888824,
-0.21196112036705017,
-0.28444984555244446,
-0.1879006028175354,
-0.21513530611991882,
-0.10742983222007751,
-0.42856505513191223,
-0.5226221084594727,
0.3706718683242798,
-0.4688911437988281,
0.15897652... | |
When user the "Implement Inteface X" context menu feature, the inserted code gets surrounded by a
```
#region [interfacename] Members
#endregion
```
pair. I always end up deleting this, is there a way I can permanently turn it off? I had a quick search through the snippets directory, but wasn't sure if this was the... | [
0.16466207802295685,
-0.10032418370246887,
0.5894607305526733,
-0.09238393604755402,
0.03441968560218811,
-0.24660038948059082,
0.24013648927211761,
0.4011988043785095,
-0.16396041214466095,
-0.8772128820419312,
-0.2008533626794815,
0.3398094177246094,
-0.33476242423057556,
0.5564064979553... | |
option-window, you select 'Text Editor', then the language of your choice (C# for ex).
Then, you select 'Advanced', and then, you have a checkbox which says:
'Surround generated code with #region' | [
-0.11171945929527283,
-0.3193938434123993,
0.5419762134552002,
0.215589240193367,
0.18041661381721497,
-0.10566610097885132,
-0.054970476776361465,
0.2562662661075592,
0.1373879313468933,
-0.5690466165542603,
-0.7731821537017822,
0.5949551463127136,
-0.08553517609834671,
-0.065770193934440... | |
Is it possible to store the results of a call to exec sp\_executesql in a 'table parameter'. The parameter value is used in another SQL Stored procedure (SQL 2000/2005)
Best you can do is insert the values into a temp table (using an INSERT EXEC pattern) and then use that temp table in the second proc down the chain ..... | [
0.14734342694282532,
-0.10727738589048386,
0.3484831154346466,
-0.07828227430582047,
-0.17818474769592285,
-0.04271864518523216,
-0.020206891000270844,
-0.34090253710746765,
-0.2562764286994934,
-0.11922004073858261,
0.19852153956890106,
0.3137514889240265,
-0.3985321819782257,
-0.37189152... | |
I have some questions about partitioning and strategy, how and when to use it. As I understood from [Partitioned Tables and Indexes in SQL Server 2005](http://msdn.microsoft.com/en-us/library/ms345146.aspx#sql2k5parti_topic1), partitioning is not used only for manageability but also to improve performance on very large... | [
0.0037017050199210644,
0.060660816729068756,
0.1557200700044632,
0.3666648864746094,
0.14062270522117615,
-0.1845540702342987,
-0.18164852261543274,
-0.06742163002490997,
-0.6774170398712158,
-0.6896005868911743,
0.09881038963794708,
0.16147278249263763,
0.10993310064077377,
0.603324830532... | |
of performance.
My idea was: I create partition on this VLDB by month for current year. Then I would create clustered index on date field of table and partition scheme. I don’t know if I understand it correctly, but what I except is, that index will be created per partition separately.
Generally how my code looks like... | [
-0.07403087615966797,
-0.06212690845131874,
0.6468992233276367,
-0.008571862243115902,
0.09402501583099365,
0.034637484699487686,
0.14010639488697052,
-0.15848611295223236,
-0.09771216660737991,
-0.5143488049507141,
-0.04518459737300873,
0.21643151342868805,
0.3235006630420685,
0.414727360... | |
2008-01-30 23:59:59.997
*/
CREATE PARTITION FUNCTION PartitionMonthlyCurrentYear(DATETIME) AS
RANGE LEFT FOR VALUES
(
DATEADD(ms, -2, DATEADD(month,((DATEPART(YEAR, GetDate())-1901)*12)+1-1,31-1)),
DATEADD(ms, -2, DATEADD(month,((DATEPART(YEAR, GetDate())-1900)*12)+1-1,31-1)),
DATEADD(ms, -2, DATEADD(month,... | [
-0.5919169187545776,
0.05937908589839935,
0.622671902179718,
-0.06491415947675705,
0.013981991447508335,
0.6781781911849976,
0.43848007917404175,
-0.27809572219848633,
-0.032297637313604355,
-0.492664098739624,
-0.23333923518657684,
0.27604347467422485,
0.01985607109963894,
0.5412485003471... | |
scheme on the primary file group. I'm aware about performance issues of this.
*/
CREATE PARTITION SCHEME SchemeMonthlyCurrentYear
AS PARTITION PartitionMonthlyCurrentYear
ALL TO ([PRIMARY]);
/*
Create clustered index on table and scheme
*/
CREATE CLUSTERED INDEX [IX_Log_Seiten_archive_Datum] ON [dbo].[Log_Seiten_arch... | [
0.09610836207866669,
-0.09063149243593216,
0.41263797879219055,
-0.22013963758945465,
-0.1134277805685997,
-0.09108532220125198,
0.022471055388450623,
-0.5846503376960754,
-0.0807231217622757,
-1.0518009662628174,
-0.11952809244394302,
0.5701358914375305,
-0.3044203817844391,
0.22458834946... | |
I do this for existing table? For example I want change year on function I showed before.
Regards
Anton Kalcik
1. You can't create SQL Server partition functions with non-deterministic functions like getdate(). If you populated your database with data spanning 10 years, and then simply stopped and watched the SQL Serv... | [
0.28486916422843933,
0.02318136766552925,
0.03696262836456299,
-0.15512730181217194,
0.05189311504364014,
0.07051810622215271,
0.24580331146717072,
-0.23183664679527283,
-0.49355021119117737,
-0.4564143717288971,
0.14438088238239288,
-0.0318206362426281,
-0.441998690366745,
0.5931714773178... | |
again unless you want to manually move it.
2. To remove partitioning on a table, apply a new clustered index that doesn't use a partition scheme. The data will be moved. (Be aware that it'll take a long time depending on the size of your data and the speed of your disks - for a multi-terabyte data warehouse, we're prob... | [
-0.14509667456150055,
-0.28471964597702026,
0.34141361713409424,
0.14283595979213715,
0.01609501801431179,
-0.2625214457511902,
0.08822181075811386,
-0.20195697247982025,
-0.6548229455947876,
-0.8411535620689392,
-0.24287335574626923,
0.4255642294883728,
-0.3484008014202118,
0.038998793810... | |
partitioning probably isn't the answer you're looking for.
Partitioning is an awesome solution to >100 million row databases with separate sets of drive arrays, but it sounds like you're just putting everything on the same set of drives, same filegroup. You're not going to see a big performance increase there.
Also, ... | [
0.1631014198064804,
-0.03145502507686615,
0.3361548185348511,
0.5607253909111023,
0.014722969383001328,
-0.3869946002960205,
-0.1351199448108673,
0.1821068525314331,
-0.3821539878845215,
-0.8665825724601746,
0.019363271072506905,
0.39209434390068054,
-0.235279843211174,
0.31729280948638916... | |
I'm trying to load the default HICON that explorer displays for:
* An open folder
* An exe that has no embedded default icon of its own. This can also be seen in 'Add/Remove Programs' or 'Programs and Features' as it's called on Vista.
Do you know where these can be found? I think the folder icon might be in the res... | [
0.21082040667533875,
-0.0399906188249588,
0.35392698645591736,
0.06571579724550247,
-0.2304796278476715,
-0.1257830262184143,
0.10868821293115616,
0.11970967054367065,
-0.19003652036190033,
-0.7961432933807373,
0.13290348649024963,
0.6127683520317078,
-0.39715155959129333,
0.30051845312118... | |
2008
---
Thanks for the help so far. I'm on Vista and have looked through Shell32.dll. I don't see an icon in there that looks the same as the default one displayed by an application in explorer. I could be missing it - there are 278 icons to look through - is it definitely in there, or is there some other location I... | [
-0.42850470542907715,
0.07352779060602188,
0.4600762724876404,
0.020858919247984886,
-0.33897390961647034,
-0.21511833369731903,
0.512965977191925,
-0.051588788628578186,
-0.07544588297605515,
-0.45773276686668396,
-0.024332351982593536,
0.8434929847717285,
-0.15548940002918243,
0.12799325... | |
Windows has a lot more icons in the "moricons.dll", but I think the file and folder icons should all be in the shell32.dll. Remind, that icons in Vista have different resolutions, up to 256x256, so the icon you are looking at a resolution 32x32 might look different then the full resolution version of the same icon. | [
-0.16043710708618164,
0.04568301513791084,
0.4420676529407501,
0.022354744374752045,
-0.05939783528447151,
-0.1790301352739334,
0.3192078769207001,
0.0298015046864748,
-0.31692907214164734,
-0.6989554166793823,
0.0005052659544162452,
0.8590616583824158,
-0.019785381853580475,
0.20815810561... | |
I'm trying to create some basic logging for unhandled exceptions in my ASP.NET MVC application, but as I'm using IIS6 all requests come through .NET. Now while I agree that missing images are an important thing to flag, they aren't show-stoppers and so I'd like to set the event priority to high for 404s unless they are... | [
-0.07869541645050049,
-0.05301375687122345,
0.5738270282745361,
-0.048764556646347046,
-0.2321551889181137,
-0.3385636508464813,
0.4461546242237091,
0.1181575208902359,
-0.721243679523468,
-0.5675204396247864,
-0.3117579221725464,
0.5935593247413635,
-0.22344207763671875,
0.054776009172201... | |
a way to tell what the `StatusCode` is *going* to be?
You can get it via `Context.Server.GetLastError()`:
```
if ((Context.Server.GetLastError() is HttpException) && ((Context.Server.GetLastError() as HttpException).GetHttpCode() == 404))
{
// do something
}
``` | [
0.33322402834892273,
-0.3413601219654083,
0.5250880122184753,
0.19849355518817902,
0.4257265031337738,
-0.08824757486581802,
0.2856970429420471,
0.15346340835094452,
-0.12988042831420898,
-0.8088500499725342,
-0.3245013952255249,
0.4386173188686371,
0.01616034284234047,
0.06111336126923561... | |
I have a checkbox column on my gridview in a Windows Application. I want an event as soon as somebody clicks on the checkbox.
How do I do this?
"equivalent code" is tricky... for example, under the bonnet and out of sight, code might use things like `Reflection.Emit` / `DynamicMethod` / `Delegate.CreateDelegate` to g... | [
0.5139970779418945,
0.06915740668773651,
0.2194739133119583,
0.059917133301496506,
-0.35910850763320923,
-0.35911640524864197,
0.10544691979885101,
0.086680106818676,
-0.26307961344718933,
-0.6879076957702637,
-0.08146443963050842,
0.4636964797973633,
-0.31504663825035095,
0.21038115024566... | |
difference between x86 and x64 (different optimizations and costs). So I'm afraid it boils down to specific tests on specific areas. A broad brush "is 20% faster" won't necessarily apply to the CPU-intensive part of your code. | [
0.3166618347167969,
0.1387077122926712,
0.22651900351047516,
0.3627175986766815,
0.04782160744071007,
-0.04521584138274193,
0.2290600687265396,
-0.050419874489307404,
0.022899340838193893,
-0.6999704241752625,
0.25225967168807983,
0.4604767858982086,
0.30426225066185,
-0.14664426445960999,... | |
From what I understand about Adobe AIR, you can use Javascript/HTML to develop desktop applications.
Does WPF also allow the use of Javascript/JQuery to build controls? Or is Microsoft's solution for interactivity here solely XAML?
WPF is solely a desktop technology. even when writing an xbap in wpf the browser is jus... | [
0.31835660338401794,
0.2235346883535385,
0.3672727346420288,
0.12876147031784058,
-0.2894446849822998,
-0.3543754518032074,
-0.16170868277549744,
-0.2433827817440033,
-0.07942710071802139,
-0.4690452814102173,
-0.04098401963710785,
0.25078409910202026,
-0.5520630478858948,
-0.1498811990022... | |
I have this function...
```
private string dateConvert(string datDate)
{
System.Globalization.CultureInfo cultEnGb = new System.Globalization.CultureInfo("en-GB");
System.Globalization.CultureInfo cultEnUs = new System.Globalization.CultureInfo("en-US");
DateTime dtGb = Convert.ToDateTime(datD... | [
0.08746469765901566,
-0.17918208241462708,
1.061468243598938,
-0.1234094575047493,
-0.005098808091133833,
0.04740715026855469,
0.17108125984668732,
0.059166401624679565,
0.022255346179008484,
-0.6200339794158936,
0.2381531298160553,
0.24766407907009125,
-0.053247202187776566,
0.54482495784... | |
Used a slightly modified version of the answer below (i.e. one that would render).
```
Convert.ToDateTime(datDate).ToString("MM-dd-yyyy");
```
```
return dateTimeValue.ToString("MM-dd-yyyy");
``` | [
0.049987275153398514,
-0.194259911775589,
0.5931507349014282,
-0.2579977810382843,
0.11406824737787247,
0.37338244915008545,
0.2535809278488159,
-0.193316251039505,
0.0010084331734105945,
-0.49565404653549194,
-0.4503761827945709,
0.49347761273384094,
-0.16075348854064941,
0.21263226866722... | |
Inspired by Eric Sink's interview on the stackoverflow podcast I would like to build a full compiler in my spare time for the learning experience. My initial thought was to build a C compiler but I'm not sure whether it would take too much time.
I am wondering if there is a smaller general purpose language that would ... | [
0.5066918134689331,
0.29015272855758667,
0.0016139145009219646,
0.028677135705947876,
0.19266746938228607,
-0.08146427571773529,
0.12009990215301514,
0.10910513997077942,
0.0150798624381423,
-0.4998053312301636,
0.0345773845911026,
0.41512271761894226,
-0.32361650466918945,
-0.028766414150... | |
will outweigh the difficulty of writing a compiler for it, typically. | [
-0.10031718015670776,
0.4901885986328125,
-0.03982173278927803,
0.297844797372818,
0.04563246667385101,
0.06673293560743332,
0.2537897825241089,
-0.19842447340488434,
0.4044332802295685,
-0.6378175616264343,
-0.4381609857082367,
0.6928843259811401,
0.06348578631877899,
-0.5249436497688293,... | |
How to implement a panel that would support line wrapping and line breaking?
I would only add textual labels and line breaks to this panel.
The labels should flow from left to right, wrapping to the next "line" if
needed. The line breaks would cause a jump to the next line.
I would also like to make the panel verticall... | [
0.014541731216013432,
-0.2714862525463104,
0.5824172496795654,
-0.09297557175159454,
-0.24358658492565155,
-0.13048087060451508,
0.22658611834049225,
-0.3032195568084717,
-0.15929795801639557,
-0.7931308746337891,
-0.0672082006931305,
0.4620891213417053,
-0.365808367729187,
-0.296152502298... | |
does what I need.
Thanks for your help though. :) | [
0.4310450553894043,
0.04217616841197014,
0.46664491295814514,
0.29640960693359375,
0.3933345079421997,
0.1612553745508194,
0.2466040998697281,
0.3384016454219818,
0.2598017454147339,
-0.26349973678588867,
0.12226784974336624,
0.43410614132881165,
0.009202439337968826,
-0.3007320761680603,
... | |
I have long been of the opinion that the time and resources it would take to write a piece of malicious software, of whatever type, could better be spent on other things. However, as a developer I am constantly worried about the possible security flaws in systems I work on.
Of course I know about validating input, I u... | [
0.7562079429626465,
0.7437281012535095,
-0.2513028681278229,
-0.13359099626541138,
0.0032657466363161802,
-0.15920652449131012,
0.3149283528327942,
0.24721185863018036,
-0.06138348951935768,
-0.46999797224998474,
0.03165332227945328,
0.6667680144309998,
0.08834290504455566,
0.1319171339273... | |
missing the point, maybe because most of my knowledge could well be classed as "new-fangled" (C#, MSSQL, PHP, some Python, a smattering of Ruby): the oldest language I know is Classic ASP.
Sometimes when I read about things like Cross Site Scripting and URL hijacking I read the articles upon which they are based but I... | [
0.28992533683776855,
0.4094645082950592,
-0.02592112310230732,
0.2951204180717468,
0.05408575385808945,
-0.4041330814361572,
0.15391679108142853,
0.6087680459022522,
-0.29658323526382446,
-0.5251746773719788,
0.06814785301685333,
0.38423410058021545,
-0.06248768791556358,
0.082821726799011... | |
could I go to learn more?
<http://www.owasp.org/> | [
0.4485171437263489,
0.013261769898235798,
0.03263210132718086,
0.20131324231624603,
0.11776155233383179,
-0.14266076683998108,
0.2945418953895569,
0.35923799872398376,
-0.1604502946138382,
-0.48002833127975464,
0.3812522292137146,
0.1770787239074707,
0.5242859721183777,
0.16153989732265472... | |
I am currently logging an AJAX application with messages which include the times of certain interactions. So I have a couple of places where the code follows a pattern such as this:
```
var startTime = new Date();
this.doFunction();
var endTime = new Date();
logger.log("doFunction took " + (endTime - startTime) + " m... | [
0.14995615184307098,
-0.3222699463367462,
0.4912024736404419,
-0.14724865555763245,
0.2171146273612976,
-0.02508680149912834,
0.33278754353523254,
-0.004439850803464651,
-0.12336333096027374,
-0.7694771885871887,
-0.033055391162633896,
0.43870583176612854,
-0.3357895314693451,
0.1587264835... | |
logger.log(toTime + " took " + (endTime - startTime) + " milliseconds.");
}
```
(Syntax may be wrong, I'm not too familiar with JavaScript)
So that then instead of doing the timing I would just do:
```
time(this.doFunction);
```
My question is, do different browsers have different behaviour when it comes to `ev... | [
0.2706645429134369,
-0.32396236062049866,
0.11827397346496582,
-0.09383299946784973,
-0.18248166143894196,
-0.188615620136261,
0.408691942691803,
-0.18852441012859344,
-0.2241724729537964,
-0.5966614484786987,
0.133055180311203,
0.4925074279308319,
-0.5057995319366455,
0.047656286507844925... | |
to look into the javascript [arguments](http://www.seifi.org/javascript/javascript-arguments.html) object and the javascript "[call](http://docstore.mik.ua/orelly/webprog/jscript/ch07_05.htm)" and "apply" methods to transparently forward the arguments passed to your outer "time" function to the inner "toTime" function. | [
0.1279589682817459,
-0.05576113611459732,
0.26544228196144104,
0.07109163701534271,
0.28644701838493347,
0.23569951951503754,
0.10792230069637299,
-0.38833335041999817,
-0.02632848173379898,
-0.5717108249664307,
-0.14999303221702576,
0.5228636860847473,
-0.0243001077324152,
-0.025607572868... | |
Is the following stored procedure code robust for multi-user application. It is working fine. I was wondering if there is any better way to do it and if there is any performance issues.
The proc has three sql statements together like 1.Updating hardware status in Allocation Table 2. Calculating Next appropriate Primar... | [
0.04184376448392868,
-0.05307108536362648,
0.7950486540794373,
0.04197876155376434,
0.2084975242614746,
0.16743947565555573,
0.0246259905397892,
-0.5011194348335266,
-0.3030703365802765,
-0.4789290130138397,
0.040350012481212616,
0.5460730195045471,
-0.3359481692314148,
0.09743383526802063... | |
@got_defect_date datetime,
@trans_status tinyint OUTPUT --Used to check transaction status
)
AS
/* Transaction Maintainer Statements */
BEGIN TRAN transac1
SET XACT_ABORT ON
SET TRANSACTION ISOLATION LEVEL SERIALIZABLE
/* Declaration Area */
DECLARE @temp nvarchar(10)
DECLARE @def_ID ... | [
0.1717774122953415,
-0.14221322536468506,
0.8188053369522095,
0.05317151919007301,
0.12233351171016693,
-0.027130600064992905,
0.269737184047699,
-0.3428812026977539,
-0.44796574115753174,
-0.4262848198413849,
-0.19842223823070526,
0.6515716910362244,
-0.07558894157409668,
0.46643882989883... | |
for the DEFECT_LOG Table */
-- Returns the largest number or 1 if no records are present in the table
SELECT @temp=COALESCE(CONVERT(int,SUBSTRING(MAX(DEFECT_ID),5,5))+1,1) FROM DEFECT_LOG
SET @def_ID = 'DEF_'+ RIGHT(replicate('0',5)+ convert(varchar(5),@temp),5)
/* Insert statement for inserting data in... | [
0.28672170639038086,
-0.24449416995048523,
0.4896606504917145,
0.21180452406406403,
0.19919253885746002,
0.23035556077957153,
0.34682610630989075,
-0.5035153031349182,
-0.22411702573299408,
-0.5008671879768372,
-0.004265523981302977,
0.6381180286407471,
-0.33164024353027344,
0.285851657390... | |
blocking and decrease throughput.
You seem to be using it in order to guarantee a unique DEFECT\_ID? Why not use an IDENTITY column for DEFECT\_ID instead? | [
0.3850087523460388,
0.06996162980794907,
-0.1757134199142456,
0.24504803121089935,
-0.040872640907764435,
-0.16220282018184662,
0.2635597288608551,
-0.052489206194877625,
-0.18121770024299622,
-0.5695110559463501,
0.07257800549268723,
0.3414829969406128,
-0.5138942003250122,
0.228807196021... | |
We (my company) is trying to develop a solution (application) for document management.
We have considered using MS Sharepoint Server 2007 or Sharepoint Services, but we need recommendation or suggestion for this.
We are planning to use windows workflow fundation for various tasks like(task assignment, document approva... | [
0.8666942119598389,
0.38340815901756287,
0.7200444936752319,
0.0983399897813797,
0.35674482583999634,
-0.14927811920642853,
0.17384211719036102,
-0.6964151859283447,
0.017926180735230446,
-0.437704861164093,
-0.15354886651039124,
0.17949171364307404,
0.16160956025123596,
0.2890579104423523... | |
is. The user can anytime logs on to the web portal and see the state of his request and if required to enter some different information.
I believe Windows Sharepoint Services (WSS) 3.0 can deliver all that you need.
You can use the Windows Workflow Foundation like you plan to do, and document-libraries deliver documen... | [
0.1278676837682724,
-0.0734032616019249,
0.5213273763656616,
0.05978669226169586,
0.09158548712730408,
-0.38711950182914734,
0.04532943665981293,
-0.031111808493733406,
-0.005127620417624712,
-0.6721681356430054,
-0.2473863959312439,
0.5557177662849426,
0.019663337618112564,
0.079060174524... | |
when you use SharePoint; see [White paper: Good, better, best: Office and SharePoint Products and Technologies](http://technet.microsoft.com/en-us/library/cc263391.aspx)
More details here: [What is Microsoft Sharepoint?](https://stackoverflow.com/questions/89101/what-is-microsoft-sharepoint) | [
0.43909889459609985,
0.06691817194223404,
0.15997692942619324,
0.20570294559001923,
0.1268840879201889,
-0.31654971837997437,
-0.10959737747907639,
0.36529067158699036,
-0.07188938558101654,
-0.38227391242980957,
-0.16509026288986206,
0.3316008746623993,
-0.014842675998806953,
0.0002442548... | |
I have created an application that runs in the taskbar. When a user clicks the application it pops up etc. What I would like is similar functionality to that in MSN when one of my friends logs in. Apparently this is know as a toast popup?
I basically want something to popup from every 20 minutes toast style fom the app... | [
0.5025270581245422,
0.26629000902175903,
0.36948955059051514,
-0.15561790764331818,
-0.18957257270812988,
-0.4755479395389557,
0.2727813124656677,
0.3317714333534241,
-0.18566858768463135,
-1.0688978433609009,
0.0022601482924073935,
0.5829347968101501,
0.008374094031751156,
0.1959362179040... | |
partial class Form1 : Form
{
private Timer timer;
private int startPosX;
private int startPosY;
public Form1()
{
InitializeComponent();
// We want our window to be the top most
TopMost = true;
// Pop doesn't need to be shown in task bar
ShowInTaskbar = false; | [
-0.028824735432863235,
-0.3709932267665863,
0.4949404001235962,
-0.18382473289966583,
0.23050473630428314,
0.0759565606713295,
0.42459994554519653,
-0.15028218924999237,
-0.007999161258339882,
-0.5238532423973083,
-0.6895385384559631,
0.2950794994831085,
-0.20100054144859314,
-0.0594151206... | |
// Create and run timer for animation
timer = new Timer();
timer.Interval = 50;
timer.Tick += timer_Tick;
}
protected override void OnLoad(EventArgs e)
{
// Move window out of screen
startPosX = Screen.PrimaryScreen.WorkingArea.Width - Width;
startPosY = Scre... | [
-0.12842640280723572,
-0.30349695682525635,
0.5850405097007751,
-0.26425105333328247,
0.45974984765052795,
0.1602521538734436,
0.18448564410209656,
-0.2793653607368469,
-0.16023245453834534,
-0.6320177316665649,
-0.5679856538772583,
0.48108330368995667,
-0.17627836763858795,
0.097035191953... | |
base.OnLoad(e);
// Begin animation
timer.Start();
}
void timer_Tick(object sender, EventArgs e)
{
//Lift window by 5 pixels
startPosY -= 5;
//If window is fully visible stop the timer
if (startPosY < Screen.PrimaryScreen.WorkingArea.Height - Height) | [
0.1755962371826172,
-0.16806551814079285,
0.8238996863365173,
-0.28389066457748413,
0.06341427564620972,
0.23662622272968292,
0.28080880641937256,
-0.24406035244464874,
-0.4799345135688782,
-0.55731201171875,
-0.3305823504924774,
0.252664715051651,
-0.16915865242481232,
0.09984200447797775... | |
timer.Stop();
else
SetDesktopLocation(startPosX, startPosY);
}
}
``` | [
0.31588155031204224,
-0.1448346972465515,
0.19664686918258667,
-0.3027021288871765,
0.49240440130233765,
-0.17241929471492767,
0.18008337914943695,
-0.2257532924413681,
-0.20362842082977295,
-0.36632460355758667,
-0.23336564004421234,
0.7630071043968201,
-0.4300678074359894,
0.269271373748... | |
I have a solid understanding of most `OOP` theory but the one thing that confuses me a lot is virtual destructors.
I thought that the destructor always gets called no matter what and for every object in the chain.
When are you meant to make them virtual and why?
Virtual destructors are useful when you might potential... | [
0.3702002167701721,
-0.1946825534105301,
0.18426749110221863,
0.22005660831928253,
0.004294656682759523,
-0.03061678819358349,
0.24475714564323425,
0.31506475806236267,
-0.24258404970169067,
-0.5429877042770386,
-0.1207946166396141,
0.7029303908348083,
-0.13244639337062836,
0.6731978058815... | |
}
};
```
Here, you'll notice that I didn't declare Base's destructor to be `virtual`. Now, let's have a look at the following snippet:
```
Base *b = new Derived();
// use b
delete b; // Here's the problem!
```
Since Base's destructor is not `virtual` and `b` is a `Base*` pointing to a `Derived` object, `delete b` ... | [
-0.07823257148265839,
-0.18452836573123932,
0.4414600729942322,
-0.2201041579246521,
0.15168242156505585,
-0.1156964972615242,
0.2729785144329071,
0.004325228277593851,
-0.29777809977531433,
-0.2647819221019745,
-0.3085007071495056,
0.6813364624977112,
-0.38750553131103516,
0.4099840223789... | |
have a virtual destructor or the
> behavior is undefined**.
In most implementations, the call to the destructor will be resolved like any non-virtual code, meaning that the destructor of the base class will be called but not the one of the derived class, resulting in a resources leak.
To sum up, always make base cla... | [
0.12462646514177322,
-0.3719991147518158,
0.12305662035942078,
0.13128288090229034,
0.15432307124137878,
-0.3115956485271454,
0.5611028075218201,
0.00530529348179698,
-0.29421356320381165,
-0.7075819969177246,
-0.4135802388191223,
0.758891224861145,
-0.40977293252944946,
0.4207769632339477... | |
class pointer.
You can learn more about virtuality and virtual base class destructor in [this article from Herb Sutter](http://www.gotw.ca/publications/mill18.htm). | [
0.12300925701856613,
-0.05114244297146797,
-0.2979106605052948,
0.3698251247406006,
-0.0030136832501739264,
0.023681022226810455,
0.38453444838523865,
0.2279939502477646,
-0.40631791949272156,
-0.5187736749649048,
-0.03455884009599686,
0.38323527574539185,
-0.11450757831335068,
0.429971665... | |
The following query does what I'd like it to do, however, I have no idea if it's efficient. I went through the [Django aggregation](http://docs.djangoproject.com/en/dev/topics/db/aggregation/) documentation, threw it together, looked at the query and tilted my head sideways like a confused dog.
What the query actually... | [
0.29495829343795776,
0.12578293681144714,
0.5018135905265808,
0.021707015112042427,
-0.10000430047512054,
-0.2938702404499054,
-0.2688429057598114,
0.10718107223510742,
-0.29386085271835327,
-0.4030998945236206,
0.11717627197504044,
0.33895477652549744,
0.0892796441912651,
0.38968613743782... | |
that I can see the RAW SQL that's querying the database?
Models:
```
class Entry(models.Model):
name = models.CharField(max_length=200, unique=True)
name_slug = models.SlugField(max_length=200, blank=True, editable=False, unique=True)
date_published = models.DateTimeField()
is_published = models.Boole... | [
-0.10051584243774414,
-0.1386333554983139,
0.6367291212081909,
-0.25160568952560425,
0.22609443962574005,
0.04040086269378662,
-0.3136211633682251,
-0.22364558279514313,
-0.2680860459804535,
-0.46614131331443787,
-0.11401508003473282,
0.5142275094985962,
-0.2675883173942566,
0.196357995271... | |
[:6]
```
2) Yes, if settings.DEBUG is true, the raw sql queries are stored in django.db.connection.queries.
<http://blog.michaeltrier.com/2007/8/11/display-the-sql-django-orm-is-generating> | [
0.16155947744846344,
0.3502674102783203,
0.32417532801628113,
-0.14540433883666992,
-0.18257863819599152,
0.06916207820177078,
0.09082942456007004,
-0.008436472155153751,
-0.23420743644237518,
-0.2672851085662842,
-0.1441168636083603,
0.5054976344108582,
-0.1112024188041687,
0.086113832890... | |
I want to be able to read line by line from a pdf, compare it to a string( a filename), and if the string appears in that line, write that line to a list.
So far I had a quick look at ITextSharp and at PDFSharp, but it doesn't seem like these are the right tools for the job as they focus most on altering and printing ... | [
0.6403075456619263,
-0.2699096202850342,
0.313336580991745,
0.09360150992870331,
-0.12757864594459534,
0.18954776227474213,
-0.4144899547100067,
0.06744623929262161,
-0.10943052172660828,
-0.6624821424484253,
0.2901827394962311,
0.3502326011657715,
0.2099107801914215,
-0.007469767238944769... | |
it does the job.
It's opensource and free. | [
0.5609078407287598,
0.2906067371368408,
0.2733166217803955,
0.2086751013994217,
-0.053966935724020004,
-0.4038645625114441,
0.0915486067533493,
0.6488009095191956,
-0.11967871338129044,
-0.4631747007369995,
-0.12476075440645218,
0.46241217851638794,
0.2907675802707672,
0.03966036066412926,... | |
```
void foo(void **Pointer);
int main ()
{
int *IntPtr;
foo(&((void*)IntPtr));
}
```
Why do I get an error?
```
error: lvalue required as unary ‘&’ operand
```
Thanks
(void\*) is not an lvalue, it is kind of a casting operator, you need to have the ampersand to the immediate left of the variable (lvalue... | [
-0.0954204648733139,
0.21317346394062042,
0.4929881691932678,
-0.2608090937137604,
0.17391109466552734,
0.1811935156583786,
0.3095763921737671,
-0.30798667669296265,
0.008753322996199131,
-0.15914374589920044,
-0.27359700202941895,
0.7028458714485168,
-0.2707693576812744,
0.182303905487060... | |
I would like to programmatically insert additional rows into a DataGrid (to act as subheadings). I have followed a number of articles online (namely option 3 from <http://aspalliance.com/723>) but they all result in the row being displayed correctly, but with no contents.
Here is the important part of the code I'm usi... | [
0.11496657878160477,
-0.05354168638586998,
0.4548082947731018,
-0.07083112746477127,
0.04121847450733185,
0.1016201600432396,
0.3047419786453247,
-0.06533148139715195,
-0.34688544273376465,
-0.5094777941703796,
-0.07024241983890533,
0.26713353395462036,
-0.4690144956111908,
0.2657292485237... | |
TableCell tc = new TableCell();
tc.Controls.Add(new LiteralControl("foo"));
tc.ColumnSpan = e.Item.Cells.Count;
// DataGridItem
DataGridItem di = new DataGridItem(e.Item.ItemIndex + 1, 0, ListItemType.Item);
di.Height = new Unit(100, UnitType.Pixel);
di.CssClass = "testC... | [
0.2888568639755249,
-0.2756938636302948,
0.6736129522323608,
0.2298111915588379,
-0.1724695861339569,
0.3000769317150116,
0.16264569759368896,
-0.6500453948974609,
-0.17349275946617126,
-0.4975704252719879,
-0.25319817662239075,
0.04733993858098984,
-0.3038042485713959,
0.30655601620674133... | |
Table childTable = (Table)dg.Controls[0];
childTable.Rows.Add(di);
}
}
```
This results in the following markup being generated in the correct place, but without the LiteralControl("foo")
```
<tr class="testClass" style="height:100px;">
</tr>
```
I would like to use this approach rather than man... | [
0.08133812993764877,
0.3552999198436737,
0.3547179102897644,
0.07781781256198883,
0.11848030984401703,
0.3919038772583008,
0.13533839583396912,
-0.20301206409931183,
-0.02444787323474884,
-0.6749846339225769,
0.09469035267829895,
0.17139361798763275,
-0.002789340913295746,
-0.0669619664549... | |
to get round the problem in a reasonably generic way:
```
private void InsertDataGridRow(DataGrid dataGrid, int index, TableCell tc)
{
DataGridItem di = new DataGridItem(index, 0, ListItemType.Item);
// Check which columns are visible
bool foundFirstVisibleColumn = false;
int numberOfVisibleColumns = ... | [
0.0164464320987463,
-0.07155290246009827,
0.45487967133522034,
-0.14403878152370453,
0.08249559998512268,
0.04757886379957199,
0.3983335494995117,
-0.25624561309814453,
-0.07796819508075714,
-0.41323620080947876,
-0.21599876880645752,
0.4384896457195282,
-0.4400835335254669,
0.188520431518... | |
foundFirstVisibleColumn = true;
}
// Add dummy columns in the columns that are hidden
if (!foundFirstVisibleColumn)
{
di.Cells.Add(new TableCell());
}
}
tc.ColumnSpan = numberOfVisibleColumns;
di.Cells.Add(tc);
Table t = (Table)dataGrid.Controls[0];... | [
0.06971649080514908,
-0.20813003182411194,
0.44406458735466003,
-0.08210843056440353,
0.3914593458175659,
-0.09125596284866333,
0.06939683854579926,
-0.35502615571022034,
-0.35134389996528625,
-0.16875845193862915,
-0.12746654450893402,
0.4045889973640442,
-0.4894323945045471,
-0.011043886... | |
something like this:
```
private void MyDataGrid_ItemCreated(object sender, DataGridItemEventArgs e)
{
// This method will create a subheading row if needed
if (e.Item.ItemType == ListItemType.AlternatingItem || e.Item.ItemType == ListItemType.Item)
{
TableCell tc = new TableCell();
tc.Cont... | [
-0.09618048369884491,
-0.3287023603916168,
0.48792579770088196,
-0.02203350141644478,
-0.017318805679678917,
0.09317597001791,
0.35059472918510437,
-0.23222970962524414,
-0.23658742010593414,
-0.18384142220020294,
-0.023263834416866302,
0.3191812038421631,
-0.7496852874755859,
0.3490214347... | |
tc);
}
}
``` | [
0.13561569154262543,
0.21574893593788147,
0.48612797260284424,
-0.23369674384593964,
0.20966380834579468,
-0.450165718793869,
0.1069570854306221,
0.05889156460762024,
-0.012470819987356663,
-0.10788707435131073,
-0.3418622314929962,
0.8607398867607117,
-0.5736883878707886,
0.46216821670532... | |
I have started to make heavy use of exceptions, I'm sure I'll grow out of it as a learn the advantages and disadvantages the hard way, but until I've become an exception guru I'd like to know if this technique is acceptable.
I intend to wrap, say a database exception in my own 'SorryFailedToSaveYourData' exception and... | [
0.13206878304481506,
0.26113438606262207,
0.19153642654418945,
-0.1915515661239624,
-0.18684294819831848,
-0.058273449540138245,
0.5919403433799744,
-0.26151159405708313,
-0.15417569875717163,
-0.6298239231109619,
-0.016182057559490204,
0.517628014087677,
-0.24705420434474945,
0.2448864430... | |
Is Nothing
BuildErrorMessage(lbl, ex.InnerException)
End While
End Sub
```
Is this practice useful or I have I completely missed the boat when it comes to handling exceptions? I know you can create your own exceptions but it seems like overkill for the size of the projects we are working on.
Thanks
I wou... | [
0.38274508714675903,
0.1507880836725235,
0.23700420558452606,
-0.08339548856019974,
-0.27065587043762207,
-0.3187488615512848,
0.7295306921005249,
-0.26208576560020447,
-0.13726414740085602,
-0.6449340581893921,
-0.02255862019956112,
0.5211589932441711,
0.00226613343693316,
0.0636997148394... | |
typed message to the user on a nice pretty display screen. Send yourself an email / log file / etc with the full-on stack trace.
This serves two purposes:
1) You get to see the real stack trace which makes it easier for you to find and fix the problem.
2) The users do not have to be shown a big scary stack trace. I... | [
0.11239118129014969,
-0.005634524393826723,
0.41695037484169006,
0.3553355634212494,
-0.16211079061031342,
-0.3291732668876648,
0.28401273488998413,
0.08246782422065735,
-0.47003281116485596,
-0.36219146847724915,
0.05098412558436394,
0.5439768433570862,
-0.31193286180496216,
-0.1266052126... | |
fix with different input. For exceptions which validate user input, often you can catch those in the presentation layer and display your nice message back to them on a label without leaving the form.
Only (ONLY!!!) use this technique if you know exactly what you are going to be catching and you give the users clear i... | [
0.5124413371086121,
-0.3871588110923767,
-0.047839805483818054,
0.3378773629665375,
-0.07542910426855087,
-0.10221532732248306,
0.3989470899105072,
0.21713459491729736,
-0.4977119266986847,
-0.39501070976257324,
-0.07083491235971451,
0.4517499804496765,
-0.6521239280700684,
-0.167699530720... | |
"catch all" exceptions. That type of handling should be done globally at the application level.
I do all of my global exception handling (emailing, logging, etc) in the application\_error handler method within Global.asax. You could also create an HttpModule which handles application errors. Then you can carry that fu... | [
0.43937763571739197,
-0.14329683780670166,
0.07726877927780151,
0.18146853148937225,
-0.015981558710336685,
-0.22606590390205383,
0.37729454040527344,
0.26979362964630127,
-0.24260582029819489,
-0.37837591767311096,
-0.017522994428873062,
0.39938491582870483,
-0.35589027404785156,
0.112580... | |
I have a really strange enum bug in Java.
```
for(Answer ans : assessmentResult.getAnswersAsList()) { //originally stored in a table
//AnswerStatus stat = ans.getStatus();
if (ans.getStatus() == AnswerStatus.NOT_ASSESSED) {
assessed = false;
}
}
```
An answer is an answer to a question on a test.... | [
0.06053687259554863,
0.2626144587993622,
-0.049264825880527496,
0.026784749701619148,
-0.17073531448841095,
-0.059248752892017365,
0.5391777157783508,
-0.14357492327690125,
-0.03043438494205475,
-0.6742905974388123,
0.03028767928481102,
0.33865317702293396,
-0.039547305554151535,
0.1017691... | |
strange; When I declare the `AnswerStatus` stat variable, it works, even if I don't use the stat variable in the if test. Could someone tell me what is going on?.
I've read something about enum bugs in serialization/RMI-IIOP but I don't use that here.
The `enum AnswerStatus` can be `ASSESSED` or `NOT_ASSESSED`.
The ... | [
-0.12026350200176239,
0.08356715738773346,
-0.03360590711236,
0.2896597385406494,
0.02178809978067875,
-0.13244524598121643,
0.5184276700019836,
0.19514335691928864,
-0.38635361194610596,
-0.5102224349975586,
0.11177872866392136,
0.26428595185279846,
-0.24939599633216858,
0.458108156919479... | |
I know of two methods of setting a default parameter, but I would like to know what the preferred method is.
```
function Foo(par1, par2)
{
if(par2 == null)
par2 = "my default"
}
```
or
```
function Foo(par1, par2)
{
par2 = par2 || "my default"
}
```
or is there a better way than either of these?
... | [
0.01277891080826521,
0.2218787968158722,
0.17476233839988708,
-0.18175500631332397,
-0.0008356214384548366,
-0.012092364020645618,
0.15052761137485504,
0.0630020871758461,
-0.0714801549911499,
-0.4416157603263855,
0.17260462045669556,
0.917842447757721,
-0.505535900592804,
-0.0697570964694... | |
par2 = "my default"
if(par3 == null)
par3 = "my default"
// Do something
}
```
And to call it:
```
Foo("Parameter one",null,true)
```
Personally I think the second form is just outright cleaner and more readable, certainly moreso than sergey's arguments inspection - though that can have it's place -... | [
-0.2585711181163788,
0.5461915731430054,
0.44885215163230896,
-0.4501970708370209,
-0.2849113941192627,
0.13167722523212433,
0.3579667806625366,
-0.13032561540603638,
-0.07038543373346329,
-0.30478209257125854,
-0.10089525580406189,
0.576862096786499,
-0.5852593779563904,
-0.09555369615554... | |
I have a list of values like this
```
1000, 20400
22200, 24444
```
The ranges don't overlap.
What I want to do is have a c# function that can store (loaded values from db then cache it locally) a relatively large list of these values then have a method for finding if a supplied value is in any of the ranges?
Does ... | [
0.4461403489112854,
0.2583718001842499,
0.2495388686656952,
-0.018113765865564346,
0.15284548699855804,
0.19719433784484863,
-0.07524818181991577,
-0.22285406291484833,
-0.20578396320343018,
-0.5058554410934448,
0.22312946617603302,
0.5395543575286865,
-0.28558897972106934,
0.1470317095518... | |
do you have any extra information about them? Do you know if they'll overlap or not? Are you just interested in the existence of a range, or do you need to find all the ranges that a value belongs to?
EDIT: With the edits to the question, Barry's answer is exactly right. Just sort (by lower bound is good enough) at in... | [
0.3731782138347626,
0.11302792280912399,
0.2891254127025604,
0.07233680039644241,
0.27267351746559143,
0.11783256381750107,
-0.016397809609770775,
-0.3311847150325775,
-0.33765360713005066,
-0.20397859811782837,
-0.10857200622558594,
0.4746081829071045,
-0.18375666439533234,
-0.20110720396... | |
`List<Range>.Sort` will work fine assuming you have no overlap.
```
public class Range : IComparable<Range>
{
private readonly int bottom; // Add properties for these if you want
private readonly int top;
public Range(int bottom, int top)
{
this.bottom = bottom;
this.... | [
0.07799092680215836,
-0.09928014874458313,
0.3660919964313507,
-0.1147538498044014,
0.2514340877532959,
0.0029443097300827503,
0.02029234915971756,
-0.5888911485671997,
-0.025865765288472176,
-0.6122119426727295,
-0.24925413727760315,
0.7611105442047119,
-0.25844806432724,
0.01888024993240... | |
{
if (bottom < other.bottom && top < other.top)
{
return -1;
}
if (bottom > other.bottom && top > other.top) | [
-0.6990363001823425,
-0.15874578058719635,
0.02490251511335373,
0.05005848407745361,
0.38457322120666504,
-0.1095423549413681,
0.14219258725643158,
-0.2391366809606552,
-0.1734490841627121,
-0.031299762427806854,
-0.7689562439918518,
0.21677179634571075,
-0.17869628965854645,
-0.1015370041... | |
{
return 1;
}
if (bottom == other.bottom && top == other.top)
{
return 0; | [
-0.5729106068611145,
-0.012018176726996899,
0.12662525475025177,
-0.14679451286792755,
0.47652649879455566,
-0.13756275177001953,
0.1606195718050003,
-0.1531631052494049,
-0.07430603355169296,
-0.03444463759660721,
-0.7378007769584656,
0.3900968134403229,
-0.19354358315467834,
-0.057482786... | |
}
throw new ArgumentException("Incomparable values (overlapping)");
}
/// <summary>
/// Returns 0 if value is in the specified range;
/// less than 0 if value is above the range;
/// greater than 0 if value is below the range.
/// </summary>
public int CompareTo(i... | [
-0.3116740584373474,
-0.05463143065571785,
0.14453548192977905,
-0.17259058356285095,
-0.004644056782126427,
0.15533994138240814,
0.13643482327461243,
-0.28846991062164307,
0.13932301104068756,
-0.3455532193183899,
-0.19228819012641907,
0.6153215765953064,
-0.3344801962375641,
-0.023005006... | |
{
if (value < bottom)
{
return 1;
}
if (value > top)
{ | [
-0.6206957697868347,
-0.05181252583861351,
0.14591115713119507,
-0.11904938519001007,
0.4403120279312134,
-0.23870013654232025,
0.05331636592745781,
-0.09937312453985214,
0.07416024059057236,
-0.045986417680978775,
-0.7735249996185303,
0.43003901839256287,
-0.13278917968273163,
-0.13768625... | |
return -1;
}
return 0;
}
}
// Just an existence search
public static bool BinarySearch(IList<Range> ranges, int value)
{
int min = 0;
int max = ranges.Count-1;
while (min <= max)
{
int mid = (min + max) / 2; | [
0.13885240256786346,
-0.48100557923316956,
0.4331652522087097,
-0.24917258322238922,
0.15189649164676666,
0.16226910054683685,
0.2945438027381897,
-0.17458371818065643,
0.10578767955303192,
-0.24715833365917206,
-0.43797463178634644,
0.5265302062034607,
-0.3748951256275177,
0.2058583647012... | |
int comparison = ranges[mid].CompareTo(value);
if (comparison == 0)
{
return true;
}
if (comparison < 0)
{
min = mid+1;
}
else if (comparison > 0) | [
-0.0061345878057181835,
-0.46079060435295105,
0.45002487301826477,
-0.21582788228988647,
-0.06617226451635361,
0.5716593265533447,
0.30424967408180237,
-0.35472571849823,
0.42992761731147766,
-0.6816378235816956,
-0.2549140453338623,
0.5792695879936218,
0.14965781569480896,
0.3414866030216... | |
{
max = mid-1;
}
}
return false;
}
``` | [
0.01622016914188862,
-0.12660785019397736,
0.23204602301120758,
-0.30500224232673645,
0.32967305183410645,
0.0789143443107605,
0.38203129172325134,
0.13307084143161774,
0.0631658285856247,
-0.2715890407562256,
-0.36694246530532837,
0.6572446823120117,
0.022461457177996635,
0.40535503625869... | |
I'm wondering what kind of persistence solutions are there for C++ with a SQL database? In addition to doing things with custom SQL (and encapsulating the data access to DAOs or something similar), are there some other (more general) solutions?
Like some general libraries or frameworks (something like Hibernate & co f... | [
0.3540891408920288,
0.22162668406963348,
0.05687257647514343,
0.23083871603012085,
-0.29454436898231506,
-0.19341640174388885,
0.15096789598464966,
0.213084414601326,
-0.2050943821668625,
-0.5040658712387085,
0.26544398069381714,
0.4934306740760803,
-0.4024316966533661,
-0.0128709943965077... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.