text stringlengths 0 30.5k | title stringclasses 1
value | embeddings listlengths 768 768 |
|---|---|---|
knows nothing about the details of Main.mxml's implementation, nor does Main.mxml know anything about MyWrapperClass other than that it dispatches a `webserviceComplete` event, and exposes a public `doWork()` method. Loose coupling and information hiding in action.
Good luck! | [
0.3296564221382141,
-0.003663228126242757,
0.2721749544143677,
0.029904300346970558,
-0.07741004973649979,
-0.5549719929695129,
0.6359474658966064,
0.384133517742157,
-0.32553955912590027,
-0.29049190878868103,
-0.06469877064228058,
0.3109237253665924,
-0.20735396444797516,
0.2912429571151... | |
I have a Map which is to be modified by several threads concurrently.
There seem to be three different synchronized Map implementations in the Java API:
* `Hashtable`
* `Collections.synchronizedMap(Map)`
* `ConcurrentHashMap`
From what I understand, `Hashtable` is an old implementation (extending the obsolete `Dict... | [
0.2587963938713074,
-0.07536989450454712,
0.3184206485748291,
0.05193362757563591,
-0.07274848222732544,
-0.1494976431131363,
0.19529707729816437,
-0.04398185759782791,
-0.47864511609077454,
-0.864983856678009,
0.35042205452919006,
0.2704671323299408,
-0.4064823389053345,
0.284053742885589... | |
Map from several threads without the need to block them. `Collections.synchronizedMap(map)` creates a blocking Map which will degrade performance, albeit ensure consistency (if used properly).
Use the second option if you need to ensure data consistency, and each thread needs to have an up-to-date view of the map. Use... | [
0.012816946022212505,
-0.5801242589950562,
-0.011924128979444504,
0.2341913878917694,
-0.029877211898565292,
-0.2229463905096054,
0.19862085580825806,
-0.14985089004039764,
-0.3767795264720917,
-0.8385375142097473,
-0.31483516097068787,
0.33432143926620483,
-0.5739556550979614,
-0.01752312... | |
thanks for all the help the last few days. I'm hoping someone knows this one.
I'm looking to dynamically create a heatmap of data based on user input, then color certain states based on the response. Like a poll for voting, for example. I'd like to do something like this...
<http://www.trulia.com/home_prices/>
What i... | [
0.18068957328796387,
-0.49920159578323364,
0.7299112677574158,
0.4641978442668915,
0.190969318151474,
0.2953599691390991,
-0.025658266618847847,
-0.18567714095115662,
-0.31849032640457153,
-0.8193234801292419,
0.1861838400363922,
-0.010704400949180126,
-0.21830964088439941,
-0.031321950256... | |
I develop a network based, multi-component software system that's designed to run on an arbitrary number of machines. I'm assuming a typical setup of 1 to 4 machines.
I want to be serious about testing the system, and I have set up a network of virtual machines on a strong PC that I can use to simulate the network int... | [
0.44046884775161743,
0.2413763403892517,
-0.0909527987241745,
0.17039090394973755,
0.3085137903690338,
0.10842908173799515,
0.10120777785778046,
0.04807150736451149,
-0.20634278655052185,
-0.7233290672302246,
0.09870296716690063,
0.49977701902389526,
-0.19845938682556152,
0.258648365736007... | |
could sometimes run any one of the virtual machines on the whole PC, to see what difference it makes, especially performance-wise, but also to check on some multithreading issues.
Buying more boxes and using harddisk partitions instead of virtual disk images are options, but are there more elegant approaches? I'm boot... | [
0.5694457292556763,
0.038751762360334396,
0.20741988718509674,
0.43901002407073975,
0.11326135694980621,
-0.042595990002155304,
-0.024633392691612244,
-0.08150268346071243,
-0.015103685669600964,
-0.5545516014099121,
0.09184940904378891,
0.7824829816818237,
-0.0026442422531545162,
-0.42295... | |
through dummy clients and by feeding data into the system that's extracted again on the other end. It's not a website and it is usually not used over the Internet but rather inside the local network. UI and Internet interfaces are going to be provided at a later stage by some of the components that are hooked up to the... | [
0.7188013792037964,
-0.13049058616161346,
0.19763122498989105,
0.05068792775273323,
0.023776564747095108,
-0.24087850749492645,
0.07642702013254166,
-0.10132001340389252,
-0.48021069169044495,
-0.5021804571151733,
0.20176666975021362,
0.4388546645641327,
0.0680646076798439,
-0.257763147354... | |
test the performance of a website?](https://stackoverflow.com/questions/53738/how-do-you-test-the-performance-of-a-website)
There are a number of tools out there to do network stress testing, but chances are that you will need to adapt them to fix your network configuration. For instance, I'm working on a project whic... | [
0.6350865364074707,
0.06195918098092079,
0.03060578741133213,
0.2473369687795639,
-0.10292449593544006,
-0.40735146403312683,
0.16398563981056213,
-0.09064087271690369,
-0.1869894117116928,
-0.5060551166534424,
0.5203700065612793,
0.789914071559906,
0.17513082921504974,
-0.3167555034160614... | |
in order to really work the network. In our case, we have a 1:2 ratio -- that is, 1 testing client for each 2 servers we're going to test. You'll have to play around with things a bit to determine how many testing boxes you'll need, but just keep an eye on the performance of your testing machines so you can get a feel ... | [
0.8496376872062683,
-0.02366795390844345,
-0.046653177589178085,
0.39967793226242065,
0.17615756392478943,
-0.045142486691474915,
0.2600615918636322,
0.0868363305926323,
-0.20332874357700348,
-0.7290535569190979,
0.33245792984962463,
0.435079425573349,
-0.05335170775651932,
-0.221563756465... | |
I am attempting to run the following command in KornShell (ksh):
```
set -A INDEXES `db2 "describe indexes for table ${TABSCHEMA}.${TABNAME} show detail" | awk '{print $1"."$2}'`
```
What I am attempting to achieve is place a list of the indexes over a particular table into an array which I can later iterate through... | [
0.030530551448464394,
0.30574044585227966,
0.23495729267597198,
-0.3167007863521576,
-0.2449948787689209,
-0.09669538587331772,
0.5085602402687073,
-0.17085129022598267,
0.08589805662631989,
-0.6626759171485901,
-0.05963824316859245,
0.5879590511322021,
-0.44492942094802856,
0.237662181258... | |
table ${TABSCHEMA}.${TABNAME} show detail"`
```
it works just fine (well, to the extent it is returning data. Obviously without the `awk` I am not capturing the correct data).
Does anyone know why the `awk` is having this affect?
I appreciate there is more than one way to get this data, but it baffles me as to why ... | [
0.22728589177131653,
0.19140343368053436,
0.2161034792661667,
0.10674100369215012,
-0.09216360747814178,
-0.2690042555332184,
0.18573825061321259,
0.2666946351528168,
-0.3294881284236908,
-0.555972158908844,
0.07265570759773254,
0.6678105592727661,
-0.15292143821716309,
0.19011996686458588... | |
It's not that something is becoming disconnected, it's that a newly created shell process (and its accompanying db2bp process) are being created but aren't being told to connect to a database.
One way to remedy this is to explicitly connect (or re-connect) to the database when you know you're in one of those situations... | [
0.2340584248304367,
0.007526468951255083,
0.06312327831983566,
0.17315401136875153,
0.019213853403925896,
-0.32990211248397827,
0.31833988428115845,
-0.1414816677570343,
-0.30526480078697205,
-0.6192992925643921,
-0.2724223732948303,
0.5091292858123779,
-0.46671977639198303,
0.325439929962... | |
produce the same result. | [
0.4352603256702423,
0.3408825993537903,
-0.008635181933641434,
0.18041497468948364,
-0.1462402045726776,
0.19057944416999817,
0.371921181678772,
-0.1688319444656372,
0.1767658293247223,
-0.6984280347824097,
-0.07106909155845642,
0.46729591488838196,
0.0421786792576313,
0.07348579913377762,... | |
I have a case where I need to translate (lookup) several values from the same table. The first way I wrote it, was using subqueries:
```
SELECT
(SELECT id FROM user WHERE user_pk = created_by) AS creator,
(SELECT id FROM user WHERE user_pk = updated_by) AS updater,
(SELECT id FROM user WHERE user_pk = owne... | [
0.037042342126369476,
0.1609155684709549,
0.3989139795303345,
0.0711202472448349,
-0.19891822338104248,
0.10412650555372238,
-0.39148634672164917,
0.024496572092175484,
-0.08073997497558594,
-0.7105215191841125,
0.0709025040268898,
0.21895276010036469,
-0.20390865206718445,
0.2713530063629... | |
active = 1" ) I thought I'd put these into a user-defined function [UDF](http://en.wikipedia.org/wiki/User-defined_function) and use that. But the performance using that UDF was abysmal.
```
CREATE FUNCTION dbo.get_user ( @user_pk INT )
RETURNS INT
AS BEGIN
RETURN ( SELECT id
FROM ice.dbo.[user]
... | [
0.019861439242959023,
-0.35532358288764954,
0.6552433967590332,
-0.07833628356456757,
-0.11983218044042587,
0.012292467057704926,
0.2823667526245117,
-0.6776987314224243,
-0.17263223230838776,
-0.6232661008834839,
-0.02299577184021473,
0.6232120990753174,
-0.3071454167366028,
-0.0419296026... | |
any way I can code in SQL server 2008, so that I don't have to use so many subqueries?
### Edit:
Just a litte more explanation of when this is useful. This simple query (that is, get userid) gets a lot more complex when I want to have a text for a user, since I have to join with profile to get the language, with a co... | [
-0.0058460598811507225,
0.3456761837005615,
0.18597184121608734,
0.15696850419044495,
-0.21628406643867493,
-0.1718110293149948,
0.5713668465614319,
0.15176278352737427,
-0.025713419541716576,
-0.6874319911003113,
0.12315777689218521,
0.6490316390991211,
-0.05682333558797836,
-0.0666833519... | |
maintainability.
The UDF is a black box to the query optimiser so it's executed for every row.
You are doing a row-by-row cursor. For each row in an asset, look up an id three times in another table. This happens when you use scalar or multi-statement UDFs (In-line UDFs are simply macros that expand into the outer quer... | [
0.19099535048007965,
0.08756674826145172,
0.5106845498085022,
0.2156485766172409,
0.10501264780759811,
-0.43821796774864197,
-0.07594209164381027,
0.10426702350378036,
-0.3461707532405853,
-0.49899014830589294,
-0.03153609484434128,
0.7441850304603577,
-0.2749003469944,
0.24463705718517303... | |
updater,
uo.id AS owner,
a.[name]
FROM
asset a
JOIN
user uc ON uc.user_pk = a.created_by
JOIN
user uu ON uu.user_pk = a.updated_by
JOIN
user uo ON uo.user_pk = a.owned_by
```
Update Feb 2019
SQL Server 2019 starts to fix this problem. | [
-0.5429294109344482,
0.06780301779508591,
0.845737099647522,
-0.1020573154091835,
0.21497321128845215,
-0.3474273681640625,
-0.4114714562892914,
-0.13606375455856323,
-0.3080006241798401,
-0.7339244484901428,
-0.6118307709693909,
0.6314512491226196,
-0.2468014359474182,
0.535666286945343,
... | |
I want to delete an DOM element right after fading out. What I did so far is
```
$(element).click(function()
{
$(this).fadeOut(500, function() { $().remove(this); });
});
```
But now I always get this error in Firebug: <http://dl.getdropbox.com/u/5912/Jing/2009-02-04_1109.png>
I guess it is because the fadeOut ... | [
0.20212006568908691,
-0.08992666006088257,
0.554807722568512,
-0.3582781255245209,
0.28141939640045166,
-0.18741664290428162,
0.5563367009162903,
-0.2460990697145462,
-0.06791992485523224,
-0.37391397356987,
-0.17335136234760284,
1.015846610069275,
-0.5162331461906433,
0.46918946504592896,... | |
How to write one SQL query that selects a column from a table but returns two columns where the additional one contains an index of the row (a new one, starting with 1 to n). It must be without using functions that do that (like row\_number()).
Any ideas?
Edit: it must be a one-select query
You can do this on any ... | [
0.12646906077861786,
0.004640412051230669,
0.19202260673046112,
-0.010534416884183884,
0.21503914892673492,
-0.3163071274757385,
-0.19353021681308746,
-0.40273767709732056,
-0.14532528817653656,
-0.5334488749504089,
0.057030968368053436,
0.39575767517089844,
-0.4800422191619873,
-0.3229876... | |
**Note:**
* Using **raw Win32** CreateTheard() API
* No MFC
* An interface is simply a pointer to a vtable
**Question:**
* How to pass an interface pointer to a thread?
**Illustration:**
```
IS8Simulation *pis8 = NULL;
...
CoCreateInstance(
clsid,
NULL,
CLSCTX_L... | [
-0.11380326002836227,
-0.0878007709980011,
0.7453395128250122,
0.05587013438344002,
0.053433969616889954,
0.0009581166668795049,
0.28920331597328186,
-0.0037345627788454294,
-0.33236250281333923,
-0.6898612976074219,
0.12066531926393509,
0.2544015049934387,
-0.5545857548713684,
0.338636726... | |
(void **) &pis8);
...
hThread = CreateThread(
NULL,
0,
SecondaryThread,
//interface pointer pis8
0, | [
0.015753353014588356,
0.0597853921353817,
0.6370856165885925,
-0.09584122896194458,
0.1416434347629547,
0.24985693395137787,
0.6566781997680664,
-0.30721810460090637,
0.08235067129135132,
-0.7933590412139893,
-0.016185730695724487,
0.32862186431884766,
-0.4348967671394348,
0.30737116932868... | |
&dwGenericThreadID);
...
DWORD WINAPI SecondaryThread(LPVOID iValue)
{
//using iValue accordingly
//E.g.: iValue->Open
```
Regards
As was stated below, passing a `COM` interface pointer between threads in not safe.
Assuming you know what you are doing:
```
hThread = CreateThread(
NULL,
... | [
0.13071303069591522,
-0.03659138083457947,
0.7588756680488586,
-0.22768940031528473,
0.29738500714302063,
-0.19084732234477997,
0.5348933339118958,
-0.306081622838974,
0.0885915458202362,
-0.7250303030014038,
-0.09755988419055939,
0.8076652884483337,
-0.29893139004707336,
0.186901673674583... | |
SecondaryThread,
(LPVOID) pis8
0,
&dwGenericThreadID);
DWORD WINAPI SecondaryThread(LPVOID iValue)
{
((IS8Simulation*) iValue)->Open();
}
```
Thread safe version:
```
void MainThread()
{ | [
-0.26259198784828186,
-0.1599130928516388,
0.6052488684654236,
-0.12044666707515717,
0.2054831087589264,
0.02260110341012478,
0.22657263278961182,
-0.022850124165415764,
-0.03643523529171944,
-0.4194980561733246,
-0.2910018265247345,
0.49911797046661377,
-0.35695597529411316,
0.34933352470... | |
IStream* psis8;
HRESULT res = CoMarshalInterThreadInterfaceInStream (IID_IS8SIMULATION, pis8, &psis8);
if (FAILED(res))
return;
hThread = CreateThread(
NULL,
0,
SecondaryThread,
(LPVOID) psis8 | [
-0.4946047365665436,
-0.17405734956264496,
0.8768949508666992,
-0.21056659519672394,
0.31162887811660767,
0.11380533128976822,
0.590691864490509,
-0.5067926645278931,
-0.01421316433697939,
-0.47622939944267273,
-0.3932424485683441,
0.6027905941009521,
-0.17874811589717865,
0.28961691260337... | |
0,
&dwGenericThreadID
);
}
DWORD WINAPI SecondaryThread(LPVOID iValue)
{
IS8Simulation* pis8;
HRESULT res = CoGetInterfaceAndReleaseStream((IStream*) iValue, IID_IS8SIMULATION, &pis8);
if (FAILED(res))
return (DWORD) res;
pis8->Open();
}
``` | [
-0.38852474093437195,
-0.3574373722076416,
0.9798866510391235,
-0.36947619915008545,
0.2425248622894287,
0.12588556110858917,
0.6667636632919312,
-0.5942907333374023,
0.06784676015377045,
-0.4963986575603485,
-0.4114387631416321,
0.7633993625640869,
-0.17023098468780518,
0.2963554561138153... | |
I have to create a console application which needs certain parameters. If they are missing or wrong I print out an error message.
Now the problem: If someone starts the program from the explorer by double-clicking the console window disappears immediately. (But the application is not entirely useless from the explorer... | [
0.11361311376094818,
0.18359458446502686,
0.29382431507110596,
-0.1361994594335556,
0.2721862494945526,
-0.1479826420545578,
0.4801769554615021,
0.10902536660432816,
-0.14664511382579803,
-0.6459152698516846,
-0.1997247338294983,
0.5448552966117859,
-0.12640567123889923,
0.5255964994430542... | |
to use GetConsoleScreenBufferInfo to determine that the cursor has not moved from the initial 0,0 position.
Code sample from @tomlogic, based on the referenced Knowledge Base article:
```
// call in main() before printing to stdout
// returns TRUE if program is in its own console (cursor at 0,0) or
// FALSE if it was... | [
0.009224376641213894,
-0.17314240336418152,
0.7736690044403076,
-0.20770764350891113,
0.12785528600215912,
0.08363278955221176,
0.5137792229652405,
-0.16637572646141052,
-0.13670162856578827,
-0.6014882922172546,
-0.44321325421333313,
0.6361197233200073,
-0.28950169682502747,
0.05842268839... | |
}
// if cursor position is (0,0) then we were launched in a separate console
return ((!csbi.dwCursorPosition.X) && (!csbi.dwCursorPosition.Y));
}
``` | [
-0.3502524793148041,
-0.1546373814344406,
0.6161890625953674,
-0.041646234691143036,
0.33407458662986755,
-0.014593968167901039,
0.04645315930247307,
0.13971589505672455,
0.03031526692211628,
-0.38844117522239685,
-0.30414557456970215,
0.6776148080825806,
-0.23565475642681122,
0.2572404146... | |
(Title was: "How to write a unit test for a DBUS service written in Python?")
I've started to write a DBUS service using dbus-python, but I'm having trouble writing a test case for it.
Here is an example of the test I am trying to create. Notice that I have put a GLib event loop in the setUp(), this is where the prob... | [
0.04631352052092552,
0.14249634742736816,
-0.15297167003154755,
-0.0753912404179573,
-0.12466686218976974,
-0.05124938488006592,
0.5244598984718323,
-0.38448432087898254,
0.32756584882736206,
-0.810825526714325,
-0.08859777450561523,
0.5595675706863403,
-0.48412951827049255,
0.112194985151... | |
def hello(self):
return "Hello World!"
class BaseTestCase(unittest.TestCase):
def setUp(self):
myservice = MyDBUSService()
loop = gobject.MainLoop()
loop.run()
# === Test blocks here ===
def testHelloService(self):
bus = dbus.SessionBus()
helloservice =... | [
-0.12410124391317368,
0.07348669320344925,
-0.015328796580433846,
-0.26885801553726196,
0.0018734600162133574,
0.030074341222643852,
0.8035311102867126,
-0.30047762393951416,
0.13130901753902435,
-0.6500440239906311,
-0.15709567070007324,
0.4715561270713806,
-0.3678377568721771,
0.21022403... | |
assert hello() == "Hello World!"
if __name__ == '__main__':
unittest.main()
```
My problem is that the DBUS implementation requires you to start an event loop so that it can start dispatching events. The common approach is to use GLib's gobject.MainLoop().start() (although I'm not married to this approach, if so... | [
-0.11630618572235107,
0.10504350066184998,
0.0273269135504961,
-0.22631870210170746,
-0.23344022035598755,
-0.22390983998775482,
0.7145349383354187,
-0.21698097884655,
0.02654534950852394,
-0.531955361366272,
-0.0746469795703888,
0.7009432911872864,
0.009697145782411098,
0.3534031808376312... | |
query the service externally using the qdbus tool, but I can't automate this inside the test that starts it.
I'm considering doing some kind of process forking inside the test to handle this, but I was hoping someone might have a neater solution, or at least a good starting place for how I would write a test like this... | [
0.4640920162200928,
-0.06941401213407516,
-0.03490511700510979,
0.09948597848415375,
-0.22116538882255554,
-0.17459604144096375,
0.7019677758216858,
0.05170499533414841,
-0.030843297019600868,
-0.7324768304824829,
0.03407323732972145,
0.30206161737442017,
-0.30385589599609375,
0.2889343202... | |
some incorrect terminology, I was trying to write a functional test, as opposed to a unit test. I was aware of the distinction, but didn't realise my mistake until later.
I've adjusted the example in my question. It loosely resembles the "test\_pidavim.py" example, but uses an import for "dbus.glib" to handle the glib... | [
0.06346020102500916,
-0.03231193870306015,
-0.02569437213242054,
0.009667472913861275,
0.053703900426626205,
0.08621890842914581,
0.31715211272239685,
-0.317409873008728,
0.21705931425094604,
-0.7610331177711487,
-0.3127204477787018,
0.6085498929023743,
-0.6827710270881653,
0.2319467812776... | |
def listen(self):
loop = gobject.MainLoop()
loop.run()
@dbus.service.method('test.helloservice')
def hello(self):
return "Hello World!"
class BaseTestCase(unittest.TestCase):
def setUp(self):
env = os.environ.copy()
self.p = subprocess.Popen(['python', './dbus_prac... | [
0.2867409586906433,
0.05789962783455849,
0.22254200279712677,
-0.3598608374595642,
0.22059321403503418,
-0.12384998798370361,
0.782351553440094,
-0.18377453088760376,
-0.10497841238975525,
-0.7664841413497925,
-0.2689422070980072,
0.8725737929344177,
-0.2243511825799942,
0.0943643897771835... | |
assert self.p.stdout == None
assert self.p.stderr == None
def testHelloService(self):
bus = dbus.SessionBus()
helloservice = bus.get_object('test.helloservice', '/test/helloservice')
hello = helloservice.get_dbus_method('hello', 'test.helloservice')
assert hello() == "Hello ... | [
-0.1447920948266983,
0.046003494411706924,
0.31594112515449524,
-0.28600651025772095,
-0.20889048278331757,
0.09700004756450653,
0.7083959579467773,
-0.293374627828598,
0.15764380991458893,
-0.2629430592060089,
-0.046368468552827835,
0.8773422837257385,
-0.22820855677127838,
0.108357615768... | |
15)
if __name__ == '__main__':
arg = ""
if len(sys.argv) > 1:
arg = sys.argv[1]
if arg == "server":
myservice = MyDBUSService()
myservice.listen()
else:
unittest.main()
``` | [
-0.08717767149209976,
-0.02003811113536358,
0.43625691533088684,
-0.11389037221670151,
0.09166049212217331,
0.2213367521762848,
0.15653902292251587,
-0.27445992827415466,
-0.2923460900783539,
-0.5320043563842773,
-0.23811395466327667,
0.689923107624054,
-0.1380082666873932,
0.2652071714401... | |
I as of yet, have not had a need to create a dll in .NET as my programs tend to be distinct from one another (and I haven't programmed for too long). However I am starting to gather a library of regularly used methods now which tend to have copies in lots of my programs (or similar methods that could be made more gener... | [
0.6559829115867615,
0.09199900180101395,
0.1305585503578186,
0.15497292578220367,
-0.25258997082710266,
-0.3057672679424286,
0.1203058511018753,
0.12901385128498077,
-0.32858940958976746,
-0.7810864448547363,
0.2870086133480072,
0.2944580912590027,
-0.13840340077877045,
0.30650410056114197... | |
custom error form and a print preview dialog which are used in almost all my programs. Is it good practice to put these in a dll?
"Good practice" in this case really relies on how much code-duplication you're cutting down on. If these dialogues are used throughout a lot of your programs and they take up a lot of code, ... | [
0.3247901201248169,
0.2521091401576996,
-0.16925397515296936,
0.4004526734352112,
-0.04732399433851242,
0.04887605085968971,
0.16886591911315918,
0.1806815266609192,
-0.4478069543838501,
-0.728811502456665,
0.04321146011352539,
0.8252506256103516,
-0.17360761761665344,
-0.21788160502910614... | |
before. Keep things simple. Keep them generic. Keep them useful.
Before you start, though, be aware that you are creating a dependency tree. If you update your library chances are you'll have to put in some time maintaining your apps that use it... But this is no different from using a third-party lib. | [
0.718626081943512,
-0.02787456288933754,
-0.1016332134604454,
0.06928661465644836,
0.008352714590728283,
-0.4732884168624878,
0.20445235073566437,
0.36800652742385864,
-0.259271502494812,
-0.6559267044067383,
0.0796385183930397,
0.516886293888092,
-0.36477091908454895,
0.14624837040901184,... | |
If you do not have Java installed in your computer, is it possible to compile and execute Java programs by pointing to a PC which has?
If you have Java installed on your machine then zip that whole directory and give that to those guys. They can extract it to their machine, they don;t need admin rights for that. Thats ... | [
0.33939945697784424,
0.04964772239327431,
0.05109255015850067,
0.057805366814136505,
-0.10739359259605408,
-0.280935138463974,
0.3380492925643921,
-0.24112564325332642,
-0.16821764409542084,
-0.7681546211242676,
-0.15266501903533936,
0.6520754098892212,
-0.3402484059333801,
-0.227296993136... | |
installed and the logged in user have execute permission. | [
0.5689579248428345,
0.1022041067481041,
0.13629035651683807,
-0.11965452134609222,
0.35402604937553406,
-0.4601142704486847,
0.21797631680965424,
0.00927321519702673,
-0.038285594433546066,
-0.6165815591812134,
-0.6742340922355652,
0.6295512318611145,
-0.015627946704626083,
-0.102607205510... | |
While reading some programming books, I notice that the authors says that, in OOP, you may have some confusion while understanding the main idea of OOP.
And hell yeah!. I had some confusion. Did you have the same and what makes this confusion to programmers(even experienced programmers)?!
And if you had it, how could... | [
0.360927551984787,
0.09577630460262299,
-0.40503036975860596,
0.048525720834732056,
-0.26325908303260803,
-0.29498186707496643,
0.43933534622192383,
-0.0451376847922802,
-0.426483154296875,
-0.29624226689338684,
0.14584752917289734,
0.4765792191028595,
-0.1596546471118927,
0.16418193280696... | |
HI all,
I use jQuery to parse my xml responses.
I have this xml :
```
<?xml version="1.0" encoding="UTF-8"?>
<response status="ok">
<client_id>185</client_id>
</response>
```
And i want to get "client\_id" value.
First, make a request for the XML with $.get or however you want.
Then:
```
clientID = $(myXML).... | [
0.1945207417011261,
0.19909076392650604,
0.9855817556381226,
-0.14064925909042358,
-0.10325109213590622,
0.13653448224067688,
0.05620323121547699,
-0.3149413466453552,
0.08848922699689865,
-0.5033424496650696,
-0.3072456121444702,
0.724955141544342,
-0.15162473917007446,
0.0257523283362388... | |
I'm running a python script on a shared hosting server which until this morning had MySQL version 4. Now it has version 5. My python script can no longer connect to MySQL, as it can't find libmysqlclient\_r.so.14:
```
$ python my_script.py
Traceback (most recent call last):
File "my_script.py", line 6, in ?
import MyS... | [
0.0367511548101902,
0.4164732098579407,
0.4663837254047394,
-0.3641345798969269,
-0.0326911062002182,
0.05454783886671066,
0.5481712222099304,
0.20355083048343658,
-0.32550543546676636,
-0.7302202582359314,
-0.06592724472284317,
0.35079655051231384,
-0.40315139293670654,
0.2946362197399139... | |
libmysqlclient to use?
You can't tell the dynamic linker which version of a library to use, because the SONAME (full name of the library + interface) is part of the binary.
In your case, you can try to upload libmysqlclient\_r.so.14 to the host and set `LD_LIBRARY_PATH` accordingly, so tell the dynamic linker which di... | [
-0.2552781403064728,
-0.10502363741397858,
0.548631489276886,
-0.03619608283042908,
-0.016916979104280472,
-0.28848767280578613,
0.054854992777109146,
-0.15045641362667084,
-0.23516377806663513,
-0.9634465575218201,
-0.349418967962265,
0.6287466883659363,
-0.6135862469673157,
0.07426718622... | |
the new libraries. | [
-0.07964861392974854,
-0.10841909795999527,
0.20761588215827942,
0.16751068830490112,
0.014823057688772678,
0.015433595515787601,
-0.14218540489673615,
-0.06177026033401489,
-0.2056356519460678,
-0.48116761445999146,
-0.04668331518769264,
0.22268036007881165,
0.23865574598312378,
0.2165136... | |
I have set some style for h2 tags (color, font-size, etc.), but when I put "A" tag inside, then style becomes as link. My html:
```
<h2>
<a class="no-decor" href="http://localhost/xxx/">Link</a>
</h2>
```
So, as You can see, I've created "no-decor" class. It should inherit h2's style for "a" tag.
```
a.no-decor {... | [
0.27250030636787415,
0.21175235509872437,
0.4759616255760193,
-0.2219107300043106,
-0.0362839512526989,
-0.30347588658332825,
0.5508125424385071,
-0.3062412142753601,
0.03071768395602703,
-0.7468479871749878,
-0.2845289707183838,
0.504748523235321,
-0.34931665658950806,
0.24509543180465698... | |
too.
P.P.S. There is some example in same way: <http://www.brunildo.org/test/inherit.html>
No, IE has never supported `inherit` for any property - sorry. This has been fixed in >= IE8.
Whilst you could use a JavaScript fix to copy the properties from `h2` to `a`, it's probably easiest just to apply the same styling r... | [
0.5460901856422424,
-0.14083290100097656,
0.47206205129623413,
0.05321076512336731,
0.19558003544807434,
-0.33476412296295166,
0.18140541017055511,
-0.2836083471775055,
-0.056455712765455246,
-0.33625131845474243,
-0.12308827042579651,
0.26274165511131287,
-0.06385488063097,
0.167826414108... | |
child; the child cannot remove it (modulo IE bugs). 'text-decoration: none' on the child is the right thing, unless you want potentially *two* underlines... | [
-0.024809496477246284,
0.1781938076019287,
0.14903524518013,
-0.0637703612446785,
0.6257066130638123,
0.03763533756136894,
0.3659416139125824,
0.2688998878002167,
-0.2172125279903412,
-0.29893505573272705,
-0.8645152449607849,
0.3576712906360626,
-0.20422647893428802,
-0.09358927607536316,... | |
I want to use the same **{% block %}** twice in the same django template. I want this block to appear more than once in my base template:
```
# base.html
<html>
<head>
<title>{% block title %}My Cool Website{% endblock %}</title>
</head>
<body>
<h1>{% block title %}My Cool Website{% endbloc... | [
0.42813611030578613,
0.12404095381498337,
0.78824782371521,
-0.0018708780407905579,
-0.006539168301969767,
-0.30672693252563477,
0.24441704154014587,
0.060753997415304184,
-0.18228526413440704,
-0.591715931892395,
-0.1743072271347046,
0.23006916046142578,
-0.1785464584827423,
-0.1514383405... | |
'base.html' %}
{% block title %}My Cats{% endblock %}
```
I will get an exception, as Django wants the block to appear only once:
> **TemplateSyntaxError at /**
>
>
> **'block' tag with name 'title' appears
> more than once**
A quick and dirty solution would be duplicating the block *title* into *title1* and *ti... | [
0.5457040667533875,
0.310604065656662,
0.6073854565620422,
-0.08403171598911285,
-0.03291390463709831,
-0.5454064607620239,
0.4913378059864044,
-0.07198499143123627,
-0.3077072203159332,
-0.35597431659698486,
-0.11771972477436066,
0.36519449949264526,
-0.4798754155635834,
0.277969330549240... | |
or work-around to this problem? How can I repeat the same block in my template, without duplicating all the code?
I think that use of the context processor is in this case an overkill. You can easily do this:
```
#base.html
<html>
<head>
<title>{% block title %}My Cool Website{% endblock %}</title>
</h... | [
0.5235328078269958,
0.15182286500930786,
0.5814185738563538,
0.2001212239265442,
-0.1882607340812683,
-0.43554121255874634,
0.5145509243011475,
0.007791637443006039,
-0.26138436794281006,
-0.6237801313400269,
-0.058410294353961945,
0.39511069655418396,
-0.14386358857154846,
-0.052821241319... | |
Lorem ipsum here...
{% endblock %}
```
and so on... Looks like DRY-compatible. | [
-0.04239692911505699,
0.1465780884027481,
0.5693721771240234,
-0.1327458918094635,
0.007145090028643608,
0.007714662700891495,
0.08945402503013611,
0.25757408142089844,
0.3880912661552429,
-0.5237423777580261,
0.11170559376478195,
0.6192231178283691,
-0.006745586171746254,
0.12514780461788... | |
I have this SQL Job (in SQL Server 2005) that creates a backup every six(6) hours, the backup's filename is based on the timestamp so that it will create a unique filename(dbname\_yyyymmddhhmmss.bak), Now my question is, How would I know using xp\_cmdshell if the file is three day old and based on my script I want to d... | [
0.21254725754261017,
0.45158886909484863,
0.2672117352485657,
-0.08032320439815521,
-0.13572156429290771,
-0.10641255974769592,
0.40087857842445374,
0.10717649757862091,
-0.44525736570358276,
-0.39214086532592773,
0.2869933247566223,
0.7633515000343323,
-0.07271113991737366,
0.101250089704... | |
-> Maintenance Plans).
I usually create one Maintenance Plan including two tasks: One "Maintenance Cleanup Task" which deletes old backups after x days, followed by a "Back Up Database Task". | [
0.39133769273757935,
-0.1319326013326645,
0.4043384790420532,
0.32311487197875977,
0.319513201713562,
-0.0672178566455841,
0.23741912841796875,
-0.22964303195476532,
0.02331417053937912,
-0.5358486175537109,
-0.40839260816574097,
0.6000874638557434,
-0.08682938665151596,
0.0521718002855777... | |
I've just tried the following, the idea being to concatenate the two strings, substituting an empty string for nulls.
```
string a="Hello";
string b=" World";
```
-- Debug (amusing that ? is print, doesn't exactly help readability...)
```
? a ?? "" + b ?? ""
```
-> "Hello"
Correct is:
```
? (a??"")+(b??"")
"H... | [
-0.2934192717075348,
0.279572993516922,
0.2933685779571533,
-0.038202978670597076,
-0.16091476380825043,
-0.07772117108106613,
0.40222322940826416,
0.14626005291938782,
-0.1073896735906601,
-0.39854422211647034,
-0.03218339756131172,
0.5097469687461853,
-0.038504693657159805,
0.24331487715... | |
be, what it is according to ECMA, what it is according to the MS spec and what csc actually does, I have one bit of advice:
**Don't do this**.
I think it's *much* clearer to write:
```
string c = (a ?? "") + (b ?? "");
```
Alternatively, given that null in string concatenation ends up just being an empty string an... | [
0.0550466850399971,
-0.11176473647356033,
0.2904092073440552,
-0.3921990394592285,
-0.06377214938402176,
-0.06358207762241364,
0.13906848430633545,
-0.439238578081131,
-0.10569803416728973,
-0.4655781686306,
-0.2581169307231903,
0.2713295519351959,
-0.5535228848457336,
0.23279805481433868,... | |
IMO. There's a change shown on the page made in July 2008 which moved the conditional operator - but apparently incorrectly! | [
-0.021758215501904488,
-0.23864524066448212,
0.171687513589859,
-0.3953315019607544,
-0.3165448307991028,
0.036243293434381485,
0.3923684358596802,
-0.046966973692178726,
-0.384795606136322,
0.06028171256184578,
-0.19251176714897156,
0.3654455840587616,
-0.41326904296875,
-0.05492026731371... | |
Is there someway to get a list of activated sessions in classic ASP?
I want to limit the number of simultaneus activated sessions.
Here is a good article which shows a way to do that: [Active User Count Without Global.asa by Josh Painter](http://www.aspfree.com/c/a/asp-code/active-user-count-without-global-asa-by-josh... | [
0.2220579832792282,
-0.09252448379993439,
-0.2771831452846527,
0.12991346418857574,
-0.19769272208213806,
-0.09949605166912079,
0.6932077407836914,
0.09784537553787231,
-0.6153988242149353,
-0.5078851580619812,
0.10634128749370575,
0.48058727383613586,
-0.5759413838386536,
-0.3207325637340... | |
could simply doing it this way:
```
Sub Session_OnStart
Application.Lock
Application("count") = Application("count") + 1
Application.Unlock
End Sub
Sub Session_OnEnd
Application.Lock
Application("count") = Application("count") - 1
If Application("count") < 0 then ' Could only happen if some other f... | [
-0.12793856859207153,
-0.2880209982395172,
0.6915174722671509,
0.07343994081020355,
0.16396307945251465,
-0.21449780464172363,
0.40786752104759216,
-0.5001604557037354,
-0.4115498960018158,
-0.47718921303749084,
-0.2646857500076294,
0.36519452929496765,
-0.19717247784137726,
0.394627273082... | |
Is simply enumerating a .NET Dictionary from multiple threads safe?
No modification of the Dictionary takes place at all.
Yes, in that case enumeration is thread safe since at the beginning of a `foreach` loop a new instance of the enumerator is created with an implicit call to `GetEnumerator`. | [
0.08477519452571869,
-0.06312136352062225,
0.057878777384757996,
0.10455387085676193,
-0.038417648524045944,
-0.2803511619567871,
0.3651227653026581,
-0.2937164306640625,
-0.03797769173979759,
-0.5632245540618896,
-0.1892269402742386,
0.3436298668384552,
-0.41329991817474365,
-0.1135627701... | |
I just considered using the new TDictionary type. But On QualityCentral I read about two memory leaks caused by TDictionary:
<http://qc.codegear.com/wc/qcmain.aspx?d=67355>
I just implemented the proposed workaround, basically subclassing TDictionary, overriding the destructor and manually freing the two objects that... | [
0.48842841386795044,
-0.09740655869245529,
0.2797379195690155,
-0.09453856199979782,
0.01023140363395214,
-0.12207262217998505,
0.5664383769035339,
-0.3778608441352844,
-0.12019778043031693,
-0.49460917711257935,
-0.013007343746721745,
0.9375037550926208,
-0.550259530544281,
0.258533298969... | |
an access violation?
Thanks in advance for reading (and hopefully answering).
You could call `inherited` first and check if the properties are still set:
```
destructor TMemCorrectedDictionary.Destroy;
begin
inherited;
Values.Free;
Keys.Free;
end;
```
And by the way: `Free` doesn't care if the instance to be ... | [
0.010321591980755329,
-0.0008217119029723108,
0.027962950989603996,
0.24441500008106232,
0.2128547728061676,
-0.44647252559661865,
0.4479902386665344,
0.0846659317612648,
-0.302430659532547,
-0.6008881330490112,
-0.11798907071352005,
0.8232191801071167,
-0.19516263902187347,
0.461528241634... | |
I am an experienced PHP programmer using Django for the first time, and I think it is incredible!
I have a project that has a lot of apps, so I wanted to group them in an apps folder.
So the structure of the project is:
```
/project/
/project/apps/
/project/apps/app1/
/project/apps/app2
```
Then in Django settings... | [
0.34678566455841064,
0.5453369617462158,
0.20435689389705658,
-0.1302429735660553,
-0.1485387682914734,
-0.06764917820692062,
0.04039651155471802,
-0.11324389278888702,
-0.320133775472641,
-0.7774747014045715,
-0.09082704037427902,
0.5884964466094971,
-0.3947584927082062,
-0.28729221224784... | |
won't be recognized as part of the package.
So each of the folders here should have '\_\_init\_\_.py' file in it. (empty is fine).
```
/project/
/project/apps/
/project/apps/app1/
/project/apps/app2
```
Then as long as your root 'module' folder is in your PYTHONPATH you'll be able to import from your apps.
Here's ... | [
0.25686365365982056,
0.08995287120342255,
0.4022613763809204,
-0.09203256666660309,
-0.049979910254478455,
-0.04243336617946625,
0.31091585755348206,
0.0273949783295393,
-0.27590158581733704,
-0.6700835824012756,
-0.38856241106987,
0.49783650040626526,
-0.40250611305236816,
-0.339598387479... | |
My application is processing IList's. ILists of different user defined types. I'm thinking that i can use reflection to to see what type of object the IList contains and then create a new instance of that type and subsequently add that to the IList itself?
So at any one time I might be processing
```
IList<Customer>... | [
0.3552454710006714,
0.26095879077911377,
0.42914968729019165,
-0.07902530580759048,
-0.09843754768371582,
0.25441527366638184,
0.04228111729025841,
-0.018360432237386703,
-0.1742713749408722,
-0.7093784809112549,
0.0886060819029808,
0.7047500014305115,
-0.5873438715934753,
0.12230633944272... | |
public static void AddNewElement<T>(IList<T> l, int i, string s)
{
T obj = (T)Activator.CreateInstance(typeof(T), new object[] { i, s });
l.Add(obj);
}
```
Usage:
```
IList<Customer> l = new List<Customer>();
l.Add(new Customer(1,"Hi there ..."));
AddNewElement(l, 0, "None");
``... | [
0.019705215469002724,
-0.2622186839580536,
0.44056448340415955,
-0.33442002534866333,
0.2296225130558014,
0.31268757581710815,
0.006098315119743347,
-0.12320095300674438,
-0.22313804924488068,
-0.7516925930976868,
-0.596289873123169,
0.6568543314933777,
-0.779151439666748,
0.09600498527288... | |
throw new ArgumentNullException();
object obj = Activator.CreateInstance(l[0].GetType(), new object[] { i, s });
l.Add(obj);
}
``` | [
-0.22914335131645203,
-0.22172434628009796,
0.274196594953537,
-0.45216238498687744,
0.09301059693098068,
0.33975329995155334,
0.3634316623210907,
-0.2675397992134094,
-0.0431465320289135,
-0.6927202343940735,
-0.3779700994491577,
0.5643631815910339,
-0.46345019340515137,
0.164209216833114... | |
We're customizing an Eclipse RCP based tool for a client. They have trouble loading it on one of their computers (it works on others) and have provided the following error log.
> !SESSION 2009-01-23 12:09:05.593
> ----------------------------------------------- eclipse.buildId=unknown
> java.version=1.5.0\_12 java.... | [
0.2892356812953949,
-0.0989256203174591,
0.3561725616455078,
0.12081802636384964,
-0.31330445408821106,
0.03402237966656685,
0.0577721893787384,
-0.2972188889980316,
-0.23396164178848267,
-0.44581806659698486,
0.17246094346046448,
0.4565412402153015,
-0.43180394172668457,
-0.03955953195691... | |
org.eclipse.swt.SWT.error(SWT.java:3374)
> at
> org.eclipse.swt.SWT.error(SWT.java:3297)
> at
> org.eclipse.swt.SWT.error(SWT.java:3268)
> at
> org.eclipse.swt.widgets.Display.error(Display.java:978)
> at
> org.eclipse.swt.widgets.Display.checkDevice(Display.java:638)
> at
> org.eclipse.swt.graphics.Device.di... | [
-0.08037601411342621,
0.23302964866161346,
0.2641962468624115,
-0.12140456587076187,
-0.31998348236083984,
0.29654979705810547,
0.20274534821510315,
-0.5468272566795349,
-0.2677968144416809,
-0.8252339959144592,
-0.24179165065288544,
0.44902926683425903,
-0.2792094349861145,
-0.03270930424... | |
threads. Since we don't see this problem on any other computer I'm at a loss as to what might be causing it.
It must be a configuration problem on the machine in question, as the code is from the vendor (so presumably well tested) and works on every other machine we've tested it on.
Does anyone have any suggestions ... | [
0.5724985599517822,
0.084455706179142,
0.06491993367671967,
0.4024657905101776,
0.12286177277565002,
-0.11231781542301178,
0.0884363129734993,
0.4873511493206024,
-0.6698706150054932,
-0.5791877508163452,
-0.06236771121621132,
0.40706250071525574,
-0.46035701036453247,
0.2644055485725403,
... | |
code in the RCP application to display the exception on the GUI with some dialog box, but this is done in the wrong thread. That would explain why it happens only on some machines. It would also explain why the problem went undetected.... it probably never happens in the dev's computers so they never bothered to check ... | [
0.30946651101112366,
0.0924747884273529,
0.36249321699142456,
0.24883736670017242,
-0.15856775641441345,
-0.3030860126018524,
0.40027499198913574,
0.02679162099957466,
-0.1686841994524002,
-0.5081049203872681,
0.05214816704392433,
0.5288610458374023,
-0.6101623177528381,
-0.042866993695497... | |
have no source code, and try to see what happens. I am pretty sure that when you hit this breakpoint on the problematic machine, an Exception will be thrown. That will be your "Real" exception. | [
0.3404281735420227,
0.39649054408073425,
0.010056158527731895,
0.2569330036640167,
0.3550322949886322,
-0.1542859971523285,
0.3671801686286926,
0.27414628863334656,
-0.25701409578323364,
-0.561877429485321,
-0.09732075780630112,
0.6223568916320801,
-0.23546335101127625,
-0.0059717022813856... | |
Got a simple form, posting to an action... the action takes the data and creates a record in the DB, and copies the image to a directory. Works great on my local dev box.
Upload the form to my host, and the image uploading doesn't work. The form acts as if it's failing the UpdateModel(), but doesn't show any validatio... | [
0.5292118191719055,
-0.037861842662096024,
0.4886804521083832,
0.053439222276210785,
-0.10263390839099884,
-0.14747068285942078,
0.6251993179321289,
-0.25536295771598816,
-0.39928963780403137,
-0.5707156658172607,
0.11108143627643585,
0.515958309173584,
-0.33906373381614685,
0.023700028657... | |
How can I specify a custom date formate to be validated with the [Validation Plugin](http://docs.jquery.com/Plugins/Validation) for jQuery?
You can create your own custom validation method using the [`addMethod`](http://docs.jquery.com/Plugins/Validation/Validator/addMethod#namemethodmessage) function. Say you wanted t... | [
0.747181236743927,
-0.0126985814422369,
0.451742023229599,
0.2193922996520996,
-0.044114064425230026,
-0.00195630406960845,
0.10899508744478226,
-0.09653913229703903,
-0.2297038435935974,
-0.16055379807949066,
0.02981678396463394,
0.06402576714754105,
-0.1131671592593193,
0.258268177509307... | |
rules : {
myDate : {
australianDate : true
}
}
})
;
``` | [
0.3041711747646332,
-0.1455100029706955,
0.35510072112083435,
-0.27901238203048706,
0.159455806016922,
-0.2684634029865265,
0.7194390892982483,
-0.013391166925430298,
-0.36937016248703003,
-0.206200510263443,
-0.3270070552825928,
0.14395025372505188,
-0.320138543844223,
0.1876101940870285,... | |
Has anyone tried using it and can say if it's well implemented?
-- Assaf (who spent the last few weeks getting increasingly frustrated with MySQL's deficient implementation of OpenGIS functions and is now considering switching to MSSQL)
Yes, they work.
I just switched one my classes from an ESRI-ArcObject-based query... | [
-0.1701582372188568,
-0.053370438516139984,
0.3715161383152008,
0.27888965606689453,
-0.021235233172774315,
-0.2680218815803528,
0.3105669617652893,
0.044739242643117905,
-0.05628874525427818,
-0.7327779531478882,
0.20638011395931244,
0.19162821769714355,
-0.19685344398021698,
-0.088450469... | |
spatial functions in SQLSVR2008).
After some tweaking,my SQL method was faster than the ESRI method but not by much. Then I jacked my search distance up to 10000 feet and then I saw the difference. The SQL Server 2008 method was a lot faster.
(ESRI) Search Nearby Customers Elapsed Time(sec): 1.503
(SQL2008) Query Ne... | [
-0.6393298506736755,
-0.3634744882583618,
1.0846045017242432,
0.19738653302192688,
-0.1511542946100235,
0.23991245031356812,
0.2554621994495392,
-0.3453289568424225,
-0.2934039831161499,
-0.8801135420799255,
0.10997073352336884,
0.4113403260707855,
0.19702711701393127,
0.0313514843583107,
... | |
,SHAPE.STY as Y ,SHAPE.STDistance(but the ArcObject developers know all about that overhead).
I'm impressed so far. | [
0.713553786277771,
0.055399276316165924,
0.16334684193134308,
0.2700105905532837,
-0.3324916958808899,
0.35029035806655884,
-0.13125160336494446,
0.32457685470581055,
-0.07130469381809235,
-0.6646737456321716,
0.044725432991981506,
0.39629682898521423,
0.26972830295562744,
-0.0772500708699... | |
I found a great article on integrating different diff and merge tools with Visual Studio 2005 and 2008: <http://blogs.msdn.com/jmanning/articles/535573.aspx>.
Does anyone know how I might integrate a tool like KDiff3 in the same way with Visual Studio.Net 2003? I would like to have KDiff3 be the default diff tool when... | [
-0.013006296940147877,
-0.24012960493564606,
0.3180205821990967,
0.06066591665148735,
-0.5306689739227295,
0.07127678394317627,
0.12081710994243622,
-0.20237775146961212,
0.01528820302337408,
-0.7723889946937561,
0.1551172137260437,
0.6694284677505493,
-0.14306356012821198,
-0.115829072892... | |
I'm using for source control integration is the VS2005 version.
So, by going into VS2005 and using "Configure User Tools...", it forces 2003 to use the same tools. | [
0.09219706803560257,
-0.051307063549757004,
0.43627774715423584,
0.006268721539527178,
-0.0648539736866951,
-0.3657044470310211,
-0.009605413302779198,
-0.044602375477552414,
0.033311713486909866,
-0.6645113229751587,
0.18192081153392792,
0.8174740672111511,
-0.19362427294254303,
0.1519510... | |
I have the 3 following tables in a MySQL 4.x DB :
* hosts: *(300.000 records)*
+ id (UNSIGNED INT) PRIMARY KEY
+ name (VARCHAR 100)
* paths: *(6.000.000 records)*
+ id (UNSIGNED INT) PRIMARY KEY
+ name (VARCHAR 100)
* urls: *(7.000.000 records)*
+ host (UNSIGNED INT) PRIMARY KEY <--- links to hosts.id
+ path (UN... | [
0.1638442426919937,
0.4548162817955017,
0.6776062846183777,
-0.010840075090527534,
-0.17648538947105408,
0.13853590190410614,
0.18500420451164246,
-0.4097132682800293,
-0.11320997774600983,
-0.8654723763465881,
0.23326632380485535,
0.229252427816391,
-0.09612663090229034,
0.569029569625854... | |
P.id;
```
This query works perfectly fine, but takes 50 minutes to run. Does anyone have any idea about how I could speed up that query?
Thanks in advance.
Nicolas
For one thing I wouldn't do the CONCAT in the query. Do it outside.
But really you're query runs slowly because you're retrieving millions of rows. | [
0.3343183696269989,
0.30151060223579407,
0.3336317539215088,
0.2264377623796463,
-0.060971450060606,
0.03368448093533516,
0.16040584444999695,
-0.06891477108001709,
-0.22767767310142517,
-0.6573320031166077,
0.09467899054288864,
0.5462005138397217,
-0.16488519310951233,
0.16236375272274017... | |
I'm starting to understand XAML data binding and using the DataTemplate and it's pretty nice.
What is the best way to take the next step and put logic into the code below,
e.g. look to see if there is anything in "Address2" and if so display it,
or format foreign addresses differently, etc.?
```
<Window.Resources>
... | [
0.09448523819446564,
0.224055215716362,
0.5158294439315796,
-0.003894154680892825,
0.03465704247355461,
-0.07152623683214188,
-0.2827037572860718,
-0.0695011243224144,
-0.14707893133163452,
-0.7134353518486023,
0.032407842576503754,
0.3551182746887207,
0.12979428470134735,
0.16461019217967... | |
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<Rectangle Height="30" Width="30" Margin="0 4 0 0" Fill="LightGreen" Grid.Column="0" VerticalAlignment="Top"/>
<StackPanel Margin="3 0 0 10" Orientation="Vertical" Grid.Column="1">
<TextBlock Text="{Binding Path=... | [
-0.3694688379764557,
-0.12364021688699722,
0.8283722996711731,
-0.2941974699497223,
0.040632449090480804,
0.22154003381729126,
-0.2618905007839203,
-0.48276716470718384,
-0.511147141456604,
-0.5090109705924988,
-0.13117828965187073,
0.39882323145866394,
-0.05495607852935791,
-0.11352971941... | |
<TextBlock Text="{Binding Path=Address}"/>
<TextBlock>
<TextBlock.Text>
<MultiBinding StringFormat="{}{0}, {1} {2}"> | [
-0.3148442208766937,
-0.09795914590358734,
0.2990001142024994,
-0.12136796861886978,
-0.3372873365879059,
-0.06450798362493515,
0.33961114287376404,
-0.368575781583786,
-0.22262383997440338,
-0.5917838215827942,
-0.2944353520870209,
0.18144795298576355,
-0.5756630897521973,
0.1599549800157... | |
<Binding Path="City"/>
<Binding Path="Region"/>
<Binding Path="PostalCode"/>
</MultiBinding> | [
0.10881034284830093,
-0.2340141385793686,
0.4048865735530853,
0.10282757878303528,
-0.018572639673948288,
0.12476027756929398,
-0.13187673687934875,
-0.45084962248802185,
-0.2870861887931824,
-0.9591987133026123,
-0.3729076087474823,
-0.45584386587142944,
-0.8552744388580322,
0.16876681149... | |
</TextBlock.Text>
</TextBlock>
</StackPanel>
</Grid>
</DataTemplate>
</Window.Resources>
<Grid>
<ListBox Name="dataListBox" ItemTemplate="{StaticResource CustomersTemplate}"/>
</Grid>
```
Here is the code behind for completeness (autogenerated LINQ to SQL classes on Northw... | [
-0.16981768608093262,
0.03963096812367439,
0.8386298418045044,
-0.007868383079767227,
0.18574172258377075,
-0.09803028404712677,
-0.12317987531423569,
0.05258794128894806,
-0.3589068055152893,
-0.5704439878463745,
-0.20707327127456665,
0.3104500472545624,
0.010474967770278454,
0.2103426903... | |
triggers, here is the code to remove blank address lines from your example:
I've added a name to the address text block and added a DataTrigger to hide it when the address is blank
```
<Window.Resources>
<DataTemplate x:Key="CustomersTemplate">
<Grid>
... snip ...
<TextBlock Name="Address... | [
0.3946729600429535,
-0.08847041428089142,
0.2622416913509369,
0.0002944126899819821,
-0.03426744416356087,
0.03846883401274681,
-0.27121540904045105,
-0.38003453612327576,
-0.4611872136592865,
-0.6787997484207153,
0.20406818389892578,
0.4386233985424042,
-0.02834301069378853,
0.10439891368... | |
Value="">
<Setter TargetName="AddressLine" Property="Visibility" Value="Collapsed"/>
</DataTrigger>
</DataTemplate.Triggers>
</DataTemplate>
</Window.Resources>
``` | [
-0.07391036301851273,
-0.02891661413013935,
0.18524494767189026,
0.05063590779900551,
0.08126150816679001,
-0.024718452244997025,
-0.014292027801275253,
-0.3252831697463989,
-0.10088886320590973,
-0.6608436107635498,
-0.41331255435943604,
0.3218235969543457,
-0.08130109310150146,
0.1845081... | |
I have a GridView...
```
<asp:GridView EnableViewState="true"
ID="grdResults"
runat="server"
CssClass="resultsGrid"
OnRowDataBound="grdResults_OnRowDataBound"
AutoGenerateColumns="false" | [
0.19254295527935028,
-0.06174518167972565,
0.6001546382904053,
-0.171149343252182,
-0.05577550828456879,
0.058486927300691605,
0.21239449083805084,
-0.2603239119052887,
0.1626497209072113,
-0.8781664967536926,
0.07510554790496826,
0.37484854459762573,
-0.019878989085555077,
0.0454028323292... | |
HeaderStyle-CssClass="header"
OnRowCommand="grdResults_OnRowCommand">
<Columns>
<asp:TemplateField>
<ItemTemplate>
<asp:Label ID="lblView"
runat="server" | [
-0.04803778976202011,
-0.20434902608394623,
0.37036699056625366,
0.05138131603598595,
-0.48000162839889526,
-0.0714612752199173,
-0.11117127537727356,
-0.30498048663139343,
-0.4712352752685547,
-0.389923632144928,
-0.19198885560035706,
-0.015158932656049728,
-0.16127873957157135,
0.1555010... | |
Visible="false"
Text="View">
</asp:Label>
<asp:HyperLink ID="hypEdit" | [
0.36492985486984253,
-0.14427293837070465,
0.016868047416210175,
0.149741068482399,
-0.26174455881118774,
-0.21089915931224823,
0.3430875539779663,
-0.22016632556915283,
-0.17379066348075867,
-0.45387259125709534,
-0.18141736090183258,
0.4169118404388428,
-0.5136852264404297,
-0.2901835739... | |
runat="server"
Visible="false"
Text="(Edit)" | [
0.3172074854373932,
-0.20796270668506622,
-0.01596992276608944,
0.03888282552361488,
-0.31777581572532654,
-0.18935759365558624,
0.5877624750137329,
0.1994759440422058,
-0.22454780340194702,
-0.22977757453918457,
-0.5866169929504395,
0.20973435044288635,
-0.6379736065864563,
0.119442224502... | |
CssClass="edit">
</asp:HyperLink>
<asp:LinkButton ID="btnDelete"
runat="server" | [
0.05737478286027908,
-0.08858425170183182,
0.30182161927223206,
-0.04727812111377716,
-0.29495006799697876,
0.03961911424994469,
0.13763026893138885,
0.11016176640987396,
-0.7857841849327087,
-0.46770691871643066,
-0.5241158604621887,
-0.1377745419740677,
-0.3400265574455261,
0.03335096687... | |
Visible="false"
Text="(Delete)"
CssClass="delete"
CommandName="DeleteItem" | [
-0.17707550525665283,
-0.16678281128406525,
0.16846992075443268,
-0.07526566833257675,
0.14532895386219025,
-0.20282141864299774,
0.5421613454818726,
0.1415262669324875,
-0.6592546105384827,
-0.3829299807548523,
-0.6377480030059814,
0.33101916313171387,
-0.21250733733177185,
0.319650501012... | |
OnClientClick="return confirm('Are you sure you want to delete?')">
</asp:LinkButton>
<asp:HyperLink ID="hypSelect"
runat="server" | [
-0.09189630299806595,
-0.26897358894348145,
0.4840388596057892,
0.17148222029209137,
0.37370866537094116,
-0.335130512714386,
0.44483301043510437,
0.08099251240491867,
-0.17831014096736908,
-0.35797634720802307,
-0.33417195081710815,
0.24747058749198914,
-0.6052441000938416,
0.092073999345... | |
Visible="false"
Text="(Select)"
CssClass="select"> | [
0.16381779313087463,
-0.23002970218658447,
-0.0030363677069544792,
-0.009235815145075321,
0.028172295540571213,
-0.09761126339435577,
0.2910439670085907,
-0.0690111294388771,
-0.3410724699497223,
-0.5275976061820984,
-0.41920194029808044,
0.20545265078544617,
-0.26702263951301575,
-0.03917... | |
</asp:HyperLink>
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
```
This has one static column containing a label two hyperlinks and a link button and also has a number of dynamically generated columns...
```
private void SetupColumnStructure(IEnumerable<string> columnNames)
{
... | [
0.16214865446090698,
-0.29589205980300903,
0.6309955716133118,
-0.03107685036957264,
0.12185260653495789,
-0.0722411498427391,
0.0987439975142479,
-0.26264309883117676,
-0.16715429723262787,
-0.6876078248023987,
-0.16460847854614258,
0.3685704171657562,
-0.35393521189689636,
0.005843888968... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.