text stringlengths 0 30.5k | title stringclasses 1
value | embeddings listlengths 768 768 |
|---|---|---|
I'm using an object to start boost thread and it has some public member variables which I modify in the thread (in the () operator). How can I access the object's member variables from outside the thread?
I tried using a mutex (defined in the object's class) that is locked both in the operator() of the object and from... | [
-0.03523654118180275,
0.030629996210336685,
0.5304020047187805,
-0.33226853609085083,
-0.007505514193326235,
0.3374719023704529,
0.32175031304359436,
-0.4195842742919922,
-0.10716289281845093,
-0.18162529170513153,
0.006819569040089846,
0.7830204367637634,
-0.4379015266895294,
0.2131566107... | |
x = m.x; y = m.y; port = m.port; }
void operator()()
{
ifstream ifs;
ifs.open (port.c_str(), ios::binary );
if (!ifs.is_open())
{
cout << "Impossible d'ouvrir " << port.c_str() << "\n";
exit(0);
}
while (true) //modify x, y in infinit loop
{
char buf[3];
ifs.read... | [
-0.12543661892414093,
-0.28170037269592285,
0.5923280119895935,
-0.4913114309310913,
0.40252333879470825,
0.25671884417533875,
0.645986020565033,
-0.3361336290836334,
-0.09019575268030167,
-0.44898173213005066,
-0.44535157084465027,
0.5777391195297241,
-0.5968873500823975,
0.12706714868545... | |
= (unsigned char *) buf;
unsigned char xsign = (msg[0]>>4) & 1;
unsigned char ysign = (msg[0]>>5) & 1;
unsigned char always1 = (msg[0]>>3) & 1;
short dx = msg[1] - 256*xsign;
short dy = msg[2] - 256*ysign;
{
boost::mutex::scoped_lock lock(mutex);
x += abs(dx);
y += dy;
... | [
0.07418040931224823,
-0.20802505314350128,
0.5649462342262268,
-0.39810845255851746,
0.046541351824998856,
0.4246775507926941,
0.5954663157463074,
-0.5665847659111023,
-0.1624845713376999,
-0.22968177497386932,
-0.5104995965957642,
0.7600583434104919,
-0.4582572281360626,
0.045186776667833... | |
try to access the x and y variables of the mouse:
```
{
boost::mutex::scoped_lock leftlock(leftMouse.mutex);
xLeft = leftMouse.x;
yLeft = leftMouse.y;
}
{
boost::mutex::scoped_lock rightlock(rightMouse.mutex);
xRight = rightMouse.x;
yRight = rightMouse.y;
}
cout << xRight << " " << yR... | [
-0.11617793887853622,
0.07909145951271057,
0.41225960850715637,
-0.3119620084762573,
0.40578675270080566,
0.18456383049488068,
0.4310063123703003,
-0.12731783092021942,
-0.2148960828781128,
-0.34558844566345215,
-0.11879706382751465,
0.667266845703125,
-0.3445940911769867,
0.28023749589920... | |
mouse("abc.txt");
boost::thread thr(mouse); // thr gets a copy of mouse
...
// thread changes it's own copy of mouse
...
}
```
You can use `boost::ref` to pass a reference to an existing object instead:
```
Mouse mouse("abc.txt");
boost::thread thr(boost::ref(mouse)); // thr gets a reference of mouse
``... | [
0.033278945833444595,
0.2804321348667145,
0.5620084404945374,
-0.3113718330860138,
0.25113585591316223,
-0.28622329235076904,
0.25502046942710876,
-0.07595094293355942,
-0.22785165905952454,
-0.5709877610206604,
-0.23821912705898285,
0.8203412890434265,
-0.6494601368904114,
0.1926990151405... | |
I'm finding Liferay 5.2 to be fairly buggy (IMO) and more specifically there are a number of security-related bugs that I find very troubling. Is Sun's version of this product (Glassfish Web Space Server) any better?
I spent a small amount of time setting up Sun's Webspace server, and immediately noticed several of the... | [
0.2352730929851532,
0.22704549133777618,
0.22649799287319183,
-0.010931813158094883,
0.03634112700819969,
-0.07144434750080109,
0.3402511775493622,
0.20730775594711304,
-0.3836236596107483,
-0.6152374148368835,
0.08118163794279099,
0.6009941101074219,
-0.39890018105506897,
0.12965676188468... | |
didn't want to spend much time on this. The Liferay + Sun collaboration thing is pretty new, so I'm not surprised that the two products are so similar. | [
0.7591464519500732,
-0.016984350979328156,
0.10347048193216324,
0.06535544991493225,
0.10998721420764923,
-0.2512342929840088,
-0.0221211276948452,
0.22424370050430298,
-0.14672841131687164,
-0.4735026955604553,
0.42231830954551697,
0.402940958738327,
0.0404927060008049,
0.0994762927293777... | |
Is there a more concise way of doing this in Python?:
```
def toDict(keys, values):
d = dict()
for k,v in zip(keys, values):
d[k] = v
return d
```
Yes:
```
dict(zip(keys,values))
``` | [
0.09595073759555817,
-0.21780391037464142,
0.1988324224948883,
-0.2638663947582245,
0.07730188965797424,
0.07729537785053253,
0.2751324474811554,
-0.3110126554965973,
-0.04166611656546593,
-0.17733360826969147,
-0.3448065519332886,
0.5848513245582581,
-0.5738487243652344,
-0.09387172013521... | |
I am moving some data and I need to come up with a TSQL statement to convert dates currently in a datetime field to another database field with the varchar MM/yy format.
This statement needs to work on both SQL Server 2k5 **and also** SQL Compact Edition 3.5 - so the answer needs to be "set" based and not include cur... | [
0.27094167470932007,
0.2887381315231323,
0.7320892810821533,
-0.046231843531131744,
0.012964541092514992,
-0.05165264010429382,
0.06377463787794113,
-0.20958927273750305,
-0.07151851058006287,
-0.6053879261016846,
-0.10834400355815887,
0.1266258805990219,
-0.21130670607089996,
0.1746117323... | |
"3". As long as you know the language of the server will always be the same, those methods are the easiest.
Using datepart is probably more reliable, but if you want say 03/08 instead of 3/08, you have to make sure to prefix the month with a "0", so
```
select
right( '00' + convert(varchar(2), datepart( mm, @dda... | [
0.27151504158973694,
0.08397842198610306,
0.9959765672683716,
-0.34796443581581116,
-0.1624486744403839,
0.1683093011379242,
0.38768428564071655,
-0.33729809522628784,
-0.09848982840776443,
-0.40394800901412964,
-0.09486914426088333,
0.4240681529045105,
-0.10210032016038895,
0.125730067491... | |
I'm working with a legacy database in Oracle and some of my tables have columns that are set to NOT-NULL that I don't want in my domain model, but, obviously, I need to specify somewhere that at least some default value is saved to the database (eg a Groups table may have a "Indentation" column thaqt always expects a c... | [
0.19781409204006195,
0.25371479988098145,
-0.09725091606378555,
-0.006697364617139101,
-0.11629973351955414,
0.021617934107780457,
0.050302840769290924,
-0.047715652734041214,
-0.2294716238975525,
-0.5478379726409912,
0.369916707277298,
0.44700193405151367,
-0.035878777503967285,
0.2214787... | |
start...). I can't change the database schema so this, sadly, isn't an option (fluent versions are ok too...).
If you don't want to pollute your POCOs, an Interceptor probably is the best option. Take a look at various articles about interceptors, like [this one](http://www.lostechies.com/blogs/rhouston/archive/2008/03... | [
0.17286823689937592,
0.04740628972649574,
0.43197980523109436,
-0.04867003485560417,
-0.1955447942018509,
-0.29491347074508667,
0.4160214066505432,
-0.33279311656951904,
0.025027215480804443,
-0.6757707595825195,
0.23178242146968842,
0.6249551773071289,
-0.5262237787246704,
0.0869542583823... | |
false;
```
Edit:
You're trying to insert data that doesn't exist in your domain but is required by your database model, so the above wouldn't quite work for you. Instead, you'll have to add an element to each of the state, propertyNames, and types arrays. | [
0.3440428078174591,
0.23142015933990479,
-0.18732371926307678,
0.10360939055681229,
0.19066035747528076,
-0.16964688897132874,
0.22066126763820648,
-0.22840043902397156,
0.11091642081737518,
-0.42011550068855286,
-0.1708773672580719,
0.4587552547454834,
-0.5312895178794861,
0.3027892410755... | |
I am building an indexer application based on a suffix tree, that enables me to index whole documents and search strings, substrings, etc, extremely fast.
What I'm doing is entering a string in a textbox, pressing a button, and running a function that queries the suffixtree and adds the positions of all occurences of ... | [
-0.029208317399024963,
0.3823903203010559,
0.29592636227607727,
0.10953427851200104,
-0.29209068417549133,
0.0999484658241272,
0.09308748692274094,
-0.06683139503002167,
-0.14910408854484558,
-0.43814370036125183,
-0.19342437386512756,
0.3079568147659302,
-0.1549524962902069,
0.19212728738... | |
letter e.
The problem is that the positions of the letter e do get listed inside the listbox. All 88974 of them. However, when I'm scrolling down by dragging the scroller button, the listbox appears to circularly go back to the top when I'm at around item 60000 or so. The problem is made wierder by the fact that I've ... | [
0.010706122033298016,
-0.06686700880527496,
0.4517487585544586,
0.11045417189598083,
-0.2677111029624939,
0.17340867221355438,
0.4836007356643677,
0.16749174892902374,
-0.4281596839427948,
-0.8534120917320251,
0.013638723641633987,
0.31498199701309204,
-0.022261152043938637,
0.283228963613... | |
all those who answered, thanks for answering. I've finally implemented this with a listview, and it's much faster, and can hold many items quite well. Thanks!
Probably ListBox still uses the 16 bit range/position messages for scrollbars. You could try to reproduce it in Win32 if it's a problem of the underlying control... | [
0.35896018147468567,
-0.29299286007881165,
0.5551944971084595,
0.3132728636264801,
-0.16549406945705414,
-0.07377196103334427,
0.20305965840816498,
0.1040482297539711,
-0.6145541667938232,
-0.6737306714057922,
0.057076405733823776,
0.6387207508087158,
0.07563995569944382,
-0.01162882149219... | |
I recently refactored a piece of code used to generate unique negative numbers.
**edit:** Multiple threads obtain these ids and add as keys to a DB; numbers need to be negative to be easily identifiable -at the end of a test session they're removed from the DB.
My Java algorithm looks like this:
```
private fina... | [
0.17969797551631927,
0.022695764899253845,
0.24012477695941925,
-0.16099555790424347,
-0.34641990065574646,
0.01730148307979107,
0.46392643451690674,
-0.5024734735488892,
-0.12105898559093475,
-0.6049937605857849,
0.20740343630313873,
0.2987197935581207,
-0.28880611062049866,
0.42611280083... | |
result *= -1;
}
} while (!seen.add(result));
return result;
}
```
The code structure above, with its speculative addition to the set and "retry" loop, makes me think there's an equivalent nonblocking algorithm that replaces the synchronized set with any of the [atomic variables](http://java.sun.com/do... | [
0.16652776300907135,
0.250347763299942,
0.2167242020368576,
0.011476801708340645,
-0.14191371202468872,
-0.16145282983779907,
0.4335483908653259,
-0.3670692443847656,
-0.29323869943618774,
-0.23942890763282776,
0.05658390372991562,
0.599700391292572,
-0.38003239035606384,
0.158837288618087... | |
guard
```
private final AtomicInteger atomi = new AtomicInteger(0);
public Integer generateUniqueNegativeIdsWithAtomicAlgo() {
boolean added = false;
int result = 0;
do {
result = random.nextInt();
if (result > 0) {
result *= -1;
}
if (atomi.compareAndSet(0, res... | [
0.053997211158275604,
-0.3887997567653656,
0.3137078881263733,
-0.13047422468662262,
0.0363403782248497,
0.10859578847885132,
0.36500170826911926,
-0.7624434232711792,
-0.019430987536907196,
-0.6166083812713623,
-0.11446402966976166,
0.5299355983734131,
-0.30846676230430603,
0.259190917015... | |
}
} while (!added);
return atomi.getAndSet(0);
}
```
**edit:** test harness below:
```
public static void main(String[] args) {
final int NUMBER_OF_THREADS = 10000;
final Set<Integer> uniques = Collections.synchronizedSet(new HashSet<Integer>());
final List<Integer> positives = Collections.syn... | [
0.11215222626924515,
-0.44825443625450134,
0.38844338059425354,
-0.14852528274059296,
0.2133084535598755,
0.35943716764450073,
0.23038360476493835,
-0.3555454611778259,
-0.4787023365497589,
-0.39869582653045654,
-0.22504884004592896,
0.34557458758354187,
-0.34811773896217346,
0.46437713503... | |
runnable = new Runnable() {
public void run() {
int number = nuig.generateUniqueNegativeIds();
if (number > 0) {
positives.add(number);
} | [
0.13466350734233856,
-0.6235900521278381,
0.10535029321908951,
-0.08733510226011276,
0.39287811517715454,
0.04575902596116066,
0.4155295491218567,
-0.047179967164993286,
-0.41394853591918945,
-0.3851258158683777,
-0.14235198497772217,
0.5624726414680481,
-0.7759568691253662,
0.216588199138... | |
uniques.add(number);
}
};
workers[i] = new Thread(runnable);
workers[i].start();
}
for (int i = 0; i < workers.length; i++) {
try {
workers[i].join();
} catch (InterruptedException ie) {} | [
0.07705865055322647,
-0.3604238033294678,
0.2021731287240982,
-0.34482502937316895,
0.2437165528535843,
0.3032681345939636,
0.28762128949165344,
-0.1646343618631363,
-0.5317283868789673,
-0.44612738490104675,
-0.07193303108215332,
0.084835484623909,
-0.5076489448547363,
0.5257224440574646,... | |
}
long end = System.nanoTime();
System.out.println(String.format("duration = %dns", (end - start)));
System.out.println(String.format("#threads = %d", NUMBER_OF_THREADS));
System.out.println(String.format("#uniques = %d", uniques.size()));
System.out.println(String.format("#positives = %d", positive... | [
0.03438882529735565,
-0.0020386474207043648,
0.5222064256668091,
-0.25865671038627625,
0.3693351447582245,
0.16364283859729767,
0.11335064470767975,
-0.2928101420402527,
-0.28717926144599915,
-0.4464600384235382,
-0.3532699644565582,
0.33294424414634705,
-0.2482592910528183,
0.748531639575... | |
requirements you've given, I would personally just use a medium-quality random number generator that you know won't produce duplicates within the number of unique numbers that you require. Unless you have an extra requirement you haven't mentioned, it seems overkill to keep the set of all the previously generated numbe... | [
0.46328461170196533,
0.32546842098236084,
-0.21857181191444397,
0.18315237760543823,
0.24393297731876373,
-0.01867937110364437,
0.018309667706489563,
-0.27775245904922485,
-0.35716748237609863,
-0.5152270197868347,
0.04492983594536781,
0.660478949546814,
-0.4038015902042389,
0.087655819952... | |
(int) System.nanoTime();
final int origSeed = seed;
public int nextUniqueNegativeNumber() {
int n = seed;
do {
n ^= (n << 13);
n ^= (n >>> 17);
n ^= (n << 5);
seed = n;
if (n == origSeed) {
throw new InternalError("Run out of numbers!");
}
} while (n > 0);
return n;
}
```
I'll l... | [
-0.18167145550251007,
-0.20411856472492218,
0.22164635360240936,
-0.06855414807796478,
0.478706419467926,
0.21433961391448975,
0.16317737102508545,
-0.3747408092021942,
-0.07219413667917252,
-0.6368539929389954,
0.13371439278125763,
0.3900773525238037,
-0.21793276071548462,
0.3465178012847... | |
concurrent case you maybe only want to write back to "seed" after getting the next *negative* number.
OK, by popular demand, the atomic version would then be something like this:
```
AtomicInteger seed = new AtomicInteger((int) System.nanoTime());
public int nextUniqueNegativeNumber() {
int oldVal, n;
do... | [
-0.0905686467885971,
-0.2044309377670288,
0.1413077712059021,
-0.004840985406190157,
0.3523842394351959,
0.08166757225990295,
0.1550912857055664,
-0.29071885347366333,
-0.31955820322036743,
-0.4870457947254181,
0.23255789279937744,
0.516859769821167,
-0.3402059078216553,
0.4747950434684753... | |
n ^= (n << 5);
} while (seed.getAndSet(n) != oldVal);
} while (n > 0);
return n;
}
``` | [
-0.09104926884174347,
0.006208647508174181,
0.06554096192121506,
-0.3347996473312378,
0.5008381009101868,
0.03804059699177742,
0.24574294686317444,
-0.2840062081813812,
-0.13344082236289978,
-0.3443640172481537,
-0.13603650033473969,
0.4813971519470215,
-0.2010444849729538,
0.5217598080635... | |
For some reasons, **asdoc** seems to be only good at 'excluding' classes but not 'skipping', which means all the files will always be walked through and examine for errors.
Is there a way to make **asdoc** really 'skip' some certain files? So it can bypass some already known problematic files and still generate the ne... | [
0.5516409873962402,
-0.016668852418661118,
-0.3811074495315552,
0.5246275067329407,
0.0688290223479271,
-0.40713921189308167,
0.25038397312164307,
0.3769427239894867,
-0.6598267555236816,
-0.32107776403427124,
-0.014134800061583519,
0.3499204218387604,
-0.0027190083637833595,
-0.1914483010... | |
set of all the previously generated numbers.
For example, using a 32-bit XORShift generator will produce all 2^31 negative 4-byte integers in "random" order before repeating the pattern. If you need more numbers than that, you probably don't want to be putting them in a hash set anyway. So something like this (warning... | [
-0.04126368463039398,
-0.324723482131958,
0.05326903611421585,
0.05125422403216362,
0.5560295581817627,
0.03948986157774925,
0.0074506462551653385,
-0.34312549233436584,
-0.17054489254951477,
-0.7168641686439514,
0.06217053905129433,
0.28205758333206177,
-0.2856549918651581,
0.487440556287... | |
seed = n;
if (n == origSeed) {
throw new InternalError("Run out of numbers!");
}
} while (n > 0);
return n;
}
```
I'll leave it up to the reader to convert "seed" to use an AtomicInteger if concurrency is necessary...
Edit: actually, to optimise the concurrent case you maybe only want to write back... | [
-0.043079257011413574,
-0.16810685396194458,
0.11601769179105759,
0.0005423949332907796,
0.1788148134946823,
0.012702571228146553,
0.146684467792511,
-0.240017831325531,
-0.1972733438014984,
-0.5860469341278076,
0.29577064514160156,
0.5118079781532288,
-0.3281473219394684,
0.38743263483047... | |
int oldVal, n;
do {
do {
oldVal = seed.get();
n = oldVal ^ (oldVal << 13); // Added correction
n ^= (n >>> 17);
n ^= (n << 5);
} while (seed.getAndSet(n) != oldVal);
} while (n > 0);
return n;
}
``` | [
-0.28579166531562805,
0.027579227462410927,
0.13460201025009155,
-0.3740023970603943,
0.4983535408973694,
0.2553594708442688,
0.3128097653388977,
-0.38803306221961975,
-0.16121448576450348,
-0.5006906390190125,
-0.3588603734970093,
0.5581966638565063,
-0.11859522014856339,
0.42546051740646... | |
How can i know the next free primary key of some model?
Even if you can query the next available primary key value, it wouldn't help you. Unless you lock the table, you can't use that value before some other database client might grab it for their insert.
Instead, you should just insert your row, and then you can quer... | [
0.2665446400642395,
0.06682593375444412,
0.4553074836730957,
0.3701639771461487,
0.16568106412887573,
-0.2899480164051056,
0.2919751703739166,
-0.2957020401954651,
-0.04462689906358719,
-0.3983457386493683,
-0.11409832537174225,
0.6403499245643616,
-0.03867622837424278,
0.37482598423957825... | |
any inserts being done concurrently by other clients. They can generate key values and your session will continue to report the same value *it* inserted most recently.
@Stuart Childs [supposes](https://stackoverflow.com/questions/579957/model-next-available-primary-key/580061#580061) that MySQL generates the next ID w... | [
0.3124431073665619,
-0.09993874281644821,
0.5162056684494019,
-0.058803871273994446,
0.28686410188674927,
0.10413260757923126,
-0.058030854910612106,
-0.025511382147669792,
-0.5180543661117554,
-0.2181621640920639,
-0.08192514628171921,
0.5598706603050232,
-0.45767346024513245,
0.128496274... | |
table.
Likewise if you insert but don't commit immediately. Before you commit, some other client does an insert. Both your session and the other client's session will have their own unique ID value generated. Auto-generated primary keys operate without regard to transaction isolation, to ensure uniqueness.
Auto-gener... | [
-0.028176961466670036,
0.10963574796915054,
0.16481368243694305,
-0.00348689709790051,
0.21720770001411438,
0.05910080298781395,
-0.18340560793876648,
-0.10469716787338257,
-0.5568432807922363,
-0.4944514036178589,
-0.22194071114063263,
0.6328330636024475,
-0.2942078113555908,
0.0243281647... | |
I have a question that really applies to any MVC framework, I'm using the Zend Framework MVC.
When exactly should you create a new controller? What exactly should the Controller layer define?
I've created several apps with the MVC, progressively becoming more reusable, but I've always struggled with naming Controlle... | [
0.5051588416099548,
-0.009190019220113754,
0.4867645800113678,
0.2409062385559082,
-0.13284631073474884,
-0.29477396607398987,
-0.0772768184542656,
0.0032405683305114508,
-0.32369187474250793,
-0.4509753882884979,
0.1862330436706543,
0.41502511501312256,
-0.1816299557685852,
0.224892511963... | |
it's pretty easy to create a disorganized MVC application...
I generally have one controller for each logical group of functions. Often this will correspond with one controller per model, sometimes not.
Imagine you're creating a simple online catalog that displays a list of categories then when the user selects a cat... | [
0.04880758002400398,
0.012864080257713795,
0.3872884213924408,
0.28810635209083557,
-0.028017373755574226,
0.06050661578774452,
-0.2550959289073944,
-0.13405977189540863,
-0.3373810350894928,
-0.360110342502594,
-0.1490638256072998,
0.7213215231895447,
-0.37842699885368347,
0.2704171538352... | |
and `ProductController`). I'd then have a controller for categories and products on the back end (`AdminCategoryController` and `AdminProductController`). The two back end controllers would handle list/add/edit/delete/view operations for their respective models. If you think though your URL structure and put related fu... | [
0.14491738379001617,
0.024201547726988792,
0.5184077024459839,
0.37607091665267944,
-0.07236877083778381,
-0.14772816002368927,
-0.03100414015352726,
-0.15603061020374298,
-0.03045625612139702,
-0.4845927655696869,
-0.2465638518333435,
0.552460253238678,
-0.14117947220802307,
0.29821804165... | |
"assign the current time to completion\_date when status is set to 'complete'" is a great fit models.
Views contain the entirety of your presentation. Controllers/Models shouldn't generate or handle HTML. Decisions such as 2 columns or 3 belong in views. Logic in views should be restricted to that which is required t... | [
-0.02572047896683216,
-0.23755641281604767,
0.5797523260116577,
0.3515627980232239,
-0.0028674157802015543,
-0.029262492433190346,
-0.012069502845406532,
-0.14032696187496185,
-0.23149847984313965,
-0.5911369919776917,
-0.03373615816235542,
0.248170405626297,
0.04391810670495033,
0.0193532... | |
required to handle the request. | [
0.19195738434791565,
0.17229463160037994,
0.3008628785610199,
0.19644694030284882,
-0.231278195977211,
-0.17611730098724365,
0.0977291464805603,
-0.39974239468574524,
0.08731295168399811,
-0.3625401556491852,
-0.2529262900352478,
0.4337797164916992,
0.17285096645355225,
-0.2679308950901031... | |
I've seen a few questions here related to determining the similarity of files, but they are all linked to a particular domain (images, sounds, text, etc). The techniques offered as solutions require knowledge of the underlying file format of the files being compared. What I am looking for is a method without this requi... | [
0.44000211358070374,
0.26059481501579285,
0.12061593681573868,
0.3335520029067993,
-0.06165732443332672,
0.08903184533119202,
-0.21953968703746796,
-0.1298619657754898,
-0.24990463256835938,
-0.7379408478736877,
0.24477244913578033,
0.4547131359577179,
0.0685180202126503,
0.356227219104766... | |
potentially applicable to many things, I do have a specific problem that I'm working on. I also currently have a working solution, but I don't think that it is ideal. There are probably many optimizations in terms of the comparison method, and storing the results. Hopefully some people here will be able to give me some... | [
0.7881866693496704,
0.29526835680007935,
0.010175243020057678,
0.23636828362941742,
0.2463996708393097,
-0.06950041651725769,
-0.06772582232952118,
0.2094479203224182,
-0.11788992583751678,
-0.8322723507881165,
0.2254403978586197,
0.5423812866210938,
-0.2512481212615967,
0.2881684899330139... | |
for video game ROM images**. For those that don't have experience with emulation, ROMs are dumps of the data on game cartridges. A ROM "clone" is typically a modified version of the same game, the most common type being a translated version. For example, the Japanese and English versions of the original *Final Fantasy*... | [
0.45495253801345825,
0.04088304936885834,
0.04994944483041763,
0.2931104898452759,
0.044541485607624054,
-0.16058777272701263,
-0.15766727924346924,
0.06653458625078201,
-0.10819810628890991,
-0.3893517851829529,
-0.5291483402252197,
0.41412657499313354,
-0.11518524587154388,
0.40537807345... | |
all done manually. What I am attempting to do is find a method to detect similar ROM images automatically and objectively, based on data similarity instead of "these seem like the same game". There are several reasons for detecting clones, but one of the major motivations is to be used with [Solid compression](http://e... | [
0.5959967374801636,
0.16276168823242188,
-0.08588836342096329,
0.2318088561296463,
0.26882505416870117,
-0.17452295124530792,
-0.022495293989777565,
-0.46122244000434875,
-0.28022500872612,
-0.6605265736579895,
-0.34960857033729553,
0.6923767924308777,
-0.042959969490766525,
0.036197055131... | |
the system. Some are small, but modern systems may have large ones, 256MB or more. Some (all?) systems only have powers of 2 as possible sizes, a 130MB game on one of these systems would have a 256MB rom, largely empty. Note that because of this, some clones may have wildly different sizes, if a game version crosses th... | [
0.4573107361793518,
-0.03701984882354736,
0.18704351782798767,
0.38683056831359863,
0.13505534827709198,
0.012891782447695732,
0.018485821783542633,
-0.10857600718736649,
-0.4794765114784241,
-0.27304181456565857,
-0.22756639122962952,
0.5048320293426514,
-0.12856769561767578,
0.4196829795... | |
that produces modified ROMs often.
* Storing similarity data for every possible pair of ROMs would result in millions of rows of data for any of the more popular systems. A system with 5000 ROMs would require 25 million rows of similarity data, with a single new game adding another 5000 rows.
* State of the processing ... | [
0.3173512816429138,
0.20911571383476257,
0.10724114626646042,
0.2881788909435272,
0.01929132454097271,
0.08843916654586792,
0.1448563039302826,
-0.22510649263858795,
-0.42689430713653564,
-0.4416689872741699,
0.24543382227420807,
0.384793758392334,
-0.29544126987457275,
0.38476353883743286... | |
added at any time, so the method should not assume that it already has a "complete" set. That is, even after you have already figured out similarity for all existing ROMs, if a new one is added (and this could also occur before previous processing was entirely finished) there must be a method for comparing it to all pr... | [
0.6001794338226318,
0.07077094167470932,
0.3621426224708557,
0.08632440865039825,
0.027515606954693794,
0.14483116567134857,
-0.0013113211607560515,
-0.2672722339630127,
-0.3838208317756653,
-0.7556748390197754,
-0.1511341780424118,
0.27266067266464233,
-0.19242504239082336,
0.228176668286... | |
day of processing to compare a new ROM to all the previous ones, the program would probably never truly complete.
It's been an interesting problem to work on, I look forward to seeing what other people can come up with. Let me know in the comments if you want any more details, and I'll try to supply them.
It sounds li... | [
0.7028632760047913,
-0.1606147438287735,
-0.003946633078157902,
0.2717857360839844,
0.09108298271894455,
0.20142655074596405,
-0.21977850794792175,
0.021666403859853745,
-0.04917866736650467,
-0.6289181709289551,
0.3397279679775238,
0.3615533411502838,
-0.07553675025701523,
0.1466240435838... | |
are a lot of similarities between compression and delta creation, so I'd say you aren't far off with your current implementation.
That being said, pairwise comparison of every binary file in your database is probably prohibitively expensive (O(n2), I think). I would try to find a simple hash for identifying possible c... | [
0.29391828179359436,
0.04551837965846062,
-0.29316672682762146,
0.12987087666988373,
-0.08122364431619644,
0.34982553124427795,
-0.18712382018566132,
-0.20153756439685822,
-0.1900067776441574,
-0.7921916842460632,
0.08484745025634766,
0.4604218602180481,
-0.0027011032216250896,
0.137752577... | |
general case has been an actively pursued research topic in CS for several years. The [LSHKit](http://lshkit.sourceforge.net/) software library implements some algorithms of this sort. The internet accessible paper [FINDING SIMILAR FILES IN A LARGE FILE SYSTEM](http://www.usenix.org/publications/library/proceedings/sf9... | [
-0.33290359377861023,
0.15507124364376068,
0.2304014414548874,
-0.18104112148284912,
-0.3959693908691406,
0.07333233952522278,
-0.11621323972940445,
-0.20709101855754852,
-0.27125221490859985,
-0.5901923775672913,
0.04612019285559654,
0.427240788936615,
-0.20174729824066162,
0.405850201845... | |
the wikipedia entry itself is pretty math heavy. As a more user-friendly alternative you might be able to apply some ideas (or even executables) from the field of [Acoustic Fingerprinting](http://en.wikipedia.org/wiki/Acoustic_fingerprint).
If you're willing to abandon the general case it's likely that you can find a ... | [
0.4320504069328308,
0.2284470647573471,
0.10476122796535492,
0.15448996424674988,
-0.10475213080644608,
-0.1610117107629776,
0.016700856387615204,
0.24576148390769958,
-0.03777739033102989,
-0.530724287033081,
0.02253561094403267,
0.03919147327542305,
0.050327837467193604,
0.37218359112739... | |
for sound, images or text. Binary formats frequently store the addresses of these sorts of sections near the beginning of the file. Some also use a chaining mechanism that stores the address of the first section at a known location along with it's size. This allows you to move to the next section which also contains a ... | [
0.29520443081855774,
0.24748046696186066,
0.17997950315475464,
0.22513805329799652,
0.2806255519390106,
-0.08230560272932053,
0.09166184812784195,
-0.0509362518787384,
-0.5152153372764587,
-0.3813451826572418,
-0.43176189064979553,
0.06504908949136734,
-0.05175691470503807,
0.2996655404567... | |
(or they require input of some sort to define a metric/distance) then there are several binary delta algorithms and implementations available on the web. The one I'm most familiar with is used by the subversion version control system. It uses a binary delta algorithm called xdelta to efficiently store binary file revis... | [
0.22393962740898132,
-0.42398014664649963,
0.4552221894264221,
-0.09549347311258316,
-0.19504040479660034,
0.05496998503804207,
-0.30699655413627625,
0.20599955320358276,
-0.535835325717926,
-0.8011319041252136,
0.1538148820400238,
0.3249226212501526,
-0.24586251378059387,
0.08521020412445... | |
I've found my devices using `IOServiceGetMatchingServices` and got the property dictionary like this:
```
kernResult = IORegistryEntryCreateCFProperties(nextMedia,
(CFMutableDictionaryRef *)&props,
kCFAllocatorDefault, 0);
```
From that dictionary I c... | [
-0.016036830842494965,
0.17033956944942474,
0.8656200170516968,
0.05652043595910072,
0.5491281747817993,
0.25756028294563293,
0.06499544531106949,
-0.38845741748809814,
-0.04338793456554413,
-0.9298040866851807,
0.02960440143942833,
0.8211278319358826,
-0.005932503845542669,
-0.03078590333... | |
valueForKeyPath:@"IOMediaIcon.IOBundleResourceFile"];
```
Those two give me this (as an example):
```
com.apple.iokit.IOStorageFamily (Bundle identifier)
Internal.icns (Resource File)
```
I tried to extract the icon using this method:
```
NSBundle *bundleWithIcon = [NSBundle bundleWithIdent... | [
0.1194688156247139,
-0.34108880162239075,
0.6475687623023987,
0.09909536689519882,
-0.04533597081899643,
-0.0009725810959935188,
0.11822324246168137,
-0.6318097710609436,
-0.43438807129859924,
-0.6966854929924011,
-0.0041135819628834724,
0.49386999011039734,
-0.2926800847053528,
-0.0109875... | |
bundles, not if this is the correct way.
Just recently [Andrew Myrick answered a similar question](http://lists.apple.com/archives/darwin-dev/2009/Oct/msg00088.html) on the darwin-dev mailing list:
> `KextManagerCreateURLForBundleIdentifier()`
> in `<IOKit/kext/KextManager.h>` may be
> of use, though I believe it on... | [
0.6556383371353149,
-0.3362685739994049,
0.26800963282585144,
0.3156936466693878,
-0.4234391748905182,
-0.14200593531131744,
0.078944131731987,
-0.4688236713409424,
-0.3597921133041382,
-0.4518551826477051,
-0.48363766074180603,
-0.17010261118412018,
-0.25041571259498596,
0.265442997217178... | |
allocator to use to allocate memory for the new object.
> * Pass <code>NULL</code> or <code>kCFAllocatorDefault</code>
> * to use the current default allocator.
> * @param kextIdentifier
> * The bundle identifier to look up.
> *
> * @result
> * A CFURLRef locating a kext with the... | [
0.2384723424911499,
-0.21782910823822021,
0.7716943621635437,
0.3011864125728607,
-0.16241306066513062,
0.08125835657119751,
-0.22973410785198212,
-0.5725778937339783,
-0.2083781212568283,
-0.4387247562408447,
-0.34921684861183167,
0.049141597002744675,
-0.10833737254142761,
0.134948447346... | |
*
> * @discussion
> * Kexts are looked up first by whether they are loaded, second by version.
> * Specifically, if <code>kextIdentifier</code> identifies a kext
> * that is currently loaded,
> * the returned URL will locate that kext if it's still present on disk.
> * If the requested kext is not loaded,
> * or... | [
0.40943804383277893,
-0.053461167961359024,
0.5877607464790344,
0.2229197770357132,
0.1802956610918045,
0.00642949715256691,
-0.12753595411777496,
-0.1538121998310089,
-0.3102968633174896,
-0.8444095253944397,
-0.6149352788925171,
0.08031313866376877,
0.15427163243293762,
0.291710823774337... | |
* If no version of the kext can be found, <code>NULL</code> is returned.
> */
> CFURLRef KextManagerCreateURLForBundleIdentifier(
> CFAllocatorRef allocator,
> CFStringRef kextIdentifier);
>
> ```
>
> Note that prior to Snow Leopard, it
> may only work for kexts in /S/L/E; the
> API existed, but there w... | [
0.2903973162174225,
0.005541171412914991,
0.13030791282653809,
-0.06944577395915985,
-0.10949494689702988,
-0.2019134759902954,
0.5194485783576965,
-0.06959781795740128,
0.019280828535556793,
-0.5553773045539856,
-0.2631147503852844,
0.3345307409763336,
-0.37248551845550537,
-0.06935422122... | |
In my Apache 2 config I have a `VirtualHost` which looks something like this:
```
<VirtualHost *:80>
ServerName sub.domain.com
# username:password sent on to endpoint
RequestHeader set Authorization "Basic dXNlcm5hbWU6cGFzc3dvcmQ=="
ProxyPass /xyz http://192.168.1.253:8080/endpoint
ProxyPassReverse ... | [
-0.035669997334480286,
0.1424587219953537,
0.5985399484634399,
0.12389880418777466,
-0.13730290532112122,
-0.5978506207466125,
0.5729090571403503,
-0.1807406097650528,
-0.02046618051826954,
-0.7688354849815369,
-0.08224286884069443,
0.35193729400634766,
-0.2183111160993576,
0.0389324836432... | |
am using the virtual host as reverse proxy to another server (which I will call the endpoint) on the network.
I am trying to figure out a configuration that would allow users inside the network browsing to `sub.domain.com` to automatically be served the endpoint. However, users outside the network should be prompted ... | [
0.24887771904468536,
0.38310280442237854,
0.574578583240509,
-0.1371748447418213,
0.1891561895608902,
-0.12589412927627563,
0.3415723443031311,
-0.28645703196525574,
0.025195879861712456,
-0.7270179390907288,
-0.06256061047315598,
0.38753870129585266,
-0.012785707600414753,
0.5638536214828... | |
through under the following circumstances
# * They are in 192.168.1.0/24
# * They have a valid user in a htpasswd file
```
Right out of <http://httpd.apache.org/docs/2.2/mod/core.html#satisfy>:
```
Require valid-user
Order allow,deny
Allow from 192.168.1
Satisfy any
```
Of course, you also need to ... | [
0.4902312755584717,
0.2936834990978241,
0.7905057668685913,
0.0809360072016716,
0.11841154843568802,
-0.19992612302303314,
0.4646460711956024,
-0.42388829588890076,
0.19019053876399994,
-0.6082966327667236,
-0.5640658140182495,
0.4914599657058716,
-0.2610390782356262,
0.5378570556640625,
... | |
I came across this Perl construct today:
```
@foo = split("\n", $bar);
```
That works well for splitting a large string into an array of lines for UNIX-type line endings, but leaves a trailing \r for Windows. So I changed it to:
```
@foo = split("\r?\n", $bar);
```
Which splits the string by lines and doesn't lea... | [
-0.005168974865227938,
0.03544304147362709,
0.3590030372142792,
-0.3193320035934448,
-0.2614269256591797,
-0.017021773383021355,
0.09826786816120148,
0.06494824588298798,
-0.22445785999298096,
-0.19293905794620514,
-0.22693225741386414,
0.42043668031692505,
-0.5539792776107788,
0.263303965... | |
and LF, but the ? is treated as a regex metacharacter rather than a literal question mark.
Are the slashes around the regular expression just optional for split()? Is it just assumed that the first parameter to the function will be a regex?
You can pass split a regex as a string or a regex literal. So passing it as a ... | [
0.5318412780761719,
-0.48398616909980774,
0.14940688014030457,
-0.1080760657787323,
-0.08575227856636047,
0.1489577740430832,
-0.3189365863800049,
-0.04567922279238701,
-0.0876198559999466,
-0.07702486962080002,
-0.394317626953125,
0.8006657361984253,
-0.3619503080844879,
-0.35991603136062... | |
I am trying to create a generic list class for use with tiOPF (an Object Persistence Framework for delphi @ www.tiopf.com). Specifically I am trying to take an existing generic class (TtiObjectList) and make a generic version that uses TtiObject descenants.
I have limited scope for altering the base classes as they n... | [
0.297623872756958,
-0.021479755640029907,
0.20665843784809113,
-0.14832037687301636,
-0.044424645602703094,
-0.07117076963186264,
0.2538536787033081,
-0.2874245345592499,
-0.1371704339981079,
-0.5942714810371399,
-0.05359254777431488,
0.62782222032547,
-0.7666976451873779,
0.02953483723104... | |
integer; const AValue: TtiObject); virtual;
...
public
function Add(const AObject : TtiObject): integer; overload; virtual;
...
end;
```
My class is defined as follows:
```
TtiGenericObjectList<T: TtiObject> = class(TtiObjectList)
protected
function GetItems(i:integer): T; reintroduce;
proced... | [
-0.3600999414920807,
-0.21583648025989532,
0.24789448082447052,
-0.2584429979324341,
-0.03643301874399185,
0.22528968751430511,
0.32440704107284546,
-0.43442225456237793,
-0.14560416340827942,
-0.36067935824394226,
-0.6368405222892761,
0.7456873059272766,
-0.4595922529697418,
0.07559966295... | |
end;
// alternate add, also fails
function TtiGenericObjectList<T>.Add(const AObject: T): integer;
begin
result:= inherited Add(AObject); /// **There is no overloaded version**
/// **of 'Add' that can be called with these arguments**
end;
function TtiGenericObjectList<T>.GetItems(i: integer): T;
begi... | [
-0.1345055103302002,
-0.22829823195934296,
0.2322598248720169,
-0.2513190805912018,
-0.1323026567697525,
-0.0017775712767615914,
0.35410404205322266,
-0.5553279519081116,
-0.12346144765615463,
-0.4953363537788391,
-0.359126478433609,
0.5772786140441895,
-0.5274530053138733,
-0.004614953882... | |
something like:
```
function TtiGenericObjectList<T>.Add(const AObject: T): integer;
var obj: TtiObject;
begin
obj:= TtiObject(AObject); /// **Invalid typecast***
result:= inherited Add(obj);
end;
```
If I don't do a type cast, then I get overload errors instead as shown in the listing above.
Any idea... | [
-0.17689456045627594,
-0.02278219722211361,
-0.06508751213550568,
-0.17734771966934204,
-0.16130618751049042,
-0.09669861942529678,
0.5113213062286377,
-0.28633129596710205,
-0.17144954204559326,
-0.38921841979026794,
0.006618115119636059,
0.9076058268547058,
-0.3705412447452545,
-0.092901... | |
TtiObject(GenericAsObject(AObject));
result:= inherited Add(obj);
// replaces the following which gets overload errors
// result:= inherited Add(TtiObject(AObject));
end;
```
and
```
function TtiGenericObjectList<T>.GetItems(i: integer): T;
var obj: TtiObject;
begin
obj:= inherited GetItems(i);
result:= Ob... | [
-0.3043125867843628,
-0.19848547875881195,
0.44832852482795715,
-0.26514899730682373,
-0.22247028350830078,
0.20982973277568817,
0.393674373626709,
-0.3747248947620392,
-0.2722499966621399,
-0.5185074210166931,
-0.4004434049129486,
0.6777393817901611,
-0.6140636205673218,
-0.19352297484874... | |
I've recently been given the… *opportunity*… to completely redesign the layout of a web site I support. In the interest of keeping my CSS simple and my HTML semantic, I decided to use a modified version of [the "holy grail" layout](http://www.alistapart.com/articles/holygrail/) (the main difference is moving the right ... | [
0.41858553886413574,
0.29557350277900696,
0.7058306932449341,
-0.12298950552940369,
-0.3118821978569031,
0.1204480230808258,
0.5356882810592651,
-0.02037658914923668,
-0.09959973394870758,
-0.6541109085083008,
0.21412377059459686,
0.3451870381832123,
-0.08401938527822495,
0.105338796973228... | |
I didn't expect it to break quite so spectacularly — I seem to have triggered some kind of rendering bug in IE6 which I can neither isolate nor eliminate.
When adapting the holy grail layout, I had initially omitted the IE6-specific hack it uses, at it isn't (shouldn't be?) needed with the modifications I've made to t... | [
0.03430135175585747,
0.2522701323032379,
0.39322999119758606,
-0.014366907067596912,
-0.07555872946977615,
0.2823091447353363,
0.5003568530082703,
-0.09943550825119019,
-0.24422863125801086,
-0.6725099682807922,
-0.03510965034365654,
0.1955789476633072,
-0.12662729620933533,
0.148681059479... | |
in the stylesheet), so I tried resizing the window to make sure it wasn't related to page size. Much to my surprise, *the column then leapt ~1000 pixels to the right*, well beyond the edge of the page.
Going back and removing the IE6 hack, the same behavior occurs when resizing, only instead of leaping from the left-h... | [
0.20290112495422363,
-0.2800895869731903,
0.5402389764785767,
-0.009566702879965305,
-0.24375952780246735,
0.09345319867134094,
0.346321165561676,
-0.19929559528827667,
-0.09237391501665115,
-0.7996002435684204,
0.12292182445526123,
0.2576511800289154,
-0.027209870517253876,
0.032374780625... | |
of, but can't seem to eliminate the jump-on-page-resize behavior.
Has anyone seen this bug before, if bug it is? Complete code follows:
```
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html lang="en">
<head>
<title>Modified grail layout</title>
<styl... | [
-0.3752794861793518,
-0.0015679873758926988,
0.7957965731620789,
0.12592391669750214,
-0.13353437185287476,
-0.12528693675994873,
0.28475698828697205,
-0.29022765159606934,
-0.2844918370246887,
-0.5602258443832397,
-0.27553340792655945,
0.2586289048194885,
-0.16576282680034637,
0.192944571... | |
padding: 0;
}
#main {
background: white;
overflow: auto;
padding-left: 180px; | [
-0.17390896379947662,
-0.08144664019346237,
0.22381891310214996,
-0.48064935207366943,
0.3329441249370575,
0.39941129088401794,
0.2701071500778198,
-0.031075704842805862,
-0.08968900144100189,
-0.39580419659614563,
-0.5962459444999695,
0.29145684838294983,
-0.5365514159202576,
-0.156646057... | |
}
#content {
background: #dfd;
float: left;
padding: 10px 10px 0;
width: 800px;
} | [
0.16909568011760712,
-0.21943774819374084,
0.4819311499595642,
0.07879345118999481,
0.3171592652797699,
-0.004027429036796093,
0.11454913020133972,
0.017489563673734665,
-0.06073002889752388,
-0.4424743354320526,
-0.5396125912666321,
0.44002482295036316,
-0.21065862476825714,
-0.1115778163... | |
#left {
background: #ccc;
float: left;
margin-left: -100%;
position: relative;
padding: 10px 10px 0; | [
-0.41298121213912964,
0.1328844577074051,
0.5317860245704651,
-0.06193840876221657,
0.30596867203712463,
-0.0019630668684840202,
-0.22522257268428802,
-0.010527152568101883,
0.07617786526679993,
-0.20248188078403473,
-0.5467685461044312,
0.32809096574783325,
-0.1912480592727661,
-0.3301134... | |
right: 180px;
width: 160px;
}
#right {
background: #fdd;
float: right; | [
-0.09837030619382858,
-0.00826494675129652,
0.47919318079948425,
-0.31652510166168213,
0.1662844568490982,
0.035512398928403854,
-0.11011145263910294,
-0.14983701705932617,
0.0987483561038971,
-0.2415424883365631,
-0.5179576873779297,
0.5840675830841064,
-0.07007904350757599,
-0.3307464718... | |
margin-bottom: 10px;
padding: 10px 10px 0;
width: 160px;
}
#top {
margin: 0 auto; | [
-0.40627774596214294,
0.1409836709499359,
0.6779819130897522,
0.005129049997776747,
-0.0018150655087083578,
0.3261233866214752,
-0.08911635726690292,
-0.29620641469955444,
-0.07764994353055954,
-0.32844677567481995,
-0.4698411524295807,
0.5471241474151611,
-0.016283612698316574,
-0.4997312... | |
width: 1000px;
}
body {
background: #ddf;
}
/* fake content */
#cc1 { | [
0.547645092010498,
-0.17847439646720886,
0.2909081280231476,
0.1818617880344391,
0.01473572663962841,
-0.10013648122549057,
0.08054956048727036,
0.1406467705965042,
-0.36384326219558716,
-0.26617923378944397,
-0.2404724508523941,
0.40051522850990295,
-0.06096159666776657,
0.059571426361799... | |
height: 320px;
width: 800px;
}
#cc2 {
height: 320px;
margin-right: 190px;
} | [
-0.3399045169353485,
0.046653274446725845,
0.5770572423934937,
-0.00351478299126029,
-0.03549940884113312,
0.062163278460502625,
-0.22079916298389435,
0.01869865693151951,
-0.29643428325653076,
-0.3417659103870392,
-0.16317884624004364,
0.37962600588798523,
0.1362956315279007,
-0.091441385... | |
#cc3 {
height: 160px;
margin-right: 190px;
}
#lc1 {
height: 120px;
margin-left: auto; | [
-0.3561282157897949,
-0.08122477680444717,
0.43284234404563904,
0.2589493691921234,
0.14714457094669342,
0.16759124398231506,
-0.33836930990219116,
-0.1030241996049881,
-0.30051350593566895,
-0.10072659701108932,
-0.1257242113351822,
0.4023975729942322,
-0.028811851516366005,
-0.1907556653... | |
margin-right: auto;
width: 144px;
}
#lc2 {
height: 300px;
width: 160px; | [
-0.4876711964607239,
-0.18218077719211578,
0.6785725355148315,
-0.00959110539406538,
0.13633513450622559,
0.22972619533538818,
-0.2547752559185028,
-0.2094259411096573,
-0.07753747701644897,
-0.2570147216320038,
-0.23299220204353333,
0.7172439098358154,
0.16601717472076416,
-0.130255058407... | |
}
#lc3 {
height: 400px;
width: 160px;
}
#rc1 {
height: 400px; | [
-0.06026865169405937,
-0.20365925133228302,
0.3234962821006775,
-0.05779479444026947,
0.056951794773340225,
0.2735145688056946,
0.010761312209069729,
-0.14461921155452728,
-0.39882081747055054,
0.03802785277366638,
-0.3023991584777832,
0.6568469405174255,
-0.15604616701602936,
-0.017622109... | |
width: 160px;
}
#rc2 {
height: 300px;
width: 160px;
}
div.fake-content { | [
0.45326513051986694,
-0.02363976463675499,
0.5785812139511108,
-0.005104450974613428,
-0.050571899861097336,
0.021600214764475822,
0.31761279702186584,
0.08056902885437012,
-0.11567986011505127,
0.004322797060012817,
-0.2893296182155609,
0.5331215858459473,
-0.11722448468208313,
0.01561648... | |
background: #666;
color: white;
margin-bottom: 10px;
}
/* Internet Explorer (all) */
#ie body { | [
0.18319986760616302,
0.048687245696783066,
0.36818909645080566,
0.06112578511238098,
0.26351508498191833,
-0.01912064105272293,
0.14586971700191498,
0.24886344373226166,
0.04683096334338188,
-0.9239247441291809,
-0.4149508774280548,
0.4830494821071625,
-0.1525225043296814,
-0.2450126707553... | |
text-align: center;
}
#ie #left {
text-align: center;
}
#ie #left * {
text-align: left; | [
-0.6739402413368225,
0.15527299046516418,
0.27922797203063965,
-0.343727171421051,
0.014709795825183392,
-0.09040030837059021,
-0.028757264837622643,
0.1922222077846527,
0.3573276400566101,
-0.6757159233093262,
-0.6530821919441223,
0.6097729206085205,
-0.0732484832406044,
-0.50632661581039... | |
}
#ie #right {
margin-bottom: 0;
}
#ie #top {
text-align: left;
}
/* Internet | [
-0.14007721841335297,
0.09592876583337784,
0.3445802330970764,
0.05638813227415085,
0.300594300031662,
-0.35381755232810974,
0.010115385055541992,
0.43692052364349365,
-0.08263957500457764,
-0.9655438661575317,
-0.1361234039068222,
0.41066351532936096,
-0.22740969061851501,
-0.124041087925... | |
Explorer 6 */
#ie6 #left {
left: 246px; /* WTF!? */
}
</style>
</head>
<body>
<!--[if IE 6]><div id="ie"><div id="ie6"><![endif]-->
<!--[if IE 7]><div id="ie"><div id="ie7"><![endif]-->
<!--[if IE 8]><div id="ie"><div | [
0.04308568686246872,
-0.23204030096530914,
0.6250820755958557,
-0.1420607715845108,
-0.239289790391922,
-0.019164685159921646,
0.47765377163887024,
-0.29818645119667053,
0.32367831468582153,
-1.151423692703247,
-0.14531490206718445,
0.43506520986557007,
-0.282051146030426,
-0.0515762344002... | |
id="ie8"><![endif]-->
<div id="top">
<div id="main">
<div id="content">
<div id="cc1" class="fake-content">cc1</div>
<div id="right"> | [
0.239827498793602,
-0.13481837511062622,
0.3571217358112335,
0.26566848158836365,
-0.09865459054708481,
-0.4825795590877533,
-0.1568017303943634,
0.0895487442612648,
-0.13850797712802887,
-0.20077145099639893,
-0.33839505910873413,
0.24890141189098358,
-0.11034458875656128,
0.1106295064091... | |
<div id="rc1" class="fake-content">rc1</div>
<div id="rc2" class="fake-content">rc2</div>
</div>
<div id="cc2" class="fake-content">cc2</div>
<div id="cc3" class="fake-content">cc3</div> | [
0.48924097418785095,
0.2654665410518646,
-0.02799057960510254,
0.33381929993629456,
-0.266756147146225,
-0.03410809114575386,
-0.008334188722074032,
-0.13487139344215393,
-0.3194223642349243,
0.10567838698625565,
-0.07078547030687332,
0.3275553584098816,
-0.15638886392116547,
0.09580048173... | |
</div>
<div id="left">
<div id="lc1" class="fake-content">lc1</div>
<div id="lc2" class="fake-content">lc2</div>
<div id="lc3" class="fake-content">lc3</div> | [
-0.3304206132888794,
-0.20243366062641144,
0.38313502073287964,
0.08168670535087585,
0.05177217349410057,
0.1773013323545456,
-0.17361211776733398,
-0.016476789489388466,
-0.3282984495162964,
-0.1696595996618271,
-0.39548590779304504,
0.3233496844768524,
-0.3370048403739929,
0.069404706358... | |
</div>
</div>
<p id="footer">©2009 Blah blah blah</p>
</div>
<!--[if IE]></div></div><![endif]-->
</body>
</html>
```
Specifying `position: relative` for `#top` fixes it in IE6, believe it or not.
See [this](http://www.satzansatz.de/cssd/onhavinglayout.html#rp), [the... | [
0.15430857241153717,
-0.16686920821666718,
0.7239476442337036,
0.047464679926633835,
-0.052379854023456573,
-0.1094675287604332,
0.3289909362792969,
-0.00022130418801680207,
-0.3251391351222992,
-0.4027504026889801,
-0.49520498514175415,
0.12501731514930725,
0.01136523112654686,
-0.0946258... | |
I am trying to do an ASP.net custom control for the [Flow Player](http://flowplayer.org/) flv player that has the swf object embedded. With [Steve Orr Controls](http://steveorr.net/) I learned that you can embed javascript files and register them so you don't have to always add the javascript files manually. I am wonde... | [
0.39512425661087036,
0.16154129803180695,
0.3930870294570923,
0.031757012009620667,
-0.15954382717609406,
-0.36437615752220154,
0.027803918346762657,
0.11142666637897491,
-0.25603505969047546,
-0.7978187799453735,
0.25313395261764526,
0.5761134028434753,
-0.3600730299949646,
0.010214311070... | |
urls but when I try to show the video in the rendered < A > tags as per instructions by the flowman site. Also I have been researching the other flv players available, still the question remains on how to embed the swf flash video player and using the webresource url.
In short what I am doing is the following:
```
... | [
0.09589438140392303,
-0.10642006248235703,
1.0380702018737793,
0.12205572426319122,
-0.3790566623210907,
-0.22019879519939423,
0.11501621454954147,
-0.31534984707832336,
-0.11807286739349365,
-0.6223108768463135,
-0.15540803968906403,
0.6463549733161926,
-0.5865496397018433,
0.229167208075... | |
As String
Protected Overrides Sub OnPreRender(ByVal e As System.EventArgs)
MyBase.OnPreRender(e)
If Me.DesignMode Then Exit Sub
Dim rstype As Type = Me.GetType
Dim rsname As String = "FlowMan_Helper.Resources.flowplayer-3.0.5.min.js"
' Register the client resource with th... | [
0.1552370935678482,
-0.21765510737895966,
0.8722370266914368,
-0.33966782689094543,
-0.14405366778373718,
0.0718182846903801,
0.47829878330230713,
-0.5597208142280579,
-0.2616037130355835,
-0.45536983013153076,
-0.21544009447097778,
0.3756847381591797,
-0.3729584217071533,
0.37180283665657... | |
'cs.RegisterClientScriptResource(rstype, "FlowMan_Helper.Resources.flowplayer-3.0.5.swf")
End Sub
Protected Overrides Sub Render(ByVal writer As System.Web.UI.HtmlTextWriter)
Dim htmlwrite As New System.Text.StringBuilder()
htmlwrite.Append("<a href=""http://blip.tv/file/get/KimAronson-TwentyS... | [
0.009540455415844917,
0.022480443120002747,
1.158160924911499,
-0.08672148734331131,
-0.3559013903141022,
0.15388207137584686,
0.5432687997817993,
-0.6203473806381226,
-0.3738093078136444,
-0.6147304177284241,
-0.40766441822052,
0.3221374452114105,
-0.35790035128593445,
0.1483668088912964,... | |
htmlwrite.Append(vbCrLf & "<script>")
htmlwrite.Append(vbCrLf & "HelloWorld();")
htmlwrite.Append(vbCrLf & "</script>")
' <script>
' flowplayer("player", "../flowplayer-3.0.5.swf");
'</script>
writer.Write(htmlwrite.ToString())
End Sub
Private Sub FlowMan... | [
-0.5073953866958618,
0.02732219360768795,
1.0252522230148315,
-0.2958504855632782,
-0.16733679175376892,
0.18195976316928864,
0.5390461087226868,
-0.34725168347358704,
-0.004098320379853249,
-0.8256744146347046,
-0.34912121295928955,
0.4170209467411041,
-0.45249417424201965,
0.157674461603... | |
flowPlayerJSPath = Page.ClientScript.GetWebResourceUrl(Me.GetType(), "FlowMan_Helper.Resources.flowplayer-3.0.5.min.js")
flowPlayerPath = ResolveClientUrl(flowPlayerPath)
End Sub
```
Did you make sure you marked the embedded resource as an "Embedded Resource" for the solution, so that it bundled it in wi... | [
-0.5365989208221436,
-0.1931373029947281,
0.7757430076599121,
-0.07723040133714676,
-0.2204040139913559,
-0.246477872133255,
0.37251776456832886,
-0.29238516092300415,
0.003963502589613199,
-0.7432422041893005,
-0.09344826638698578,
0.6662675142288208,
-0.44735151529312134,
-0.239282637834... | |
I saw the following line of code:
```
class Sample<T,U> where T:class where U: struct, T
```
In the case above, parameter `U` is *value type*, and it derives from *reference type* `T`.
How can that line be legal?
Also, if a value type inherits from a reference type, where is memory allocated: heap or stack?
Cont... | [
0.1022455170750618,
-0.11245451122522354,
-0.12297835201025009,
0.18083921074867249,
0.024608727544546127,
0.14408376812934875,
-0.02436046674847603,
-0.13340869545936584,
-0.08123858273029327,
-0.4769217073917389,
0.12623022496700287,
0.42828691005706787,
-0.38358184695243835,
0.337101250... | |
for example, T=IConvertible, U=System.Int32 works perfectly well.
I can't imagine this is a particularly common or useful constraint, but it's not *quite* as counterintuitive as it seems at first sight.
As to the more general point: as Obiwan Kenobi says, it all depends on your point of view. The CLI spec has quite a... | [
0.34065914154052734,
-0.060384564101696014,
-0.08532579988241196,
0.09021205455064774,
-0.11423099786043167,
-0.03336844965815544,
-0.23813310265541077,
-0.17875151336193085,
0.02012031152844429,
-0.3407661020755768,
-0.06220610812306404,
0.5051801800727844,
-0.31678226590156555,
0.2016489... | |
you're declaring a `struct` or an `enum`. It's somewhat confusing that both of these are, themselves, reference types... | [
0.5528047680854797,
0.2737680673599243,
0.07244444638490677,
0.06573061645030975,
-0.3635450303554535,
-0.2650173306465149,
0.080276258289814,
0.027872895821928978,
0.10462788492441177,
-0.5017315149307251,
-0.41554516553878784,
-0.09655927121639252,
-0.17956498265266418,
0.576769351959228... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.