text stringlengths 0 30.5k | title stringclasses 1
value | embeddings listlengths 768 768 |
|---|---|---|
A common component is a library or some other piece of code that is created and maintained by one group and used by many groups.
Some problems we have are:
* The users don't report issues with the components.
* Users build workarounds to the components to suit their needs.
* They break compatibility with the trunk ve... | [
0.6188836693763733,
0.2962065637111664,
-0.009697232395410538,
0.4664096236228943,
-0.0069178310222923756,
-0.36555737257003784,
0.3435111939907074,
-0.13246622681617737,
-0.18086381256580353,
-0.34033119678497314,
-0.14937429130077362,
0.3960287272930145,
-0.32485002279281616,
0.252548962... | |
to the code.
* ...
What you have here may be a human factors problem rather than a technical one. In fact it may be primarly a learning issue (coupled with the typical not invented here syndrom).
Having worked in large companies, I realise that it is tough for a new person to understand all the resources (i.e. shared ... | [
0.4816713333129883,
0.2202996462583542,
-0.20779921114444733,
0.27698615193367004,
0.14364579319953918,
-0.1711818128824234,
0.26659175753593445,
-0.052273496985435486,
-0.26337119936943054,
-0.5925747156143188,
-0.34534987807273865,
0.8654584288597107,
0.10779976099729538,
0.1349550932645... | |
reward people for using the common components, improving them and submitting improvments back to the library? Or do managers simply care about their own projects.
As for your group that maintains the common library, what form or reconginition do they give to people who take the time to suggest or submit improvements? ... | [
0.5444467067718506,
0.24387244880199432,
-0.14127527177333832,
0.3784334361553192,
-0.006252041552215815,
-0.38076019287109375,
0.24427218735218048,
-0.057779714465141296,
-0.4415653645992279,
-0.31757214665412903,
0.06457068771123886,
0.6659646034240723,
0.2628656029701233,
-0.13288831710... | |
I have written a simple .NET webservice, which I will be hosted on a different server may be on different continent. I don't really know. Now, I only had its URL and I tried to use webrequest and webresponse method to access that web service vai HTTP POST. Now, I want to know is there any way to secure the webservice a... | [
0.5919889211654663,
0.41880956292152405,
0.4512560963630676,
0.0955079048871994,
0.07468334585428238,
-0.39321938157081604,
0.37966156005859375,
-0.00755103537812829,
-0.23693984746932983,
-0.4815538823604584,
0.10495100915431976,
0.3920793831348419,
0.007839678786695004,
0.179906576871871... | |
and this whole thing is happening from server to server, not from client to server?
You can pass a service key (much like Amazon WS) in the authorization header of the web request which could be encrypted with an algorithm of your choice, which is then decrypted at the service end and only continue with the execution i... | [
0.5271980166435242,
-0.1934758573770523,
0.1705891638994217,
0.17359134554862976,
0.05524174124002457,
-0.18195997178554535,
0.42652761936187744,
-0.017871998250484467,
-0.39456987380981445,
-0.30121666193008423,
-0.18956567347049713,
0.11384648084640503,
-0.2653203308582306,
0.38040864467... | |
I was recently reading [this thread](https://stackoverflow.com/questions/233030/worst-php-practice-found-in-your-experience/233746), on some of the worst PHP practices.
In the second answer there is a mini discussion on the use of `extract()`, and im just wondering what all the huff is about.
I personally use it to ch... | [
0.3183099627494812,
0.03772370144724846,
-0.09068506211042404,
0.038924653083086014,
-0.21613341569900513,
0.06340881437063217,
0.08255168050527573,
0.003272562986239791,
-0.22595609724521637,
-0.3356192409992218,
0.17148935794830322,
0.3988293409347534,
-0.0756126195192337,
0.031078865751... | |
which future maintainers (or yourself in a few weeks) have no idea where they're coming from. Consider this scenario:
```
extract($someArray); // could be $_POST or anything
/* snip a dozen or more lines */
echo $someVariable;
```
Where did `$someVariable` come from? How can anyone tell?
I don't see the problem i... | [
0.26414066553115845,
-0.10675177723169327,
0.27913951873779297,
-0.06571312993764877,
0.13246899843215942,
0.1533234417438507,
0.14836722612380981,
0.14839696884155273,
-0.0730029046535492,
-0.3535141050815582,
-0.07307412475347519,
0.5287609100341797,
0.009391501545906067,
-0.176948711276... | |
it are overblown somewhat. The function can take a second parameter that actually gives you fairly good control over the newly created variables, including not overwriting any existing variables (`EXTR_SKIP`), ONLY overwriting existing variables (so you can create a whitelist) (`EXTR_IF_EXISTS`), or adding prefixes to ... | [
0.16210317611694336,
-0.06911270320415497,
0.1603471338748932,
0.1954297423362732,
0.04660828411579132,
-0.19988417625427246,
0.18525944650173187,
-0.05893215164542198,
-0.34011340141296387,
-0.34623849391937256,
-0.21063031256198883,
0.29008251428604126,
-0.37994182109832764,
0.1362471729... | |
I'm using Hibernate JPA and Spring in my project. Suppose if I try to insert a record with duplicate key value, the insert query will throw an exception.
Now, is it possible to get the table name, field name and possible cause for the exception from the SQL Exception object at run time !?
As the other answers have me... | [
0.3045084774494171,
0.12732228636741638,
0.20523062348365784,
0.18469533324241638,
-0.16079655289649963,
-0.22859077155590057,
0.053391218185424805,
-0.13679799437522888,
-0.3272751271724701,
-0.23226292431354523,
0.037832945585250854,
0.29092973470687866,
-0.2816484868526459,
0.2348445355... | |
if you try to put too large a value in a column you can use this:
```
try {
entityManager.persist(object);
} catch (InvalidStateException e) {
log.info("Caught Hibernate exception: #0", e.getClass().getName());
InvalidValue[] invalidValues = e.getInvalidValues();
for(InvalidValue invalidValue : inv... | [
-0.15279878675937653,
-0.2612653970718384,
0.5298707485198975,
-0.0942155048251152,
0.15624238550662994,
0.10069431364536285,
0.3585098087787628,
-0.28866511583328247,
-0.4521363377571106,
-0.4722599387168884,
-0.23881961405277252,
0.4361903667449951,
-0.3994913399219513,
0.259079694747924... | |
How do we shift from protected mode to real mode in Linux 2.6?
You do not.
The kernel cannot function at all in real mode, nor can bios calls be (sensibly) made, so you wouldn't be able to do anything anyway.
You might look at how DosEMU uses v86 mode to run your "real mode" code, but that's all. | [
0.3337435722351074,
-0.23952819406986237,
0.39635729789733887,
0.08631069213151932,
-0.06743618100881577,
-0.4419991374015808,
0.302697092294693,
0.1973070502281189,
0.09917420148849487,
-0.36723899841308594,
-0.1109442487359047,
1.1636111736297607,
-0.5748167634010315,
-0.0396314784884452... | |
I have a singleton bean which needs for each call of a function to return a reference to a different (new) prototype bean. The only way that I can think of doing this is to programmatically retrieve a new prototype bean instance from the BeanFactory/ApplicatioContext by invoking its getBean() method. Code sample will f... | [
0.019000766798853874,
0.16004358232021332,
-0.13147853314876556,
-0.06486675888299942,
0.1832534223794937,
0.14696045219898224,
0.11258327960968018,
0.12521524727344513,
-0.22675342857837677,
-0.9916626214981079,
0.03726835921406746,
0.48736104369163513,
-0.47945040464401245,
0.24971008300... | |
SingletonBean {
private BeanFactory factory;
public ProtoBean dispense() {
return (ProtoBean) factory.getBean("protoBean");
}
....
}
```
take a look at [Method Injection](http://static.springframework.org/spring/docs/2.5.x/reference/beans.html#beans-factory-method-injection) | [
0.2306331843137741,
-0.22121822834014893,
-0.02487506903707981,
-0.4807657301425934,
0.47097381949424744,
0.22593413293361664,
0.4778396487236023,
0.03876900672912598,
-0.23957715928554535,
-0.5106584429740906,
-0.09985589981079102,
0.6459190249443054,
-0.7328138947486877,
0.05692714825272... | |
The Windows API function `CopyFile` has an argument `BOOL bFailIfExists` that allows you to control whether or not you want to overwrite the target file if it exists.
The `boost::filesystem` `copy_file` function has no such argument, and will fail if the target file exists. Is there an elegant way to use the boost co... | [
0.31685271859169006,
0.3377494215965271,
0.3344719111919403,
-0.05715858191251755,
-0.05718311667442322,
-0.14893677830696106,
0.3865109980106354,
-0.05867566913366318,
-0.1337769329547882,
-0.48960310220718384,
0.013082846067845821,
0.8428995013237,
-0.46016645431518555,
0.270902335643768... | |
**boost::filesystem::copy\_option::overwrite\_if\_exists**
```
copy_file(source_path, destination_path, copy_option::overwrite_if_exists);
```
<https://www.boost.org/doc/libs/1_75_0/libs/filesystem/doc/reference.html> | [
-0.039593931287527084,
0.21787402033805847,
0.41637974977493286,
-0.19918251037597656,
0.316963255405426,
-0.19412001967430115,
0.141323059797287,
-0.19519823789596558,
-0.2329428344964981,
-0.3495400547981262,
-0.4011760354042053,
0.8392171859741211,
-0.4857664108276367,
-0.13990740478038... | |
I need today's date - and zero anything else (" 05/06/08 00:00:00 ")
I've tried
```
Calendar calendar = Calendar.getInstance();
calendar.set(Calendar.HOUR, 0);
Date date1 = calendar.getTime();
System.out.println(date1);
```
Run: (This is seriously messed up)
If the hour on th... | [
0.2646322250366211,
0.250448614358902,
0.6884549260139465,
0.09486141800880432,
0.13747207820415497,
-0.04569946601986885,
0.5977427959442139,
-0.02227514423429966,
-0.15528461337089539,
-0.5890727043151855,
0.21465103328227997,
0.6328131556510925,
-0.05351398512721062,
0.1691245287656784,... | |
gave this up.
All the Date's setters are deprecated (except the epoch time) - so I don't want to use them either
The only thing I could think of is
```
Calendar calendar = Calendar.getInstance();
SimpleDateFormat dateFormat = new SimpleDateFormat("dd/MM/yyyy");
String sDate = dateFormat.format(calendar.getTime... | [
0.13787128031253815,
-0.30191415548324585,
0.47474050521850586,
0.07350168377161026,
0.1174030601978302,
0.04366292059421539,
0.2246585190296173,
-0.0506347119808197,
-0.3370347321033478,
-0.528626561164856,
-0.06572510302066803,
0.35229721665382385,
-0.15612564980983734,
0.169160947203636... | |
that's what you want to represent. (Be careful of combinations of time zone and date where there *is* no midnight though...)
What do you need to use the `Date` with? If you can get away with changing to use Joda throughout, that's great. Otherwise, you can use Joda to do what you want and then convert to milliseconds ... | [
0.33183595538139343,
-0.2658303678035736,
0.07339925318956375,
-0.1837085634469986,
-0.33657777309417725,
-0.10760059207677841,
0.2794751524925232,
0.14088715612888336,
-0.30050307512283325,
-0.7891690135002136,
-0.0022506341338157654,
0.3561066687107086,
0.025263871997594833,
-0.006837144... | |
Consider the following simple DAG:
```
1->2->3->4
```
And a table, #bar, describing this (I'm using SQL Server 2005):
```
parent_id child_id
1 2
2 3
3 4
//... other edges, not connected to the subgraph above
```
Now imagine that I have some other arbitrary criteria that select th... | [
-0.17411932349205017,
0.18219083547592163,
0.47562214732170105,
-0.24593214690685272,
-0.1441047340631485,
0.14920194447040558,
-0.03032776340842247,
-0.209816575050354,
-0.2432297319173813,
-0.714681088924408,
0.03784847632050514,
0.14235098659992218,
-0.17800600826740265,
0.2565792202949... | |
using terminology from [MSDN](http://msdn.microsoft.com/en-us/library/ms186243.aspx)):
```
with foo(parent_id,child_id) as (
// anchor member that happens to select first and last edges:
select parent_id,child_id from #bar where parent_id in (1,3)
union all
// recursive member:
select #bar.* from #bar
join foo on #bar... | [
-0.12905532121658325,
0.08263882994651794,
0.5650885105133057,
-0.010163943283259869,
0.015264908783137798,
0.4835849106311798,
0.02971627376973629,
-0.6037408113479614,
-0.19584114849567413,
-0.986321747303009,
-0.06796425580978394,
0.009385474026203156,
-0.09703768044710159,
0.3671213984... | |
recursing into subgraphs that have already been described? I could achieve this if, in my "recursive member" part of the query, I could reference *all data that has been retrieved by the recursive CTE so far* (and supply a predicate indicating in the recursive member excluding nodes already visited). However, I think I... | [
-0.3295355439186096,
-0.21743546426296234,
0.2739247977733612,
0.008826619945466518,
-0.37962105870246887,
0.11052805930376053,
0.7967994809150696,
-0.13172174990177155,
-0.25120437145233154,
-0.5709288716316223,
-0.25972312688827515,
0.4461596608161926,
-0.22310411930084229,
0.10917527973... | |
of my statement to achieve the desired results, but this seems to be applied *after* all the (repeated) recursion is done, so I don't think this is an ideal solution.
*Edit* - hainstech suggests stopping recursion by adding a predicate to exclude recursing down paths that were explicitly in the starting set, i.e. recu... | [
0.14129561185836792,
0.15709288418293,
0.1697847992181778,
-0.07267817109823227,
-0.20099425315856934,
0.121040940284729,
0.7988615036010742,
-0.2560971677303314,
-0.15882134437561035,
-0.4646146297454834,
-0.2174186110496521,
0.23556706309318542,
-0.3896189332008362,
0.2214391976594925,
... | |
the above set. Edge 4->5 will be captured twice, even with the suggested predicate. :(
The `CTE`'s are recursive.
When your `CTE`'s have multiple initial conditions, that means they also have different recursion stacks, and there is no way to use information from one stack in another stack.
In your example, the recur... | [
-0.21229684352874756,
0.012689617462456226,
0.13966137170791626,
0.1015145406126976,
-0.09309316426515579,
0.2696329951286316,
0.39412328600883484,
-0.3332841694355011,
-0.32237833738327026,
-0.788982629776001,
-0.5424375534057617,
0.4096754491329193,
-0.26561591029167175,
0.24122290313243... | |
do not intersect.
You could probably record the visited values in a temporary table, `JOIN` each value with the temptable and do not follow this value it if it's found, but `SQL Server` does not support these things.
So you just use `SELECT DISTINCT`. | [
0.03694720193743706,
0.05013455078005791,
0.22459733486175537,
0.36619269847869873,
0.10793392360210419,
-0.4235568642616272,
0.239498108625412,
0.2437400072813034,
-0.09100855141878128,
-0.4730623662471771,
-0.009221389889717102,
0.21451973915100098,
-0.5438889265060425,
0.348080426454544... | |
So I have been neglecting to do any backups of my fogbugz database, and now the fogbugz ldf file is over 2 and half gigs. Thats been built up over the six months we've been using fogbugz.
I backed up the database, then I backed up, and truncated the transaction log, yet the transaction log is still 2 and a half gigs. ... | [
0.2633243203163147,
0.16421249508857727,
0.986653745174408,
-0.05979098752140999,
-0.04252324253320694,
-0.1463947743177414,
0.3209587633609772,
0.10294808447360992,
-0.6588241457939148,
-0.28476983308792114,
0.26149335503578186,
0.3624841272830963,
-0.18226248025894165,
0.3391478657722473... | |
this point to detach the database, delete the log file and then reattach with a new one?
Welcome to the fickle world of SQL Server log management.
SOMETHING is wrong, though I don't think anyone will be able to tell you more than that without some additional information. For example, has this database ever been used f... | [
0.43951550126075745,
0.08871785551309586,
0.15778908133506775,
0.32646647095680237,
0.15757478773593903,
-0.5291194319725037,
0.3173067271709442,
0.1807812601327896,
-0.4741307199001312,
-0.40520283579826355,
0.21408477425575256,
0.5197740197181702,
-0.4018256664276123,
0.3128802180290222,... | |
backup method of your database to "Simple"
3. Open a query window and enter "checkpoint" and execute
4. Perform another backup of the database
5. Change the backup method of your database back to "Full" (or whatever it was, if it wasn't already Simple)
6. Perform a final full backup of the database.
You should now be ... | [
0.09488531947135925,
-0.26920780539512634,
0.6326925158500671,
0.14615334570407867,
0.30689767003059387,
-0.11171426624059677,
0.575481116771698,
-0.12645037472248077,
-0.45825377106666565,
-0.47436046600341797,
-0.17148245871067047,
0.9045558571815491,
-0.15485811233520508,
-0.21159093081... | |
I divided my problem into a short and a long version for the people with little time at hand.
Short version:
I need some architecture for a system with provider and consumer plugins.
Providers should implement intereface IProvider and consumers should implement IConsumer.
The executing application should only be awar... | [
0.2739052474498749,
0.0633791983127594,
0.33128413558006287,
0.003561826888471842,
0.04078010097146034,
0.513062059879303,
0.09654330462217331,
-0.2622896730899811,
-0.21990379691123962,
-0.6860546469688416,
0.127836674451828,
0.6534677743911743,
-0.43428879976272583,
0.027647823095321655,... | |
somehow doesn't know this InterfaceX type (cast fails). Solution would be to include InterfaceX into some assembly that both the plugins and the executing assembly reference but this should mean a recompile for every new provider/consumer pair and is highly undesireable.
Any suggestions?
Long version:
I'm developing... | [
0.7204127907752991,
-0.05910857394337654,
0.3436480462551117,
0.025157364085316658,
-0.1042257770895958,
0.12814341485500336,
0.306477814912796,
0.051194943487644196,
-0.04262795299291611,
-0.8993090987205505,
0.12850478291511536,
0.5427764654159546,
-0.4330287575721741,
0.1132773384451866... | |
my solution.
Project A: A Windows Service project for hosting all plugins and basic functionality. A TestGUI Windows Forms project is used for easier debugging. An instance of the ServiceProcessor class from Project B is doing the plugin related stuff. The subfolders "Consumers" and "Providers" of this project contain... | [
0.4312990605831146,
-0.03785490617156029,
0.24118857085704803,
0.13413883745670319,
-0.038725346326828,
0.37164950370788574,
0.009610394947230816,
-0.23214808106422424,
0.08816662430763245,
-0.7841510772705078,
-0.27837663888931274,
0.13092653453350067,
-0.15875683724880219,
0.077799282968... | |
interface (ITest, itself derived from IProvider) is implemented by the TestProvider.
The goal here is that a Consumer plugin can ask the ServiceProcessor which Providers (implementing at least IProvider) it has). The returned IProvider objects should be casted to the other interface it implements (ITest) in the IConsu... | [
0.22781549394130707,
-0.3878359794616699,
0.3428300619125366,
0.3055804967880249,
-0.12204080820083618,
0.19108319282531738,
-0.25812557339668274,
-0.23187178373336792,
0.06859713792800903,
-0.8189039826393127,
-0.0384240597486496,
0.7445261478424072,
-0.20507100224494934,
-0.1129056736826... | |
events TestProvider and TestConsumer are aware of. The general idea is to keep project A simple and unaware of what the plugins do with each other.
With ITest in project C there and code in the Initialize method of the TestConsumer that casts the IProvider to ITest (this whould not fail in a single class library itsel... | [
0.046384382992982864,
-0.22702541947364807,
-0.0011904580751433969,
0.21404683589935303,
-0.35775187611579895,
-0.28059983253479004,
0.17956645786762238,
0.021537110209465027,
-0.15190927684307098,
-0.5563554167747498,
-0.1265793740749359,
0.47178196907043457,
-0.18659989535808563,
-0.0287... | |
we need to recompile project A when a new interface is build.
I tried to put ITest in a single class library referenced by project C only, since only the provider and consumer need to be aware of this interface, but with no success: when loading the plugin the CLR states the referenced project could not be found. This... | [
0.06086132675409317,
-0.040392227470874786,
0.4589218497276306,
-0.07658308744430542,
-0.2611277103424072,
0.10298405587673187,
0.16756536066532135,
0.07018209993839264,
-0.22204600274562836,
-0.509037435054779,
-0.018800709396600723,
0.386101096868515,
-0.4470932185649872,
0.3946191072463... | |
both load the assemblies which itself work well: both assemblies are resident in the Assemblies collection or the current AppDomain:
Assembly found: Datamex.Projects.Polaris.Testing.Providers, Version=1.0.0.0, Culture=neutral, PublicKeyToken=2813de212e2efcd3
Assembly found: Datamex.Projects.Polaris.Testing.Consumers, V... | [
0.4457037150859833,
0.008199051953852177,
0.17341601848602295,
-0.05618820711970329,
0.022222232073545456,
0.3230981230735779,
0.25661134719848633,
-0.41055068373680115,
-0.20337525010108948,
-0.41872820258140564,
0.10236784815788269,
0.2741313576698303,
-0.4496370553970337,
0.196573182940... | |
ultimate goal:
Consumer plugins ask the ServiceProcessor which Providers it has that do implement Interface x. The providers can be casted to this interface x, without executing assembly being aware of interface x.
Somebody that can help?
Thanks in advance,
Erik
I just tried to recreate your solution as best as I can... | [
0.446785032749176,
-0.2667714059352875,
0.3496268093585968,
-0.03199343755841255,
-0.16906066238880157,
0.33329567313194275,
-0.1556151658296585,
-0.21720458567142487,
-0.015733351930975914,
-0.7844917178153992,
-0.3208910822868347,
0.6547272205352783,
-0.4375666081905365,
-0.1013747826218... | |
LoadConsumers();
}
public IProvider RequestProvider(Type providerType)
{
foreach(Type t in _providers)
{
if (t.GetInterfaces().Contains(providerType))
{
return (IProvider)Activator.CreateInstance(t);
} | [
0.09272628277540207,
-0.32329419255256653,
0.3554060161113739,
-0.011399084702134132,
-0.022361915558576584,
0.22992250323295593,
0.2646038830280304,
-0.40030303597450256,
-0.103886678814888,
-0.6585635542869568,
-0.3171026110649109,
0.44851136207580566,
-0.41202685236930847,
0.31063088774... | |
}
return null;
}
private void LoadProviders()
{
DirectoryInfo di = new DirectoryInfo(PluginSearchPath);
FileInfo[] assemblies = di.GetFiles("*.dll");
foreach (FileInfo assembly in assemblies)
{
Assembly a = Assembly.LoadFrom(assembly.FullName);
... | [
0.1837281584739685,
-0.1568937748670578,
0.3799979090690613,
-0.4133116602897644,
0.2131463885307312,
0.1861814260482788,
0.47622567415237427,
-0.30807194113731384,
-0.15119682252407074,
-0.6431003212928772,
-0.36497509479522705,
0.6290207505226135,
-0.7129037380218506,
0.3240014314651489,... | |
{
if (type.GetInterfaces().Contains(typeof(IProvider)))
{
_providers.Add(type);
}
}
} | [
0.24047617614269257,
-0.05541975796222687,
0.3063054084777832,
-0.052296869456768036,
0.2900881767272949,
0.25901639461517334,
0.2479093223810196,
-0.3998827040195465,
-0.15976272523403168,
-0.7926060557365417,
-0.18155847489833832,
0.430076003074646,
-0.544428825378418,
0.2280061095952987... | |
}
private void LoadConsumers()
{
DirectoryInfo di = new DirectoryInfo(PluginSearchPath);
FileInfo[] assemblies = di.GetFiles("*.dll");
foreach (FileInfo assembly in assemblies)
{
Assembly a = Assembly.LoadFrom(assembly.FullName);
foreach (Type type in a.G... | [
0.27975574135780334,
-0.18884964287281036,
0.2885759472846985,
-0.3755106031894684,
0.23924189805984497,
0.14432081580162048,
0.45230960845947266,
-0.34110066294670105,
-0.11300156265497208,
-0.5621643662452698,
-0.3646172881126404,
0.6153252720832825,
-0.7386679649353027,
0.34505650401115... | |
if (type.GetInterfaces().Contains(typeof(IConsumer)))
{
IConsumer consumer = (IConsumer)Activator.CreateInstance(type);
consumer.Initialize(this);
} | [
-0.09211330115795135,
-0.22092410922050476,
0.5593538880348206,
-0.22987718880176544,
0.05682855844497681,
0.453553706407547,
0.21933026611804962,
-0.5295616984367371,
-0.027358125895261765,
-0.8020848631858826,
-0.25878262519836426,
0.5131906270980835,
-0.3873691260814667,
0.1006412878632... | |
}
}
}
```
Obviously this can be tidied up enormously.
Next project is the shared library which contains the following three interfaces:
```
public interface ILoader
{
IProvider RequestProvider(Type providerType);
}
public interface IConsumer
{
void Initialize(ILoader loader);
}
public interfa... | [
-0.0794009193778038,
-0.07717154920101166,
0.33439546823501587,
0.043140556663274765,
-0.16917680203914642,
0.2934846878051758,
-0.04599037766456604,
-0.4699477553367615,
0.1230119839310646,
-1.1187663078308105,
-0.11932571977376938,
0.4493870735168457,
-0.5308186411857605,
-0.076351225376... | |
}
}
public class TestProvider : ITest
{
}
```
Both the application and the plugin projects reference the shared project and the plugin dll is copied to the search directory for the application - but they don't reference one another.
When the PluginLoader is constructed it finds all the IProviders then creat... | [
0.484746515750885,
0.09595616906881332,
0.09155558049678802,
0.09664853662252426,
-0.07603109627962112,
0.09537603706121445,
0.10190296173095703,
-0.14254987239837646,
0.2332472950220108,
-0.68319171667099,
-0.09842368960380554,
0.726517379283905,
-0.21302925050258636,
0.21740953624248505,... | |
loading of assemblies. | [
0.24208521842956543,
0.2784503996372223,
-0.2377670407295227,
-0.08962618559598923,
-0.11840908974409103,
0.4970211386680603,
-0.3538670241832733,
-0.17378859221935272,
-0.5412598848342896,
-0.5478060245513916,
-0.332731693983078,
0.4572043716907501,
-0.29198378324508667,
-0.12438016384840... | |
In SQL Server, TOP may be used to return the first n number of rows in a query. For example,
```
SELECT TOP 100 * FROM users ORDER BY id
```
might be used to return the first 100 people that registered for a site. (This is not necessarily the best way, I am just using it as an example).
My question is - What is the ... | [
-0.24430327117443085,
-0.0647483840584755,
0.4120008647441864,
0.2941177487373352,
-0.2403983622789383,
-0.10515647381544113,
-0.21783289313316345,
-0.04214520379900932,
-0.2134171575307846,
-0.3804544508457184,
-0.18274173140525818,
0.2840563654899597,
-0.22343558073043823,
-0.01678746379... | |
*
FROM Table
ORDER BY
column
LIMIT 100
```
`Oracle`:
```
SELECT *
FROM (
SELECT t.*
FROM table
ORDER BY
column
)
WHERE rownum <= 100
```
Note that you need a subquery here. If you don't add a subquery, `ROWNUM` will select first `10` rows in | [
-0.49872419238090515,
0.1284329742193222,
0.43019381165504456,
-0.1975744366645813,
0.12332843989133835,
0.32328447699546814,
-0.10455163568258286,
-0.2643049955368042,
-0.17286993563175201,
-0.5245103240013123,
-0.39762255549430847,
0.4215533137321472,
-0.296707421541214,
-0.1963779181241... | |
random order and then sort them by `column`.
To select rows between `100` and `300`:
`MySQL`:
```
SELECT *
FROM TABLE
ORDER BY
column
LIMIT 100, 200
```
`PostgreSQL`:
```
SELECT *
FROM Table
ORDER BY
column
OFFSET 100 LIMIT 200
```
`Oracle`:
```
SELECT *
FROM (
SELECT t.*... | [
-0.3323989808559418,
-0.08732739835977554,
0.2702080011367798,
-0.1473049521446228,
0.1367509961128235,
0.5153908133506775,
-0.1880774050951004,
-0.43117523193359375,
-0.028699932619929314,
-0.38636574149131775,
-0.052168719470500946,
0.3922440707683563,
-0.2847873568534851,
0.060459118336... | |
AND rownum <= 200
```
Note that an attempt to simplify it with `ROWNUM BETWEEN 100 AND 200` (as opposed to `rn BETWEEN 100 AND 200` in the outer query) will return nothing in `Oracle`!
`RN BETWEEN 100 AND 200` will work in `Oracle` too but is less efficient.
See the article in my blog for performance details:
* [*... | [
-0.22719000279903412,
0.14020708203315735,
0.11363302171230316,
-0.35729655623435974,
0.06665345281362534,
0.08457320928573608,
0.05419887229800224,
-0.6419864296913147,
0.020334839820861816,
-0.40032607316970825,
0.07787803560495377,
0.6596969962120056,
-0.1811540126800537,
0.008475705981... | |
I have a webpage that heavily uses Javascript (AJAX requests, Google Maps API, HTML building, etc) and the page brings my PC to its knees whenever opened in Internet Explorer. I'm looking for some tools to help me find out which functions are taking the most time to finish. I have some basic profiling javascript functi... | [
0.3662150502204895,
0.34133395552635193,
0.23273161053657532,
0.08923284709453583,
-0.2635337710380554,
-0.15148372948169708,
0.3390747308731079,
0.20136350393295288,
0.012657140381634235,
-0.9756428003311157,
0.24041230976581573,
0.42039209604263306,
-0.008666143752634525,
0.0740278512239... | |
know js debugging and profiling are part of it. | [
0.9163336157798767,
0.5094683170318604,
0.1526271402835846,
0.12204400449991226,
0.40695732831954956,
-0.5674773454666138,
0.30069437623023987,
0.23316670954227448,
0.3187929689884186,
-0.12244585156440735,
0.22759780287742615,
0.2845240533351898,
-0.02210470475256443,
0.09294439852237701,... | |
Sometimes I need to learn the type of an expression while programming in C or C++. Sometimes there's a good IDE or existent documentation to help me, but sometimes not. I often feel such a construct could be useful:
```
void (*myFunc)(int);
printf("%s", nameoftype(myFunc)); //"void (*)(int)"
int i, unsigned int u;
pri... | [
0.29982396960258484,
0.13400591909885406,
0.1072123721241951,
0.0716676190495491,
-0.0580446794629097,
-0.19937936961650848,
0.25124886631965637,
-0.12917852401733398,
0.028317607939243317,
-0.6944291591644287,
-0.2313302755355835,
0.6939979791641235,
-0.15405665338039398,
-0.0073375874198... | |
not have such an extension. So I guess I'm curious as to how people solve this problem. (Both compile-time and runtime solutions welcome.)
What are you looking for? Automatic type inference or looking for the type so you can declare a variable correctly manually? (your own answers look like you want to have the second ... | [
0.13093887269496918,
-0.2414797991514206,
0.3537233769893646,
-0.1452028751373291,
-0.17026633024215698,
0.056662023067474365,
0.13057667016983032,
-0.32249706983566284,
-0.06323140859603882,
-0.6147953271865845,
-0.24176369607448578,
0.7079983353614807,
-0.43512162566185,
-0.0292015988379... | |
}
<geordi> rvalue unsigned int, rvalue unsigned integer, 4294967295
<litb> geordi: << TYPE_DESC(void (*)(int (*)[10]))
<geordi> pointer to a function taking a pointer to an array of 10 integers and returning nothing
```
Automatic type inference is not currently possible without helper libraries like boost.typeof, wh... | [
0.1901874840259552,
-0.20510175824165344,
0.30169808864593506,
-0.016755348071455956,
-0.260823518037796,
0.04469528794288635,
0.2394108921289444,
-0.3888564109802246,
-0.1284509301185608,
-0.5741259455680847,
-0.08452705293893814,
0.7698318958282471,
-0.3254745304584503,
-0.06060337275266... | |
/* ... */ }
int main() { int a = -1; unsigned int b = 0; f(a + b); }
``` | [
-0.007127555552870035,
-0.008115286007523537,
0.2183380275964737,
-0.5182549953460693,
0.340562105178833,
0.005586215294897556,
0.4917623996734619,
0.000867887691128999,
-0.06892786175012589,
-0.18289700150489807,
-0.5652607083320618,
0.48074981570243835,
-0.4647843837738037,
0.31397491693... | |
Does anyone know a good algorithm for perform clustering on both discrete and continuous attributes? I am working on a problem of identifying a group of similar customers and each customer has both discrete and continuous attributes (Think type of customers, amount of revenue generated by this customer, geographic loca... | [
0.18571527302265167,
-0.04031915217638016,
0.041275136172771454,
0.5848954916000366,
0.14739814400672913,
0.0228582713752985,
-0.1434653252363205,
0.2934682071208954,
-0.36390867829322815,
-0.5914035439491272,
0.2127217948436737,
0.4817420244216919,
-0.030585825443267822,
0.112836413085460... | |
could google for clustering of categorical/discrete attributes, one of the first hits: [ROCK: A Robust Clustering Algorithm for Categorical Attributes](http://www.cis.upenn.edu/~sudipto/mypapers/categorical.pdf). | [
0.037691690027713776,
-0.3397943675518036,
0.03534213453531265,
0.762383759021759,
-0.3685533404350281,
-0.10428155213594437,
0.11390826851129532,
0.28338876366615295,
-0.11321749538183212,
-0.38839367032051086,
0.07442553341388702,
0.008227131329476833,
-0.1297566294670105,
0.009771527722... | |
I have the following telephone number 866-234-5678.
I have an asp textbox and I am applying the following mask:
```
<cc2:MaskedEditExtender ID="maskPhone"
runat="server"
ClearMaskOnLostFocus="false"
AutoComplete="false" | [
0.18320457637310028,
0.26786312460899353,
0.4373183846473694,
-0.16403834521770477,
0.2777642607688904,
-0.05022590607404709,
0.687491774559021,
-0.006628356873989105,
-0.0013468111865222454,
-0.4093158543109894,
-0.0644761323928833,
0.7463758587837219,
-0.2561649680137634,
-0.312729448080... | |
MaskType="None"
Mask="(999)-999-9999"
InputDirection="LeftToRight"
TargetControlID="txtPhone"> | [
-0.15884996950626373,
-0.32436785101890564,
0.4299195408821106,
-0.22984173893928528,
-0.22017566859722137,
0.3200150430202484,
0.2980879843235016,
0.041829708963632584,
0.09634771198034286,
-0.46968555450439453,
-0.34081020951271057,
0.5583242774009705,
-0.19865062832832336,
-0.2000455707... | |
</cc2:MaskedEditExtender>
```
When I load a page with the textbox, the telephone number displays like the following:
(662)-345-678\_
The mask states 4 digits for the last group. The underscore '\_' displayed is the PromptCharacter of the MaskedEditExtender. | [
0.05029420927166939,
0.06337527930736542,
0.5494217872619629,
-0.06277462840080261,
0.10204742848873138,
0.0644945576786995,
0.36774829030036926,
-0.0714578852057457,
0.16652899980545044,
-0.4380420744419098,
-0.08819580078125,
0.701255738735199,
-0.2687481939792633,
-0.11370402574539185,
... | |
In the name of efficiency in game programming, some programmers do not trust several C++ features. One of my friends claims to understand how game industry works, and would come up with the following remarks:
* Do not use smart pointers. Nobody in games does.
* Exceptions should not be (and is usually not) used in gam... | [
0.4048764109611511,
0.5408750772476196,
-0.037420548498630524,
0.28793251514434814,
-0.14231237769126892,
-0.3528958261013031,
0.30003347992897034,
-0.21922190487384796,
-0.18799620866775513,
-0.5519266724586487,
0.25065019726753235,
0.9055796265602112,
-0.19234147667884827,
-0.13454590737... | |
development community. Is this true?
I watched another video of a talk on multi-core programming in GDC 2009. His talk was almost exclusively oriented towards Cell Programming, where DMA transfer is needed before processing (simple pointer access won't work with the SPE of Cell). He discouraged the use of polymorphism... | [
0.3609747886657715,
0.14810647070407867,
-0.21469511091709137,
0.0052556125447154045,
-0.18371684849262238,
-0.28743231296539307,
0.29011768102645874,
-0.10380382835865021,
-0.22499153017997742,
-0.32733026146888733,
0.03464127704501152,
0.3730568289756775,
-0.12071167677640915,
0.33109226... | |
here.
I agree that C++ has also not been very nice to programmers who want a small language to hack with, and not read stacks of books. Templates have also scared the hell out of debugging. Do you agree that C++ is too much feared by the gaming community?
Look, most everything you hear *anyone* say about efficiency i... | [
0.742150604724884,
0.2519829273223877,
-0.22208881378173828,
0.30528759956359863,
-0.22870536148548126,
-0.4571937322616577,
0.39693087339401245,
0.13075017929077148,
-0.4791267216205597,
-0.31596916913986206,
0.16676798462867737,
0.6065130829811096,
0.076347716152668,
-0.02492554672062397... | |
of someone who told them long ago that X was true, without anything but intuition behind it. Now, the Cell/polymorphism issue *sounds* plausible — and I bet it did to the first guy who said it. But I haven't verified it.
You'll hear the very same things said about C++ for operating systems: that it is too slow, that i... | [
0.5641932487487793,
0.4510592222213745,
-0.33429858088493347,
0.365519255399704,
-0.12473370879888535,
0.11904211342334747,
0.14261160790920258,
0.05938909575343132,
0.0060123298317193985,
-0.04669956862926483,
-0.17463086545467377,
0.6301205158233643,
-0.230329230427742,
-0.06761780381202... | |
metal, there are some bootstrapping issues, use of placement new, that kind of thing.
C++ can be a problem just because it's too damn big: I'm rereading Stroustrup's wristbreaker right now, and it's pretty intimidating. But I don't think there's anything inherent that says you can't use C++ in an effective way in game... | [
0.24880924820899963,
0.5775642991065979,
-0.28994864225387573,
0.19403214752674103,
-0.05800353363156319,
-0.08799754083156586,
0.07187040895223618,
-0.10973956435918808,
-0.4093681275844574,
-0.37702903151512146,
0.2564493417739868,
0.6781057715415955,
0.049212925136089325,
0.005291536916... | |
I recently installed IE8, and found quirks using the old copies of IE I have for testing sites with. After reinstalling the "Multiple IEs" I use, I find that now I cannot focus on input fields, either with the keyboard or mouse.
I've found that other people have experienced this behavior, but not a solution for it. Ha... | [
0.47419607639312744,
-0.2939668595790863,
0.35732799768447876,
-0.15555359423160553,
-0.11386734247207642,
-0.11343169957399368,
0.5085655450820923,
0.08914777636528015,
-0.13157081604003906,
-0.7710568308830261,
-0.046143099665641785,
0.7428107857704163,
-0.06272799521684647,
0.3122080266... | |
it worked, which it did up to a couple weeks ago.
If by *reinstalling the "Multiple IEs" I use* you are referring to installing multiple copies of Internet Explorer on the same Windows instance, I'll point out that it is an unsupported configuration and can lead to all sorts of problems, including the one you are descr... | [
0.11263202875852585,
-0.10493255406618118,
0.45309168100357056,
0.2297491729259491,
0.012169446796178818,
-0.16924427449703217,
0.3635651171207428,
0.1160753071308136,
-0.22417166829109192,
-0.5877360701560974,
0.02342705987393856,
0.7902694344520569,
-0.279747873544693,
0.1111194640398025... | |
VPC Image](http://www.microsoft.com/downloads/details.aspx?FamilyId=21EABB90-958F-4B64-B5F1-73D0A413C8EF&displaylang=en). As of this writing, the XP images expire August 31, 2009 (the Vista images expire 120 days after first run), but Microsoft has been providing updated images whenever the previous ones expire for a c... | [
0.1402358114719391,
0.30164000391960144,
1.3867806196212769,
0.22929367423057556,
-0.024359511211514473,
-0.3213905990123749,
0.3185049593448639,
0.20720113813877106,
-0.3301931619644165,
-0.20754539966583252,
-0.21676376461982727,
0.7468681335449219,
-0.053109921514987946,
0.1918869763612... | |
Is there a statment like `Exit For`, except instead of exiting the loop it just moves to the next item.
**For example:**
```
For Each I As Item In Items
If I = x Then
' Move to next item
End If
' Do something
Next
```
I know could simply add an `Else` to the If statement so it would read as ... | [
-0.059141237288713455,
-0.4000852406024933,
0.03299563750624657,
-0.06029048189520836,
0.08859054744243622,
0.059159863740205765,
0.07945616543292999,
-0.00668113399296999,
-0.1697346419095993,
-0.49174004793167114,
-0.04597611352801323,
-0.25529012084007263,
-0.16749750077724457,
0.532132... | |
next item
Else
' Do something
End If
Next
```
Just wondering if there is a way to jump to the next item in the `Items` list. I'm sure most will properly be asking why not just use the `Else` statement, but to me wrapping the "Do Something" code seems to be less readable. Especially when there is a lo... | [
0.4723372459411621,
-0.22310443222522736,
0.24012623727321625,
0.1859915852546692,
-0.2849986255168915,
-0.01346585527062416,
0.12997688353061676,
-0.22336776554584503,
-0.4845227599143982,
-0.4912636876106262,
-0.28096798062324524,
0.16992945969104767,
-0.08965975046157837,
0.215235412120... | |
Is it possible to add the "DeleteOnNull=true" on a custom class instead of modifying the DBML (generated) class directly?
For example, let's say this is a part of my generated dbml class:
```
[Table(Name="OrderDetails")]
public partial class OrderDetail :
INotifyPropertyChanging, INotifyPropertyChanged
{
... | [
-0.1485375314950943,
-0.155739426612854,
0.5458944439888,
-0.17099405825138092,
0.050458114594221115,
0.18343384563922882,
0.37851497530937195,
-0.1463557630777359,
-0.25860652327537537,
-0.3591251075267792,
-0.437918096780777,
0.6441821455955505,
-0.4548264145851135,
0.3291633427143097,
... | |
*/ }
set { /* deleted */ }
}
}
```
So is it possible to put the "DeleteOnNull=true" on a separate class? Is it is? How? I have tried the following without any luck:
```
[MetadataType(typeof(OrderDetailMetadata))]
public partial class OrderDetail {
internal sealed class OrderDetailMetadata
{
... | [
0.15605135262012482,
-0.3734423518180847,
0.431362509727478,
-0.061464373022317886,
0.275906503200531,
-0.4650365710258484,
0.4992365539073944,
-0.07398458570241928,
-0.11595584452152252,
-0.5589241981506348,
-0.44628211855888367,
0.6906583905220032,
-0.22621355950832367,
0.449548393487930... | |
on the DBML file, and choose "Open With...". Now select XML Editor and click OK.
Find your `Order_OrderDetail` association in this file, then add `DeleteOnNull="true"` to it. Save the file and let LTS re-generate your classes for you. Done! No more having your changes to the generated code file overwritten again! | [
0.21059280633926392,
-0.10036387294530869,
0.5535707473754883,
-0.11921721696853638,
-0.05995429307222366,
-0.2312534749507904,
0.6389452219009399,
-0.20888832211494446,
0.05778161808848381,
-0.6427040696144104,
-0.49266132712364197,
0.7027521729469299,
-0.5143648982048035,
0.0025611210148... | |
I'm building a simple solid modeling application. Users need to be able to manipulate object in both orthogonal and perspective views. For example, when there's a box in the screen and the user clicks on it to select it, it needs to get 'handles' at the corners and in the center so that the user can move the mouse over... | [
0.21980233490467072,
0.13036327064037323,
0.25113508105278015,
0.1871720552444458,
0.09843762218952179,
0.14204314351081848,
-0.45550721883773804,
-0.1891329139471054,
-0.09785255044698715,
-0.7348856329917908,
0.3085207939147949,
0.4237363040447235,
-0.1967208981513977,
0.115821972489357,... | |
for a box, add small boxes to the scene at the corners of the 'main' box. Problems: this won't work in perspective view, I'd need to determine the size of the boxes relative to the current zoom level (the handles need to have the same size no matter how far the user is zoomed in/out)
2) Add the handles after the scene... | [
0.07509763538837433,
-0.18487857282161713,
0.34789928793907166,
0.31299808621406555,
-0.18219441175460815,
0.2234441339969635,
0.0642094537615776,
-0.6593420505523682,
0.045916151255369186,
-0.6863003373146057,
0.12418810278177261,
0.6579320430755615,
-0.0786483883857727,
-0.27731698751449... | |
approach, as well; how do I draw in 2d on a 3d rendered image? Fall back to GDI?
There are probably more problems with both approaches. Is there an industry-standard way of tackling this problem?
I'm using OpenGL, if that makes a difference.
I would treat the handles as 3D objects. This provides many advantages - it'... | [
0.24099200963974,
-0.03868597745895386,
0.4526318609714508,
0.20022372901439667,
-0.39354613423347473,
0.10127796232700348,
-0.17031042277812958,
-0.20753249526023865,
-0.18641987442970276,
-0.9309759140014648,
0.255742609500885,
0.8189570307731628,
0.11730014532804489,
-0.2311369478702545... | |
bit of a hassle, but since there are typically only a few handles, and these are usually small objects, it should be fine performance wise.
However, I'd actually say let the handles scale with the scene. As long as you pick a rendering style for the handle that makes them stand out (ie: bright orange boxes, etc), the ... | [
0.1912824809551239,
-0.21578286588191986,
0.21861052513122559,
0.28168120980262756,
-0.31760701537132263,
0.05544689670205116,
-0.017021983861923218,
-0.031388744711875916,
-0.3404574692249298,
-0.5180068612098694,
0.20789361000061035,
0.28573450446128845,
0.13184687495231628,
-0.213016033... | |
clues as to how "deep" the handle is into the screen. | [
0.07064280658960342,
0.10867252200841904,
0.4231327474117279,
0.19269557297229767,
0.27671656012535095,
0.06831418722867966,
0.017002318054437637,
-0.04721789434552193,
-0.2825251817703247,
-0.5751024484634399,
0.14859271049499512,
0.03398348018527031,
0.6114018559455872,
0.037731476128101... | |
I have a table that contains, among other things, about 30 columns of boolean flags that denote particular attributes. I'd like to return them, sorted by frequency, as a recordset along with their column names, like so:
```
Attribute Count
attrib9 43
attrib13 27
attrib19 21
etc.
```
My efforts thus ... | [
-0.077360600233078,
0.283063679933548,
0.36519256234169006,
0.026269858703017235,
-0.2308296114206314,
0.16607791185379028,
0.19007818400859833,
-0.6881746053695679,
-0.07249262928962708,
-0.6402324438095093,
0.3105761408805847,
0.2965261936187744,
-0.13110964000225067,
0.1604241132736206,... | |
the number of attributes without manual intervention.
The first six characters of the attribute columns are the same (attrib) and unique in the table, is it possible to use wildcards in column names to pick up all the applicable columns?
Also, can I pivot the results to give me a sorted two-column recordset?
I'm usi... | [
-0.015605687163770199,
0.2651282846927643,
0.6265055537223816,
0.11531573534011841,
-0.15431052446365356,
0.20775920152664185,
0.026920266449451447,
-0.2642015516757965,
-0.46206119656562805,
-0.5041676759719849,
0.09317279607057571,
0.4835182726383209,
-0.1155596524477005,
-0.087322339415... | |
work to do--and I'm afriad you can't do it with simple SQL.
No, you can't use wildcards to column names in SQL. You'll need procedural code to do this (i.e., a VB Module in Access--you could do it within a Stored Procedure if you were on SQL Server). Use this code build the SQL code.
It won't be pretty. I *think* you... | [
0.6969906687736511,
0.18540368974208832,
0.2243475764989853,
-0.007103577256202698,
0.12355776876211166,
0.01940593495965004,
0.14335951209068298,
-0.44652801752090454,
-0.23040054738521576,
-0.4596375524997711,
0.20692551136016846,
0.6830652356147766,
-0.24486389756202698,
-0.106625996530... | |
append all those selects together with "Union" between them before running the batch.
My Access VB is more than a bit rusty, so I don't trust myself to give you anything like executable code.... | [
0.7351424694061279,
0.16625353693962097,
0.19242316484451294,
0.197731152176857,
0.13533392548561096,
0.22270768880844116,
-0.02636803686618805,
0.026444431394338608,
0.03256527706980705,
-0.3629080355167389,
0.23760472238063812,
0.2580453157424927,
-0.06878071278333664,
0.5015028715133667... | |
Basically I have a TcxGrid which will be listing various files names and I'd like to give further details based on the file extension, specifically it's description (e.g. for .PDF it's "Adobe Acrobat Document") and it's related icon.
I notice there is a [very similar question already](https://stackoverflow.com/questio... | [
0.3871150314807892,
-0.03695593774318695,
0.15278127789497375,
0.4844445288181305,
-0.06226344034075737,
-0.2921783924102783,
-0.16131363809108734,
0.10392070561647415,
-0.5079746246337891,
-0.371764212846756,
-0.24197523295879364,
0.5869341492652893,
0.04472758620977402,
-0.04839463531970... | |
of ShGetFileInfo. I then Googled on that and found these two examples - [Delphi 3000](http://www.delphi3000.com/articles/article_1086.asp?SK=), [Torry's](http://www.swissdelphicenter.ch/torry/showcode.php?id=421). From that I wrote the following class to do what I needed.
Also, just as I was finishing up Bill Miller's... | [
0.14149536192417145,
0.1129910796880722,
0.09704569727182388,
-0.1815667450428009,
-0.07052092254161835,
0.056742578744888306,
0.1724519431591034,
0.08135666698217392,
-0.1178920716047287,
-0.4721134305000305,
-0.14182180166244507,
0.22967499494552612,
-0.4245351552963257,
-0.0529342293739... | |
I've switched it to using a TcxImageList instead of a TImageList, since I was having problems with black borders appearing on the icons, because it was a quick fix.
```
unit FileAssociationDetails;
{
Created : 2009-05-07
Description : Class to get file type description and icons.
* Exten... | [
0.16083237528800964,
-0.06316748261451721,
0.7160695195198059,
-0.010825909674167633,
0.42668822407722473,
0.14246231317520142,
-0.04553466662764549,
-0.20798100531101227,
-0.5305023193359375,
-0.7075765132904053,
-0.24896693229675293,
0.5285623669624329,
-0.14883403480052948,
0.3269742727... | |
in a TImageList.
Assumption is all lists are in same order.
}
interface
uses Classes, Controls;
type
TFileAssociationDetails = class(TObject)
private
FImages : TImageList;
FExtensions : TStringList;
FDescriptions : TStringList;
public
constructor Create;
destructor Destro... | [
-0.06330592185258865,
-0.4286576807498932,
0.5096983909606934,
0.024945370852947235,
0.11380473524332047,
0.2827015519142151,
0.11747901886701584,
-0.5272151827812195,
-0.2178502082824707,
-0.4270656108856201,
-0.5779899954795837,
0.539182722568512,
-0.772787868976593,
-0.02084147743880748... | |
property Images : TImageList read FImages;
property Extensions : TStringList read FExtensions;
property Descriptions : TStringList read FDescriptions;
end;
implementation
uses SysUtils, ShellAPI, Graphics, Windows;
{ TFileAssociationDetails }
constructor TFileAssociationDetails.Create;
begin
try
inh... | [
0.14059986174106598,
-0.15185941755771637,
0.5596675276756287,
-0.11636558920145035,
0.3387758731842041,
0.2648906409740448,
0.2011476308107376,
-0.8071833848953247,
-0.3809360861778259,
-0.5399753451347351,
-0.6508610844612122,
0.6866491436958313,
-0.2906133234500885,
0.45026952028274536,... | |
Extension := UpperCase(Extension);
if (Trim(Extension) <> '') and
(FExtensions.IndexOf(Extension) = -1) then
FExtensions.Add(Extension);
end;
procedure TFileAssociationDetails.Clear;
begin
FExtensions.Clear;
end;
procedure TFileAssociationDetails.GetFileIconsAndDescriptions;
var
Icon: TIcon;
iCount :... | [
-0.005580408964306116,
-0.31844109296798706,
0.9019399285316467,
-0.24908043444156647,
0.5202877521514893,
0.46206924319267273,
0.017147110775113106,
-0.5622977614402771,
-0.09068654477596283,
-0.765020489692688,
-0.6079575419425964,
0.5970864295959473,
-0.44317176938056946,
0.122355356812... | |
SHGetFileInfo(PChar(Extension),
FILE_ATTRIBUTE_NORMAL,
FileInfo,
SizeOf(FileInfo),
SHGFI_TYPENAME or SHGFI_USEFILEATTRIBUTES | [
0.2611600160598755,
-0.20434525609016418,
0.6855848431587219,
-0.08239179849624634,
0.19836750626564026,
-0.01587981916964054,
-0.1390838623046875,
-0.06739825755357742,
-0.22890745103359222,
-0.5192716121673584,
-0.31767651438713074,
0.2669874429702759,
-0.618451714515686,
-0.056586202234... | |
);
FDescriptions.Add(FileInfo.szTypeName);
// Get icon and copy into ImageList
SHGetFileInfo(PChar(Extension),
FILE_ATTRIBUTE_NORMAL,
FileInfo,
SizeOf(FileInfo), | [
0.3861915171146393,
-0.15312908589839935,
0.892067015171051,
-0.17790642380714417,
0.26863810420036316,
-0.017933551222085953,
-0.1593475639820099,
-0.20470701158046722,
-0.2551616132259369,
-0.7151315212249756,
-0.340549111366272,
0.5765377283096313,
-0.5744906663894653,
-0.01173595432192... | |
SHGFI_ICON or SHGFI_SMALLICON or
SHGFI_SYSICONINDEX or SHGFI_USEFILEATTRIBUTES
);
Icon.Handle := FileInfo.hIcon;
FImages.AddIcon(Icon);
end;
finally
Icon.Free;
end;
end;
end.
```
Also here is an example test app using it, it's very simple, just a form w... | [
0.1605052798986435,
-0.5021070241928101,
0.7512134909629822,
-0.006794770248234272,
-0.024819286540150642,
-0.24428673088550568,
0.3320860266685486,
-0.20524516701698303,
-0.16644860804080963,
-0.47520604729652405,
-0.2045275717973709,
0.37522000074386597,
-0.5362810492515564,
-0.189182296... | |
it. My actual use was not for this, but for with a Developer Express TcxImageComboxBox in a TcxGrid.
```
unit Main;
{
Created : 2009-05-07
Description : Test app for TFileAssociationDetails.
}
interface
uses
Windows, Forms, FileAssociationDetails, Classes, Controls, ComCtrls;
type
TfmTest = class(T... | [
-0.024385297670960426,
-0.36484983563423157,
0.7760561108589172,
-0.0012477160198614001,
0.0992521345615387,
-0.018192576244473457,
0.35453957319259644,
-0.21039113402366638,
0.059009648859500885,
-0.5811290144920349,
-0.29729601740837097,
0.5966547727584839,
-0.3395659029483795,
0.1333526... | |
TObject);
var
iCount : integer;
NewTab : TTabSheet;
begin
FFileDetails := TFileAssociationDetails.Create;
FFileDetails.AddFile('C:\Documents and Settings\...\Test.XLS');
FFileDetails.AddExtension('.zip');
FFileDetails.AddExtension('.pdf');
FFileDetails.AddExtension('.pas');
FFileDetails.AddExtension('.X... | [
-0.14401523768901825,
0.07339652627706528,
0.828963041305542,
0.1251368522644043,
-0.005449986085295677,
0.18829721212387085,
0.5793027877807617,
-0.4785612225532532,
0.06908237934112549,
-0.4323364794254303,
-0.9521510004997253,
0.6404963135719299,
-0.2308240681886673,
-0.2148314714431762... | |
I was exploring [another question](https://stackoverflow.com/questions/829514/prevent-recursive-cte-visiting-nodes-multiple-times), when I hit this behaviour in Sql Server 2005. This query would exhaust the maximum recursion:
```
with foo(parent_id,child_id) as (
select parent_id,child_id
from #bar where paren... | [
-0.20948968827724457,
0.13323897123336792,
0.3734687566757202,
-0.49355000257492065,
-0.09370217472314835,
0.13376739621162415,
0.23544010519981384,
-0.2903895378112793,
-0.2665417492389679,
-0.35422325134277344,
0.00972608383744955,
0.3073851466178894,
-0.32193949818611145,
0.406936466693... | |
#bar.child_id -- Line that changed
from #bar
join foo on #bar.parent_id = foo.child_id
)
select * from foo
```
Is this a bug in Sql Server, or am I overlooking something?
Here's the table definition:
```
if object_id('tempdb..#bar') is not null
drop table #bar
create table #bar (
child_id int,
... | [
0.15616358816623688,
0.4180462658405304,
0.5847958326339722,
-0.10859477519989014,
0.3332091271877289,
0.43492013216018677,
-0.06504645943641663,
-0.3481663763523102,
0.021618057042360306,
-0.6357802152633667,
0.009360047988593578,
0.16486501693725586,
-0.2574610114097595,
0.43502524495124... | |
\* in the first place.
You defined your table with childId first then parentId, but the CTE Foo expects parentId then childId,
So essentially when you say select #bar.\* your saying select childId, parentId but your putting that into parentId, child. This results in a n-level recursive expression as you go to join ba... | [
0.0789097473025322,
0.14975349605083466,
0.17150433361530304,
-0.40653035044670105,
0.20605382323265076,
0.26021113991737366,
-0.050226181745529175,
-0.08518490940332413,
-0.08097301423549652,
-0.668470561504364,
-0.027902083471417427,
0.4685477316379547,
-0.3507656455039978,
0.09678377956... | |
What text to HTML converter for PHP would you recommend?
One of the examples would be Markdown, which is used here at SO. User just types some text into the text-box with some natural formatting: enters at the end of line, empty line at the end of paragraph, asterisk delimited bold text, etc. And this syntax is conver... | [
0.16936445236206055,
-0.10512125492095947,
0.484340101480484,
0.08336227387189865,
-0.4949519634246826,
-0.3116256892681122,
0.19664493203163147,
-0.10870987176895142,
-0.014657675288617611,
-0.6531310081481934,
0.0489666610956192,
0.6906607747077942,
-0.31102830171585083,
-0.1864879131317... | |
if there is WYSIWYG editor for it. Half-wysiwig just like here at SO would be even better.
Extra points would be if it would fit with Zend Framework well.
I will stick with my original idea of adopting Texy.
None of the products mentioned here actually beats it. I had problem with Texys syntax but it seems to be quit... | [
0.4083916246891022,
-0.05886351317167282,
0.27243757247924805,
0.025359950959682465,
-0.2923036217689514,
-0.04648236930370331,
0.16018614172935486,
0.14662477374076843,
0.356205016374588,
-0.7729678153991699,
-0.07058641314506531,
0.4617900252342224,
-0.1300276517868042,
0.000423121178755... | |
I am using MySQL and I have a table with an index that is used as a foreign key in many other tables. I want to change the data type of the index (from signed to unsigned integer) , what is the best way to do this?
I tried altering the data type on the index field, but that fails because it is being used as a foreign ... | [
0.18897408246994019,
0.27963560819625854,
0.28031647205352783,
0.07550884038209915,
0.12746308743953705,
0.03163843974471092,
0.07504311203956604,
0.11821512132883072,
-0.22094570100307465,
-0.6386014819145203,
0.2887290120124817,
0.28461533784866333,
-0.34601423144340515,
0.32955300807952... | |
could manually drop all of the foreign key constraints, change the data types and add the constraints back, but this would be a lot of work because I have a lot of tables using this index as a foreign key. Is there a way to turn off foreign key constraints temporarily while making a change? Also, is there a way to get ... | [
0.17721471190452576,
-0.026596933603286743,
0.28137385845184326,
0.2424265444278717,
0.31008103489875793,
0.06556739658117294,
0.1211574375629425,
-0.1037309318780899,
-0.4408126175403595,
-0.6620734333992004,
0.09971564263105392,
0.6451714634895325,
-0.25191929936408997,
0.237393856048583... | |
TABLE `escolaterrafir`.`t23_aluno` MODIFY COLUMN `a21_saida_id` INTEGER DEFAULT NULL;
```
Here's the error:
```
------------------------
LATEST FOREIGN KEY ERROR
------------------------
090506 11:57:34 Error in foreign key constraint of table escolaterrafir/t23_aluno:
there is no index in the table which would cont... | [
-0.5530164241790771,
0.3822191655635834,
0.7847204804420471,
0.18860268592834473,
0.2929484248161316,
0.2691924273967743,
-0.09331215918064117,
-0.11664153635501862,
-0.2805423140525818,
-0.3196823298931122,
-0.30064857006073,
0.6227281093597412,
-0.27855929732322693,
-0.08319052308797836,... | |
table that has the foreign key that points to it:
```
DROP TABLE IF EXISTS `escolaterrafir`.`t23_aluno`;
CREATE TABLE `escolaterrafir`.`t23_aluno` (
...
`a21_saida_id` int(10) unsigned default NULL,
...
KEY `Index_7` (`a23_id_pedagogica`),
...
CONSTRAINT `FK_t23_aluno_8` FOREIGN KEY (`a21_saida_id`) REFER... | [
-0.3767073452472687,
0.25705745816230774,
0.3468059003353119,
-0.075857974588871,
0.12614919245243073,
0.21382978558540344,
-0.046816788613796234,
-0.34420567750930786,
-0.38188403844833374,
-0.35760581493377686,
-0.2784731984138489,
0.3621707260608673,
-0.41458216309547424,
-0.08054114133... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.