text stringlengths 0 30.5k | title stringclasses 1
value | embeddings listlengths 768 768 |
|---|---|---|
function>(*ph, ...);
``` | [
0.02174810692667961,
-0.11303596198558807,
0.28359130024909973,
-0.17290739715099335,
0.08963034301996231,
0.17411859333515167,
0.25744539499282837,
-0.17422625422477722,
0.2611759901046753,
-0.6338276863098145,
-0.39009130001068115,
0.588883638381958,
-0.3510848581790924,
0.08883415907621... | |
Rails is a great platform, but it just doesn't have the history that Perl does, so I thought it might be an interesting idea to put them together. Anybody with lots of Rails experience see any problems with this?
Rails is not a platform. Rails is a web framework written in, and for, the Ruby programming language. | [
0.4975789487361908,
-0.016023527830839157,
-0.21530838310718536,
0.35630255937576294,
-0.37216106057167053,
-0.12928923964500427,
0.1646166890859604,
0.36112117767333984,
-0.08375566452741623,
-0.5306930541992188,
0.18500514328479767,
0.18859203159809113,
-0.559560239315033,
-0.00766587303... | |
We have a situation where our application calls some stored procedures on a sql 2000 server. Now we must get some of the data from another sql 2000 box connected by a vpn.
What would the syntax look like for performing CRUD operations from one sql server to another sql server?
Both database servers are SQL 2000 and r... | [
0.22758564352989197,
0.06318430602550507,
0.32255515456199646,
0.3037928640842438,
-0.05366668477654457,
-0.2401585429906845,
0.04042022302746773,
-0.06893859803676605,
-0.31704971194267273,
-0.5370942950248718,
-0.06751653552055359,
0.534087598323822,
-0.46790656447410583,
0.3993303477764... | |
server access
> * The ability to issue distributed
> queries, updates, commands, and
> transactions on heterogeneous data
> sources across the enterprise.
> * The ability to address diverse data sources similarly.
A query could look like this:
```
SELECT * FROM MyRemoteServer.MyDB.dbo.MyTable
``` | [
-0.1738189309835434,
0.0822451040148735,
0.39260751008987427,
0.22546297311782837,
-0.22720672190189362,
0.02115166001021862,
0.08292870223522186,
0.21304215490818024,
-0.2768082320690155,
-0.8894509673118591,
-0.10278131812810898,
0.023011036217212677,
-0.2135329693555832,
0.4978064298629... | |
Our application allows the user to change the Culture that they run it under and that culture can be different than the underlying OS Culture. The only way that I have found of doing this is by setting Thread.CurrentThread.CurrentCulture and Thread.CurrentThread.CurrentUICulture for every thread.
The only problem with... | [
0.8363215923309326,
0.0753885954618454,
0.5264778733253479,
0.056425850838422775,
0.06663232296705246,
0.02202090248465538,
0.07682927697896957,
0.28378164768218994,
-0.26891329884529114,
-0.6793715953826904,
0.40898042917251587,
0.34955593943595886,
-0.5008321404457092,
0.3384393453598022... | |
like to find a better way of doing this. I can only think of two things, but I don't know if either are possible.
1. Set the culture at the application level so that all threads default to that culture. Is this possible?
2. Is there a thread creation event anywhere that I can subscribe to? This way I can set up one ha... | [
0.943764865398407,
-0.17393992841243744,
0.31585270166397095,
0.17842285335063934,
-0.12523135542869568,
-0.054119281470775604,
0.16638168692588806,
0.29867932200431824,
-0.2802661955356598,
-0.5211471915245056,
0.22972466051578522,
0.30785074830055237,
-0.46135106682777405,
0.123115383088... | |
found.
Two new properties were added to the CultureInfo class in .NET 4.5 which solve this problem, [DefaultThreadCurrentCulture](http://msdn.microsoft.com/en-us/library/vstudio/system.globalization.cultureinfo.defaultthreadcurrentculture) and [DefaultThreadCurrentUICulture](http://msdn.microsoft.com/en-us/library/vstu... | [
0.3091255724430084,
-0.41200709342956543,
0.46904951333999634,
0.04722094535827637,
-0.009986354038119316,
0.1748647391796112,
0.16041876375675201,
0.10905076563358307,
-0.49390411376953125,
-0.6631824374198914,
0.22010132670402527,
0.30927085876464844,
-0.26104193925857544,
0.477741271257... | |
What is the best way to redirect to the login page when the session expires. I'm using
```
sessionState mode="InProc"
```
Can I set this in the web.config file?
The trick to remember about the session expiration is that this happens in the the worker process running behind the scenes and there is no direct way to n... | [
0.20272597670555115,
0.13590700924396515,
0.7483336329460144,
-0.14422239363193512,
0.2851710319519043,
-0.43540599942207336,
0.5891306400299072,
-0.11177316308021545,
-0.4059430956840515,
-1.0149692296981812,
-0.26117777824401855,
0.4526553153991699,
-0.28009018301963806,
0.11433848738670... | |
");", True)
```
You'll notice that I have the actual milliseconds stored in my web.config file so that I can adjust the timeout length as needed.
Using this, combined with the typical Session\_End event in the Global.asax file makes a pretty clean way of handling session timeouts in my web apps. | [
0.16761766374111176,
-0.003942613489925861,
0.5316651463508606,
-0.06488906592130661,
0.15941642224788666,
-0.16387107968330383,
0.3593566119670868,
0.2218204140663147,
-0.12130744755268097,
-0.7979555130004883,
0.06721024215221405,
0.5318021178245544,
0.10753895342350006,
0.04849448800086... | |
I'm just curious what Afx stands for. And what about Fx in FxCop?
From [Wikipedia](http://en.wikipedia.org/wiki/Application_Framework_eXtensions):
> One interesting quirk of MFC is the
> use of "Afx" as the prefix for many
> functions, macros and the standard
> precompiled header name "stdafx.h".
> During early de... | [
0.3741188049316406,
-0.005108431912958622,
0.6381865739822388,
-0.15164782106876373,
-0.1550309807062149,
0.01570141687989235,
-0.21726985275745392,
-0.3319624662399292,
-0.3128645122051239,
-0.4448554813861847,
-0.007993746548891068,
0.3292646110057831,
-0.6541194915771484,
-0.15637996792... | |
a group called the AFX group
>
> (stands for (A)pplication
> (F)ramework(X)).
[...]
> The AFX group was actually
> responsible for two things: the MFC
> library and the IDE's support for
> MFC (namely, the resource editor and
> the wizards). The AFX name was
> dropped in April 1994, and the group's
> membe... | [
-0.3451637625694275,
0.09198325127363205,
0.507243275642395,
-0.2607440650463104,
-0.40013086795806885,
-0.07879994064569473,
0.004993776325136423,
-0.3477190136909485,
-0.19644774496555328,
-0.09094161540269852,
-0.37096890807151794,
0.555666446685791,
-0.6312615871429443,
-0.337096601724... | |
I have an SVN repository where I have trunk and a branch.
I intend to merge the trunk into the branch at regular intervals, however, when I do this I see many property status changes, in addition to actual file content changes.
On further investigation the property changes are mergeinfo properties. I wouldn't expect ... | [
0.20904895663261414,
-0.13590465486049652,
0.28598788380622864,
0.18297484517097473,
0.3080311715602875,
-0.2076164335012436,
0.34294721484184265,
0.18715374171733856,
-0.21239130198955536,
-0.8021426796913147,
0.02387753501534462,
0.5327883362770081,
-0.035435520112514496,
0.5881680846214... | |
branch get all these mergeinfo changes in it at sub-directory levels?
Subversion 1.5.x adds a lot of svn:mergeinfo properties, even on files/folders which you think have nothing to do with the merge. But Subversion still uses those to reduce the merge time for subsequent merges.
If you don't like those, you can safely... | [
-0.003812086535617709,
-0.7500593066215515,
0.5358251333236694,
0.09178061783313751,
-0.12843741476535797,
-0.17205679416656494,
0.3339272439479828,
0.39611074328422546,
-0.5480935573577881,
-0.3713254928588867,
-0.12362595647573471,
0.4512954652309418,
-0.5584359765052795,
-0.074194058775... | |
If you set the Visible property of a Windows Forms control to true, that property still returns false if any of the control's parent windows are hidden. Is there a way to get the true, underlying visibility flag of the control in case the parent window is hidden?
Well, the regular implementation *does* check up the con... | [
0.0935252457857132,
0.014879288151860237,
0.0784565731883049,
0.12244913727045059,
0.13448213040828705,
-0.2793402671813965,
0.5516974329948425,
-0.00401698425412178,
0.010494688525795937,
-0.7664419412612915,
-0.25001800060272217,
0.5750865936279297,
-0.16909784078598022,
0.04127244651317... | |
Form form = new Form
{
Controls = {
new Panel {
Visible = false,
Controls = {
(query = new Panel {Visible = true}) | [
-0.27506446838378906,
-0.5161585807800293,
0.665176272392273,
0.043189920485019684,
-0.13429193198680878,
0.09639962017536163,
0.22984763979911804,
-0.3668864667415619,
-0.03351036459207535,
-0.8525671362876892,
-0.3235247731208801,
0.37962549924850464,
-0.2525666356086731,
-0.114743299782... | |
}
}
}
};
form.Show();
// this is the dodgy bit...
bool visible = (bool)typeof(Control)
.GetMethod("GetState", BindingFlags.Instance | BindingFlags.NonPublic)
.Invoke(query, new object[] { 2 });
``` | [
-0.08959450572729111,
-0.19420544803142548,
0.5756543874740601,
-0.1375235915184021,
0.07846616208553314,
-0.19595718383789062,
0.561922013759613,
-0.3132990300655365,
-0.14556851983070374,
-0.36660024523735046,
-0.3512755334377289,
0.3813084661960602,
-0.5439939498901367,
0.17706817388534... | |
We want to write a Windows/OS X app that sends podcast ratings info from an iPod and iTunes back to a server. Two questions:
1. Is there documentation for how ratings data are stored in iTunes,
2. if a user has iTunes set to auto-delete programs he has heard, is there a way to capture the ratings data before it's gone... | [
0.5182378888130188,
0.2777269780635834,
0.5572766065597534,
0.44280511140823364,
0.19825929403305054,
-0.20008930563926697,
-0.20824599266052246,
-0.1218070313334465,
-0.09884925931692123,
-0.4192056953907013,
0.13609521090984344,
0.6667499542236328,
0.0854930579662323,
0.01736819185316562... | |
what the user rated each song. Since its XML, it's pretty self-explanatory. That should be pretty easy to open and parse from the program you're writing.
I think iTunes doesn't remove the podcasts from its xml file until the program is closed. You should be able to grab that rating data as long as itunes is still open... | [
0.4127071499824524,
0.1391068547964096,
0.47841039299964905,
0.4887092411518097,
-0.18539582192897797,
-0.2795907258987427,
0.10224414616823196,
0.32690781354904175,
-0.053508784621953964,
0.0139081459492445,
0.20512348413467407,
0.8833185434341431,
0.168868288397789,
-0.12385682016611099,... | |
Is there an elegant solution for synchronizing sessions across multiple ASP.NET applications? I'm sure this could easily be considered a security hole, but there is a 3rd party ASP.NET application involved, for which there is no ability to extend. For this reason, a second [related] site is being developed, but will re... | [
0.3169201910495758,
0.06942196935415268,
0.04111611470580101,
0.38640302419662476,
0.10918694734573364,
-0.45193761587142944,
0.20161813497543335,
0.0025832357350736856,
-0.3220561146736145,
-0.403129518032074,
0.03496662899851799,
0.4004829227924347,
-0.30603620409965515,
0.13698320090770... | |
of your most easy solutions.make sure you have proper permissions set on the SQL objects. I am not familiar with what Manu has suggested. There is actually one more way of doing it which is a little difficult. Its done by implementing a modification of the memento like pattern. App1 stores session info in the database ... | [
0.07534003257751465,
0.020685406401753426,
0.192731112241745,
0.37101906538009644,
0.11541835218667984,
0.13348521292209625,
0.44466203451156616,
-0.2526807188987732,
-0.22391149401664734,
-0.6865827441215515,
-0.08966144174337387,
0.5148136615753174,
-0.058016322553157806,
0.1843555122613... | |
for me in one of my projects. | [
0.7376989722251892,
0.06114160642027855,
0.023882679641246796,
0.20172159373760223,
0.44753092527389526,
0.42188361287117004,
-0.2832401990890503,
0.05684434622526169,
-0.2458084672689438,
-0.2079736441373825,
-0.14713338017463684,
0.10945349186658859,
0.1074577271938324,
-0.01865899376571... | |
Will the following code result in a deadlock using C# on .NET?
```
class MyClass
{
private object lockObj = new object();
public void Foo()
{
lock(lockObj)
{
Bar();
}
}
public void Bar()
{
lock(lockObj) | [
0.10658124834299088,
0.20510034263134003,
0.3312424123287201,
-0.3084716796875,
0.41806691884994507,
-0.10297763347625732,
0.5519220232963562,
-0.2866440713405609,
-0.2445470690727234,
-0.23034898936748505,
-0.3171110153198242,
0.6050983667373657,
-0.5833185315132141,
0.38504257798194885,
... | |
{
// Do something
}
}
}
```
No, not as long as you are locking on the same object. The recursive code effectively **already has the lock** and so can continue unhindered.
`lock(object) {...}` is shorthand for using the [Monitor](http://msdn.microsoft.com/en-us/library/system.threading.... | [
0.32402339577674866,
-0.21169915795326233,
0.39049357175827026,
0.038306158035993576,
0.43934962153434753,
-0.2901412844657898,
0.41092777252197266,
-0.1250058114528656,
-0.6396363973617554,
-0.21423663198947906,
-0.5363072156906128,
0.48548707365989685,
-0.3419858515262604,
0.250992268323... | |
*different* objects, that's when you have to be careful. Pay particular attention to:
* Always acquire locks on a given number of objects in the same sequence.
* Always release locks in the **reverse** sequence to how you acquire them.
If you break either of these rules you're pretty much guaranteed to get deadlock i... | [
0.2565480172634125,
-0.29016202688217163,
0.4911963641643524,
-0.0014531522756442428,
0.0018024856690317392,
-0.026816926896572113,
0.5385735630989075,
-0.17256121337413788,
-0.757326602935791,
-0.5848417282104492,
0.22630029916763306,
0.528185248374939,
-0.4266188144683838,
0.272578895092... | |
can acquire locks on the root of that object graph, then do so. This means you have one lock on that root object and therefore don't have to worry so much about the sequence in which you acquire/release locks.
*(One further note, your example isn't technically recursive. For it to be recursive, `Bar()` would have to c... | [
-0.02995269000530243,
-0.1371893286705017,
0.07815093547105789,
-0.05936821922659874,
0.23224890232086182,
-0.09139637649059296,
0.41321077942848206,
-0.17049579322338104,
-0.3096284568309784,
-0.49476465582847595,
-0.2976900637149811,
0.31444257497787476,
-0.25211724638938904,
-0.02953524... | |
I really like how Consolas looks with ClearType enabled but unfortunately it makes everything else look terrible. Is there any way to enable this on a per app basis? I noticed that putty (the terminal emulator) has options for ClearType separate from the display setting.
I'm not entirely sure if I understood your quest... | [
-0.1664658635854721,
-0.14590278267860413,
0.9723851084709167,
-0.15377157926559448,
0.043074123561382294,
0.24240638315677643,
0.03784579411149025,
0.15209223330020905,
0.16238239407539368,
-0.7501446604728699,
0.0687553808093071,
0.71534663438797,
-0.4724327325820923,
-0.0202622879296541... | |
get { return text; }
set
{
if (text != value)
{
text = value;
// TODO: Raise the NotifyPropertyChanged event here | [
-0.26255494356155396,
-0.24223044514656067,
0.35930192470550537,
-0.06220999360084534,
0.21811679005622864,
-0.15768392384052277,
0.5333501696586609,
-0.2120579332113266,
-0.030802208930253983,
-0.49579447507858276,
-0.4333174526691437,
0.8696752786636353,
-0.1771629899740219,
-0.182441845... | |
}
}
}
}
```
With this you should be able to simply bind to the `Text` property | [
0.06084578484296799,
0.4132244884967804,
0.19384106993675232,
-0.10920940339565277,
0.02345726452767849,
-0.5899612903594971,
0.11908015608787537,
0.04579131677746773,
0.19436563551425934,
-0.483446329832077,
-0.3503532111644745,
0.6376007795333862,
-0.26431068778038025,
0.2216583639383316... | |
To the best of my knowledge, creating a dynamic Java proxy requires that one have an interface to work against for the proxy. Yet, Hibernate seems to manage its dynamic proxy generation without requiring that one write interfaces for entity classes. How does it do this? The only clue from the Hibernate documentation re... | [
-0.12424486130475998,
-0.05100870132446289,
0.15139460563659668,
0.12917082011699677,
-0.3346838653087616,
-0.22573840618133545,
0.26896214485168457,
0.0033949341159313917,
-0.16762998700141907,
-0.4315703511238098,
0.19843317568302155,
0.5776596665382385,
-0.39387649297714233,
0.053875543... | |
Do they just create a proxy of some trivial interface without concern for type safety and then cast it as desired?
Since Hibernate 3.3, the default bytecode provider is now Javassist rather than CGLib.
[Hibernate Core Migration Guide : 3.3](https://community.jboss.org/wiki/HibernateCoreMigrationGuide33) | [
-0.18177971243858337,
-0.20793163776397705,
0.4302443563938141,
-0.2527683973312378,
-0.08382827043533325,
-0.021603120490908623,
0.295154869556427,
0.003358980407938361,
-0.0859149694442749,
-0.35578298568725586,
-0.24142557382583618,
0.14907456934452057,
-0.39130350947380066,
-0.10049577... | |
I've been working with python for a while now and am just starting to learn wxPython. After creating a few little programs, I'm having difficulty understanding how to create objects that can be shared between dialogs.
Here's some code as an example (apologies for the length - I've tried to trim):
```
import wx
class... | [
0.5127393007278442,
0.22612953186035156,
0.3446670174598694,
-0.30067574977874756,
0.09367582947015762,
0.1843528151512146,
-0.008222180418670177,
-0.18738386034965515,
-0.1834077090024948,
-0.6865242123603821,
0.060192130506038666,
0.5731287002563477,
-0.4298611581325531,
0.10742928087711... | |
buttonSizer = wx.BoxSizer(wx.HORIZONTAL)
playerButton = wx.Button(self, wx.ID_ANY, "Player number", wx.DefaultPosition, wx.DefaultSize, 0)
buttonSizer.Add(playerButton, 1, wx.ALL | wx.EXPAND, 0)
nameButton = wx.Button(self, wx.ID_ANY, "Player name", wx.DefaultPosition, wx.DefaultSize, 0)
... | [
-0.680509090423584,
-0.11192963272333145,
0.6633011698722839,
-0.3523111939430237,
0.08424663543701172,
0.4528431296348572,
-0.3070962131023407,
-0.3851493299007416,
-0.5131799578666687,
-0.7103956341743469,
-0.2362748384475708,
0.5179033279418945,
-0.4838007390499115,
-0.248169407248497,
... | |
self.Layout()
# Deal with the events
playerButton.Bind(wx.EVT_BUTTON, self.playerButtonEvent)
nameButton.Bind(wx.EVT_BUTTON, self.nameButtonEvent)
self.Show(True)
return
def playerButtonEvent(self, event):
"""Displays the number of game players"""
playerDial... | [
-0.23818817734718323,
0.08103954792022705,
0.3792054057121277,
-0.4457327127456665,
-0.0864327922463417,
-0.09792473167181015,
0.2955435514450073,
-0.22222332656383514,
-0.3318164050579071,
-0.7675969004631042,
-0.22519905865192413,
0.5779397487640381,
-0.4863402545452118,
0.15535646677017... | |
playerDialog.Destroy()
return
def nameButtonEvent(self, event):
"""Displays the names of game players"""
nameDialog = NameDialogWindow(None, -1, "Name")
nameDialogResult = nameDialog.ShowModal()
nameDialog.Destroy()
return
class PlayerDialogWindow(wx.Dialog):
"... | [
-0.2189965844154358,
-0.2934229373931885,
0.18947827816009521,
-0.008305025286972523,
0.06974907964468002,
0.06381784379482269,
0.04443736746907234,
0.01446626428514719,
-0.1755206435918808,
-0.5804654955863953,
-0.42635586857795715,
0.3019525706768036,
-0.27262184023857117,
0.485053151845... | |
# Setup layout items
self.SetAutoLayout(True)
mainSizer = wx.BoxSizer(wx.VERTICAL)
dialogPanel = wx.Panel(self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.TAB_TRAVERSAL)
dialogSizer = wx.BoxSizer(wx.VERTICAL)
# Display player number
playerNumber = "Player number i... | [
-0.24025554955005646,
-0.16176456212997437,
0.4658990204334259,
-0.2168837934732437,
0.15183982253074646,
0.20601099729537964,
-0.03514332324266434,
-0.30852842330932617,
-0.46429237723350525,
-0.9634734988212585,
-0.2836015522480011,
0.423161119222641,
-0.347752183675766,
0.04651579260826... | |
| wx.EXPAND, 5)
# Setup buttons
buttonSizer = wx.StdDialogButtonSizer()
okButton = wx.Button(dialogPanel, wx.ID_OK)
buttonSizer.AddButton(okButton)
buttonSizer.Realize()
dialogSizer.Add(buttonSizer, 1, wx.EXPAND, 5)
# Complete layout
dialogPanel.SetSizer... | [
-0.16091856360435486,
-0.02329939603805542,
0.5461402535438538,
-0.3512714207172394,
0.15346215665340424,
0.31103116273880005,
0.012102310545742512,
-0.6381200551986694,
-0.5147920250892639,
-0.9940541386604309,
-0.564171552658081,
0.4788358807563782,
-0.5228801369667053,
-0.27436360716819... | |
mainSizer.Add(dialogPanel, 1, wx.ALL | wx.EXPAND, 5)
self.SetSizer(mainSizer)
self.Layout()
# Deal with the button events
okButton.Bind(wx.EVT_BUTTON, self.okClick)
return
def okClick(self, event):
"""Deals with the user clicking the ok button"""
self.EndMod... | [
-0.5011842846870422,
-0.2544324994087219,
0.39245083928108215,
-0.27114129066467285,
0.18319609761238098,
0.003635296132415533,
0.04929819703102112,
-0.26876136660575867,
-0.1765356957912445,
-0.5584377646446228,
-0.5519739985466003,
0.6758273839950562,
-0.467012494802475,
0.12608142197132... | |
def __init__(self, parent, id, title):
wx.Dialog.__init__(self, parent, id, title, size=(200,120))
# Setup layout items
self.SetAutoLayout(True)
mainSizer = wx.BoxSizer(wx.VERTICAL)
dialogPanel = wx.Panel(self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.TAB_TRAVERSAL)
... | [
-0.19238412380218506,
-0.1198883131146431,
0.4823172390460968,
-0.14241550862789154,
0.1514359414577484,
0.16515517234802246,
-0.05032878369092941,
-0.5327073335647583,
-0.41484570503234863,
-0.7621379494667053,
-0.2947967052459717,
0.5210582613945007,
-0.18291528522968292,
0.0128142936155... | |
newLabel = wx.StaticText(dialogPanel, wx.ID_ANY, playerNumber, wx.DefaultPosition, wx.DefaultSize, 0)
dialogSizer.Add(newLabel, 0, wx.ALL | wx.EXPAND, 5)
# Setup buttons
buttonSizer = wx.StdDialogButtonSizer()
okButton = wx.Button(dialogPanel, wx.ID_OK)
buttonSizer.AddButton(okB... | [
-0.2757204473018646,
-0.12901076674461365,
0.667641282081604,
-0.19484706223011017,
0.34298065304756165,
0.2983304262161255,
0.0005455674836412072,
-0.5266333222389221,
-0.453784704208374,
-1.0561836957931519,
-0.3889055550098419,
0.6109192371368408,
-0.44140756130218506,
-0.10161303728818... | |
dialogPanel.SetSizer(dialogSizer)
dialogPanel.Layout()
dialogSizer.Fit(dialogPanel)
mainSizer.Add(dialogPanel, 1, wx.ALL | wx.EXPAND, 5)
self.SetSizer(mainSizer)
self.Layout()
# Deal with the button events
okButton.Bind(wx.EVT_BUTTON, self.okClick)
return... | [
-0.30495911836624146,
-0.0938001275062561,
0.5542073249816895,
-0.3366168439388275,
0.07141391187906265,
0.24419833719730377,
0.11985307931900024,
-0.4119725525379181,
-0.3591262996196747,
-0.5916372537612915,
-0.4683622419834137,
0.541080892086029,
-0.545301079750061,
-0.20951814949512482... | |
self.EndModal(wx.ID_OK)
return
class Player(object):
"""A game player"""
def __init__(self, number, name):
self.number = number
self.name = name
return
def main():
# Start GUI
global gamePlayer
gamePlayer = Player(1, "John Smith")
app = wx.App(redirect=False)
... | [
-0.12309763580560684,
0.15448187291622162,
0.3677399158477783,
-0.1606599986553192,
0.00588277168571949,
0.09822975099086761,
0.1800035834312439,
-0.035307176411151886,
-0.2167917937040329,
-0.7675797343254089,
-0.04356475546956062,
0.6854358315467834,
-0.6499897241592407,
0.20025591552257... | |
app.MainLoop()
return 0
if __name__ == '__main__':
main()
```
So, I want both of the dialogs to access the gamePlayer object. At the moment, the only way I can think of doing it is to create the gamePlayer object as a global object, but these are normally frowned upon - is there a better way to do this?
The... | [
-0.09427370876073837,
0.006174740381538868,
0.5766515731811523,
0.06774979829788208,
0.10963775962591171,
0.11481888592243195,
0.1646023690700531,
0.21774406731128693,
-0.4179954528808594,
-0.6458963751792908,
-0.2655465006828308,
0.6631708741188049,
-0.649147093296051,
-0.0922653600573539... | |
parent, id, title, gamePlayer ):
...etc...
```
In the long run, this isn't ideal.
You should separate building an empty panel from loading that panel with data. The empty panel is one thing, populating it with data from the model is unrelated.
Populating a frame with data is where you must be given the gamePla... | [
0.3215698301792145,
0.06029253453016281,
0.2923148274421692,
0.07908441126346588,
-0.069998599588871,
-0.18170051276683807,
-0.19536253809928894,
-0.24304069578647614,
-0.09324798732995987,
-0.5412943363189697,
-0.10368626564741135,
0.7174282073974609,
-0.22334370017051697,
0.1480991840362... | |
you have a "document" which is the main object ("gamePlayer") that is being displayed. Each Frame is a view of that document. | [
0.40697231888771057,
-0.10070838779211044,
0.5012494921684265,
0.5277491807937622,
0.28976866602897644,
-0.3178798258304596,
-0.26499998569488525,
-0.09757630527019501,
-0.13695916533470154,
-0.46255412697792053,
-0.2928101420402527,
0.4886699616909027,
0.14561526477336884,
-0.009391372092... | |
FieldInfo has an IsStatic member, but PropertyInfo doesn't. I assume I'm just overlooking what I need.
```
Type type = someObject.GetType();
foreach (PropertyInfo pi in type.GetProperties())
{
// umm... Not sure how to tell if this property is static
}
```
To determine whether a property is static, you must obta... | [
-0.05820133164525032,
-0.17682626843452454,
0.32016316056251526,
-0.007321955636143684,
0.018915371969342232,
-0.0447220616042614,
-0.15932391583919525,
-0.3491734564304352,
-0.02616279385983944,
-0.3512602150440216,
-0.3705921769142151,
0.6298993825912476,
-0.31858140230178833,
-0.1386602... | |
I have a friend who likes to use metaclasses, and regularly offers them as a solution.
I am of the mind that you almost never need to use metaclasses. Why? because I figure if you are doing something like that to a class, you should probably be doing it to an object. And a small redesign/refactor is in order.
Being a... | [
0.29048991203308105,
0.03711885213851929,
-0.21939019858837128,
0.20714643597602844,
-0.14410023391246796,
-0.13156235218048096,
0.4225914180278778,
0.40112733840942383,
-0.25031453371047974,
-0.7603660821914673,
0.13955937325954437,
0.3931743800640106,
-0.14158150553703308,
0.350178986787... | |
decorators has unfortunately made it even more acceptable.
So please, I am desperate to know your valid (concrete) use-cases for metaclasses in Python. Or to be enlightened as to why mutating classes is better than mutating objects, sometimes.
I will start:
> Sometimes when using a third-party
> library it is usefu... | [
0.6669031381607056,
0.10670408606529236,
-0.0176333449780941,
0.24716022610664368,
-0.17763473093509674,
0.06677697598934174,
0.1392396241426468,
-0.07230661064386368,
-0.1515520066022873,
-0.7664324641227722,
0.3423512578010559,
0.5928238034248352,
-0.396019846200943,
-0.12242459505796432... | |
found that I was able to increment the figure count, call draw manually, etc, but I needed to do these before and after every plotting call. So to create both an interactive plotting wrapper and an offscreen plotting wrapper, I found it was more efficient to do this via metaclasses, wrapping the appropriate methods, th... | [
0.09249455481767654,
-0.23653727769851685,
0.28083401918411255,
0.04932111129164696,
-0.14156216382980347,
-0.0034892940893769264,
-0.08087056130170822,
-0.4068542420864105,
-0.03331884369254112,
-0.7408689260482788,
0.011265232227742672,
0.5550083518028259,
-0.25147101283073425,
-0.307936... | |
_Interactify(type):
def __init__(cls, name, bases, d):
super(_Interactify, cls).__init__(name, bases, d)
for base in bases:
for attrname in dir(base):
if attrname in d: continue # If overridden, don't reset
attr = getattr(cls, attrname) | [
-0.15752802789211273,
-0.28978630900382996,
0.7855476140975952,
-0.15639914572238922,
-0.19556885957717896,
0.009846665896475315,
0.4666200578212738,
-0.3072279393672943,
-0.2916819751262665,
-0.5383492708206177,
-0.1932002604007721,
0.5795072317123413,
-0.6804758906364441,
0.1636911928653... | |
if type(attr) == types.MethodType:
if attrname.startswith("add_"):
setattr(cls, attrname, wrap_pylab_newplot(attr))
elif attrname.startswith("set_"): | [
-0.1425195187330246,
-0.11867255717515945,
0.5751369595527649,
-0.24788030982017517,
0.12238391488790512,
-0.04761982336640358,
0.1993061751127243,
-0.5819082260131836,
0.06077047437429428,
-0.3630933463573456,
-0.25045427680015564,
0.5057740807533264,
-0.4704683721065521,
-0.1469727605581... | |
setattr(cls, attrname, wrap_pylab_show(attr))
```
Of course, there might be better ways to do this, but I've found this to be effective. Of course, this could also be done in `__new__` or `__init__`, but this was the solution I found the most straightforward. | [
0.40461528301239014,
-0.11525806039571762,
0.5946016311645508,
0.03376087173819542,
-0.06929167360067368,
-0.39609163999557495,
0.05386948212981224,
-0.2884560823440552,
-0.03915916383266449,
-0.6723739504814148,
-0.2429627925157547,
0.46552422642707825,
-0.40289098024368286,
-0.0189513619... | |
I am retrieving three different sets of data (or what should be "unique" rows). In total, I expect 3 different unique sets of rows because I have to complete different operations on each set of data. I am, however, retrieving more rows than there are in total in the table, meaning that I must be retrieving duplicate ro... | [
-0.08527453988790512,
0.3224484920501709,
0.2458578646183014,
-0.050692036747932434,
-0.2067725509405136,
0.4330195486545563,
0.29189544916152954,
-0.6148175001144409,
-0.1977567970752716,
-0.6895360350608826,
-0.02418803609907627,
0.29425862431526184,
-0.1026434600353241,
0.32168236374855... | |
AND t2.NAME = t1.NAME
AND t2.ADDRESS <> t1.ADDRESS
SELECT DISTINCT t1.*
FROM table1 t1
INNER JOIN table2 t2
ON t2.ID = t1.ID
AND t2.NAME <> t1.NAME
AND t2.ADDRESS <> t1.ADDRESS
SELECT DISTINCT t1.*
FROM table1 t1
INNER JOIN table2 t2 | [
-0.4068356156349182,
-0.013706090860068798,
0.23439644277095795,
-0.047207579016685486,
-0.014898665249347687,
0.5205211043357849,
-0.06888869404792786,
-0.4815065860748291,
-0.12445616722106934,
-0.5022770166397095,
-0.49992093443870544,
0.37035882472991943,
0.039666421711444855,
0.130109... | |
ON t2.ID <> t1.ID
AND t2.NAME = t1.NAME
AND t2.ADDRESS <> t1.ADDRESS
```
As you can see, I am selecting (in order of queries)
* Set of data where the id AND name match
* Set of data where the id matches but the name does NOT
* Set of data where the id does not match but name DOES
I am retrie... | [
-0.10937736183404922,
0.14108256995677948,
0.2322607934474945,
-0.08174259960651398,
-0.01782429777085781,
0.2902921140193939,
0.07313960790634155,
-0.35903894901275635,
-0.00821739248931408,
-0.7870095372200012,
-0.18751655519008636,
0.6148030757904053,
-0.15548579394817352,
-0.0090517625... | |
which I don't think is logically possible, plus this means I must be duplicating rows (if it is logically possible) somewhere which prevents me from executing different commands against each set (since a row would have another command executed on it).
Can someone find where I'm going wrong here?
Consider if Name is no... | [
0.0628110021352768,
0.3725070059299469,
0.05824332684278488,
-0.035757362842559814,
0.21635262668132782,
-0.20408260822296143,
0.10210242122411728,
-0.16788767278194427,
-0.3610692024230957,
-0.57431960105896,
0.3120945394039154,
0.34563708305358887,
-0.09556945413351059,
0.332032531499862... | |
ID Name Address
0 Jim Smith 1111 A St 0 Jim Smith 2222 A St
1 Jim Smith 2222 B St 1 Jim Smith 3333 C St
```
Then Query 1 gives you:
```
0 Jim Smith 1111 A St
1 Jim Smith 2222 B St
```
Because rows 1 & 2 in Table 1 match rows 1 & 2, respectively in Table 2.
Query | [
0.08368821442127228,
0.6084638237953186,
0.0672646090388298,
-0.2844558358192444,
-0.22447821497917175,
0.35995638370513916,
0.15623857080936432,
-0.3838953971862793,
0.1822938174009323,
-0.30851805210113525,
0.04173312336206436,
0.028342943638563156,
-0.40530386567115784,
0.05623767152428... | |
2 gives you nothing.
Query 3 gives you
```
0 Jim Smith 1111 A St
1 Jim Smith 2222 B St
```
Because row 1 in Table 1 matches row 2 in Table 2 and row 2 in Table 1 matches row 1 in Table 2. Thus you get 4 rows out of Table 1 when there are only 2 rows in it. | [
-0.02622939832508564,
0.2572031617164612,
0.313570499420166,
-0.22191086411476135,
-0.35051488876342773,
0.15128549933433533,
0.45696380734443665,
-0.5076369643211365,
-0.11308061331510544,
-0.44128280878067017,
-0.09057924896478653,
0.18665005266666412,
-0.6946442127227783,
-0.03723655268... | |
If I start copying a huge file tree from one position to another or if some other process starts doing lots of disk activity, the foreground app (GUI) slows way down. For example, take a 2gb file tree with 100k files in it. Open a console and do cp -r bigtree bigtree2. Then go to firefox and start browsing. Firefox is ... | [
0.23458422720432281,
-0.09708549082279205,
0.371844083070755,
0.15174493193626404,
0.030261075124144554,
-0.2485453486442566,
-0.08035068213939667,
0.15840700268745422,
-0.44593822956085205,
-1.001937747001648,
-0.1864120215177536,
0.5184367895126343,
-0.42790549993515015,
0.31083703041076... | |
circumstances.
My HD is using DMA, not PIO. It's SATA. Not mounted with the atime flag.
Try [ionice](http://linux.die.net/man/1/ionice)-ing or nice-ing the copy process. The issue is due to the fact that IO gets the same priority as the GUI, which for a desktop, affects perceived responsiveness.
There's an Ubuntu [br... | [
0.281800240278244,
-0.13049715757369995,
0.42040199041366577,
0.15878926217556,
-0.268959641456604,
-0.09142459183931351,
-0.10223372280597687,
-0.04529905319213867,
0.017363332211971283,
-0.8556644916534424,
-0.38154685497283936,
0.6366780996322632,
-0.10525672882795334,
-0.04597612097859... | |
I have a regex created from a list in a database to match names for types of buildings in a game. The problem is typos, sometimes those writing instructions for their team in the game will misspell a building name and obviously the regex will then not pick it up (i.e. spelling "University" and "Unversity").
Are there ... | [
0.47951915860176086,
0.3983927071094513,
0.224955216050148,
0.3359016180038452,
0.0031341968569904566,
0.09112836420536041,
0.24116548895835876,
0.08560044318437576,
0.02981993556022644,
-0.5599328875541687,
0.07436221092939377,
0.08272749930620193,
-0.10619207471609116,
0.2101508677005767... | |
word with a letter missing and then another with letters added in.
I'm using PHP but I'd hope that any solution to this issue would not be PHP specific.
Allow me to introduce you to the [Levenshtein Distance](http://en.wikipedia.org/wiki/Levenshtein_distance), a measure of the difference between strings as the number ... | [
0.5212018489837646,
-0.0489681139588356,
0.38816630840301514,
-0.20898835361003876,
-0.2238215059041977,
0.16568370163440704,
0.39790865778923035,
-0.30931442975997925,
-0.04343033581972122,
-0.7468711137771606,
-0.003892675507813692,
-0.05514371022582054,
0.028511669486761093,
0.246098458... | |
way than trying to craft regex's for each special case. | [
0.09712580591440201,
-0.21511784195899963,
-0.21580851078033447,
0.5217257142066956,
-0.04555075988173485,
0.15352439880371094,
0.01087940577417612,
-0.013516033999621868,
-0.23806580901145935,
-0.34116092324256897,
0.30452868342399597,
0.2156113237142563,
-0.03201352804899216,
0.105585597... | |
I'm wondering if there's a way to save window configurations across emacs sessions. I know desktop-save is fantastic for preserving buffers and whatnot and the emacs manual demonstrates storing a window configuration into a register but this doesn't persist across sessions.
Of course this doesn't seem like it would be... | [
0.2289070338010788,
0.09780976176261902,
0.14942891895771027,
0.1694759726524353,
-0.11320269107818604,
0.15786822140216827,
0.44444161653518677,
0.3658205568790436,
-0.33654046058654785,
-0.7694961428642273,
0.030368871986865997,
0.6140329837799072,
-0.020077254623174667,
0.23449927568435... | |
I'm setting up a blog, and I'm fascinated by RDF and the idea of the sematic web. I'd like to use RDFa to embed sematic data into my blog. There are several well know semantic web ontologies like FOAF for decribing people, ical for events, geo for places.
Is there an ontology for blogs? Something to say "This site is ... | [
0.6229261755943298,
0.2994987964630127,
0.33649542927742004,
-0.22685901820659637,
-0.35219624638557434,
-0.1154710203409195,
-0.1762004941701889,
0.4380355775356293,
-0.2056555151939392,
-0.37750890851020813,
-0.15711845457553864,
-0.11146244406700134,
0.10102737694978714,
-0.122421674430... | |
Core, that seems to cover a lot of stuff I want (e.g. "This was written at this time", "This was written by this person", "The title of this is whatever"). So that's goes about 75% of the way there. Is there anything that fully marks up blogs? Takes it to the next level? "This is a blog", "This is a comment on this ent... | [
0.597201406955719,
0.10157700628042221,
0.1796189248561859,
0.3713182508945465,
-0.029847273603081703,
-0.42699071764945984,
-0.31885239481925964,
0.2997635304927826,
-0.3699883222579956,
-0.3911338448524475,
0.11095095425844193,
0.1957242339849472,
0.1716303527355194,
0.06867559254169464,... | |
wikis and other kinds of social media sites.
useful information:
* [a list of SIOC applications](http://rdfs.org/sioc/applications/)
* [SIOC plugin for WordPress](http://sioc-project.org/wordpress/)
* [Semantic Radar extension for Firefox](https://addons.mozilla.org/en-US/firefox/addon/3886) | [
0.27519917488098145,
-0.052461907267570496,
0.20387034118175507,
0.23127400875091553,
0.07808011025190353,
-0.17816507816314697,
0.30841872096061707,
-0.055649012327194214,
-0.518826425075531,
-0.5875465273857117,
-0.5154410600662231,
0.41720953583717346,
-0.5315461754798889,
-0.3120336830... | |
Is there any way to modify the bound value of one of the variables inside a closure? Look at the example to understand it better.
```
def foo():
var_a = 2
var_b = 3
def _closure(x):
return var_a + var_b + x
return _closure
localClosure = foo()
# Local closure is now "return 2 + 3 + x"
a = l... | [
-0.02525852993130684,
0.04918327555060387,
0.4707765579223633,
-0.2604629099369049,
0.11638537794351578,
-0.3237963020801544,
0.4990304410457611,
-0.09872972965240479,
-0.3215811848640442,
-0.21283932030200958,
-0.18836286664009094,
0.7880873084068298,
-0.4116795063018799,
0.24704815447330... | |
even possible?
# Local closure is now "return 0 + 3 + x"
b = localClosure(1) # 0 + 3 +1 == 4
```
I don't think there is any way to do that in Python. When the closure is defined, the current state of variables in the enclosing scope is captured and no longer has a directly referenceable name (from outside the closure... | [
-0.13990618288516998,
0.12053309381008148,
0.28742727637290955,
-0.04384828358888626,
0.31180161237716675,
-0.2580384910106659,
0.3244841992855072,
0.09246546030044556,
-0.2013305425643921,
-0.29544538259506226,
-0.2194412499666214,
0.477236807346344,
-0.5499502420425415,
0.125171944499015... | |
def __init__(self):
self.var_a = 2
self.var_b = 3
def __call__(self, x):
return self.var_a + self.var_b + x
localClosure = foo()
# Local closure is now "return 2 + 3 + x"
a = localClosure(1) # 2 + 3 + 1 == 6
# DO SOME MAGIC HERE TO TURN "var_a" of the | [
-0.2532176375389099,
0.03233695030212402,
0.4932289719581604,
-0.5687897801399231,
0.018517501652240753,
-0.11929991841316223,
0.7195318937301636,
-0.17291097342967987,
-0.1551317572593689,
-0.36386317014694214,
-0.07415831089019775,
0.8150732517242432,
-0.32922622561454773,
0.131427288055... | |
closure into 0
# ...but what magic? Is this even possible?
localClosure.var_a = 0
# Local closure is now "return 0 + 3 + x"
b = localClosure(1) # 0 + 3 +1 == 4
```
If you do use this technique I would no longer use the name `localClosure` because it is no longer actually a closure. However, it works the same as one. | [
-0.1344437450170517,
-0.13689187169075012,
0.6926364898681641,
-0.22661596536636353,
0.058312058448791504,
-0.5241830945014954,
0.4358953535556793,
0.08893796801567078,
-0.14731134474277496,
-0.38564804196357727,
-0.2329222559928894,
0.6343058943748474,
-0.43349412083625793,
0.472944349050... | |
If I develop a GUI wrapper **that only executes** a GPL cli application (for the sake of argument, say [tar](http://www.gnu.org/software/tar/)) must I release the GUI wrapper as GPL? Is it a derivitive work?
If it is a derivative work what must I release?
Both the GPL application and the wrapper will be distributed ... | [
0.4457399547100067,
0.5293001532554626,
0.2191207855939865,
-0.07702632248401642,
-0.41893643140792847,
-0.26780930161476135,
-0.10879053920507431,
-0.41663065552711487,
-0.0647016316652298,
-0.35489001870155334,
0.03326192498207092,
0.8334825038909912,
-0.3705122768878937,
-0.066850110888... | |
are non-free or GPL-incompatible. The only condition is that you cannot release the aggregate under a license that prohibits users from exercising rights that each program's individual license would grant them.
>
>
> Where's the line between two separate programs, and one program with two parts? This is a legal quest... | [
0.6797533631324768,
0.3352152705192566,
0.2701587975025177,
0.09273020178079605,
0.20715929567813873,
-0.3969651162624359,
-0.0037887629587203264,
-0.265268474817276,
-0.3381618857383728,
-0.16853977739810944,
-0.2974969446659088,
0.5890644788742065,
-0.32674112915992737,
0.170679211616516... | |
the same executable file, they are definitely combined in one program. If modules are designed to run linked together in a shared address space, that almost surely means combining them into one program.
>
>
> **By contrast, pipes, sockets and command-line arguments** are communication mechanisms normally used between... | [
0.49507391452789307,
0.1482481211423874,
0.12810151278972626,
0.2795949876308441,
-0.01764104701578617,
-0.32614606618881226,
-0.09482139348983765,
-0.42939770221710205,
-0.5025768876075745,
-0.5737884044647217,
-0.3133341670036316,
0.36823615431785583,
-0.3824412226676941,
0.1833624690771... | |
that relates to this is "If a program released under the GPL uses plug-ins, what are the requirements for the licenses of a plug-in":
> It depends on how the program invokes its plug-ins. If the program uses **fork** and **exec** to invoke plug-ins, then the plug-ins are separate programs, so the license for the main ... | [
0.24623624980449677,
0.4058566987514496,
0.08598503470420837,
-0.018031219020485878,
-0.15036743879318237,
-0.8251437544822693,
-0.24365472793579102,
-0.39332279562950134,
0.08713895827531815,
-0.10732530802488327,
-0.21090370416641235,
0.7949906587600708,
-0.4751111567020416,
0.1451756954... | |
I may want to create a RIA but am wondering, whether [Adobe AIR](http://www.adobe.com/products/air/) or [Titanium](http://titaniumapp.com/) is the way to go.
Do you think the open source version will last longer? Will it be better in anyway?
Although AIR isn't open source yet, the technology stack it's on (Flex, Webki... | [
0.7039536833763123,
-0.08466935902833939,
0.18911051750183105,
0.11943497508764267,
-0.30716803669929504,
-0.09236633777618408,
-0.04110536724328995,
-0.24770626425743103,
0.048135124146938324,
-0.44719982147216797,
0.07204636186361313,
0.6656209826469421,
0.121153824031353,
-0.09285384416... | |
and help develop it that's something else...
---
Just to clarify, AIR lets you use HTML/js to build your apps as well. | [
0.7465444207191467,
0.27545055747032166,
0.21818535029888153,
0.32351696491241455,
-0.17402130365371704,
-0.34093376994132996,
-0.15764912962913513,
0.2084895670413971,
0.09919976443052292,
-0.6512287259101868,
-0.31627732515335083,
0.32540929317474365,
-0.11619220674037933,
-0.36386364698... | |
The issue is simple really. Instead of creating folders in Visual Studio, I create a directory structure for my project on the file system. How do I include all the folders and files in a project, keeping the structure?
If I "Add Existing File" on a folder named Services and navigate to a file in the directory structu... | [
0.4387500286102295,
0.28286099433898926,
0.017901107668876648,
-0.006922997068613768,
-0.14814981818199158,
-0.029865775257349014,
-0.018855653703212738,
-0.12138090282678604,
-0.4136779010295868,
-0.8825414180755615,
0.05076194927096367,
0.43812963366508484,
-0.11730625480413437,
0.024556... | |
do I add all the folders and files to the project in Visual Studio? Or do I have to do what most Microsoft users do and "put up with it" and recreate each and every folder through Visual Studio?
You need to put your directory structure in your project directory. And then click "Show All Files" icon in the top of Soluti... | [
0.3904772698879242,
-0.10969364643096924,
0.3168777525424957,
0.029551608487963676,
0.07840912789106369,
0.16295212507247925,
0.21273228526115417,
-0.3833397924900055,
-0.17165552079677582,
-0.8486261367797852,
-0.30002647638320923,
0.43083247542381287,
-0.25576138496398926,
-0.14251787960... | |
Application 1 -
* Opens a SqlConnection and a SqlTransaction against a SQLServer 2005 database
* Inserts a record into Table1
* Does not commit or roll-back the SqlTransaction - intentially keeping this alive to demonstrate / describe the problem
Application 2 -
* Opens SqlConnection and a SqlTransaction against a... | [
-0.12580156326293945,
0.24899286031723022,
0.31910067796707153,
-0.02486010268330574,
-0.15147070586681366,
0.0183698907494545,
0.1830843985080719,
-0.5917180180549622,
-0.24510557949543,
-0.10057009011507034,
0.10982584208250046,
0.4141250550746918,
-0.5871423482894897,
0.0162890348583459... | |
Application 1.
Though the scenario mentioned above is fictional - it demonstrates the problem that we are facing adequately. We want to be able to open a long running SqlTransaction (maybe hours) and do many inserts/updates via that SqlTransaction.
We are developing a data conversion application which has to do a lo... | [
0.24798260629177094,
0.027536528185009956,
0.1351286917924881,
0.3078386187553406,
0.06015770509839058,
-0.41877439618110657,
-0.04671356827020645,
-0.27275246381759644,
-0.22432900965213776,
-0.6730201244354248,
0.18716679513454437,
0.4732357859611511,
-0.5676175355911255,
-0.328071147203... | |
our application are segmented by a ClientID field from a ClientMaster table. For example if we have a CollegeMaster table, then it would have a ClientID field as a part of the primary key and a ID field for its own identification. The data conversion starts by creating a new ClientID and that new ClientID field is used... | [
0.2536201477050781,
0.0582597553730011,
0.6882466077804565,
0.39249107241630554,
0.20818571746349335,
-0.15692350268363953,
0.027508391067385674,
-0.2650090157985687,
-0.26887941360473633,
-0.8337178230285645,
-0.05774211883544922,
0.3827332556247711,
-0.1736263632774353,
0.199989676475524... | |
due to the long running transaction. What can Application 1 do to ensure that this is achieved?
You may want to look into this Sql 2005 feature. Sounds like it may help you.
Its a newer locking mechanism you have to enable in the DB, but apparently has much less blocking.
<http://msdn.microsoft.com/en-us/library/ms177... | [
0.001205570762977004,
-0.028034381568431854,
0.32543399930000305,
0.1856565922498703,
-0.07496830821037292,
-0.41420647501945496,
0.34803345799446106,
-0.12085031718015671,
-0.27537721395492554,
-0.09172873198986053,
-0.05623571202158928,
0.4416601061820984,
-0.1689235270023346,
0.18738211... | |
How to download a file via web service ? And how the client application accept this?
I write down the code as below in the client app, it throws an exception "Access Denied"
```
wsDownload.wsDownloadFile downFile = new wsDownload.wsDownloadFile();
byte[] file = downFile.DownloadFile(strFileName, "", "", "");
MemorySt... | [
0.13498851656913757,
-0.07199423015117645,
0.6485111117362976,
0.09261615574359894,
0.13296060264110565,
-0.09715180099010468,
0.30660223960876465,
-0.07682985812425613,
-0.10496662557125092,
-0.7397226691246033,
-0.4676702320575714,
0.6280267834663391,
-0.0454908087849617,
0.1381559967994... | |
a derivative word.
In short, if something can be initialized, it is initializeable. Just like it can be runable, or stopable.
Now, I don't think it will be long before a grammar Nazi points out the error of my ways here. But English is rich and expressive language. A word doesn't have to be listed on "dictionary.com... | [
0.21253269910812378,
0.026550009846687317,
0.3214017152786255,
0.026440424844622612,
-0.1645778864622116,
-0.030494363978505135,
0.29301586747169495,
0.4022451937198639,
0.13831479847431183,
-0.6890014410018921,
0.16191042959690094,
0.3594752550125122,
0.10513497143983841,
-0.0370996668934... | |
how American English is used.
"Atomic" is a good example of a word we use in software development all the time that is somewhat of a "made up" word. In a development context something that is atomic either happens, or does not happen - it cannot be divided into separate operations. But, the common definition for this... | [
0.39171865582466125,
0.09777124226093292,
-0.052946604788303375,
0.10855194926261902,
0.21865594387054443,
-0.2925223410129547,
0.39972013235092163,
0.5711798071861267,
-0.2332763969898224,
-0.20289820432662964,
-0.1268082857131958,
0.41241592168807983,
-0.24036429822444916,
-0.05922699347... | |
I'm using MySql 5.x and in my environment, I have a table with the name CALLS.
Table CALLS has a column status which takes an enum {inprogress, completed}.
I want reads/updates of the table to be row-locked, so:
```
SET TRANSACTION ISOLATION LEVEL SERIALIZABLE;
SET AUTOCOMMIT = 0;
SELECT amount from CALLS where call... | [
-0.06862346827983856,
0.1896681785583496,
0.6492192149162292,
-0.1669190526008606,
0.008823386393487453,
0.09310493618249893,
0.1738349348306656,
-0.2620863616466522,
-0.2774484157562256,
-0.7000462412834167,
0.0019910570699721575,
0.6472657918930054,
-0.4215034544467926,
0.193006992340087... | |
achieve the same transaction consistency without incurring locking overheads ? Thanks.
Disclaimer: MySQL is generally full of surprises, so the following could be untrue.
What you are doing doesn't make any sense to me: You are committing after the SELECT, which should break the lock. So in my opinion, your code shoul... | [
0.28342917561531067,
-0.1866803765296936,
0.0670643001794815,
0.32555288076400757,
0.19128736853599548,
-0.45430538058280945,
0.27852511405944824,
0.010221009142696857,
-0.34517136216163635,
-0.4735994338989258,
0.18937571346759796,
0.7817884683609009,
-0.11960430443286896,
-0.119157828390... | |
have different code paths: One (using FOR UPDATE) used when the retrieved value is used in a subsequent change-operation. And another one (not using FOR UPDATE) used when the value doesn't have to be protected from changes. | [
-0.01569443754851818,
-0.07748378813266754,
0.033932875841856,
0.1621488481760025,
0.042853944003582,
0.021753545850515366,
0.1846807450056076,
-0.18769040703773499,
0.007290402892976999,
-0.626862645149231,
-0.32210877537727356,
0.5365788340568542,
-0.24830980598926544,
-0.229227885603904... | |
Heres the problem. I use around three different machines for development. My partner is using two. We have to go through the same freaking set up procedure on all five machines to get to work.
Working with a php project here, so:
Install and configure, PDT, a php debugger, and some version of XAMPP.
Then possible inst... | [
0.49748602509498596,
0.18745264410972595,
0.1680579036474228,
0.4987943470478058,
0.22442282736301422,
0.18787626922130585,
0.12128085643053055,
-0.13048696517944336,
-0.41262272000312805,
-0.5059909224510193,
0.13504666090011597,
0.5449197888374329,
-0.08314913511276245,
0.028182379901409... | |
copy of the VM image, run that image on each of the five machines and do all of our development in that VM. Put Eclipse, apache, mysql, the works, all in that vm.
The only negative of this approach, and please correct me on the only part, is performance. Is it really that big of an issue though? The slowest machine ou... | [
0.2816481590270996,
-0.03913203626871109,
0.4961419999599457,
0.43235358595848083,
0.24308916926383972,
0.05334777012467384,
-0.00476632546633482,
0.22753819823265076,
-0.30921658873558044,
-0.47623029351234436,
-0.028268074616789818,
0.41068533062934875,
-0.2761381268501282,
0.11987920105... | |
had performance problems. Another approach that you could take would be to image the drive in the state that you want. Use Acronis or Ghost to re-image each machine when you need to. Only takes about 5-10 minutes to restore an image on any modern PC. | [
0.0785655677318573,
-0.25651514530181885,
0.535662055015564,
0.5547108054161072,
0.08976494520902634,
-0.2059786170721054,
0.4801754951477051,
0.1230819821357727,
-0.19577738642692566,
-0.687557578086853,
-0.026174526661634445,
0.7394630908966064,
0.17964747548103333,
0.09515979886054993,
... | |
I had a Dataset with some data in it. When I tried to write this DataSet into a file, everything was OK. But When I tried to write it into a MemoryStream, the XML file declaration was lost.
The code looks like:
```
DataSet dSet = new DataSet();
//load schema, fill data in
dSet.WriteXML("testFile.xml");
MemoryStream st... | [
0.379819393157959,
0.058625221252441406,
0.30051541328430176,
0.12476470321416855,
0.1201040968298912,
-0.018722832202911377,
0.4450896978378296,
-0.29913532733917236,
0.12080927938222885,
-0.6089880466461182,
0.1139196828007698,
0.602898359298706,
-0.4178250730037689,
0.05165344104170799,... | |
simple solution?
It wasn't dropped. Simply not included. Though it is highly recommend the xml declaration is not a required element of the xml specification.
<http://msdn.microsoft.com/en-us/library/ms256048(VS.85).aspx>
You can use XmlWriter.WriteStartDocument to include the xml declaration in the stream like so:
... | [
0.1485728919506073,
-0.13443578779697418,
0.5216760635375977,
0.12106049805879593,
0.2990027964115143,
-0.21691326797008514,
0.3486213684082031,
-0.4189152121543884,
0.05388917028903961,
-0.6122287511825562,
0.0016729353228583932,
0.7329947352409363,
-0.3523767590522766,
-0.057630214840173... | |
**When designing a website, what do you consider the best image format to use for a particular task?**
I always find myself in a dilemma when trying to figure out what format to use for a specific task...like for example, *should I use .jpg all round?* or, *when and why should I use a .png?*
For example, taking *[Ama... | [
0.34319964051246643,
-0.028593456372618675,
0.4459993243217468,
-0.04728482663631439,
-0.3985956907272339,
0.1481044441461563,
0.09342686086893082,
-0.11389622837305069,
-0.4132094979286194,
-0.742203414440155,
-0.28654080629348755,
0.38463088870048523,
-0.13390874862670898,
-0.09384720772... | |
and as far as their main page goes, they dont have any **.png**s on it.
*So what formats should I use for my websites? and why should I use them?*
**[UPDATE]**
Thanks [CruellO](https://stackoverflow.com/questions/392635/website-image-formats-choosing-the-right-format-for-the-right-task#392641) for [this link](http:/... | [
0.4067187011241913,
-0.14110398292541504,
0.3541991114616394,
0.32760459184646606,
-0.5007007718086243,
-0.10037877410650253,
0.23708251118659973,
-0.08309238404035568,
-0.22231115400791168,
-0.4266659617424011,
0.32494980096817017,
0.7507738471031189,
0.050916772335767746,
-0.149839624762... | |
like a JPEG file. A PNG equivalent of a JPEG will typically be a lot larger (assuming it's photorealistic). There may be times where this is still desirable.
PNG does allow for 8-bits of transparency, but if you have to support IE, you'll find that they continually refuse to support that correctly. They *do* support a... | [
0.4734382927417755,
-0.09354552626609802,
0.19742098450660706,
0.1859978586435318,
-0.42769625782966614,
-0.18166351318359375,
-0.01979813724756241,
0.024281492456793785,
-0.43353456258773804,
-0.6666335463523865,
-0.18559184670448303,
0.3640066683292389,
-0.4084818363189697,
-0.1282289773... | |
After running a insert or update query against a SQLServer 2005 database, under what scenario (if at all) can this happen - SQLServer 2005 does not perform or fails to perform the insert / update, AND ALSO DOES NOT "THROW" AN EXCEPTION?
Consider that we are running the insert or update query via a SqlCommand object. A... | [
-0.20979273319244385,
0.2408420592546463,
0.35376131534576416,
-0.09768899530172348,
-0.1347867250442505,
-0.18879790604114532,
0.3165048360824585,
-0.3150976002216339,
0.01800570823252201,
-0.2511705458164215,
-0.15077193081378937,
0.6608024835586548,
-0.15883560478687286,
-0.083943232893... | |
the "WHERE" condition will find a recrod that needs to be updated.
Can we assume that after we do a SqlCommand.ExecuteNonQuery(), if a insert or update is not performed, then, an un-handled exception will ALLWAYS occur? Otherwise, we can assume that the insert or update query has been successful.
JPEGs are for photos.... | [
0.2585647404193878,
-0.019975757226347923,
0.24348482489585876,
0.33069565892219543,
0.01567484438419342,
-0.1193496584892273,
-0.07973724603652954,
-0.29220545291900635,
-0.29281875491142273,
-0.4206705689430237,
-0.11569958925247192,
0.5085233449935913,
-0.27711021900177,
-0.110397636890... | |
quality like a JPEG file. A PNG equivalent of a JPEG will typically be a lot larger (assuming it's photorealistic). There may be times where this is still desirable.
PNG does allow for 8-bits of transparency, but if you have to support IE, you'll find that they continually refuse to support that correctly. They *do* s... | [
0.4504181146621704,
-0.15612301230430603,
0.1905282735824585,
0.25137272477149963,
-0.3813139796257019,
-0.1319819688796997,
-0.002859758911654353,
0.0517084002494812,
-0.3346881568431854,
-0.7638109922409058,
-0.07141726464033127,
0.5996649861335754,
-0.12006580084562302,
-0.0913900658488... | |
I am using 2 500K bitmaps in to display images on my WiX dialogs.
They dramatically increase the size of the installation package, and what is worse - it looks there's no way to package them as a part of a .cab file since they're `<binary>`-es in the WiX terms.
So, I thught, is there any way to use other file formats... | [
0.502602756023407,
0.01127779483795166,
0.5163878202438354,
-0.022124024108052254,
-0.3729521930217743,
0.09288714081048965,
0.33266451954841614,
-0.11055874079465866,
-0.15687644481658936,
-0.7339174747467041,
-0.022670075297355652,
0.4562349319458008,
-0.16993871331214905,
0.044099386781... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.