text stringlengths 0 30.5k | title stringclasses 1
value | embeddings listlengths 768 768 |
|---|---|---|
variable.
**Update:** here's [a bit more about ruby-debug](http://bashdb.sourceforge.net/ruby-debug.html). | [
0.20054283738136292,
0.01494513638317585,
-0.07220307737588882,
-0.061440642923116684,
-0.41211485862731934,
-0.18535619974136353,
0.5047483444213867,
0.02107832580804825,
-0.37499675154685974,
-0.19530220329761505,
-0.09800248593091965,
0.5562676191329956,
-0.2805918753147125,
0.134743481... | |
Is there an IE6/PNG fix that is officially developed by the jQuery team?
If not which of the available plugins should I use?
I'm using [jquery.pngFix.js](http://jquery.andreaseberhard.de/pngFix/). I don't know if it's officially sanctioned or not, I do know that it works. I chose it because it was the plugin included ... | [
0.6375842690467834,
0.14124728739261627,
0.1764421910047531,
0.12591397762298584,
-0.10006077587604523,
-0.3598930239677429,
0.3081510365009308,
0.32279932498931885,
-0.12437444180250168,
-0.38291463255882263,
-0.10155683010816574,
0.5120659470558167,
-0.2745745778083801,
-0.22046984732151... | |
Currently my app uses just Direct3D9 for graphics, however in the future I' m planning to extend this to D3D10 and possibly OpenGL. The question is how can I do this in a tidy way?
At present there are various Render methods in my code
```
void Render(boost::function<void()> &Call)
{
D3dDevice->BeginScene();
... | [
-0.1528126448392868,
0.09966106712818146,
1.051090121269226,
-0.27103352546691895,
-0.17568105459213257,
0.149811252951622,
0.31287527084350586,
-0.1359785944223404,
-0.11328868567943573,
-0.9720117449760437,
-0.10854482650756836,
0.7562483549118042,
-0.13724254071712494,
0.251884281635284... | |
(*it)->Render();
UI->Render();
}
```
And a sample class derived from entity::Base
```
class Sprite: public Base
{
IDirect3DTexture9 *Tex;
Point2 Pos;
Size2 Size;
public:
Sprite(IDirect3DTexture9 *Tex, const Point2 &Pos, const Size2 &Size);
virtual void Render();
};
```
Each method then tak... | [
-0.06718602031469345,
-0.07764525711536407,
0.7396308779716492,
0.08403749763965607,
-0.44096216559410095,
0.1523408442735672,
0.09724227339029312,
-0.34594985842704773,
0.1518671065568924,
-0.5819381475448608,
-0.18530473113059998,
0.3752876818180084,
-0.2517050802707672,
0.10917647927999... | |
is sufficient for your application's graphic output demands. Then implement this interface for every renderer you want to support.
```
class IRenderer {
public:
virtual ~IRenderer() {}
virtual void RenderModel(CModel* model) = 0;
virtual void DrawScreenQuad(int x1, int y1, int x2, int y2) = 0;
// ...... | [
-0.13705480098724365,
-0.0734550729393959,
0.8969689607620239,
-0.17549608647823334,
-0.25984421372413635,
0.25333574414253235,
0.17019054293632507,
-0.22880414128303528,
0.02946615219116211,
-0.9347905516624451,
0.015804657712578773,
0.9185768365859985,
-0.23734024167060852,
0.09521725773... | |
{
// draw screen aligned quad using OpenGL
}
};
class CDirect3DRenderer : public IRenderer {
// similar, but render using Direct3D
};
```
Properly designing and maintaining these interfaces can be very challenging though.
In case you also operate with render driver dependent objects like textures, you c... | [
0.08771030604839325,
-0.11746760457754135,
0.5005797147750854,
-0.033263757824897766,
-0.4927417039871216,
0.051801133900880814,
0.12370933592319489,
-0.319387823343277,
-0.08369968831539154,
-0.8936865925788879,
0.10371758043766022,
0.8538475036621094,
-0.34887030720710754,
0.083861716091... | |
virtual ITexture* CreateTexture(const char* filename) {
// COpenGLTexture is the OpenGL specific ITexture implementation
return new COpenGLTexture(filename);
}
//...
};
```
Isn't it an idea to look at existing (3d) engines though? In my experience designing this kind of interfaces really distracts f... | [
0.02854117937386036,
-0.2492254674434662,
0.4771912395954132,
0.2364329844713211,
-0.1919357180595398,
-0.13797743618488312,
0.05368560925126076,
0.19157341122627258,
0.20507347583770752,
-0.7091832756996155,
-0.22190146148204803,
0.8723464608192444,
-0.2586768567562103,
0.1203825324773788... | |
An example of an app that does this is [Enso](http://www.humanized.com/enso/), it pops up when you press the caps lock.
You can act on global hotkeys by calling the winapi function [RegisterHotKey](https://www.pinvoke.net/default.aspx/user32/RegisterHotKey.html). Also see <https://www.codeproject.com/Articles/4345/NET-... | [
-0.16890205442905426,
-0.4330802261829376,
0.544387698173523,
0.1668166220188141,
0.20794527232646942,
0.010629450902342796,
0.033478494733572006,
0.017488999292254448,
-0.41825950145721436,
-0.4662545323371887,
-0.39678484201431274,
0.630370020866394,
-0.38610902428627014,
0.0958731025457... | |
I'm having trouble ordering by more than one field in my Linq to NHibernate query. Does anyone either know what might be wrong or if there is a work around?
Code:
```
IQueryable<AgendaItem> items = _agendaRepository.GetAgendaItems(location)
.Where(item => item.Minutes.Contains(query) || item.Description.Contains(q... | [
-0.013519910164177418,
-0.12102300673723221,
0.6528923511505127,
-0.07704389840364456,
-0.07793733477592468,
0.18446317315101624,
0.2406817376613617,
-0.44819122552871704,
-0.6794867515563965,
-0.7673066258430481,
-0.2396208643913269,
0.27880099415779114,
-0.2914765775203705,
0.46703848242... | |
[SqlException (0x80131904): Invalid column name '__hibernate_sort_expr_0____hibernate_sort_expr_1__'.
Invalid column name '__hibernate_sort_expr_0____hibernate_sort_expr_1__'.]
System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection) +1948826
System.Data.SqlClient.S... | [
-0.14371128380298615,
0.17577676475048065,
0.43554243445396423,
0.10231257230043411,
-0.11137128621339798,
0.3234727382659912,
0.4001722037792206,
-0.35189932584762573,
-0.21949584782123566,
-0.44195085763931274,
-0.12297340482473373,
0.07645642757415771,
-0.18850989639759064,
0.5359686017... | |
agenda1_.Date as Date2_0_, location2_.Id as Id7_1_, location2_.Name as Name7_1_ FROM AgendaItem this_ left outer join Agenda agenda1_ on this_.AgendaId=agenda1_.Id left outer join Location location2_ on agenda1_.LocationId=location2_.Id WHERE location2_.Id = ? and (this_.Minutes like ? or this_.Description like ?) ORDE... | [
-0.6401151418685913,
-0.11734610050916672,
0.39530226588249207,
0.12933510541915894,
-0.09083139896392822,
0.28501662611961365,
-0.06861203908920288,
-0.3476659059524536,
-0.5362851619720459,
-0.8255214095115662,
0.18861016631126404,
0.03124074451625347,
-0.05313701182603836,
0.23732085525... | |
Agenda agenda1_ on this_.AgendaId=agenda1_.Id left outer join Location location2_ on agenda1_.LocationId=location2_.Id WHERE location2_.Id = ? and (this_.Minutes like ? or this_.Description like ?) ORDER BY agenda1_.Date asc, this_.OutcomeType asc, this_.OutcomeNumber asc]]
NHibernate.Loader.Loader.DoList(ISessi... | [
-0.5002835988998413,
-0.15823237597942352,
0.5597954392433167,
0.20107918977737427,
-0.37497463822364807,
0.3375735282897949,
-0.16741375625133514,
-0.7198750972747803,
-0.6665971279144287,
-0.5064346790313721,
0.0573648139834404,
-0.027128128334879875,
-0.20230096578598022,
0.344037652015... | |
NHibernate.Linq.CriteriaResultReader`1.List() in C:\home\dev\tools\NHibernate\NHibernateContribSrc\src\NHibernate.Linq\src\NHibernate.Linq\CriteriaResultReader.cs:22
NHibernate.Linq.d__0.MoveNext() in C:\home\dev\tools\NHibernate\NHibernateContribSrc\src\NHibernate.Linq\src\NHibernate.Linq\CriteriaResultReader.c... | [
-0.48315244913101196,
-0.037864234298467636,
0.5561875104904175,
-0.33300119638442993,
-0.031751397997140884,
0.1043231263756752,
0.1850280910730362,
-0.5019488334655762,
-0.4980013370513916,
-0.6521871089935303,
-0.11462901532649994,
0.2445174604654312,
-0.5615687966346741,
0.319453090429... | |
How do I select one or more random rows from a table using SQLAlchemy?
This is very much a database-specific issue.
I know that PostgreSQL, SQLite, MySQL, and Oracle have the ability to order by a random function, so you can use this in SQLAlchemy:
```
from sqlalchemy.sql.expression import func, select
select.order... | [
-0.032928548753261566,
0.013260576874017715,
0.08105717599391937,
-0.019734445959329605,
-0.22497190535068512,
0.015202563256025314,
-0.39739057421684265,
-0.2881709635257721,
-0.2878964841365814,
-0.5842423439025879,
0.10324117541313171,
0.5305389761924744,
-0.2932013273239136,
0.17664226... | |
I am working on a web application, where I transfer data from the server to the browser in XML.
Since I'm danish, I quickly run into problems with the characters `æøå`.
I know that in html, I use the `"&aelig;&oslash;&aring;"` for `æøå`.
however, as soon as the chars pass through JavaScript, I get black ... | [
0.3738354742527008,
0.4523080289363861,
0.3164985775947571,
-0.3354018032550812,
-0.31117677688598633,
0.13235343992710114,
0.529228687286377,
-0.16277505457401276,
0.009532089345157146,
-0.5566599369049072,
-0.20566189289093018,
0.17238248884677887,
-0.03773614019155502,
-0.29371643066406... | |
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
<script type="text/javascript" charset="utf-8">
alert("æøå");
alert("æøå");
</script>
</head>
<body>
</body>
</html>
```
What am... | [
0.10852746665477753,
0.3187912404537201,
0.5173665285110474,
-0.1291274130344391,
-0.09565793722867966,
-0.041794855147600174,
0.7039873003959656,
-0.4125434458255768,
-0.1588650345802307,
-0.48810991644859314,
-0.04142257198691368,
0.5955629944801331,
-0.07944628596305847,
-0.263692915439... | |
only solves the problem for static content, I figure I'd include the solution for strings from a MySQL server, pulled out using PHP:
`utf8_encode($MyStringHere)`
Just specifying UTF-8 in the header is not enough. I'd bet you haven't saved your file as UTF-8. Any reasonably advanced text editor will have this option. T... | [
0.043371956795454025,
0.039676617830991745,
0.25147512555122375,
0.09175089746713638,
-0.058931127190589905,
-0.11942591518163681,
0.5397881865501404,
0.27615857124328613,
-0.30156412720680237,
-0.3864353597164154,
-0.13289962708950043,
0.47874563932418823,
-0.3138485252857208,
-0.00717972... | |
While it would be very convenient to use inline functions at some situations,
Are there any drawbacks with inline functions?
**Conclusion**:
Apparently, There is nothing wrong with using inline functions.
But it is worth noting the following points!
* Overuse of inlining can actually make programs slower. Dependin... | [
-0.02233770489692688,
-0.15951788425445557,
0.08791578561067581,
0.31980544328689575,
-0.1864684522151947,
0.10513584315776825,
0.23350727558135986,
0.16722965240478516,
-0.1328483670949936,
-0.6988328099250793,
0.1293710470199585,
0.3558816611766815,
-0.5024052858352661,
-0.12151405960321... | |
speed benefits of inline functions tend to diminish as the function grows in size. At some point the overhead of the function call becomes small compared to the execution of the function body, and the benefit is lost [- Source](http://www-rocq.inria.fr/who/Marc.Thiriet/Langages/tic0324.html)
* There are few situations ... | [
-0.1167277842760086,
-0.13213713467121124,
0.5651642680168152,
0.3223694860935211,
0.05460738763213158,
0.08474168181419373,
0.2914375960826874,
-0.07118970155715942,
0.006657639052718878,
-0.35988086462020874,
-0.1298876404762268,
0.8792009949684143,
-0.5280769467353821,
-0.29402273893356... | |
is specified, whether or not `__inline` is honored depends on the setting of the inline optimizer option. By default, the inline option is in effect whenever the optimizer is run. If you specify optimize , you must also specify the noinline option if you want the `__inline` keyword to be ignored. [-Source](http://suppo... | [
0.12363388389348984,
-0.017826255410909653,
0.582367479801178,
0.0356624536216259,
0.0750962495803833,
-0.08858788758516312,
0.2013404667377472,
-0.006632304284721613,
0.04452446848154068,
-0.5104582905769348,
-0.29180529713630676,
0.7122893929481506,
-0.46554678678512573,
-0.0681431293487... | |
of instantiations). This can be a problem on some platforms (eg. embedded systems), especially if the function itself is recursive.
I'd also recommend making inline'd functions **very small** - The speed benefits of inline functions tend to diminish as the function grows in size. At some point the overhead of the func... | [
0.0399988628923893,
-0.04725084453821182,
0.2933766841888428,
0.3142569065093994,
-0.19087408483028412,
-0.03446516767144203,
0.5580343008041382,
0.12065493315458298,
-0.1431039273738861,
-0.4966612160205841,
-0.22616633772850037,
0.7494668960571289,
-0.32858651876449585,
-0.18783332407474... | |
I know a few advanced ways, to change directories. `pushd` and `popd` (directory stack) or `cd -` (change to last directory).
But I am looking for quick way to achieve the following:
Say, I am in a rather deep dir:
```
/this/is/a/very/deep/directory/structure/with\ lot\ of\ nasty/names
```
and I want to switch to ... | [
-0.11106135696172714,
-0.17722919583320618,
0.3904998302459717,
0.08021914213895798,
0.1341077834367752,
-0.20952767133712769,
0.13174089789390564,
0.08149856328964233,
0.0206893477588892,
-0.6876741051673889,
-0.16624699532985687,
0.6554679274559021,
-0.05668465793132782,
-0.0031098446343... | |
'foo' replaced by 'bar'. | [
0.47513237595558167,
0.5393878817558289,
0.2728833258152008,
-0.5561379194259644,
-0.3980761766433716,
0.4256642460823059,
0.3579119145870209,
0.4703669548034668,
-0.09656233340501785,
0.10135084390640259,
-0.6112386584281921,
0.25188174843788147,
-0.3483410179615021,
0.37463128566741943,
... | |
I have a query where I wish to retrieve the oldest X records. At present my query is something like the following:
```
SELECT Id, Title, Comments, CreatedDate
FROM MyTable
WHERE CreatedDate > @OlderThanDate
ORDER BY CreatedDate DESC
```
I know that normally I would remove the 'DESC' keyword to switch the order of th... | [
0.48763272166252136,
0.38086849451065063,
0.3862136900424957,
0.10744516551494598,
-0.18270991742610931,
-0.06553629040718079,
-0.10963492095470428,
-0.1541244089603424,
-0.38190287351608276,
-0.9165549874305725,
-0.003572979010641575,
0.14606067538261414,
-0.13035564124584198,
0.834019303... | |
database exists on SQL Server 2005.
Why not just use a subquery?
```
SELECT T1.*
FROM
(SELECT TOP X Id, Title, Comments, CreatedDate
FROM MyTable
WHERE CreatedDate > @OlderThanDate
ORDER BY CreatedDate) T1
ORDER BY CreatedDate DESC
``` | [
0.12758110463619232,
0.08466514945030212,
0.27727946639060974,
0.11751406639814377,
-0.15306474268436432,
-0.25048190355300903,
0.199854776263237,
-0.2582757771015167,
-0.013306849636137486,
-0.46941301226615906,
0.39663952589035034,
0.06842385232448578,
-0.09092098474502563,
0.54461580514... | |
Can I use this approach efficiently?
```
using(SqlCommand cmd = new SqlCommand("GetSomething", new SqlConnection(Config.ConnectionString))
{
cmd.Connection.Open();
// set up parameters and CommandType to StoredProcedure etc. etc.
cmd.ExecuteNonQuery();
}
```
My concern is : Will the Dispose method of the... | [
-0.18040069937705994,
0.33025553822517395,
0.5528715252876282,
-0.08667305111885071,
0.11785296350717545,
-0.23051650822162628,
0.2538534104824066,
-0.48753732442855835,
-0.20541751384735107,
-0.7708463668823242,
-0.2806049585342407,
0.4818592369556427,
-0.3310796618461609,
0.3502217531204... | |
new SqlCommand(cmdstring, conn))
{
cmd.ExecuteNonQuery();
}
}
```
Otherwise, the Connection is unchanged by the fact that a Command that was using it was disposed (maybe that is what you want?). But keep in mind, that a Connection should
be disposed of as well, and likely more important to dispose of... | [
-0.10601716488599777,
-0.014053627848625183,
0.793459415435791,
-0.009614028967916965,
0.23060567677021027,
-0.0641183853149414,
-0.04931875318288803,
-0.3470733165740967,
-0.31365835666656494,
-0.6014614105224609,
-0.0979607030749321,
0.5593714714050293,
-0.472090482711792,
0.383954286575... | |
fieldid = 2", conn))
{
Console.WriteLine(cmd.ExecuteScalar().ToString());
}
conn.Dispose();
```
The first command was disposed when the using block was exited. The connection was still open and good for the second command.
***So, disposing of the command definitely does not dispose of the connection it was u... | [
-0.20953050255775452,
-0.18243397772312164,
0.45521074533462524,
-0.3463907241821289,
0.4208434224128723,
-0.15278436243534088,
0.3207956552505493,
-0.37302860617637634,
-0.08130885660648346,
-0.49728333950042725,
-0.12354034930467606,
0.5778334140777588,
-0.33742570877075195,
0.1958422362... | |
I find working on the command line in Windows frustrating, primarily because the console window is wretched to use compared to terminal applications on linux and OS X such as "rxvt", "xterm", or "Terminal". Major complaints:
1. No standard copy/paste. You have to turn on "mark" mode and it's only available from a mult... | [
0.2964054048061371,
0.05949801579117775,
0.26970577239990234,
-0.1483071744441986,
0.008438369259238243,
-0.015222868882119656,
0.1540384292602539,
-0.055870700627565384,
-0.10209399461746216,
-0.6387612819671631,
-0.08633332699537277,
0.8113763332366943,
-0.07066170871257782,
0.1341737061... | |
window
3. You can only make the window so big before horizontal scroll bars enter the picture. Horizontal scroll bars suck.
4. With the cmd.exe shell, you can't navigate to folders with \\netpath notation (UNC?), you need to map a network drive. This sucks when working on multiple machines that are going to have differ... | [
-0.16676384210586548,
-0.12932126224040985,
0.7145022749900818,
-0.16875122487545013,
-0.41440650820732117,
0.06063687056303024,
0.09464797377586365,
0.26702946424484253,
-0.10378225892782211,
-0.76764315366745,
-0.03023540787398815,
0.6943405866622925,
-0.6394711136817932,
0.2291029244661... | |
program was designed to work with [Far Manager](http://www.farmanager.com/) (my favorite shell replacement - file and archive management, command history and completion, powerful editor). But ConEmu can be used with any other console application or simple GUI tools (like PuTTY for example). ConEmu is a live project, op... | [
-0.1333787739276886,
-0.43627992272377014,
0.3046879172325134,
-0.166189044713974,
-0.056254833936691284,
0.062419742345809937,
0.22797492146492004,
0.33279725909233093,
0.11251534521579742,
-0.6876108646392822,
-0.14323922991752625,
0.6790306568145752,
-0.21313534677028656,
0.090461790561... | |
7 Jump lists and Progress on taskbar
* Integration with [DosBox](http://www.dosbox.com/) (useful in 64bit systems to run DOS applications)
* Smooth resize, maximized and fullscreen window modes
* Scrollbar initially hidden, may be revealed by mouseover or checkbox in settings
* Optional settings (e.g. pallette) for sel... | [
-0.16362318396568298,
-0.4521068334579468,
0.687703549861908,
-0.06775736063718796,
0.1024482324719429,
0.027040164917707443,
0.08388480544090271,
-0.059160470962524414,
-0.10243366658687592,
-0.6427828669548035,
-0.3777621388435364,
0.7604253888130188,
-0.018082493916153908,
-0.2596694827... | |
How do you create a database from an Entity Data Model.
So I created a database using the EDM Designer in VisualStudio 2008, and now I want to generate the SQL Server Schema to create storage in SQL Server.
From what I understand you are not just supposed to use EDM as a "pretty" database designer, in fact EDM does no... | [
0.2835959494113922,
-0.06755425035953522,
0.36460140347480774,
0.3692467212677002,
-0.12348588556051254,
-0.12547042965888977,
-0.3195408880710602,
-0.05518568307161331,
-0.2771620452404022,
-0.5179576873779297,
0.35801082849502563,
0.2835867702960968,
-0.2525220215320587,
0.14820514619350... | |
class, etc.. For a DDL kind of export, I've never done that but what I did was map my EDM to an existing database, which was easier for me to get started.
There is a great tutorial on MSDN, which details step by step instructions on how to go about using an existing database, but also touches the how to start from scr... | [
0.19492694735527039,
-0.2829505205154419,
-0.21130727231502533,
0.2652091681957245,
-0.05940381437540054,
-0.11442630738019943,
0.14662817120552063,
0.19766783714294434,
-0.019563864916563034,
-0.6352233290672302,
-0.04877588152885437,
0.4615665078163147,
0.26975879073143005,
0.03986882418... | |
I'd like to script, preferably in rake, the following actions into a single command:
1. Get the version of my local git repository.
2. Git pull the latest code.
3. Git diff from the version I extracted in step #1 to what is now in my local repository.
In other words, I want to get the latest code form the central rep... | [
0.4047938287258148,
-0.09895838052034378,
0.4855706989765167,
0.06306543946266174,
-0.169114351272583,
0.1571846604347229,
-0.06412580609321594,
-0.11452668905258179,
-0.08715895563364029,
-0.7292222380638123,
-0.15412692725658417,
0.6250405311584473,
-0.1677517294883728,
0.261814653873443... | |
Note that if the pull doesn't actually update the current branch, the diff will give you the wrong results. Another option is to explicitly record the current version:
```
current=`git rev-parse HEAD`
git pull origin
git diff $current..
```
I personally use an alias that simply shows me a log, in reverse order (i.e.... | [
-0.10276738554239273,
-0.11631961166858673,
0.5947715044021606,
-0.08017231523990631,
0.24042445421218872,
0.02605009265244007,
0.256232351064682,
0.20898671448230743,
-0.31495797634124756,
-0.5164077281951904,
-0.025091368705034256,
0.5665674209594727,
-0.28474000096321106,
0.387289047241... | |
I know this is a broad question, but I've inherited several poor performers and need to optimize them badly. I was wondering what are the most common steps involved to optimize. So, what steps do some of you guys take when faced with the same situation?
> Related Question:
>
> [What generic techniques can be applie... | [
0.3052169382572174,
-0.21413631737232208,
0.28169187903404236,
0.0815223753452301,
0.00815843977034092,
-0.1274372786283493,
0.3741683065891266,
-0.6156297922134399,
-0.15163782238960266,
-0.41020679473876953,
-0.058077987283468246,
0.7563944458961487,
-0.234712153673172,
-0.16872972249984... | |
I've got a table of URLs and I don't want any duplicate URLs. How do I check to see if a given URL is already in the table using PHP/MySQL?
If you don't want to have duplicates you can do following:
* add uniqueness constraint
* use "[REPLACE](http://dev.mysql.com/doc/refman/5.0/en/replace.html)" or "[INSERT ... ON DU... | [
0.7233718037605286,
0.36146366596221924,
-0.05963229015469551,
0.032403409481048584,
-0.1799972951412201,
-0.09976349025964737,
0.10953694581985474,
-0.21959634125232697,
-0.354560911655426,
-0.6566768884658813,
0.2610597312450409,
0.05697451904416084,
-0.36416155099868774,
0.4609281420707... | |
I'm trying to create a sitemap using Linq to Xml, but am getting an empty namespace attribute, which I would like to get rid of. e.g.
```
XNamespace ns = "http://www.sitemaps.org/schemas/sitemap/0.9";
XDocument xdoc = new XDocument(new XDeclaration("1.0", "utf-8", "true"),
new XElement(ns + "urlset",
new XEl... | [
0.09156318753957748,
0.2138018012046814,
0.7878466248512268,
0.035133540630340576,
0.11773599684238434,
-0.16804128885269165,
-0.19175881147384644,
-0.05922185257077217,
-0.18233510851860046,
-0.6809077262878418,
-0.4902748167514801,
0.3788643479347229,
-0.11913783848285675,
0.238493159413... | |
using Replace on the final xdoc.ToString(), but is there a more correct way?
The "more correct way" would be:
```
XDocument xdoc = new XDocument(new XDeclaration("1.0", "utf-8", "true"),
new XElement(ns + "urlset",
new XElement(ns + "url",
new XElement(ns + "loc", "http://www.example.com/page"),
new XElement(n... | [
0.07239419221878052,
0.04556646570563316,
0.9288055896759033,
-0.09695498645305634,
0.15526312589645386,
-0.1223132386803627,
-0.039909008890390396,
-0.35447558760643005,
-0.230920672416687,
-0.5116662979125977,
-0.536990761756897,
0.4771709144115448,
-0.28178927302360535,
-0.0221661366522... | |
I'm not mistaken, what you want. | [
0.4985141456127167,
-0.018127989023923874,
-0.23958763480186462,
0.25530341267585754,
-0.07999584078788757,
0.09007798880338669,
-0.03954683244228363,
0.109944649040699,
-0.21144112944602966,
-0.4115111231803894,
0.16367806494235992,
0.5201598405838013,
-0.09540925174951553,
0.176239773631... | |
My motto for Java is "just because Java has static blocks, it doesn't mean that you should be using them." Jokes aside, there are a lot of tricks in Java that make testing a nightmare. Two of the most I hate are Anonymous Classes and Static Blocks. We have a lot of legacy code that make use of Static Blocks and these a... | [
0.49690869450569153,
0.29295945167541504,
-0.5244455337524414,
-0.11636839807033539,
-0.22456490993499756,
-0.3946073055267334,
0.7684566378593445,
0.4064372479915619,
-0.030035382136702538,
-0.637650191783905,
0.1811019331216812,
0.25304165482521057,
0.09136435389518738,
0.203102141618728... | |
suggestion to my colleagues is to move the body of the static block into a private static method and call it `staticInit`. This method can then be called from within the static block. For unit testing another class that depends on this class could easily mock `staticInit` with [JMockit](https://jmockit.github.io/) to n... | [
0.12997770309448242,
-0.43340450525283813,
0.4284968674182892,
-0.07103429734706879,
0.08647671341896057,
0.345429003238678,
-0.2775692641735077,
-0.0563364215195179,
-0.23572944104671478,
-0.26376137137413025,
-0.1122920960187912,
0.7406535148620605,
-0.30054011940956116,
0.22707156836986... | |
we can do the following in a [JUnit](https://junit.org/junit5/).
```
public class DependentClassTest {
public static class MockClassWithStaticInit {
public static void staticInit() {
}
}
@BeforeClass
public static void setUpBeforeClass() {
Mockit.redefineMethods(ClassWithStaticInit.class, MockClas... | [
0.317749559879303,
-0.27680471539497375,
0.6626725196838379,
0.09228447824716568,
0.12499702721834183,
0.17258377373218536,
0.1466837376356125,
-0.07641799747943878,
-0.14542265236377716,
-0.28575852513313293,
0.2048320770263672,
1.045692801475525,
-0.19410823285579681,
0.1202482059597969,... | |
I usually do the same thing you describe, except I make the static method protected so I can invoke it manually. On top of this, I make sure that the method can be invoked multiple times without problems (otherwise it is no better than the static initializer as far as the tests go).
This works reasonably well, and I c... | [
0.5410570502281189,
0.28388121724128723,
-0.03314553201198578,
0.037427693605422974,
0.03341105207800865,
-0.12703937292099,
0.4775134027004242,
-0.23784250020980835,
-0.017849747091531754,
-0.3837029039859772,
-0.05726325139403343,
0.851468563079834,
-0.08098764717578888,
-0.1510880291461... | |
use this mechanism, I make sure to document that the protected method is only exposed for testing purposes, with the hopes that it won't be used by other developers. This of course may not be a viable solution, for example if the class' interface is externally visible (either as a sub-component of some kind for other t... | [
0.26167431473731995,
0.008287586271762848,
-0.06548258662223816,
0.3342040479183197,
-0.06746339797973633,
-0.6227607727050781,
0.34122374653816223,
0.014135543256998062,
-0.10741043090820312,
-0.6126798391342163,
-0.036893393844366074,
0.588660717010498,
-0.14139430224895477,
0.0185771640... | |
If you were to self-fund a software project which tools, frameworks, components would you employ to ensure maximum productivity for the dev team and that the "real" problem is being worked on.
What I'm looking for are low friction tools which get the job done with a minimum of fuss. Tools I'd characterize as such are ... | [
0.6787286400794983,
-0.19828224182128906,
-0.08612341433763504,
0.3651423454284668,
-0.5833283066749573,
-0.07258333265781403,
0.21686241030693054,
0.029866140335798264,
-0.5490612983703613,
-0.6410006284713745,
-0.06753101944923401,
0.6264243721961975,
-0.041907187551259995,
0.09843778610... | |
afford it, *Team Foundation Server* offers some benefits. If you want to be super-modern, consider a distributed versioning system, such as *git*, *bazaar* or *Mercurial*. Whatever you do, don't use SourceSafe or other lock-based tools, but rather merge-baseed ones. Consider installing both a Windows Explorer client (s... | [
0.5315357446670532,
-0.28409382700920105,
-0.019804321229457855,
0.44492828845977783,
0.22901155054569244,
0.040454406291246414,
-0.12021850049495697,
0.13011981546878815,
-0.4138662815093994,
-0.8669198155403137,
-0.08705268055200577,
0.6286870241165161,
0.18486513197422028,
-0.3730595111... | |
the popular open-source choice. Does the job. Consider installing the *TestDriven.NET* Visual Studio add-in.
That said, you want to look at the answers to [Essential Programming Tools](https://stackoverflow.com/questions/2187/essential-programming-tools) and [What is your best list of ‘must have’ development tools?](h... | [
0.5814465880393982,
0.053550004959106445,
-0.17360983788967133,
0.3010547459125519,
0.03100247122347355,
-0.4260546565055847,
0.18269981443881989,
-0.0838494598865509,
0.030192401260137558,
-0.5279642939567566,
-0.16900111734867096,
0.7598786354064941,
-0.10163559764623642,
-0.154203131794... | |
This question is a follow up to my [previous question](https://stackoverflow.com/questions/56279/export-aspx-to-html) about getting the HTML from an ASPX page. I decided to try using the webclient object, but the problem is that I get the login page's HTML because login is required. I tried "logging in" using the webcl... | [
0.28780171275138855,
0.2312847226858139,
0.5866867303848267,
0.01739053800702095,
0.02673889510333538,
-0.21365836262702942,
0.32737529277801514,
-0.12847557663917542,
-0.40841761231422424,
-0.5798873901367188,
-0.12269843369722366,
0.36441290378570557,
-0.19102710485458374,
0.238837674260... | |
login parameters to a given URI. Should help you out.
**If you don't have login information you shouldn't be trying to circumvent it.**
```
public static string HttpPost( string URI, string Parameters )
{
System.Net.WebRequest req = System.Net.WebRequest.Create( URI );
req.ContentType = "appl... | [
0.1403876096010208,
0.05178646370768547,
0.6932650804519653,
0.1405530720949173,
0.11634854227304459,
-0.19872847199440002,
0.2896096408367157,
-0.07086586207151413,
-0.20990006625652313,
-0.8600044846534729,
-0.44568875432014465,
0.23401746153831482,
-0.5772332549095154,
0.436324208974838... | |
System.IO.Stream os = req.GetRequestStream();
os.Write( bytes, 0, bytes.Length );
os.Close();
System.Net.WebResponse resp = req.GetResponse();
if ( resp == null ) return null;
System.IO.StreamReader sr = new System.IO.StreamReader( resp.GetResponseStream() );
return... | [
-0.17695355415344238,
-0.2798874080181122,
0.772966206073761,
-0.18118815124034882,
0.2876487076282501,
0.24615679681301117,
0.3955686092376709,
-0.11265748739242554,
-0.23502632975578308,
-0.8681641817092896,
-0.40370410680770874,
0.551067590713501,
-0.2427348643541336,
0.2586799263954162... | |
I have a problem with a little .Net web application which uses the Amazon webservice. With the integrated Visual Studio web server everything works fine. But after deploying it to the IIS on the same computer i get the following error message:
```
Ein Verbindungsversuch ist fehlgeschlagen, da die Gegenstelle nach
eine... | [
0.1665627509355545,
0.6190726161003113,
0.31290051341056824,
-0.040874190628528595,
0.04769636690616608,
0.0014675605343654752,
0.7525746822357178,
0.14968466758728027,
0.001081334543414414,
-0.5727781057357788,
-0.09566956758499146,
0.38986948132514954,
-0.40815627574920654,
0.30216965079... | |
should not be used.
**How do I prevent the IIS from using a proxy?**
I think it has something to do with policy settings for the Internet Explorer. An "old" AD user has this setting, but a newly created user does not. I checked all the group policy settings and nowhere is a proxy defined.
The web server is running i... | [
0.47655242681503296,
0.3549489378929138,
0.5508341789245605,
-0.05836649239063263,
-0.0548928864300251,
-0.12378036230802536,
0.2960943281650543,
-0.037622109055519104,
-0.12014005333185196,
-0.8082305788993835,
0.2153545469045639,
0.45243504643440247,
-0.20190832018852234,
0.2759277820587... | |
check?
Proxy use can be configured in the web.config.
The system.net/defaultProxy element will let you specify whether a proxy is used by default or provide a bypass list.
For more info see: [<http://msdn.microsoft.com/en-us/library/kd3cf2ex.aspx>](http://msdn.microsoft.com/en-us/library/kd3cf2ex.aspx) | [
0.4543951451778412,
0.05197061970829964,
0.18707171082496643,
0.24139441549777985,
0.21245594322681427,
-0.13311399519443512,
0.4049222469329834,
0.006942917592823505,
0.032535750418901443,
-0.5468320846557617,
-0.17439690232276917,
0.22727210819721222,
-0.5724096894264221,
0.0514701902866... | |
I have a third party library that internally constructs and uses the SqlConnection class. I can inherit from the class, but it has a ton of overloads, and so far I have been unable to find the right one. What I'd like is to tack on a parameter to the connection string being used.
Is there a way for me to put a breakpo... | [
0.36767786741256714,
0.19000622630119324,
-0.21443524956703186,
0.2134581357240677,
0.13353858888149261,
-0.11508238315582275,
0.08579433709383011,
0.08623340725898743,
-0.19556410610675812,
-0.4501626193523407,
0.2576790153980255,
0.46438053250312805,
-0.2575867474079132,
0.26050212979316... | |
I can do this?
Specifically, what I want to do is to tack on the *Application Name* parameter, so that our application is more easily identified on the server when looking at connections.
---
**Edit**: Well, it appears I need more help. I think I've enabled everything related to symbol server support, and I've notic... | [
0.3964281380176544,
0.16545824706554413,
0.2962581515312195,
0.02632388472557068,
0.03977755829691887,
-0.28451865911483765,
0.5510101914405823,
-0.14509189128875732,
-0.14014491438865662,
-0.8043304681777954,
0.13022710382938385,
0.32181575894355774,
-0.009460141882300377,
0.0793523564934... | |
framework source code Microsoft supplied, you could try a different debugger. Like mdbg or even windbg.
**edit**
[This](http://blogs.msdn.com/sburke/archive/2008/01/16/configuring-visual-studio-to-debug-net-framework-source-code.aspx) explains getting the released parts of .Net framework and how to set breakpoints in... | [
0.5287574529647827,
0.20190076529979706,
0.19265544414520264,
0.05827879533171654,
-0.4753178358078003,
-0.3574230670928955,
0.3706906735897064,
-0.16589871048927307,
-0.05041849613189697,
-0.8000115156173706,
-0.0228421650826931,
0.5610695481300354,
-0.29146188497543335,
-0.22518514096736... | |
I am thinking about the design of an iPhone app I'd like to create. One possible problem is that this application will have to run as root (to access certain network ports). In a typical UNIX app, I'd just get the app to run with setuid, but I'm wondering if that is possible with an iPhone app.
I've read this question... | [
0.6407032608985901,
0.024498846381902695,
-0.013226738199591637,
0.0019272922072559595,
0.22725193202495575,
-0.20531874895095825,
0.2505207061767578,
0.021954607218503952,
-0.3854793608188629,
-0.5780363082885742,
0.21529409289360046,
0.35561349987983704,
-0.15243566036224365,
0.372683018... | |
a hacker tool here.
I'm sure I could get around this on a jail-broken iPhone, but that's not what I'm after. Is there any way to run an app with elevated privileges on an unbroken iPhone?
(BTW, there is no need to warn me about the NDA.)
Section 3.3.4 of the iPhone SDK Agreement suggests that you mustn't work outside... | [
0.2999161183834076,
0.20802941918373108,
0.37422704696655273,
-0.10202459990978241,
0.2059178501367569,
-0.5441182255744934,
0.6639420390129089,
-0.20243649184703827,
-0.5090727806091309,
-0.2222849428653717,
-0.17237697541713715,
0.5137832760810852,
-0.2051263004541397,
-0.059136796742677... | |
So, even if it currently *is* possible to elevate your app's privileges, it very likely won't be in a future release. | [
0.27531665563583374,
0.006958709564059973,
0.3949495553970337,
0.49817177653312683,
0.5337663888931274,
-0.34789878129959106,
0.23155395686626434,
0.15699400007724762,
-0.2668713331222534,
-0.3831460773944855,
-0.10924812406301498,
0.5126577019691467,
-0.0059181274846196175,
0.219656050205... | |
Do you expect your WPF developers to know expression blend?
Any good resources for learning more about Blend?
[UPDATE] Does knowing blend make you more productive?
I found Blend a great way to ease into XAML. Many of the common things you want to do are easy in Blend, especially databinding. Databinding has no intell... | [
0.7067699432373047,
-0.34311118721961975,
0.195987269282341,
0.25356343388557434,
-0.40306854248046875,
-0.49101293087005615,
0.1044142097234726,
-0.07448765635490417,
0.1476988047361374,
-0.7468451261520386,
0.12895232439041138,
0.6643415689468384,
-0.292481392621994,
-0.28889164328575134... | |
Knowing an exception code, is there a way to find out more about what the actual exception that was thrown means?
My exception in question:
0x64487347
Exception address: 0x1
The call stack shows no information.
I'm reviewing a .dmp of a crash and not actually debugging in Visual Studio.
Because you're reviewing a c... | [
0.21553601324558258,
0.41951480507850647,
0.001262680278159678,
0.15675532817840576,
-0.20260758697986603,
-0.23071496188640594,
0.5090959072113037,
-0.035876259207725525,
-0.3045414388179779,
-0.32627931237220764,
0.01640646904706955,
0.3540053963661194,
-0.008659563027322292,
0.162496641... | |
numbers like this.
A little Googling turned up one hit for dHsg in the proper context, the name of a function in a Google Book search for "Using Visual C++ 6" By Kate Gregory. Unfortunately that alone was not helpful. | [
0.1403016448020935,
0.17766869068145752,
0.1098063588142395,
0.2788583040237427,
-0.4018106758594513,
0.19590021669864655,
0.33591797947883606,
0.161905899643898,
-0.43617552518844604,
-0.149323970079422,
0.10523848980665207,
0.19057327508926392,
-0.2727080285549164,
0.04148372262716293,
... | |
I have a function that gives me the following warning:
> [DCC Warning] filename.pas(6939): W1035 Return value of function 'function' might be undefined
The function, however, is clean, small, and does have a known, expected, return value. The first statement in the function is:
```
Result := '';
```
and there is n... | [
-0.06698442995548248,
-0.088097482919693,
0.46105873584747314,
-0.2122550755739212,
-0.13524749875068665,
-0.4100114703178406,
0.46603554487228394,
0.05852966383099556,
-0.13894636929035187,
-0.4279709458351135,
-0.0834759771823883,
0.48816099762916565,
-0.27379557490348816,
0.321386158466... | |
of their head what i can do?
Are you sure you have done everything to solve the warning? Maybe you could post the code for us to look at?
You can turn off the warning locally this way:
```
{$WARN NO_RETVAL OFF}
function func(...): string;
begin
...
end;
{$WARN NO_RETVAL ON}
``` | [
0.4682164490222931,
0.20794744789600372,
0.8258978724479675,
-0.04469215124845505,
0.19940921664237976,
-0.20915232598781586,
0.32669708132743835,
-0.2191917598247528,
-0.27761855721473694,
-0.39182430505752563,
-0.11155861616134644,
0.6817976236343384,
-0.31289881467819214,
0.223793208599... | |
I'm making an example for someone who hasn't yet realized that controls like `ListBox` don't have to contain strings; he had been storing formatted strings and jumping through complicated parsing hoops to get the data back out of the `ListBox` and I'd like to show him there's a better way.
I noticed that if I have an ... | [
0.42101117968559265,
-0.12362082302570343,
0.08219759166240692,
0.02916628308594227,
-0.12271922081708908,
0.030047940090298653,
0.06733189523220062,
-0.3007209002971649,
-0.43995121121406555,
-0.4840463697910309,
0.2902756929397583,
0.45345038175582886,
-0.6068482398986816,
0.140447095036... | |
listbox and a button onto the form:
```
Public Class Form1
Protected Overrides Sub OnLoad(ByVal e As System.EventArgs)
MyBase.OnLoad(e)
For i As Integer = 1 To 3
Dim tempInfo As New NumberInfo()
tempInfo.Count = i
tempInfo.Number = i * 100
ListBox1.... | [
0.035713229328393936,
-0.3102213740348816,
0.5345125198364258,
-0.10757166892290115,
-0.18672235310077667,
-0.04731418564915657,
0.21932749450206757,
-0.3451012372970581,
-0.43277281522750854,
-0.37729859352111816,
-0.2962011396884918,
0.4201950132846832,
-0.5372675657272339,
0.22050042450... | |
Next
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
For Each objItem As Object In ListBox1.Items
Dim info As NumberInfo = DirectCast(objItem, NumberInfo)
info.Count += 1
Next
End Sub
End Class
Publ... | [
-0.4282919466495514,
-0.3632083535194397,
0.8816958069801331,
0.13513340055942535,
0.0210587028414011,
0.1746927797794342,
0.25294771790504456,
-0.220391184091568,
-0.1884034126996994,
-0.41927051544189453,
-0.3447549343109131,
0.2305299937725067,
-0.26829779148101807,
0.5968427062034607,
... | |
Public Number As Integer
Public Overrides Function ToString() As String
Return String.Format("{0}, {1}", Count, Number)
End Function
End Class
```
I thought that perhaps the problem was using fields and tried implementing *INotifyPropertyChanged*, but this had no effect. (The reason I'm using fields i... | [
-0.20628824830055237,
0.16121363639831543,
0.14186692237854004,
0.14074285328388214,
-0.3242800533771515,
0.07561597228050232,
0.29805853962898254,
-0.05824507400393486,
-0.20166029036045074,
-0.1474563479423523,
-0.148077130317688,
0.3421249985694885,
-0.2864644229412079,
0.42590144276618... | |
I've never noticed that I don't know how to make this work.
So what am I missing?
BindingList handles updating the bindings by itself.
```
using System;
using System.ComponentModel;
using System.Windows.Forms;
namespace TestBindingList
{
public class Employee
{
public string Name { get; set; }
... | [
0.412213534116745,
-0.01024855300784111,
0.38159415125846863,
-0.11551033705472946,
-0.15884335339069366,
-0.10258448868989944,
0.28780803084373474,
-0.6667201519012451,
-0.11246800422668457,
-0.6785305738449097,
-0.12869128584861755,
0.3945624530315399,
-0.4339384436607361,
0.223873063921... | |
lstEmployees;
private TextBox txtId;
private TextBox txtName;
private Button btnRemove;
public Form1()
{
InitializeComponent();
FlowLayoutPanel layout = new FlowLayoutPanel();
layout.Dock = DockStyle.Fill; | [
-0.10298532992601395,
-0.37072932720184326,
0.9009177088737488,
-0.5760882496833801,
0.41284164786338806,
0.49247604608535767,
0.0301874577999115,
-0.08183853328227997,
-0.16983498632907867,
-0.7882996797561646,
-0.36424577236175537,
0.5839893817901611,
-0.34300169348716736,
0.071335978806... | |
Controls.Add(layout);
lstEmployees = new ListBox();
layout.Controls.Add(lstEmployees);
txtId = new TextBox();
layout.Controls.Add(txtId);
txtName = new TextBox();
layout.Controls.Add(txtName);
btnRemove = new Button(); | [
-0.12209321558475494,
-0.4333644211292267,
0.6353626251220703,
-0.3101954162120819,
0.2787626087665558,
0.5439550280570984,
-0.1433028280735016,
-0.1692184954881668,
-0.5830215215682983,
-0.9036416411399841,
-0.3542594015598297,
0.489655077457428,
-0.6034876108169556,
0.07195603847503662,
... | |
btnRemove.Click += btnRemove_Click;
btnRemove.Text = "Remove";
layout.Controls.Add(btnRemove);
Load+=new EventHandler(Form1_Load);
}
private void Form1_Load(object sender, EventArgs e)
{
_employees = new BindingList<Employee>(); | [
-0.05910971015691757,
-0.1987849622964859,
0.4245806932449341,
-0.41158416867256165,
0.13141405582427979,
0.15368685126304626,
0.5033705234527588,
-0.43717241287231445,
-0.4357790946960449,
-0.45974263548851013,
-0.4662095308303833,
0.41640597581863403,
-0.6249257326126099,
0.3235270678997... | |
for (int i = 0; i < 10; i++)
{
_employees.Add(new Employee() { Id = i, Name = "Employee " + i.ToString() });
}
lstEmployees.DisplayMember = "Name";
lstEmployees.DataSource = _employees; | [
-0.07633831351995468,
-0.17816738784313202,
0.475385457277298,
-0.40044230222702026,
0.36783573031425476,
0.4966486096382141,
0.05794895067811012,
-0.15728291869163513,
-0.1282499134540558,
-0.7666890025138855,
-0.3292205333709717,
0.35524073243141174,
-0.3417397737503052,
0.22787438333034... | |
txtId.DataBindings.Add("Text", _employees, "Id");
txtName.DataBindings.Add("Text", _employees, "Name");
}
private void btnRemove_Click(object sender, EventArgs e)
{
Employee selectedEmployee = (Employee)lstEmployees.SelectedItem;
if (selectedEmployee != null)... | [
-0.005442925728857517,
-0.5030629634857178,
-0.030817300081253052,
-0.11869554221630096,
0.32690730690956116,
0.36542871594429016,
0.2317166030406952,
0.04109995812177658,
-0.39434412121772766,
-0.42719927430152893,
-0.44160038232803345,
0.35108938813209534,
-0.3982487618923187,
0.32843831... | |
_employees.Remove(selectedEmployee);
}
}
}
}
``` | [
0.11861427128314972,
0.15386231243610382,
0.09826604276895523,
-0.19773580133914948,
0.27928921580314636,
-0.192243292927742,
0.33454400300979614,
0.25489965081214905,
-0.15283675491809845,
-0.48951002955436707,
-0.2837335169315338,
0.369391530752182,
-0.5349155068397522,
0.597878277301788... | |
After trying to avoid JavaScript for years, Iv started using Query for [validation](http://bassistance.de/jquery-plugins/jquery-plugin-validation/) in MVC asp.net, as there does not seem to be an official way of doing validation, Iv been surprised how good jQuery is.
Firstly is there a way to get intellisense working... | [
0.1818869411945343,
-0.11661805212497711,
0.5196727514266968,
-0.1700243353843689,
-0.40997475385665894,
-0.309756338596344,
0.27390527725219727,
-0.3449710011482239,
-0.20124799013137817,
-0.3352114260196686,
0.34978118538856506,
0.47993138432502747,
-0.2614438235759735,
0.019670136272907... | |
UserName: {
required: true,
minLength: 2,
}
},
messages: {
UserName: { | [
-0.3555489480495453,
-0.22442761063575745,
0.28759273886680603,
0.25019630789756775,
0.1316612809896469,
0.3023452162742615,
0.46370720863342285,
0.30133435130119324,
-0.009147990494966507,
-0.6097341775894165,
-0.2826036810874939,
0.4109164774417877,
-0.15075477957725525,
0.15467344224452... | |
required: "Please enter a username",
minLength: "Your username must consist of at least 2 characters",
}
}
});
});
</script>
<form id="CreateLog" action="Create" method="post" />
<label>UserName</label><br />
<%=Html.TextBox("UserName")%>
<br /> | [
-0.27154189348220825,
0.007607119623571634,
0.49420660734176636,
-0.3186374604701996,
0.1305883824825287,
0.1640039086341858,
0.34498143196105957,
-0.4179324209690094,
0.057946622371673584,
-0.5086421966552734,
-0.6533330082893372,
0.43086984753608704,
-0.10470998287200928,
-0.226484522223... | |
<div class="error"> </div>
<input type=submit value=Save />
</form>
```
I tried adding this to the script:
```
errorLabelContainer: $("#CreateLog div.error")
```
and this to the html:
```
<div class="error"> </div>
```
But this didn't work.
Try specifying both a wrapper and a label container ... | [
0.10411471873521805,
-0.12155745178461075,
0.5477061867713928,
-0.24062083661556244,
-0.18189744651317596,
-0.04182562232017517,
0.24115660786628723,
-0.29999151825904846,
0.003590876702219248,
-0.7530452013015747,
-0.17062905430793762,
0.4821200966835022,
-0.484477162361145,
-0.0626650154... | |
UserName: {
required: true,
minLength: 2,
}
},
messages: {
UserName: {
required: "Please enter a username",
minLength: "Your username must consist of at least 2 characters" | [
-0.5162041187286377,
0.017027176916599274,
0.3477189838886261,
0.19021399319171906,
0.0974361002445221,
0.4067355990409851,
0.43331587314605713,
0.23251484334468842,
0.06743095815181732,
-0.5398774743080139,
-0.5440309047698975,
0.3610060513019562,
0.08710305392742157,
-0.2306884527206421,... | |
}
}
});
});
```
```html
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<div class="error-container">
<ul></ul>
</div>
<form id="CreateLog" action="Create" method="post" />
<label>UserName</label><br />
<%=Html.TextBox("UserName")%>
<br />
<in... | [
-0.1644591987133026,
-0.27034276723861694,
0.7120665907859802,
-0.16138394176959991,
0.2347758263349533,
-0.031020479276776314,
0.06456669420003891,
-0.3158905506134033,
-0.03523299843072891,
-0.7655835151672363,
-0.20042772591114044,
0.7045693397521973,
-0.10138993710279465,
-0.1418466418... | |
I need to figure out what div is visible out of four possible divs using jQuery. Only one of those div's will be visible at any given time.
This is what I have that works so far:
```
$("#FeatureImage1:visible, #FeatureImage2:visible, #FeatureImage3:visible, #FeatureImage4:visible").attr("id");
```
Is there a way to... | [
0.22118552029132843,
-0.08954906463623047,
0.6087757349014282,
-0.25323915481567383,
-0.3490860164165497,
0.21228134632110596,
0.3136194348335266,
-0.14053460955619812,
0.06864302605390549,
-0.9472258687019348,
-0.10452662408351898,
0.694818377494812,
-0.11575436592102051,
0.05275161564350... | |
Do you know if there is a built-in function to build a dictionary from an arbitrary object? I'd like to do something like this:
```
>>> class Foo:
... bar = 'hello'
... baz = 'world'
...
>>> f = Foo()
>>> props(f)
{ 'bar' : 'hello', 'baz' : 'world' }
```
**NOTE:** It should not include methods. Only fields.
... | [
0.07114987820386887,
0.2839904725551605,
0.2248823046684265,
-0.20386551320552826,
0.02068202942609787,
0.05524209141731262,
0.35149744153022766,
0.006288360338658094,
0.09522455185651779,
-0.6073946952819824,
0.004057627171278,
0.6222628355026245,
-0.26361340284347534,
-0.0696978643536567... | |
`__dict__`. Usually, you'll declare your methods at class level and your attributes at instance level, so `__dict__` should be fine. For example:
```python
>>> class A(object):
... def __init__(self):
... self.b = 1
... self.c = 2
... def do_nothing(self):
... pass
...
>>> a = A()
>>> a.__dict__
{'c': ... | [
0.009154411032795906,
0.12775270640850067,
0.15754228830337524,
-0.1227605789899826,
-0.18442100286483765,
-0.10772755742073059,
0.36237606406211853,
-0.26016002893447876,
-0.06846572458744049,
-0.5394664406776428,
-0.21004506945610046,
0.6989526748657227,
-0.2639842927455902,
-0.061856780... | |
you can override `getattr` and/or `setattr` to call through and set the dict. For example:
```
class Foo(dict):
def __init__(self):
pass
def __getattr__(self, attr):
return self[attr]
# etc...
``` | [
-0.13808803260326385,
-0.058105189353227615,
0.16591967642307281,
-0.22289696335792542,
-0.2162381261587143,
-0.06412084400653839,
0.38589590787887573,
-0.17634934186935425,
0.10590264201164246,
-0.440311998128891,
-0.3352680504322052,
0.7712348699569702,
-0.48703277111053467,
-0.009357142... | |
There is a lot of information out there on object-relational mappers and how to best avoid impedance mismatch, all of which seem to be moot points if one were to use an object database. My question is why isn't this used more frequently? Is it because of performance reasons or because object databases cause your data t... | [
0.14053060114383698,
0.1930052787065506,
0.06641960889101028,
0.3828778862953186,
-0.20314639806747437,
-0.2978362441062927,
-0.038022302091121674,
0.17875322699546814,
-0.277460515499115,
-0.8877235054969788,
-0.04571905732154846,
0.8717309236526489,
0.2632189393043518,
0.0760606676340103... | |
support.** You can pick between many more first-party (SQL servers) and third-party (administrative interfaces, mappings and other kinds of integration) tools than is the case with OODBMSs.
Naturally, the object-oriented model is more familiar to the *developer*, and, as you point out, would spare one of ORM. But thus... | [
0.21269972622394562,
0.10699919611215591,
0.4046350121498108,
0.3096023499965668,
0.10732202976942062,
-0.19234567880630493,
-0.03516165167093277,
0.020891418680548668,
-0.41895705461502075,
-0.30752813816070557,
-0.2979893386363983,
0.6680179834365845,
-0.35676613450050354,
-0.08469714224... | |
I have a network C++ program in Windows that I'd like to test for network disconnects at various times. What are my options?
Currently I am:
1. Actually disconnecting the network wire from the back of my computer
2. using ipconfig /release
3. Using the [cports](http://www.nirsoft.net/utils/cports.html) program to clo... | [
0.21299917995929718,
0.022248171269893646,
0.4749343693256378,
0.034924574196338654,
-0.00007107034616637975,
-0.19558139145374298,
0.27908235788345337,
0.04186127707362175,
-0.34914103150367737,
-0.7001039981842041,
-0.03533216938376427,
0.5454203486442566,
-0.08960869908332825,
0.4926560... | |
types of problems.
It would also be nice to be able to build some automated unit tests while this emulated bad network is up.
You might want to abstract the network layer, and then you can have unit tests that inject interesting failure events at appropriate points. | [
0.2857156991958618,
0.08300157636404037,
-0.11468735337257385,
0.558184027671814,
-0.1728895604610443,
-0.14672566950321198,
0.18161386251449585,
0.14329884946346283,
-0.34291592240333557,
-0.6318991184234619,
0.034279901534318924,
0.7088495492935181,
-0.17014320194721222,
0.10479341447353... | |
Do you often see in API documentation (as in 'javadoc of public functions' for example) the description of "value limits" as well as the classic documentation ?
**Note:** I am not talking about [comments within the code](https://stackoverflow.com/questions/20922/do-you-comment-your-code)
By "value limits", I mean:
*... | [
0.518964946269989,
0.20418384671211243,
-0.12809033691883087,
-0.05857488885521889,
-0.05285089462995529,
-0.50667804479599,
0.13523392379283905,
-0.05759261175990105,
-0.38118571043014526,
-0.1513163447380066,
-0.26481175422668457,
0.3449172377586365,
-0.25538450479507446,
0.1126547902822... | |
been published first.
* @param aReaderNameRegexp filter in order to return only reader matching the regexp
* @return array of reader names
*/
String[] getReaderNames(final String aReaderNameRegexp);
```
What I *like to see* would be:
```
/**
* Get all readers name for this current Report. <br />
* <b>Warning</... | [
-0.28290578722953796,
-0.1164427101612091,
0.881615161895752,
-0.0506877563893795,
-0.6718477606773376,
0.17457561194896698,
0.06887922435998917,
-0.5049946308135986,
-0.4059133231639862,
-0.33655068278312683,
-0.21676020324230194,
0.23583054542541504,
-0.329025000333786,
0.131204560399055... | |
reader names array matching regexp, or all readers if regexp is null or empty)
*/
String[] getReaderNames(final String aReaderNameRegexp);
```
**My point is:**
When I use a library with a getReaderNames() function in it, I often do not even need to read the API documentation to guess what it does. But I need to be... | [
-0.009188495576381683,
0.02150324173271656,
0.6263983845710754,
-0.08098116517066956,
-0.13577589392662048,
-0.010523950681090355,
0.31247377395629883,
-0.2157105803489685,
-0.11130646616220474,
-0.7436532378196716,
-0.20023423433303833,
0.5705839395523071,
-0.2801666557788849,
0.165406182... | |
almost never see that kind of information in API documentation...
**Edit:**
This can influence the usage or not for *[checked or unchecked exceptions](https://stackoverflow.com/questions/27578#73355)*.
What do you think ? value limits and API, do they belong together or not ?
I think they **can** belong together bu... | [
0.5302082300186157,
0.16214103996753693,
-0.1292424201965332,
0.2554440200328827,
-0.04310469701886177,
-0.4472729563713074,
0.11036491394042969,
-0.21202689409255981,
-0.46554526686668396,
-0.4853067100048065,
0.04474308714270592,
0.44508570432662964,
-0.19445568323135376,
-0.129289820790... | |
is a "restricted integer", where you define an integer variable and explicitly indicate that it will only (and always) be within a certain numeric range. In that case, the datatype itself indicates the restriction. It should still be visible and discoverable through the API documentation and intellisense, but wouldn't ... | [
-0.04442382603883743,
-0.0704612135887146,
0.3313694894313812,
-0.04557204991579056,
0.14986805617809296,
-0.2593998908996582,
-0.24251843988895416,
-0.04178587719798088,
-0.1512337327003479,
-0.02722993865609169,
-0.29497504234313965,
0.13187731802463531,
-0.38399699330329895,
0.088270172... | |
In python, you can have a function return multiple values. Here's a contrived example:
```
def divide(x, y):
quotient = x/y
remainder = x % y
return quotient, remainder
(q, r) = divide(22, 7)
```
This seems very useful, but it looks like it can also be abused ("Well..function X already computes what w... | [
0.06871791929006577,
-0.05354979634284973,
0.13824288547039032,
-0.12491179257631302,
-0.22895818948745728,
-0.10859835892915726,
0.07145833969116211,
-0.37905728816986084,
-0.19999302923679352,
-0.19467203319072723,
-0.06825977563858032,
0.5096511840820312,
-0.3362690508365631,
0.00327143... | |
does exactly that.
```
q, r = divmod(x, y) # ((x - x%y)/y, x%y) Invariant: div*y + mod == x
```
There are other examples: `zip`, `enumerate`, `dict.items`.
```
for i, e in enumerate([1, 3, 3]):
print "index=%d, element=%s" % (i, e)
# reverse keys and values in a dictionary
d = dict((v, k) for k, v in adict.it... | [
-0.1984359174966812,
0.14136560261249542,
0.43858739733695984,
-0.016315000131726265,
-0.4305666983127594,
0.4041476845741272,
0.46761783957481384,
-0.3275286853313446,
0.006718447431921959,
-0.4317188560962677,
-0.5950490236282349,
0.3381349742412567,
-0.14882151782512665,
-0.036178845912... | |
trailing comma for a singleton tuple: a, or (a,)
> * Separating items with commas: a, b, c or (a, b, c)
> * Using the tuple() built-in: tuple() or tuple(iterable)
### Functions should serve single purpose
Therefore they should return a single object. In your case this object is a tuple. Consider tuple as an ad-hoc co... | [
-0.2705754041671753,
-0.2768750786781311,
0.5298202037811279,
-0.005191981792449951,
-0.5303694605827332,
0.07234910875558853,
0.27249574661254883,
0.05027509108185768,
-0.3800486624240875,
-0.11524642258882523,
-0.4953037202358246,
0.11137443035840988,
-0.6054071187973022,
0.1293991357088... | |
tuples instead of plain tuples.
```
>>> import collections
>>> Point = collections.namedtuple('Point', 'x y')
>>> x, y = Point(0, 1)
>>> p = Point(x, y)
>>> x, y, p
(0, 1, Point(x=0, y=1))
>>> p.x, p.y, p[0], p[1]
(0, 1, 0, 1)
>>> for i in p:
... print(i)
...
0
1
``` | [
-0.5059219002723694,
0.012663421221077442,
0.5579201579093933,
-0.04829179495573044,
-0.48373857140541077,
0.5981833338737488,
0.32251447439193726,
-0.1351591944694519,
-0.15992124378681183,
-0.6734623908996582,
-0.6685100197792053,
0.10352329164743423,
-0.3197742700576782,
-0.060714814811... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.