text stringlengths 0 30.5k | title stringclasses 1
value | embeddings listlengths 768 768 |
|---|---|---|
validate();
// grow process
}
}
```
Following the Checkstyle rule the Plant.validate() method is not designed for extension. But how do I design for extension in this case?
The rule is complaining because it is possible for a deriving (extending) class to completely replace the functionality you provided ... | [
0.40730077028274536,
-0.11225109547376633,
0.3334532380104065,
-0.31982558965682983,
0.33436399698257446,
-0.33196502923965454,
-0.02753247693181038,
-0.3947370946407318,
-0.0518580861389637,
-0.38034847378730774,
0.022718586027622223,
0.5292969346046448,
-0.46790024638175964,
0.3008115887... | |
String roots;
private String trunk;
// setters go here
private void validate() {
if (roots == null) throw new IllegalArgumentException("No roots!");
if (trunk == null) throw new IllegalArgumentException("No trunk!");
validateEx();
}
protected void validateEx() { }
pub... | [
0.3136886954307556,
-0.026768023148179054,
0.3307286202907562,
-0.028458913788199425,
0.2868770658969879,
-0.08679182082414627,
0.5469891428947449,
-0.3468431532382965,
-0.38355329632759094,
0.11497949808835983,
-0.2783795893192291,
0.5095970630645752,
-0.27284032106399536,
0.2348855882883... | |
meant to use the `validate` method you could also make it public final instead. | [
0.4216328263282776,
0.004686965607106686,
0.10963412374258041,
0.09170879423618317,
-0.23364631831645966,
-0.5500395894050598,
0.33178994059562683,
-0.18422575294971466,
0.08379245549440384,
-0.2617470324039459,
-0.052670449018478394,
0.381333589553833,
0.30094465613365173,
0.0619267560541... | |
Lets say I have a selectbox wit 10 predefined amounts and an option "other". If I select "other" i get an input box to give the amount. When I leave that field i wnat the value of the selecbox to be the amount typed in the input box. How would I do that with jquery?
Add the following to your code just after the line wh... | [
0.17333242297172546,
-0.14318886399269104,
0.4793531596660614,
-0.11079249531030655,
0.4171468913555145,
0.3402056396007538,
-0.2751178741455078,
-0.43085601925849915,
-0.27635201811790466,
-0.9241604208946228,
0.08799933642148972,
0.6049816012382507,
0.14067956805229187,
0.085957981646060... | |
Environment.MachineName + @"\" + username;
newpool.Properties["WAMUserPass"].Value = password;
```
You'll obviously need to add the string variables `username` and `password` to your `CreateAppPool()` method parameters as well.
Another thing you need to do, if you weren't already aware, is make sure your application... | [
0.10836489498615265,
0.12904761731624603,
0.6378488540649414,
-0.12273682653903961,
0.12452919036149979,
-0.20398303866386414,
0.03076709806919098,
-0.17597630620002747,
-0.1828579157590866,
-1.0566959381103516,
0.02379285730421543,
0.7373883128166199,
-0.37230363488197327,
0.1941412538290... | |
```
function Foo(f) {
var f = f;
}
```
Here inside the function, variable `f` is local to the `Foo` (it has a function scope), but why is the variable `f` in the argument list not in conflict? Maybe because it is bound inside the `Foo.arguments` object?
In other languages we cannot declare an argument variabl... | [
-0.22208724915981293,
0.20214657485485077,
0.2304837703704834,
-0.23224787414073944,
-0.17621667683124542,
-0.18481840193271637,
0.21742787957191467,
-0.13998277485370636,
-0.039495959877967834,
-0.4482920169830322,
-0.1972464621067047,
0.7387194037437439,
-0.5094196796417236,
-0.053649492... | |
interested in is called "hoisting" - JS moves var declarations to the top of a function, where they serve the sole purpose of reserving this variable name as a local variable in the function's scope. Sometimes, this leads to [lots of weirdness](http://calculist.blogspot.com/2005/12/dynamic-scope.html). If the variable ... | [
0.17612342536449432,
-0.03204519301652908,
0.20924507081508636,
-0.10212021321058273,
-0.19691820442676544,
-0.13633941113948822,
-0.13354507088661194,
0.15681181848049164,
-0.1754191517829895,
-0.16219422221183777,
-0.2878000736236572,
0.5952931046485901,
-0.4443029463291168,
-0.065831266... | |
is that arguments also declare that variable name as local to the function.
The result of all this is that when you have a `var f` as well as an argument name `f`, the `var f' gets dropped, and your example is equivalent to:
```
function Foo(f) {
f = f;
}
```
You can see this in Hippo's example, because:
```
fu... | [
-0.21281272172927856,
0.1161598190665245,
0.2096276581287384,
-0.14514130353927612,
0.0908041000366211,
0.25933679938316345,
0.04946039244532585,
-0.04466063901782036,
-0.11521359533071518,
-0.586702287197113,
-0.26363277435302734,
0.7721235752105713,
-0.31112220883369446,
0.08658798784017... | |
var f;
console.log(f); // --> 11
console.log(arguments); // --> array [11]
f = 10;
console.log(f); // --> 10
console.log(arguments); // --> [10] (!!!)
}
```
Is equivalent to:
```
function foo(f) {
console.log(f); // --> 11
console.log(arguments); // --> array [11]
f = 10;
console.... | [
-0.291109174489975,
0.041691750288009644,
0.5311965346336365,
-0.3844117820262909,
-0.004723412916064262,
0.35454466938972473,
0.04129485413432121,
-0.37901437282562256,
-0.2370661348104477,
-0.3470546007156372,
-0.5021603107452393,
0.5996594429016113,
-0.426149845123291,
-0.08248461037874... | |
Following the directions from [Spring Source](http://static.springframework.org/spring/docs/2.5.x/reference/mvc.html#mvc-coc) and the book Spring in Action, I am trying to set up Spring MVC in a way that minimizes xml configuration. However according to Spring Source this is how you set up the ControllerClassNameHandle... | [
0.0973815768957138,
-0.03416792303323746,
0.4331508278846741,
-0.15442945063114166,
-0.19371110200881958,
-0.1572958379983902,
-0.07369628548622131,
-0.4160456657409668,
-0.4128756821155548,
-0.23736964166164398,
-0.06410709768533707,
0.36621448397636414,
-0.2841443419456482,
-0.1147907450... | |
code block to use the ControllerClassNameHandlerMapping, which would make it far more useful. However, I have not yet been able to get this to work.
Can anyone with Spring experience help me out?
There are actually two different things going on here:
1. the mapping between URLs and controllers
2. the definition of c... | [
0.2386350929737091,
-0.1840270608663559,
0.05842300131917,
0.015912774950265884,
-0.17337091267108917,
-0.2870631814002991,
-0.12094216048717499,
-0.06865381449460983,
-0.43336793780326843,
-0.5426254272460938,
0.22402386367321014,
0.27319765090942383,
-0.08915029466152191,
0.1270031630992... | |
auto-wiring, which eliminates the need for XML bean definitions. Or not, the choice is up to you.
What you avoid by using ControllerClassNameHandlerMapping is having to explictly map all your potential URLs to Controllers. We have used this successfully.
One other thing you might want to use is the DefaultRequestToVi... | [
0.10722854733467102,
-0.1325000375509262,
0.48193368315696716,
0.1274844855070114,
0.055381618440151215,
-0.25302910804748535,
0.018095847219228745,
-0.45746827125549316,
-0.19507303833961487,
-0.8523935675621033,
0.0020550217013806105,
0.6236566305160522,
-0.17776617407798767,
0.050100009... | |
Is it possible to bind a foreign key relationship on my model to a form input?
Say I have a one-to-many relationship between `Car` and `Manufacturer`. I want to have a form for updating `Car` that includes a select input for setting `Manufacturer`. I was hoping to be able to do this using the built-in model binding, b... | [
0.39843878149986267,
0.22622501850128174,
0.3687473237514496,
0.09815524518489838,
0.1894095540046692,
0.4033540189266205,
-0.32671481370925903,
-0.20438581705093384,
-0.05419057980179787,
-0.3955834209918976,
0.045860543847084045,
0.5948505401611328,
0.016290739178657532,
0.27056688070297... | |
get set properly, but not Manufacturer, which makes sense since the model binder has no idea what the PK field is. Does that mean I would have to write a custom `IModelBinder` that it aware of this? I'm not sure how that would work since my data access repositories are loaded through an IoC container on each `Controlle... | [
0.5847207903862,
-0.2602623403072357,
0.11359992623329163,
0.40372124314308167,
0.14570078253746033,
-0.3194541931152344,
-0.10221690684556961,
-0.3497604727745056,
-0.2081933617591858,
-0.5507997870445251,
-0.06372837722301483,
0.5040544867515564,
-0.11681336164474487,
0.22368453443050385... | |
IRepository from Ninject, it uses that to retrieve the foreign key object.
```
public class ForeignKeyModelBinder : System.Web.Mvc.DefaultModelBinder
{
private IKernel serviceLocator;
public ForeignKeyModelBinder( IKernel serviceLocator )
{
Check.Require( serviceLocator, "IKernel is required" );
... | [
-0.3805794417858124,
0.05771031230688095,
0.5295513272285461,
-0.3406102955341339,
0.10373014956712723,
0.0967024713754654,
0.29757240414619446,
-0.22847144305706024,
-0.033303018659353256,
-0.561210572719574,
-0.3989568054676056,
0.72584468126297,
-0.28761592507362366,
0.26992738246917725... | |
default behavior.
/// </summary>
protected override object GetPropertyValue( ControllerContext controllerContext, ModelBindingContext bindingContext,
PropertyDescriptor propertyDescriptor, IModelBinder propertyBinder )
{
var submittedValue = bindingContext.ValueProvider.GetValue( bindingCont... | [
-0.42849767208099365,
-0.4869433045387268,
0.7170853018760681,
0.06959550827741623,
0.10264942795038223,
-0.15371987223625183,
0.5325685739517212,
-0.4714234471321106,
-0.13089177012443542,
-0.5829659104347229,
-0.528589129447937,
0.6905168890953064,
-0.391353040933609,
0.45293572545051575... | |
fullPropertyKey );
}
if ( submittedValue != null )
{
var value = TryGetFromRepository( submittedValue.AttemptedValue, propertyDescriptor.PropertyType );
if ( value != null )
return value;
}
return base.GetPropertyValue( | [
-0.1670694202184677,
-0.24138639867305756,
0.75765061378479,
-0.20550766587257385,
0.08602324873209,
0.145872101187706,
0.8219630718231201,
-0.4109572172164917,
0.19803278148174286,
-0.38017842173576355,
-0.7205440402030945,
0.4879644215106964,
-0.184025377035141,
0.30977338552474976,
0.... | |
controllerContext, bindingContext, propertyDescriptor, propertyBinder );
}
protected override object CreateModel( ControllerContext controllerContext, ModelBindingContext bindingContext, Type modelType )
{
string fullPropertyKey = CreateSubPropertyName( bindingContext.ModelName, "Id" );
var... | [
-0.30455973744392395,
-0.4663163423538208,
0.7947365641593933,
0.15966814756393433,
0.07130640745162964,
-0.21912604570388794,
0.43499255180358887,
-0.5067402124404907,
0.16343139111995697,
-0.4137301445007324,
-0.6220017075538635,
0.590765655040741,
-0.38671553134918213,
0.474981248378753... | |
if ( value != null )
return value;
}
return base.CreateModel( controllerContext, bindingContext, modelType );
}
private object TryGetFromRepository( string key, Type propertyType )
{
if ( CheckRepository( propertyType ) && !string.IsNullOrEmpty( key ) )
{ | [
-0.23558342456817627,
-0.37125876545906067,
0.5059697031974792,
0.0062696910463273525,
0.2755962610244751,
-0.1054505854845047,
0.26980262994766235,
-0.3113061189651489,
0.06549470126628876,
-0.3120172321796417,
-0.3081481456756592,
0.555125892162323,
-0.34331730008125305,
0.25051286816596... | |
Type genericRepositoryType = typeof( IRepository<> );
Type specificRepositoryType = genericRepositoryType.MakeGenericType( propertyType );
var repository = serviceLocator.TryGet( specificRepositoryType );
int id = 0;
#if DEBUG
Check.Require( repository, "{0} is not avail... | [
-0.01745988428592682,
-0.13770237565040588,
0.4600823223590851,
0.06688455492258072,
-0.19216035306453705,
-0.05424594506621361,
0.5125234127044678,
-0.48777997493743896,
0.0939258337020874,
-0.34887707233428955,
-0.22622579336166382,
0.2269025593996048,
-0.4568031430244446,
0.552356958389... | |
Int32.TryParse( key, out id ) )
{
return repository.InvokeMethod( "GetById", id );
}
}
return null;
}
/// <summary>
/// perform simple check to see if we should even bother looking for a repository
/// </summary> | [
0.01876419596374035,
-0.06038250774145126,
-0.08276406675577164,
0.05631932616233826,
0.36322981119155884,
-0.08918463438749313,
0.5505214929580688,
-0.2732146382331848,
0.1888464391231537,
-0.4915851056575775,
-0.22174204885959625,
0.3415679633617401,
-0.39785805344581604,
0.2519459426403... | |
private bool CheckRepository( Type propertyType )
{
return propertyType.HasInterface<IModelObject>();
}
}
```
you could obviously substitute Ninject for your DI container and your own repository type. | [
0.15617378056049347,
-0.1775214523077011,
-0.11951279640197754,
0.002413306850939989,
-0.04689716920256615,
-0.3223302364349365,
0.19760268926620483,
-0.047312188893556595,
0.1442296952009201,
-0.6380040049552917,
-0.16006746888160706,
0.4809677004814148,
-0.3512170910835266,
0.48497700691... | |
My company is building a medical application. We would like to utilize Silverlight 2.0/3.0. Because of HIPAA laws, security is at the top of the list and can't make mistakes here.
What makes or doesn't make a WCF call secure in the context of using Silverlight?
Since Silverlight only works with the HTTP(S) bindings o... | [
0.8438498377799988,
0.4647408127784729,
0.3388591706752777,
0.006727661471813917,
0.2275121808052063,
-0.4046591520309448,
0.2790604531764984,
-0.3832104802131653,
0.1083453893661499,
-0.4180229604244232,
0.40102845430374146,
0.5274685025215149,
-0.25674620270729065,
0.01972287707030773,
... | |
```
InetAddress serverAddr = InetAddress.getByName(serverAddress);
String hostname = serverAddr.getCanonicalHostName();
Socket socket = new Socket(serverAddr, portNumber);
// Freezes before this line if the server is unavailable
socket.setSoTimeout(3000);
```
Does anyone know how to implement the check of server avai... | [
-0.09128906577825546,
0.07423777133226395,
0.5166124105453491,
-0.18544255197048187,
-0.018482297658920288,
-0.1591326892375946,
0.5444472432136536,
-0.16614413261413574,
-0.43768176436424255,
-1.0348857641220093,
-0.3265502452850342,
0.2944488227367401,
-0.25047188997268677,
0.40946379303... | |
Does the .net framework have any builtin assemblies for handling reading and writing from and to text delimited files? Or is this something I have create myself?
[FileHelpers](http://filehelpers.sourceforge.net/) is the one that is supposedly good at it. | [
0.30724743008613586,
-0.0858563780784607,
-0.02652793750166893,
0.1530546396970749,
-0.14413860440254211,
-0.42482298612594604,
0.15708649158477783,
0.15729600191116333,
-0.30562788248062134,
-0.5965191125869751,
0.061285439878702164,
0.5051912069320679,
-0.11065106838941574,
-0.2205489128... | |
I'm writing some optimized C code that basically runs through an array and does something to each element. What it does depends on the current value of the element so something like:
```
for (i=0; i < a_len; i++) {
if (a[i] == 0) {
a[i] = f1(a[i]);
} else if (a[i] % 2 == 0) {
a[i] = f2(a[i]);
... | [
0.10366653650999069,
0.17464293539524078,
0.2070315033197403,
-0.5668908357620239,
-0.06533483415842056,
0.19963274896144867,
0.5390765070915222,
-0.17333054542541504,
-0.1068287193775177,
-0.5741151571273804,
-0.1617710292339325,
0.5780409574508667,
-0.21869318187236786,
0.041830897331237... | |
working in dynamic languages, where my practice has been to try to write straightforward code and not create lots of local variables for things that I can just refer to directly, like a[i] above. *I am very much aware that best practices are to write readable code and trust that the compiler is smarter than you and wil... | [
-0.05168171599507332,
0.014444617554545403,
-0.2345489114522934,
0.02804466150701046,
-0.0999394878745079,
0.00542935635894537,
0.3891124129295349,
-0.023094728589057922,
-0.4751507639884949,
-0.6699911952018738,
-0.14160354435443878,
0.7162445783615112,
-0.21865034103393555,
-0.5064555406... | |
a smart compiler might do a load every time because it can't be sure that the memory hasn't changed. (Or do I have to explicitly declare "a" volatile for the compiler to not make this optimization?).
So, my question is: should I expect better performance by rewriting with a local variable like so:
```
for (i=0; i < a... | [
-0.15721265971660614,
-0.2728719115257263,
-0.06334803253412247,
-0.04211840778589249,
0.13627874851226807,
0.001493020448833704,
0.3739345669746399,
-0.17820824682712555,
0.12890881299972534,
-0.49054545164108276,
-0.07418569922447205,
0.9845840334892273,
-0.3197355270385742,
-0.295115292... | |
a[i] = f2(val);
} else {
a[i] = 0;
}
```
Or does stuff like -O3 take care of this automatically for me? The code I'm optimizing takes days to run, so even modest improvements will make a difference.
The functions `f1` and `f2` seems to share the same signature. How differently do they behave? Do you reall... | [
0.09809432923793793,
-0.027973346412181854,
0.08357429504394531,
-0.20731483399868011,
0.030385617166757584,
-0.004631577990949154,
0.44270408153533936,
-0.3558458685874939,
-0.13710330426692963,
-0.4287637174129486,
-0.0334671325981617,
0.510490357875824,
-0.19656772911548615,
-0.27758261... | |
value of `a[ i ]` to index in to that array and call the correct function.
Hand-optimization often turns out to be error prone micro-optimization. It's best to leave this task to the compiler. If you really need to optimize, look at the big picture, think of algorithms, the design, layers etc.
As for your question: ... | [
-0.1964193433523178,
0.30869704484939575,
-0.10397245734930038,
0.24923834204673767,
-0.014609137549996376,
0.1232236921787262,
0.055306144058704376,
-0.1994200199842453,
-0.0364738292992115,
-0.47861427068710327,
-0.09982232004404068,
0.8888369202613831,
-0.11671851575374603,
-0.088845275... | |
I'm new to Icefaces and Facelets both, but I'm using them on a new project. I've got everything working configured and working fine. However, when I visit mywebapp/file.xhtml, the entire facelets template source comes up in my browser. How could I hide this to prevent users from viewing my server-side templates?
Put al... | [
0.3029210567474365,
0.3667079508304596,
0.8470532298088074,
-0.22675122320652008,
-0.30861660838127136,
-0.014690812677145004,
0.5735211968421936,
-0.14552558958530426,
-0.0861377939581871,
-0.9085394144058228,
0.053542155772447586,
0.40314942598342896,
-0.32937219738960266,
-0.04466781765... | |
<auth-constraint>
<description>Only Let 'developer's access XHTML pages</description>
<role-name>someone</role-name>
</auth-constraint>
</security-constraint>
``` | [
-0.0640595555305481,
0.26568150520324707,
0.5001852512359619,
0.03180324286222458,
-0.1423378586769104,
-0.13775379955768585,
0.149240642786026,
0.021942738443613052,
-0.05210134759545326,
-0.8500384092330933,
-0.5110103487968445,
0.36297881603240967,
-0.4797397553920746,
0.130805358290672... | |
Can anybody tell me the C# equivalent for this C code?
```
static const value_string message_id[] = {
{0x0000, "Foo"},
{0x0001, "Bar"},
{0x0002, "Fubar"},
...
...
...
}
```
```
private static readonly IDictionary<int, string> message_id = new Dictionary<int, string>
{
{ 0x0000, "... | [
0.07082771509885788,
0.26740187406539917,
0.478485643863678,
-0.053359925746917725,
-0.09594951570034027,
0.0935974270105362,
0.27558353543281555,
0.08639391511678696,
-0.06587311625480652,
-0.5044251680374146,
-0.031147923320531845,
0.8836178779602051,
-0.2845049500465393,
0.1254509985446... | |
If I create a DIB using `CreateDIBSection()`, I can specify wether it should be top-down or bottom-up by setting the `biHeight` field of the `BITMAPINFOHEADER` struct to a negative or positive value. However, if i call `GetObject()` on such a bitmap to fill a `DIBSECTION` structure, then both the `dsBm.bmHeight` and `d... | [
0.18846747279167175,
-0.08299363404512405,
0.1574399173259735,
0.046872761100530624,
-0.13628603518009186,
-0.3129073679447174,
0.18378739058971405,
-0.04684855043888092,
-0.010978811420500278,
-0.4877365827560425,
-0.2159055769443512,
0.43982166051864624,
-0.4590057134628296,
0.2341936528... | |
is that it also requires an HDC and the HBITMAP has to be a DDB.
*see: [GetDIBits Function](http://msdn.microsoft.com/en-us/library/dd144879(VS.85).aspx)*
I'm not positive, but its possible you'll lose any top-downness in the conversion. | [
0.1040726751089096,
-0.06596668064594269,
0.13849496841430664,
0.022365575656294823,
0.1495094746351242,
-0.15404869616031647,
0.3221394717693329,
-0.014587245881557465,
-0.16019809246063232,
-0.47796303033828735,
-0.0885649174451828,
0.5240607857704163,
-0.04942740499973297,
-0.0499865561... | |
I read [this article](http://hallvards.blogspot.com/2007/10/dn4dp22-net-only-pinvoke-magic.html) and find the concept of Virtual Library Interfaces nice for runtime loading of DLLs. However it seems that they aren't available for Win32. Is this true? And if so: Why? I don't see what would tie the idea to .NET.
EDIT: I... | [
0.30283311009407043,
0.11117851734161377,
0.18021243810653687,
0.07274458557367325,
-0.2678509056568146,
-0.2062913328409195,
0.46634820103645325,
-0.07571037858724594,
-0.36536410450935364,
-0.3302548825740814,
0.0661846399307251,
0.6262595653533936,
-0.2250984013080597,
-0.01650978811085... | |
DLL etc.
It seems to me like the three answers so far have completely missed the point of your question. That, or I have. You're asking why Win32 Delphi doesn't have something like the magical `Supports` function that Hallvard's article talks about, aren't you? Namely, a function that, given the name of a DLL and the t... | [
0.025144685059785843,
-0.1465148627758026,
0.12518306076526642,
0.03358227387070656,
-0.43205752968788147,
-0.32736924290657043,
0.06174509599804878,
-0.21672756969928741,
-0.38928332924842834,
-0.38019436597824097,
-0.29763221740722656,
0.5248931646347046,
-0.4265357255935669,
0.145830377... | |
export a special self-registration function that the manager will call when it loads the DLL, and the function must return an instance of the `TJvPlugin` class, so the plug-in DLL must be written in Delphi or C++ Builder. The `Supports` function, on the other hand, works with any DLL written in any language. You could ... | [
0.06514326483011246,
0.06929093599319458,
0.14232300221920013,
-0.16860009729862213,
-0.28115418553352356,
-0.40828636288642883,
0.128010556101799,
0.1891038864850998,
-0.2968451678752899,
-0.3749203383922577,
-0.2008792906999588,
0.7731394171714783,
-0.579125165939331,
-0.0185459740459918... | |
works like that, and I don't expect it would be any harder to write than the .Net version must have been, unless Microsoft's .Net libraries already provide most of the pieces and Delphi just wraps them up into a convenient-to-call function that looks like the several other overloaded versions of `Supports` that Delphi ... | [
0.2525688707828522,
0.06073229759931564,
0.15179094672203064,
0.19947916269302368,
0.2628774344921112,
-0.2455884963274002,
-0.009046945720911026,
0.026515362784266472,
-0.20383474230766296,
-0.5570588707923889,
-0.21187657117843628,
0.7241060137748718,
-0.055703092366456985,
-0.3708255887... | |
make sure that type information for an interface held, at a minimum, the undecorated names of its methods. Then, `Supports` would need to generate a function stub for each method in the interface (besides \_AddRef, \_Release, and QueryInterface). The stub would go something like this, assuming the calling convention is... | [
0.1541929543018341,
0.11081817001104355,
0.7627984881401062,
-0.1905035376548767,
-0.04677967354655266,
0.0066071245819330215,
0.24481739103794098,
-0.5089275240898132,
-0.03779163584113121,
-0.44659438729286194,
-0.36289557814598083,
0.4230361878871918,
-0.5711789727210999,
-0.23002365231... | |
name of the corresponding interface method. The `stdcall` calling convention is easy to wrap like that; `cdecl` is a little cumbersome; `register` is a pain in the neck.
Once it has all the stubs generated, it would need to generate an "object" that looks like it implements the given interface. It doesn't have to be a... | [
0.08081333339214325,
-0.021689020097255707,
0.3279537856578827,
0.1094675287604332,
-0.08194412291049957,
-0.23633518815040588,
0.15516608953475952,
-0.1228271871805191,
-0.0113145112991333,
-0.7005899548530579,
-0.14387312531471252,
0.5587537288665771,
-0.5844451189041138,
0.0392827466130... | |
where you'd call `FreeLibrary` when the reference count reached zero; `QueryInterface` wouldn't do much at all, except claim that it supports `IUnknown` and the interface given to `Supports`.
Delphi used to come with a sample program that demonstrated implementing an interface without any classes at all. It was all do... | [
-0.20311526954174042,
0.031024765223264694,
-0.0029480098746716976,
0.1258440613746643,
-0.31078460812568665,
-0.26387205719947815,
0.24096840620040894,
0.04159549996256828,
-0.1796169877052307,
-0.402107298374176,
0.008415509946644306,
0.5691362023353577,
-0.33562180399894714,
-0.13884481... | |
still around somewhere. | [
0.32672640681266785,
0.17510414123535156,
0.11677348613739014,
-0.0651131197810173,
-0.10897878557443619,
-0.4715433418750763,
0.22968821227550507,
0.5592296719551086,
-0.3915640115737915,
-0.0757143571972847,
0.27018341422080994,
-0.30773618817329407,
-0.1183546856045723,
0.32391810417175... | |
I am writing an installer class for my web service. In many cases when I use WMI (e.g. when creating virtual directories) I have to know the siteId to provide the correct metabasePath to the site, e.g.:
```
metabasePath is of the form "IIS://<servername>/<service>/<siteID>/Root[/<vdir>]"
for example "IIS://localhost/W... | [
0.3340556025505066,
0.1531468778848648,
0.6434356570243835,
-0.26262593269348145,
0.07646111398935318,
-0.22062954306602478,
0.47288140654563904,
-0.2389267086982727,
-0.026969850063323975,
-0.9412322044372559,
-0.24321810901165009,
0.4236047565937042,
-0.32074370980262756,
0.1389886736869... | |
string.Format("IIS://{0}/w3svc", serverName));
foreach (DirectoryEntry site in w3svc.Children)
{
if (site.Properties["ServerComment"] != null)
{
if (site.Properties["ServerComment"].Value != null)
{
if (string.Compare(site.Properties["ServerComment"].Value.ToString(),
... | [
-0.27808675169944763,
-0.004520312417298555,
0.8491374254226685,
-0.28891393542289734,
0.09584540128707886,
0.04259611293673515,
0.23658956587314606,
-0.25204938650131226,
0.07058041542768478,
-0.793524980545044,
-0.3479311466217041,
0.45224297046661377,
-0.06488066911697388,
0.49880582094... | |
result = int.Parse(site.Name);
break;
}
}
}
}
return result;
}
``` | [
-0.03636251762509346,
0.1385280191898346,
0.2707676291465759,
-0.316797137260437,
0.10212145000696182,
-0.21930380165576935,
0.4260280430316925,
-0.1471957564353943,
-0.15984320640563965,
-0.40552443265914917,
-0.4957813322544098,
0.23119238018989563,
-0.16127529740333557,
0.43735349178314... | |
This is something I've come across twice in the past month and I'm not even certain how to phrase this as a Google query.
I'm actually using SVN for all of this, but it seems like this should be a general versioning problem.
We have two projects and one of them is dependent on some of the other's code. Due to API iss... | [
0.54807448387146,
0.1369807869195938,
0.18308497965335846,
0.07971617579460144,
0.09996306896209717,
-0.2660285532474518,
0.20734292268753052,
0.2927442193031311,
-0.13026487827301025,
-0.4764823615550995,
0.22979924082756042,
0.2977535128593445,
-0.20261742174625397,
0.5039082765579224,
... | |
the shared code into the directory structure, I will end up overwriting all of the config files that SVN uses. This would mean that the version in the dependent project's directories would no longer be able to update.
Ex:
Project #1 needs to use the class MyExampleClass, however, MyExampleClass is something which is ... | [
0.08497820049524307,
0.03237093240022659,
0.39193007349967957,
-0.035501133650541306,
0.052392181009054184,
-0.3167789578437805,
0.3950527012348175,
-0.07115823030471802,
-0.32695773243904114,
-0.38121509552001953,
-0.24961762130260468,
0.513652503490448,
-0.09536127746105194,
0.2909203171... | |
Greetings Everyone.
I'm currently trying to compile a multiple-language program (C, C++ and FORTRAN) using GNU compilers in UNIX (g++, gcc & f77 respectively).
All my sources are compiling into objects with no errors however I encounter a symbol referencing error as they are linked as shown below:
```
f77 -L/usr/sfw... | [
-0.17289422452449799,
0.5349904298782349,
0.8235494494438171,
0.11444046348333359,
-0.35333365201950073,
0.038970232009887695,
0.49596524238586426,
0.24220606684684753,
-0.0718638077378273,
-0.6666554808616638,
-0.49766573309898376,
0.1957147866487503,
0.2807430326938629,
-0.13767990469932... | |
Solve.o
Undefined first referenced
symbol in file
_Znwj SA.o
_ZNSt14basic_ofstreamIcSt11char_traitsIcEED1Ev SA.o
_ZNSt14basic_ofstreamIcSt11char_traitsIcEEC1Ev SA.o
_ZNKSsixEj | [
-0.8397847414016724,
0.124437116086483,
0.44649747014045715,
-0.00895626936107874,
0.23818282783031464,
0.2723945081233978,
0.3081527054309845,
-0.17541532218456268,
0.10000192373991013,
-0.6674343943595886,
0.18309429287910461,
0.16023403406143188,
-0.2454337477684021,
0.02452532947063446... | |
main.o
_ZNSolsEPFRSoS_E SA.o
_ZNSt14basic_ofstreamIcSt11char_traitsIcEE4openEPKcSt13_Ios_Openmode SA.o
_ZNSolsEd SA.o
_ZNSolsEi SA.o
__cxa_end_catch | [
-0.19825977087020874,
-0.05374608561396599,
0.4177696704864502,
0.05418282374739647,
0.15065011382102966,
-0.014011754654347897,
0.157057523727417,
0.31016266345977783,
-0.3438475728034973,
-0.46107107400894165,
-0.22144609689712524,
0.26061415672302246,
-0.2340122014284134,
0.378802269697... | |
SA.o
__cxa_begin_catch SA.o
_ZdlPv SA.o
_ZNSt14basic_ofstreamIcSt11char_traitsIcEE7is_openEv SA.o
_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c SA.o
_ZSt4cerr SA.o
_ZSt4cout | [
-0.5142393112182617,
-0.03859869763255119,
0.6235076785087585,
-0.11480919271707535,
-0.02256210520863533,
0.29948925971984863,
0.34859731793403625,
0.09752727299928665,
-0.31597405672073364,
-0.6960002183914185,
-0.03969720005989075,
0.23962514102458954,
0.09613598883152008,
0.16668255627... | |
SA.o
_ZNSt14basic_ofstreamIcSt11char_traitsIcEE5closeEv SA.o
_ZNSt8ios_base4InitD1Ev main.o
_ZNSt8ios_base4InitC1Ev main.o
_ZNKSt9basic_iosIcSt11char_traitsIcEEntEv SA.o
__gxx_personality_v0 main.o
_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc SA.o
__cxa_rethrow ... | [
-0.5260166525840759,
0.17199604213237762,
0.5774298310279846,
-0.14355671405792236,
-0.18173617124557495,
0.7237905263900757,
0.757073700428009,
0.13787664473056793,
-0.19649922847747803,
-0.751112163066864,
0.08334784209728241,
0.4969908595085144,
-0.03905433788895607,
0.02592183277010917... | |
main.o
_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_ SA.o
ld: fatal: Symbol referencing errors. No output written to SlowDynamic.exe
*** Error code 1
make: Fatal error: Command failed for target `SlowDynamic.exe'
```
With the Following Makefile:
```
products: SlowDynamic.exe
SlowDynamic.exe: main.o SA.... | [
-0.555955171585083,
0.14884954690933228,
0.5173719525337219,
0.5120720267295837,
0.032429542392492294,
0.5051738023757935,
0.4324631094932556,
0.320911169052124,
-0.29080596566200256,
-0.5136191248893738,
-0.42777276039123535,
0.262026846408844,
0.05906999111175537,
0.1717430204153061,
0... | |
g++ -c -o mersenne.o mersenne.cpp
CFE.o: CFE.c
gcc -c -o CFE.o CFE.c
MA_57.o: MA_57.f
f77 -c -o MA_57.o MA_57.f
blas.o: blas.f
f77 -c -o blas.o blas.f
MA_57_Depend.o: MA_57_Depend.f
f77 -c -o MA_57_Depend.o MA_57_Depend.f
Metis.o: Metis.f
f77 -c -o Metis.o Metis.f
BCs.o: BCs.c
gcc -c -o BC... | [
-0.3926946520805359,
0.08769609034061432,
0.7554801106452942,
0.17476330697536469,
-0.3048899471759796,
0.6243779063224792,
0.1568959802389145,
0.08671215921640396,
-0.49046075344085693,
-0.7055091261863708,
-0.4368566572666168,
0.3287297785282135,
-0.18427230417728424,
-0.0079959155991673... | |
rm *.o Main.exe *.gpi
```
I have read that this is typically the fault of missing libraries. I know the C & FORTRAN code compiles fine seperatly (respective libraries included) as does the C++ code when compiled on its own. This leads me to believe that it is the interface between the two programs that causes the err... | [
0.24134084582328796,
0.5450320243835449,
0.014875398017466068,
-0.04472149908542633,
-0.17670172452926636,
-0.1163744330406189,
0.2791711688041687,
-0.28602540493011475,
-0.17745766043663025,
-0.29612278938293457,
0.1336580067873001,
0.8423211574554443,
-0.18879267573356628,
0.028075192123... | |
the program.
First the C++ part: SA.h, SA.cpp
SA.h:
```
class SimAnneal {
...
std::vector<float> DensityArray;
std::vector<float> EnergyArray;
public
double ObjFunction ();
...
}
```
SA.ccp:
```
#include <math.h>
#include <iostream>
#include <fstream>
#include <time.h>
... | [
-0.12689611315727234,
-0.34717804193496704,
0.8226699233055115,
0.12035554647445679,
-0.05508536100387573,
0.3782522976398468,
-0.16170290112495422,
-0.34343454241752625,
-0.31102487444877625,
-0.6854679584503174,
-0.054533202201128006,
0.29743054509162903,
-0.3288150131702423,
-0.02650321... | |
// shown in CFE.c
double SumStrainEnergy = 0;
for (int i = 0; i < EnergyArray.size(); i++)
{
SumStrainEnergy += EnergyArray[i]; //Effectively sum of array
//engy[] from CFE.c
} | [
0.43062278628349304,
-0.3950711786746979,
0.7963506579399109,
-0.42489248514175415,
0.1530841737985611,
0.24433572590351105,
0.2282787263393402,
-1.0273019075393677,
-0.18335427343845367,
-0.5851157903671265,
-0.12625735998153687,
0.5340218544006348,
-0.3010478615760803,
-0.297479152679443... | |
return SumStrainEnergy;
}
```
Secondly the C/FORTRAN part: CFE.h, CFE.c
CFE.h:
```
#ifdef __cplusplus
extern "C" {
#endif
void CFE(float density[], float energy[]);
#ifdef __cplusplus
}
#endif
```
CFE.c:
```
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include "BCs.h"
#inclu... | [
0.25226083397865295,
0.07044460624456406,
0.7513933181762695,
-0.22291967272758484,
0.005039962939918041,
0.17210496962070465,
0.10895347595214844,
-0.7843908667564392,
-0.31633636355400085,
-0.39688095450401306,
-0.18913231790065765,
0.3467549979686737,
-0.3533300757408142,
-0.01792233064... | |
is called in main.cpp, which contains main().
Is there any visible fault?
Is there any way I can ask the linker to announce what causes / where the error occours in the linking?
Any help will be much appriciated.
Thank you.
+++ EDIT: Verbose feedback +++
```
birch $ g++ -v Hello.cpp
Reading specs from /usr/sfw/li... | [
-0.24342785775661469,
0.13304391503334045,
0.6363963484764099,
0.05839100852608681,
-0.02596610225737095,
-0.11809589713811874,
0.39326709508895874,
0.1762789785861969,
-0.5675485730171204,
-0.1943313181400299,
-0.2675357460975647,
0.24978627264499664,
-0.3571728467941284,
0.23753531277179... | |
(sparc-sun-solaris2.10)
compiled by GNU C version 3.4.3 (csl-sol210-3_4-branch+sol_rpath).
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
Hello.cpp:6:2: warning: no newline at end of file
/usr/ccs/bin/as -V -Qy -s -xarch=v8 -o /var/tmp//ccvAshv7.o /var/tmp//cc2JwHRb.s
/usr/ccs/bin/a... | [
-0.4064946174621582,
0.34406760334968567,
0.6365898251533508,
0.0935034528374672,
-0.03959151357412338,
-0.053516749292612076,
0.6436865329742432,
-0.30500179529190063,
-0.4296474754810333,
-0.32887473702430725,
-0.34571918845176697,
0.506950318813324,
-0.49228259921073914,
0.1088540256023... | |
(-lstdc++).
To debug further:
1. Run f77, g++, etc, in verbose mode (`-v`) with single language programs and see which libraries the compiler automatically includes in the link phase for each language
2. For symbols that are in your own code, use `nm` to look at both the native language declarations and non-native in... | [
-0.20543569326400757,
0.1880035400390625,
0.4474068284034729,
-0.17502440512180328,
-0.02992631308734417,
-0.24933397769927979,
0.46724408864974976,
-0.1554759442806244,
-0.15524697303771973,
-0.6322668790817261,
-0.19509708881378174,
0.25087133049964905,
-0.32622718811035156,
0.0091546364... | |
Considering iis 6.0 and above can't run on xp what options have i available?
Remote debugging (using a win 2k3 host) i'm aware of but i might not have the facilities available very easily
Some of those undefined symbols clearly relate to standard C++ classes (i.e. ostream).
You need to ensure that you've got at least... | [
0.11987258493900299,
0.19941473007202148,
0.3634321391582489,
-0.03018089197576046,
-0.200291708111763,
-0.21277588605880737,
0.5684033632278442,
-0.2649567425251007,
0.022769594565033913,
-0.6490040421485901,
-0.3104323744773865,
0.6132234334945679,
-0.5029010772705078,
0.0888599157333374... | |
both the native language declarations and non-native invocations to determine how they mismatch. There are rules about underscore prefixes, etc, which are commonly applied.
(As far as I can remember, but it's 15 years since I last linked C and Fortran, C symbols are always internally prefixed with an underscore, but F... | [
0.039320677518844604,
0.4090380072593689,
0.14956486225128174,
-0.1729493886232376,
-0.39814072847366333,
-0.20346346497535706,
0.4426940083503723,
-0.09197927266359329,
-0.16531811654567719,
-0.16153453290462494,
-0.23473680019378662,
0.3298310935497284,
-0.19295929372310638,
-0.052753262... | |
C# has a syntax feature where you can concatenate many data types together on 1 line.
```
string s = new String();
s += "Hello world, " + myInt + niceToSeeYouString;
s += someChar1 + interestingDecimal + someChar2;
```
What would be the equivalent in C++? As far as I can see, you'd have to do it all on separate line... | [
-0.1461317092180252,
-0.0051231286488473415,
0.48025262355804443,
-0.3151937425136566,
-0.2508760094642639,
-0.15369798243045807,
0.27223262190818787,
0.06167270615696907,
-0.24476401507854462,
-0.4328104555606842,
-0.3069920837879181,
0.4266910254955292,
-0.6592197418212891,
-0.1180305555... | |
myInt << niceToSeeYouString;
std::string s = ss.str();
```
Take a look at this Guru Of The Week article from Herb Sutter: [The String Formatters of Manor Farm](http://www.gotw.ca/publications/mill19.htm) | [
0.3079690635204315,
-0.16117066144943237,
0.40456777811050415,
0.09071118384599686,
-0.1776546686887741,
0.0694398358464241,
0.6174952387809753,
0.06932264566421509,
-0.07233821600675583,
-0.40999892354011536,
0.006985856220126152,
0.22647830843925476,
-0.008933263830840588,
0.326929569244... | |
I have a legacy COM-component with an interface declaring a property like this (IDL notation):
```
interface IPasswordCallback : IUnknown {
[propget] HRESULT Password( [in] VARIANT_BOOL ownerNeeded, [in, out]
VARIANT_BOOL* isResultValid, [out, retval] BSTR* password );
}
```
This interface is implemented... | [
-0.028647148981690407,
0.17467331886291504,
0.4809039235115051,
-0.11760864406824112,
-0.15052275359630585,
-0.1440592259168625,
0.2493075430393219,
-0.4006507396697998,
0.055624689906835556,
-0.7941862344741821,
0.03253796696662903,
0.5255537629127502,
-0.21281400322914124,
0.362735956907... | |
passed ByRef. [MSDN says](http://msdn.microsoft.com/en-us/library/7abxsyxb.aspx) VB.Net doesn't allow such parameters.
Is there any way I could implement such a property in VB.Net?
Create a new interface around the old interface that has the property properly implemented. You don't need the original source you can jus... | [
0.45277851819992065,
0.1327410340309143,
0.65740567445755,
0.22688202559947968,
-0.21560600399971008,
0.06960371881723404,
0.27895089983940125,
-0.39383313059806824,
-0.31806042790412903,
-0.3746524155139923,
0.1903264969587326,
-0.06122925505042076,
-0.14115166664123535,
0.724633038043975... | |
for a major version change in the VB6 code (when we break binary compatibility). Doing makes the new DLL not compatible with the old DLL. | [
0.20984938740730286,
-0.06114501878619194,
0.3983510136604309,
0.01428247895091772,
-0.04456883296370506,
-0.3919484317302704,
0.3671210706233978,
0.04960506409406662,
-0.22389332950115204,
-0.47125548124313354,
-0.24163199961185455,
0.44716763496398926,
-0.32748138904571533,
0.38847157359... | |
In Python, I often have tests which look something like this:
```
tests = [
(2, 4),
(3, 9),
(10, 100),
]
for (input, expected_output) in tests:
assert f(input) == expected_output
```
What is the "right" way to write tests like this (where a set of test cases is specified, then a loop runs each of the... | [
0.2858595848083496,
0.055221524089574814,
-0.3070862889289856,
-0.1575392335653305,
-0.30978935956954956,
-0.06749271601438522,
0.5989828109741211,
-0.35734957456588745,
-0.09918699413537979,
-0.3478196859359741,
-0.013729569502174854,
0.6790385842323303,
-0.28657007217407227,
-0.362015485... | |
{2, 4},
{3, 9},
{10, 100}
};
for (int[] test : tests) {
assertEquals(test[1], f(test[0]));
}
```
Certainly not as pretty as python but few things are.
You may also want to look into [JUnit Theories](http://junit.sourceforge.net/doc/ReleaseNotes4.4.html), a future feature..... | [
0.5023791193962097,
-0.10149829089641571,
0.0033484024461358786,
0.031399667263031006,
0.0592300109565258,
-0.04930851608514786,
0.4010673761367798,
-0.14358067512512207,
-0.0023956275545060635,
-0.3864920735359192,
-0.05721614137291908,
0.6643043160438538,
-0.1577996164560318,
-0.13874819... | |
I have made an app with a Tabbar and an RSS reader in one window.
I know how to open the RSS links in the build in safari browser, but how do I open the links in a UIWebView in the same tab instead? I don't want to quit my app to view the webpage, and how do I go back to the RSS view? Simply by hiding the webview?
I t... | [
0.6183052659034729,
0.062018681317567825,
0.2828844487667084,
0.3259675204753876,
-0.134948268532753,
-0.180603489279747,
0.24387618899345398,
0.15384824573993683,
-0.2973751127719879,
-0.4999459981918335,
-0.01955368183553219,
0.8224431276321411,
-0.2313104122877121,
0.4162691831588745,
... | |
your RSS feed, create an instance of a new view controller that has a WebView as it's view. You can then pass the URL to the new web view and 'push' the webview onto your navigation stack.
All you have to do then is tell the webview to load the URL you passed it, and it'll do its thing.
Then when the user is done, al... | [
0.5295464396476746,
-0.2581814229488373,
0.7604708671569824,
0.07998894155025482,
-0.236630380153656,
-0.0857805535197258,
0.007233514450490475,
0.1996706873178482,
-0.30785220861434937,
-0.49156105518341064,
0.028302643448114395,
0.5388743877410889,
-0.3217523694038391,
0.2404348701238632... | |
Site Usage report in Site Administration does not help. I also tried querying
the SQL Db to read daylastaccessed but that would not help. 'GetUsageData' method of the Object model only reads data for last 1 month and the "Most Recent Day" value is not accurate. Also I want a report of the last 6 months.
The search cra... | [
0.31115880608558655,
0.03809460252523422,
0.39605051279067993,
-0.11788268387317657,
-0.3653876483440399,
-0.1890360563993454,
0.5673810839653015,
0.2546500265598297,
-0.3475431501865387,
-0.7525256276130676,
0.062101442366838455,
0.06224987655878067,
-0.09157194942235947,
0.30688914656639... | |
I have a test case that requires typing in a partial value into an ajax based textfield and verifying the list has the expected content. If it does, select the content. Any idea how to make this work?
The **type** command may not be enough to trigger the autocomplete. Dave Webb's suggestions are otherwise spot on. My o... | [
0.33806800842285156,
-0.02758476324379444,
-0.24767708778381348,
0.07928849011659622,
-0.01691940240561962,
-0.26527655124664307,
0.38252922892570496,
0.12525203824043274,
-0.08637285232543945,
-0.5321377515792847,
-0.04882856085896492,
0.672294557094574,
-0.453593909740448,
-0.06267663836... | |
Does anyone know an easy way in Python to convert a string with HTML entity codes (e.g. `<` `&`) to a normal string (e.g. < &)?
`cgi.escape()` will escape strings (poorly), but there is no `unescape()`.
[HTMLParser](https://docs.python.org/2.7/library/htmlparser.html) has the functionality in the standard libra... | [
0.09356609731912613,
-0.35354116559028625,
0.5167225003242493,
0.22831986844539642,
-0.013583717867732048,
-0.24525563418865204,
0.42624709010124207,
-0.4064622223377228,
-0.2711837589740753,
-0.6356173753738403,
-0.4185759127140045,
0.4036695063114166,
-0.3120310604572296,
0.0662466734647... | |
If you only need the predefined entities and no numeric character references, you could even just use a plain old string replace for speed. | [
0.1647399663925171,
0.047568999230861664,
0.05601305887103081,
0.39227741956710815,
0.060181714594364166,
-0.23433737456798553,
0.03888650983572006,
0.13182327151298523,
-0.3232364356517792,
-0.35688766837120056,
-0.08455493301153183,
0.40495678782463074,
-0.14888212084770203,
-0.065329484... | |
I am an excel newb, wondering if excel has built in functionality to do the following.
Turn this data:
```
Name | Activity | Option
Bob | Monday Activities | Golf
Bob | Tuesday Activities| Kayak
Marge | Monday Activities | Spa
John | Tuesday Activities| Soccer
Liz | Tuesday Activities| Spa
```
Into... | [
0.3584214150905609,
0.017931180074810982,
0.43825310468673706,
-0.12028409540653229,
-0.15459464490413666,
-0.21145831048488617,
0.5197047591209412,
-0.13011083006858826,
-0.3605906367301941,
-0.4518466889858246,
0.09794830530881882,
0.14073185622692108,
-0.24272941052913666,
-0.1249722540... | |
|
John | | Soccer
Liz | | Spa
```
(Edit: expanded on the answer to answer some of the comments)
The compiler takes the inner classes and turns them into top-level classes. Since private methods are only available to the inner class the compiler has to add new "synthetic" methods... | [
0.054533593356609344,
-0.01544624287635088,
-0.1576024740934372,
0.05114830657839775,
-0.11126820743083954,
-0.07835905998945236,
0.4711756110191345,
-0.18397735059261322,
-0.10580691695213318,
-0.3315446078777313,
-0.34361639618873596,
0.39169496297836304,
-0.6079158186912537,
-0.40462297... | |
to it.
Something like this (the $ ones are added by the compiler):
```
class A
{
private void f()
{
final B b;
b = new B();
// call changed by the compiler
b.$g();
}
// method generated by the compiler - visible by classes in the same package
void $f()
{ | [
0.1400291919708252,
-0.07169979810714722,
0.23551107943058014,
-0.3703731596469879,
0.10679543763399124,
0.06302618980407715,
0.052467796951532364,
-0.09627245366573334,
-0.19025151431560516,
-0.27592238783836365,
-0.41017308831214905,
0.6356602907180786,
-0.6287497282028198,
0.28410729765... | |
f();
}
}
class B
{
private void g()
{
final A a;
a = new A();
// call changed by the compiler
a.$f();
}
// method generated by the compiler - visible by classes in the same package
void $g()
{ | [
0.11386114358901978,
-0.12649613618850708,
0.15752044320106506,
-0.39998918771743774,
-0.006027052644640207,
0.24122203886508942,
0.22586990892887115,
-0.24548408389091492,
-0.12864211201667786,
-0.11930984258651733,
-0.559546709060669,
0.5062717199325562,
-0.652336835861206,
0.21085761487... | |
g();
}
}
```
Non-static classes are the same, but they have the addition of a reference to the outer class so that the methods can be called on it.
The reason Java does it this way is that they did not want to require VM changes to support inner classes, so all of the changes had to be at the compiler level.
T... | [
-0.23333826661109924,
-0.0028780701104551554,
0.18385136127471924,
-0.19400453567504883,
-0.09728522598743439,
-0.2415742427110672,
0.24452278017997742,
-0.2610287070274353,
-0.14281614124774933,
-0.37492817640304565,
-0.3127999007701874,
0.3935655951499939,
-0.7155700922012329,
-0.0498254... | |
"forwarding" methods. They are made at the package level (not public) to ensure that only classes in the same package can access them. The compiler also updated the method calls to the private methods to the generated "forwarding" methods.
You can avoid having the compiler generate the method my declaring the methods ... | [
0.009473511949181557,
0.04356291890144348,
0.11303979903459549,
-0.2780238389968872,
-0.4128536581993103,
0.053391389548778534,
0.21084150671958923,
-0.3398706018924713,
-0.1230613961815834,
-0.15348708629608154,
-0.04556451737880707,
0.5470298528671265,
-0.6927963495254517,
0.301220387220... | |
throws Exception
{
final Class<?> clazz;
clazz = Class.forName("NotPrivate$A");
for(final Method method : clazz.getDeclaredMethods())
{
if(method.isSynthetic())
{
final | [
-0.30732017755508423,
-0.024579165503382683,
0.23433274030685425,
-0.12908129394054413,
0.2757346034049988,
0.04980168491601944,
0.346073180437088,
-0.2096361517906189,
-0.16114944219589233,
-0.1305188536643982,
-0.48147696256637573,
0.29118919372558594,
-0.2123856246471405,
0.242456197738... | |
Constructor constructor;
final Object instance;
constructor = clazz.getDeclaredConstructor(new Class[0]);
constructor.setAccessible(true);
instance = constructor.newInstance();
method.setAccessible(true); | [
-0.30316346883773804,
-0.15761396288871765,
0.29650887846946716,
-0.02961668372154236,
0.019758330658078194,
0.10026761889457703,
0.5340302586555481,
-0.3430428206920624,
-0.14838777482509613,
-0.4060644507408142,
-0.4377320110797882,
0.5144010186195374,
-0.33500730991363525,
0.45432114601... | |
method.invoke(null, instance);
}
}
}
}
``` | [
-0.08280853927135468,
0.03529852628707886,
0.0506078265607357,
0.09934491664171219,
0.04108958691358566,
-0.17103244364261627,
0.42656901478767395,
-0.18839357793331146,
0.1853620707988739,
-0.38939857482910156,
-0.05937729403376579,
0.5085336565971375,
-0.5967360138893127,
0.4932709634304... | |
I was reading through some threading related code and found this piece of code:
```
MyThread::start()
{
//Create a thread
m_pThread = AfxBeginThread(/*some parameters*/)
//Create a duplicate handle for the created thread
m_hDuplicateHandle = DuplicateHandle(/* some more parameters*/)
}
MyThread::stop()
{
/... | [
0.06154320761561394,
0.08723831176757812,
0.47335800528526306,
0.24803020060062408,
0.1963115632534027,
0.033616237342357635,
0.3416001498699188,
-0.11463764309883118,
-0.34524670243263245,
-0.48114287853240967,
-0.09632018953561783,
0.4347410500049591,
-0.40608179569244385,
0.388681769371... | |
use the handle directly you need to duplicate it, otherwise when the thread ends MFC may have closed the handle before you get to the WaitForSingleObject call.
If you were working directly with the win32 CreateThread API then you could certainly wait directly on the returned handle. | [
0.42450419068336487,
-0.27605777978897095,
0.361194372177124,
0.10229440033435822,
-0.08622030913829803,
-0.28670749068260193,
0.19621343910694122,
0.07370030879974365,
-0.43618789315223694,
-0.43478313088417053,
-0.1278989315032959,
0.34625712037086487,
-0.32191693782806396,
0.48087376356... | |
My Vuze cannot update itself as it claims that my application folder is not writeable.
I tried to make it writeable by
```
chmod 777 /Applications
```
I get the following error
```
$chmod 777 /Applications/
chmod: /Applications/: Operation not permitted
```
**How can you make /Applications folder writeable?**
A... | [
0.07976000010967255,
-0.042880162596702576,
0.544813334941864,
-0.04983529448509216,
0.1244446188211441,
-0.3519001007080078,
0.5914652943611145,
0.26556509733200073,
-0.01630130410194397,
-0.6966949701309204,
-0.3330862820148468,
0.8632193207740784,
-0.09546531736850739,
0.320496946573257... | |
etc.
Edited to further add: if you just want to give yourself write access, you're probably much better off with:
```
$sudo chmod u+w /Applications
```
rather than granting everyone complete access. | [
0.11332621425390244,
0.37671419978141785,
0.19319584965705872,
0.056835755705833435,
0.12065136432647705,
-0.40217074751853943,
0.32175514101982117,
0.20051506161689758,
-0.23122979700565338,
-0.5999426245689392,
-0.4272567331790924,
0.41856151819229126,
-0.005116756539791822,
0.3372521698... | |
I created a minimal debug loop which runs and debugs a process.
When the process hangs and the user tries to close it, Windows gives the message box with the option to wait or end now. I would like to try to detect when they hit end now, so my debugger can gather relevant information. However I cannot seem to figure o... | [
0.6013060212135315,
0.1288863867521286,
0.34971606731414795,
-0.15432482957839966,
0.10300574451684952,
0.05425971373915672,
0.4320135712623596,
0.20595084130764008,
-0.43710750341415405,
-0.10727139562368393,
-0.018941884860396385,
0.04909399524331093,
-0.2346644252538681,
0.7796059250831... | |
run this debugger after the app is closed, like Dr. Watson. Perhaps it is just my machine, but I do not seem to be able to get a debugger (VS JIT debug, Dr. Watson, etc) to launch when closing a hung app.
I know this must be possible somehow because I've seen HUNGAPP dumps around before.
Thanks for any information!
T... | [
0.7426740527153015,
0.20877735316753387,
0.05946209281682968,
0.11115269362926483,
-0.1578344702720642,
-0.48823416233062744,
0.28224021196365356,
0.38014131784439087,
-0.5347955822944641,
-0.012969515286386013,
-0.18171252310276031,
0.10257598757743835,
-0.3171554207801819,
0.299587011337... | |
I host a couple of websites for some customers. So basically what they do is change their A Record to my server's IP and everything works fine.
Now I want to upgrade my server and of course my clients have to change their A Record.
So what I want for the future is to keep my flexibility in choice of servers without ... | [
0.5817949175834656,
0.2229454517364502,
0.05805813893675804,
0.07427074015140533,
0.043495357036590576,
-0.03623102977871895,
0.20223550498485565,
0.07548777759075165,
-0.6490957736968994,
-0.43900465965270996,
0.6207244992256165,
0.46691980957984924,
0.05522303283214569,
0.274373412132263... | |
using a second server as a load balancer.
Anyone good experiences with either of these solutions or even has other ideas?
We host our own DNS servers and instruct the client to point the domain at them. There really is no other *good* way to handle it. As far as load balancing, get a load balancer (dedicated hardware ... | [
0.5103654861450195,
-0.2681155502796173,
0.12821488082408905,
0.3024144470691681,
0.009602105244994164,
-0.13227126002311707,
-0.1801244616508484,
0.16635242104530334,
-0.41397494077682495,
-0.7660298943519592,
-0.0305162463337183,
0.31621354818344116,
-0.21659445762634277,
0.0562274716794... | |
I'm trying to query an Entity to return multiple rows based on a filter.
For instance in SQL we have:
```
SELECT * FROM table WHERE field IN (1, 2, 3)
```
How do I do it in LINQ to Entities?
Although I did recieved some prompt answers, and I thank you all for that. The method shown on the replies I've got didn't wo... | [
0.1358725130558014,
0.16283684968948364,
0.26623958349227905,
0.21685104072093964,
-0.21570506691932678,
0.08148378878831863,
0.09924053400754929,
0.010585788637399673,
-0.3905397653579712,
-0.6383156180381775,
0.0854230523109436,
0.3214628994464874,
-0.27287426590919495,
0.166433915495872... | |
TValue>> propertySelector, params TValue[] values)
{
return source.Where(GetWhereInExpression(propertySelector, values));
}
public static IQueryable<T> WhereIn<T, TValue>(this IQueryable<T> source, Expression<Func<T, TValue>> propertySelector, IEnumerable<TValue> values)
{
return source... | [
0.14690999686717987,
-0.3990555703639984,
0.9122739434242249,
-0.0475693941116333,
-0.292162150144577,
0.06476227939128876,
0.2151869386434555,
-0.44989779591560364,
-0.23788778483867645,
-0.6797991991043091,
-0.5541912913322449,
0.8434872031211853,
-0.5621834397315979,
0.19839663803577423... | |
return e => false;
var equals = values.Select(value => (Expression)Expression.Equal(propertySelector.Body, Expression.Constant(value, typeof(TValue))));
var body = equals.Aggregate<Expression>((accumulate, equal) => Expression.Or(accumulate, equal));
return Expression.Lambda<Func<T, bool>>(bod... | [
0.0960196703672409,
-0.11669370532035828,
0.37078121304512024,
-0.08580511063337326,
0.12632901966571808,
0.20923495292663574,
0.19977156817913055,
-0.6359978318214417,
-0.14171752333641052,
-0.2558111846446991,
-0.239092156291008,
0.8080714344978333,
-0.42354512214660645,
-0.0824686959385... | |
I've just installed IE8 (final) and restarted. I can no longer debug Web Application Projects using Visual Studio 2005 on Windows Server 2003 Enterprise R2. I get the message "Internet Explorer cannot display the webpage" and then WebDev.WebServer.exe quits with no visible error message and nothing in the Event Viewer.... | [
0.16409599781036377,
0.30306604504585266,
0.6289433836936951,
-0.14578436315059662,
-0.27054688334465027,
-0.3845275342464447,
0.795973002910614,
0.266954243183136,
-0.37170636653900146,
-0.7900928258895874,
-0.1609186828136444,
0.7150612473487854,
-0.2276342809200287,
0.27837851643562317,... | |
default Visual Studio browser to Firefox, which allows me to debug
My hosts file contains:
```
# Copyright (c) 1993-1999 Microsoft Corp.
#
# This is a sample HOSTS file used by Microsoft TCP/IP for Windows.
#
# This file contains the mappings of IP addresses to host names. Each
# entry should be kept on an individual... | [
0.281106173992157,
0.366327166557312,
0.41560468077659607,
-0.09110703319311142,
-0.12890738248825073,
-0.13209401071071625,
0.030411940068006516,
0.30928850173950195,
-0.25387394428253174,
-0.6402196288108826,
-0.17933492362499237,
0.3265365958213806,
-0.32409197092056274,
0.1811740994453... | |
a '#' symbol.
#
# For example:
#
# 102.54.94.97 rhino.acme.com # source server
# 38.25.63.10 x.acme.com # x client host
127.0.0.1 localhost
```
A colleague of mine was having similar issues and found this:
> IE 8 has a feature called Loosely-Coupled Internet Explorer (L... | [
0.2403593361377716,
-0.2788773775100708,
0.28158918023109436,
-0.04494991898536682,
-0.1513916552066803,
-0.14837324619293213,
0.25470149517059326,
0.1335912048816681,
-0.33274465799331665,
-0.7312943935394287,
0.015085572376847267,
0.44824060797691345,
-0.4542505443096161,
0.1817664504051... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.