text stringlengths 0 30.5k | title stringclasses 1
value | embeddings listlengths 768 768 |
|---|---|---|
Assume I have a user defined Java class called Foo such as:
```
public class Foo
{
private String aField;
@Override
public String toString()
{
return aField;
}
}
```
And a Collection such as:
```
List<Foo> aList;
```
What I am looking to do is to sort the List alphabetically based ... | [
0.06695667654275894,
-0.1379377543926239,
0.08817414939403534,
-0.18561038374900818,
0.2512287199497223,
0.011968054808676243,
-0.0346374437212944,
-0.28706109523773193,
-0.09890914708375931,
-0.5212823152542114,
0.03953414037823677,
0.6342692971229553,
-0.4667743146419525,
-0.134511053562... | |
c)`which specifies a comparator, and implement is as you wish.
Alternatively, if you do not specifically need a List, use a [`SortedSet`](http://java.sun.com/javase/6/docs/api/java/util/SortedSet.html), same goes with the comparator. | [
0.04537589102983475,
-0.02899940311908722,
0.21096040308475494,
-0.1251886785030365,
0.002855281112715602,
-0.014782803133130074,
-0.2742920219898224,
-0.2200097143650055,
-0.3418624997138977,
-0.4227774143218994,
-0.4588691294193268,
0.5500831007957458,
-0.61519455909729,
-0.1929031014442... | |
I created an XPCOM object in C++ for a FireFox extension. I'm using a worker thread to listen for an event and when it happens, I need to do stuff on the main thread. Obviously, I can't just sit and wait in JavaScript on the main thread because you need to be able to use the browser (my event happens very rarely).
I t... | [
0.5261803865432739,
0.0535292811691761,
0.46034660935401917,
-0.11535394191741943,
-0.08452344685792923,
-0.2769491374492645,
0.3002357482910156,
-0.15452736616134644,
-0.047336187213659286,
-0.5986055731773376,
0.016975093632936478,
0.827843427658081,
-0.516032338142395,
0.011061727069318... | |
around a bit or resize the window and then suddenly the function gets called. Like JavaScript suddenly woke up. I assume this is because it's happening in a thread.
Is there some better way for the worker to ask the main thread to do something?
Use the API `sort(List list, Comparator c)`which specifies a comparator, a... | [
0.3451165556907654,
-0.3927667737007141,
0.4781421422958374,
-0.203828826546669,
-0.2592499554157257,
0.1300911009311676,
0.03728397563099861,
-0.1900409460067749,
-0.4331706464290619,
-0.6349129676818848,
-0.20534154772758484,
0.4452584385871887,
-0.42705219984054565,
0.05081968382000923,... | |
I recently read [this article](http://vim.wikia.com/wiki/Indenting_source_code) related to indenting source files in Vim . However , I would like to be able to custom indent some of them . Is there a way to specify which binary runs when I press = ?
From the help:
```
={motion} Filter {motion} lines through the... | [
0.41774171590805054,
-0.34581851959228516,
0.559973955154419,
-0.03547806292772293,
-0.1581106036901474,
0.24024836719036102,
0.12866918742656708,
-0.3915463984012604,
-0.571357786655426,
-0.6090965270996094,
0.13873101770877838,
0.4539607763290405,
-0.4341900646686554,
-0.0265512540936470... | |
is the default), use the
internal formatting function |C-indenting|. But when
'indentexpr' is not empty, it will be used instead
|indent-expression|.
```
It looks like setting the `equalprg` option is what you want. | [
-0.17484541237354279,
-0.1997537463903427,
0.6784083843231201,
-0.18314367532730103,
0.005304369609802961,
-0.22382794320583344,
0.011691906489431858,
-0.22690021991729736,
-0.07465674728155136,
-0.28269055485725403,
-0.3321157693862915,
0.8676185607910156,
-0.3509562909603119,
-0.14206513... | |
I have a route table similar to this
```
// Allow browsing categories by name, instead of by ID.
routes.MapRoute("Categories", "Categories/{action}/{name}",
new { controller = "Categories", action = "Index", name = "" }
);
// All other pages use the default route.
routes.MapRoute("Default", "{controller}/{action}... | [
-0.005984889343380928,
-0.09044916182756424,
0.41364872455596924,
0.21438102424144745,
-0.014080443419516087,
-0.2108583003282547,
0.038466960191726685,
-0.2698530852794647,
-0.3352442979812622,
-0.8271786570549011,
-0.020245663821697235,
0.21515773236751556,
-0.3617916405200958,
0.0032720... | |
attemps the default route above the wildcard route... thus causing the infomous resource not found ASP.net error page... I want a custom error page... please help
I have used Scala on our existing Java infrastructure to query and manipulate large xml documents. Was not possible using the standard Java xml libraries or ... | [
0.11752299219369888,
0.004979821387678385,
0.20509351789951324,
0.3913183808326721,
-0.502383828163147,
0.03885016217827797,
0.4679197669029236,
-0.2914051413536072,
-0.06878356635570526,
-0.5119535326957703,
0.2674843370914459,
1.0412160158157349,
-0.3623378574848175,
-0.6095114350318909,... | |
Have no real experience with this, but it seems to be easier in Scala.
Point is, don't try to see it as a Java replacement for now, but use it where you can utilize it strenghts next to your existing Java code.
I used Intellij with the Scala plugin as an IDE, but it is not there yet. It is do-able in combination with... | [
0.28855833411216736,
-0.12221228331327438,
0.11543861776590347,
-0.05187627300620079,
-0.11039958149194717,
-0.1661808341741562,
0.04419079050421715,
0.3605178892612457,
-0.25714170932769775,
-0.9183412790298462,
0.0346255786716938,
0.6540761590003967,
-0.04867184907197952,
-0.087768286466... | |
community is growing again thanks to the Seaside framework, so you might want to return*
The things I learned or got a better understanding of:
* the use of constructors
* the immutable concept
* working with lists and recursion
* functional programming in general
So yes, I think it is worth it. | [
0.3949460983276367,
-0.1439056098461151,
0.1801491528749466,
-0.1535160392522812,
-0.10245749354362488,
-0.32650402188301086,
0.357350617647171,
0.32854050397872925,
-0.5507310628890991,
-0.6399692893028259,
0.237135112285614,
0.37336796522140503,
0.4670264422893524,
-0.1024942621588707,
... | |
I have the following class structure (abbreviated for sake of time, names changed) in my application. When I was writing the code I felt that the similarities between Action1 and Action2 should warrant some sort of generalization. I've provided the UML Class diagram with the relevant parts (except for the interfaces, w... | [
0.10920798778533936,
-0.08486481755971909,
0.36201971769332886,
-0.14534413814544678,
-0.3065844476222992,
0.14435313642024994,
0.247512549161911,
-0.2978992462158203,
-0.3829193413257599,
-0.796947717666626,
-0.03748695179820061,
0.5174733400344849,
-0.3927927613258362,
0.0258658807724714... | |
set; }
public Property2 { get; set; }
}
public IActor2
{
public Property3 { get; set; }
public Property2 { get; set; }
}
```
[Layered windows](http://msdn.microsoft.com/en-us/library/ms997507.aspx) (`WS_EX_LAYERED`) should do the job, keeping in mind that you must use [`UpdateLayeredWindow()`](http://msdn... | [
0.5536596775054932,
-0.1202390044927597,
0.3151535391807556,
-0.08711259067058563,
-0.10757573693990707,
-0.02454911172389984,
0.0363629050552845,
-0.33703887462615967,
-0.20644742250442505,
-0.5763945579528809,
-0.08771005272865295,
0.31900256872177124,
-0.5342700481414795,
-0.03711694851... | |
Is there a way to execute some Xpath code in a Selenium test? I know you can execute javascript, but I'm looking for a way to execute some Xpath code beyond simply locating an element on the page.
Anyone run into this?
I believe the accepted answer is incorrect. I am currently learning Selenium WebDriver with Java and... | [
0.4012409746646881,
0.024652833119034767,
0.13834528625011444,
0.22267556190490723,
-0.06536130607128143,
-0.1152849793434143,
0.2839423716068268,
-0.16836997866630554,
-0.11469782888889313,
-0.2993757426738739,
0.15584328770637512,
0.7120568156242371,
-0.1332351714372635,
-0.2755778133869... | |
I'm looking at the following apple example source code:
```
/*
Cache the formatter. Normally you would use one of the date formatter styles (such as NSDateFormatterShortStyle), but here we want a specific format that excludes seconds.
*/
static NSDateFormatter *dateFormatter = nil;
if (dateFormatter == nil) {
... | [
0.17234645783901215,
-0.04353925585746765,
0.43111303448677063,
-0.161458358168602,
-0.03398077189922333,
0.05907028913497925,
0.05502267926931381,
-0.2815002501010895,
-0.3659968674182892,
-0.412445992231369,
-0.07588542997837067,
0.174343541264534,
-0.17908090353012085,
0.110196411609649... | |
variables retain their assigned values over repeated calls to the function. They're basically like global values that are only "visible" to that function.
The initializer statement is only executed once however.
This code initializes dateFormatter to nil the first time the function is used. On every subsequent call t... | [
0.05621426925063133,
-0.3251008093357086,
0.5619286298751831,
-0.017832638695836067,
-0.09935881197452545,
-0.08753667026758194,
0.03467196971178055,
-0.04695449769496918,
-0.11844039708375931,
-0.30298444628715515,
0.05719393119215965,
0.6908372044563293,
-0.21494032442569733,
0.376267313... | |
have downsides too (in this example it's impossible to release the dateFormatter object for example).
Just a tip: Sometimes it can be educational to place a breakpoint in the code and have a look to see what's going on. As the complexity of your programs increase this will become an invaluable skill. | [
0.5310177803039551,
-0.20258840918540955,
0.15951217710971832,
0.4560394883155823,
0.30147626996040344,
-0.41432565450668335,
0.2876048684120178,
0.25594478845596313,
-0.22404909133911133,
-0.4588008224964142,
0.07686717063188553,
0.6314043998718262,
0.08195026218891144,
-0.122372381389141... | |
I'm writing my third app, and I already have an app in the App Store, but I still don't get this App ID business.
I created the App IDs for my first two applications like this:
```
XXXXXXXXXX.me.cbg.FirstApp
YYYYYYYYYY.me.cbg.SecondApp
```
but then Apple introduced the App ID wizard, which I used to create the App I... | [
0.3764476180076599,
0.3979496955871582,
0.5951023697853088,
0.011964239180088043,
-0.41656577587127686,
0.30602115392684937,
0.1543450653553009,
-0.32004255056381226,
-0.1059269979596138,
-0.7644475102424622,
0.19177980720996857,
0.7037491202354431,
-0.46676725149154663,
-0.026506133377552... | |
tradeoff between ease of management and allowing more granular management of certificates.
There two technical difference:
1. Applications with IDs that are
identical save from the top level
(e.g. com.mycompany.aaa and
com.mycompany.bbb) are able to
access each others saved data. If
you are writing a suite of
applica... | [
0.4164558947086334,
0.27609580755233765,
0.23121784627437592,
0.30123627185821533,
0.002801771042868495,
-0.31055450439453125,
0.05585581809282303,
-0.2571849524974823,
-0.19681814312934875,
-0.6493930220603943,
0.16447724401950836,
0.530657947063446,
-0.31957802176475525,
0.04625801369547... | |
that for each ID you'll probably have three individual certificates (dev/adhoc/appstore).
Background:
Every iPhone application must have a unique identifier and certificate. Developers can either create a certificate per application by using a complete name (e.g. com.mycompany.aaa), or they can create a wildcard cert... | [
0.4642372131347656,
0.3063484728336334,
0.5022495985031128,
0.21228501200675964,
0.29502424597740173,
-0.10217950493097305,
0.1379658281803131,
0.011487009935081005,
-0.4612947106361389,
-0.11729465425014496,
-0.32925155758857727,
0.19599393010139465,
-0.14522401988506317,
0.05990710482001... | |
What are the pros and cons of using EntityDataSource vs ObjectDataSource in Entity Framework asp.net based apps?
Basically [EntityDataSource](http://msdn.microsoft.com/en-us/library/cc488502.aspx "EntityDataSource") is build to support Entity Framework entities for features like sorting, filtering, inserting, deleting ... | [
0.001238150172866881,
-0.34126290678977966,
0.29691970348358154,
0.38017338514328003,
0.08553885668516159,
-0.17610721290111542,
-0.055044304579496384,
-0.07340367138385773,
-0.21363504230976105,
-0.6019870042800903,
-0.08668968826532364,
0.5897815823554993,
-0.23719848692417145,
0.1363467... | |
I have an operation contract (below) that I want to allow GET and POST requests against. How can I tell WCF to accept both types of requests for a single OperationContract?
```
[OperationContract,
WebInvoke(Method="POST",
BodyStyle = WebMessageBodyStyle.Bare,
RequestFormat = WebMessageFormat.Xml,
ResponseF... | [
0.08727788925170898,
0.12279299646615982,
0.6455859541893005,
-0.07763121277093887,
0.0017605583416298032,
0.2629459798336029,
0.19041591882705688,
-0.538154661655426,
-0.21434727311134338,
-0.43138229846954346,
0.03623250871896744,
0.5964537858963013,
-0.28346267342567444,
-0.026497732847... | |
now but if anyone else has any cleaner solutions let me know.
```
[OperationContract,
WebInvoke(Method="POST",
BodyStyle = WebMessageBodyStyle.Bare,
RequestFormat = WebMessageFormat.Xml,
ResponseFormat = WebMessageFormat.Xml,
UriTemplate = "query")]
XElement Query_Post(string qry);
[OperationContract,... | [
0.3782501518726349,
0.02514110691845417,
0.7516154646873474,
0.10091494023799896,
-0.011937471106648445,
-0.0014971101190894842,
0.44059517979621887,
-0.3744230270385742,
-0.07924611121416092,
-0.7103836536407471,
-0.2619204819202423,
0.6682736277580261,
-0.3398037850856781,
0.207674860954... | |
*I'm developing a application that needs storing secrets in a database.*
I need a portable database (like Firebird, Sqlite, etc) where the data will be stored encrypted or password protected or both...
*Let's take **as example** that I want create a password manager.* I will need store that passwords in a database. I... | [
0.5048125982284546,
0.28466084599494934,
-0.1129462718963623,
0.32407721877098083,
0.03689996153116226,
-0.28052449226379395,
0.20773063600063324,
0.2616463899612427,
-0.3219746947288513,
-0.6730903387069702,
0.09098371118307114,
0.5585716366767883,
-0.09809567034244537,
0.1456731110811233... | |
[sqlite-crypt](http://sqlite-crypt.com/documentation.htm). Which should be your best bet. sqlite db with all data on disk encrypted. | [
0.1921369880437851,
0.08171934634447098,
0.28267332911491394,
0.2969452738761902,
-0.21080097556114197,
-0.4127909243106842,
0.2545546293258667,
0.06541600823402405,
-0.17297914624214172,
-0.15062901377677917,
-0.3657817244529724,
0.5594707727432251,
-0.1465637981891632,
0.0754919424653053... | |
Are there possibility to set breakpoint (as i see Data Breakpoint) in VS 2005(C++) on Floating Point codes(ST0-ST7) changing? For example on changing of value ST7 with condition ST7==INF. Thanks a lot.
There is a project called [sqlite-crypt](http://sqlite-crypt.com/documentation.htm). Which should be your best bet. sq... | [
0.07590339332818985,
-0.12239459902048111,
0.17422538995742798,
0.2400088906288147,
-0.34025073051452637,
-0.2473018914461136,
0.18915574252605438,
-0.11429590731859207,
-0.41812241077423096,
-0.16872908174991608,
0.14049047231674194,
0.6883333325386047,
-0.17996729910373688,
0.08331607282... | |
I have various objects whose surfaces are 3D and non rectangular, such as spheres, pyramids, and various other objects represented by meshes. The mesh is not composed of polygons of equal size and distribution across the surface of the object, nor are they all semi/symmetrical objects like the ideal shapes of cylinders... | [
0.4074525833129883,
0.2527492940425873,
0.031376808881759644,
0.45018669962882996,
-0.05667134374380112,
0.1984502375125885,
0.012873844243586063,
0.0348263718187809,
-0.17305651307106018,
-0.7552531361579895,
0.08665679395198822,
0.21892470121383667,
-0.18453839421272278,
0.26551866531372... | |
ways to generate multiresolution grid decompositions, label cells as "free" or "collision" and search the resulting grid using something like A\* (as [Theran](https://stackoverflow.com/questions/555104/pathfinding-on-arbitrary-non-rectangular-bodies/555240#555240) mentions).
In general, you may need to use more power... | [
0.22010381519794464,
-0.19700922071933746,
0.2949945628643036,
0.531561017036438,
-0.1428900957107544,
-0.11883057653903961,
-0.16400615870952606,
-0.4974323511123657,
-0.7301615476608276,
-0.6677872538566589,
-0.018431762233376503,
0.23263056576251984,
-0.08623101562261581,
0.077390536665... | |
What is the fastest-track set of resources for a C# developer wishing to hit the ground running in an enterprise-class Java team?
I would suggest the following books:
* [Java Enterprise in a nutshell, O'Reilly](https://rads.stackoverflow.com/amzn/click/com/0596101422)
* [Effective Enterprise Java](https://rads.stackov... | [
0.05522171035408974,
0.1788705736398697,
-0.14717862010002136,
-0.022227268666028976,
-0.011533398181200027,
-0.23281508684158325,
0.21574315428733826,
-0.09097538143396378,
-0.22455397248268127,
-0.758232057094574,
0.19923365116119385,
0.7751497030258179,
-0.04821055382490158,
-0.39021015... | |
does guide you for most of the way. | [
-0.02868795022368431,
0.224966898560524,
0.2489178329706192,
0.039292111992836,
0.23166246712207794,
-0.26091909408569336,
0.46524882316589355,
0.45337826013565063,
0.14354988932609558,
-0.43318814039230347,
0.11549079418182373,
0.3117144703865051,
0.5527923703193665,
-0.05342723801732063,... | |
edit: Initially I was trying to be general but it came out vague. I've included more detail below.
I'm writing a script that pulls in data from two large CSV files, one of people's schedules and the other of information about their schedules. The data is mined and combined to eventually create pajek format graphs for... | [
0.41881945729255676,
-0.15159821510314941,
0.5785934925079346,
0.28168776631355286,
-0.06379877775907516,
0.2632192373275757,
0.08410180360078812,
0.04874185472726822,
-0.5856443047523499,
-0.6521565914154053,
0.16186796128749847,
-0.06613428145647049,
-0.3248301148414612,
0.17201231420040... | |
used by a seperate program written by another researcher.
Pajek format has a large header, and then lists connections as (vertex1 vertex2) unordered pairs. It's difficult to store these pairs in a dictionary, because there are often multiple connections on the same day between two pairs.
I'm wondering what the best w... | [
0.08554749190807343,
-0.05802256986498833,
0.04613320156931877,
0.013836507685482502,
-0.2675558626651764,
0.14420369267463684,
0.28385454416275024,
0.049741894006729126,
-0.36687493324279785,
-0.7694875597953796,
-0.06830362975597382,
-0.03166180104017258,
-0.5234197974205017,
0.176495552... | |
output them when I can (like a queue)?
I would suggest the following books:
* [Java Enterprise in a nutshell, O'Reilly](https://rads.stackoverflow.com/amzn/click/com/0596101422)
* [Effective Enterprise Java](https://rads.stackoverflow.com/amzn/click/com/0321130006)
* [Java Enterprise best practices, O'Reilly](https://... | [
0.3505256474018097,
-0.07735292613506317,
0.12711849808692932,
-0.04654212296009064,
-0.21461641788482666,
-0.09478186070919037,
0.32187819480895996,
0.09198137372732162,
-0.15397033095359802,
-0.8951604962348938,
-0.12254973500967026,
0.7076156735420227,
-0.0805337205529213,
-0.3158511221... | |
I have a function that exports values into a CSV file, but the "comments" field has commas in it and it messes up the columns when you open it in a spreadsheet program.
Is there a way around exporting it properly?
```
//this exports only names and comments into a CSV file
function exportNamesCommentsCSV($table, $colu... | [
0.2454608678817749,
0.3342823386192322,
0.5811087489128113,
-0.21600817143917084,
-0.07698451727628708,
0.14182035624980927,
0.23284980654716492,
-0.29086706042289734,
-0.25359904766082764,
-0.6336199641227722,
-0.041447024792432785,
0.2234422117471695,
-0.28227299451828003,
0.114236243069... | |
while ($row = mysql_fetch_assoc($result)) {
$csv_output .= $row['Field'].", ";
$i++;
}
}
$csv_output .= "\n";
$values = mysql_query("SELECT lname, fname, email, comments FROM ".$table."");
while ($rowr = mysql_fetch_row($values)) {
for ($j=0;$j<$i;$j++) {
... | [
-0.46547749638557434,
-0.1741449236869812,
0.8598498106002808,
-0.33447209000587463,
0.07586931437253952,
0.42230501770973206,
0.24435009062290192,
-0.34939077496528625,
-0.3910137414932251,
-0.12745670974254608,
-0.5250105857849121,
0.4050105810165405,
-0.43848320841789246,
-0.06092117726... | |
}
$csv_output .= "\n";
}
$filename = $file."_".date("Y-m-d_H-i",time());
header("Content-type: application/vnd.ms-excel");
header("Content-disposition: csv" . date("Y-m-d") . ".csv");
header( "Content-disposition: filename=".$filename.".csv");
print $csv_output;
exit;
}
```
EDIT: ... | [
-0.03532911092042923,
0.3257402777671814,
0.51838618516922,
-0.056620705872774124,
0.12174946814775467,
-0.027154002338647842,
0.2386307418346405,
-0.2112714648246765,
-0.23479926586151123,
-0.4661102890968323,
-0.3401913642883301,
0.3358747363090515,
-0.48110395669937134,
0.26409015059471... | |
in the values, and numeric values will also still work fine.
To put a quote in the value, however, you need to put two quotes together. E.g. representing this string:
```
Bobby says, "Hi!"
```
it will need to be represented as
```
"some value","Bobby says, ""Hi!""","Some other value"
```
You can do this with:
`... | [
0.33078351616859436,
0.4092574417591095,
0.5241796374320984,
-0.07128749042749405,
0.14698359370231628,
0.06275613605976105,
0.17046396434307098,
-0.18544290959835052,
-0.08118902891874313,
-0.28383517265319824,
-0.22879160940647125,
0.4100799858570099,
-0.3708420395851135,
0.0337252877652... | |
I'am unclear as to what the roles and responsibility of the factory class is. I know enough that the factory class should be resposible for the creation of domain objects (aggregate root) along with its associated entities and value objects.
But what is not clear to me is where the factory "layer" lies with a DDD arch... | [
0.3664833605289459,
0.23627403378486633,
0.14532622694969177,
0.009849407710134983,
-0.06192166730761528,
0.2955057919025421,
0.38765600323677063,
-0.08434412628412247,
-0.2415047436952591,
-0.6307014226913452,
-0.20272569358348846,
0.3874936103820801,
-0.401083379983902,
0.582106113433837... | |
for object creation would'nt you get circular references if you wanted to create your objects in your data and service layers?
If the role of the factory class is for object creation then what benefits does the service layer have?
I've asked a lot of questions and appreciate any response. What i'am lacking is a sampl... | [
0.3921673595905304,
0.16873952746391296,
0.05025927349925041,
0.23267461359500885,
-0.22606393694877625,
0.15792709589004517,
0.0534222237765789,
-0.021903151646256447,
-0.29217249155044556,
-0.6753713488578796,
0.21184638142585754,
0.4846850335597992,
-0.34233248233795166,
0.5307065844535... | |
the repository
> to get its data or the service
> library?
The factory should be the one-stop shop to construct domain objects. Any other part of the code that needs to do this should use the factory.
Typically, there are at least three sources of data that are used as input into a factory for domain object constru... | [
0.5437038540840149,
0.16195151209831238,
0.08097020536661148,
-0.05319926142692566,
-0.14132779836654663,
0.04083508998155594,
0.22533084452152252,
-0.16156861186027527,
-0.2893131673336029,
-0.5028959512710571,
-0.0019641558174043894,
0.27337250113487244,
-0.3913590908050537,
0.3023052215... | |
started realizing that it [doesn't mix too well with DDD factories](http://moffdub.wordpress.com/2009/02/22/i-suffer-from-ocd-odorless-code-dreamer/).
```
// domain layer
class Order
{
private Integer ID;
private Customer owner;
private List<Product> ordered;
// can't be null, needs complicated rules... | [
0.28368309140205383,
-0.04932577908039093,
0.48342272639274597,
-0.46939975023269653,
0.033575672656297684,
0.20587606728076935,
0.20372283458709717,
-0.10206456482410431,
-0.2978634834289551,
-0.5404764413833618,
-0.31846410036087036,
0.4964640736579895,
-0.5781604051589966,
0.35558423399... | |
logic methods here ...
interface Importer
{
Integer importID();
Customer importOwner();
Product importOrdered();
}
interface Exporter
{
void exportID(Integer id);
void exportOwner(Customer owner);
void exportOrdered(Product ordered);
}
}
// doma... | [
-0.07415854930877686,
-0.3774852454662323,
0.7362356781959534,
-0.03899585083127022,
-0.19087804853916168,
0.2849509119987488,
-0.08251193165779114,
-0.0830703154206276,
-0.1101522445678711,
-0.8225401639938354,
-0.17137210071086884,
0.5838518142700195,
-0.3074611723423004,
0.3736338317394... | |
dto) { ... }
}
// App Layer
class OrderEntryDTO implements OrderEntryScreenExport { ... }
```
Here is what the OrderFactory might look like:
```
interface OrderFactory
{
Order createWith(Customer owner, Product ordered);
Order createFrom(OrderEntryScreenExport to);
Order createFrom(List<String> resultSe... | [
0.29556089639663696,
-0.20003056526184082,
0.779643714427948,
-0.3427075147628784,
-0.013290269300341606,
0.5006396770477295,
0.2560875713825226,
-0.4388430118560791,
-0.09371393918991089,
-0.7089084386825562,
-0.27494317293167114,
0.5879231095314026,
-0.3460861146450043,
0.143307581543922... | |
returnList.add(this.orderFactory.createFrom(row));
return returnList;
}
```
In your application layer:
```
public void submitOrder(OrderEntryDTO dto)
{
Order toBeSubmitted = this.orderFactory.createFrom(dto);
this.orderRepo.add(toBeSubmitted);
// do other stuff, raise events, etc
}
```
Within yo... | [
0.17739270627498627,
0.1476687639951706,
0.7997270226478577,
-0.24613668024539948,
-0.044158175587654114,
0.35758113861083984,
0.37853631377220154,
-0.8578798770904541,
-0.3067202866077423,
-0.2768370509147644,
-0.4437779188156128,
0.42413362860679626,
-0.2553681433200836,
0.19700033962726... | |
to create your objects
> in your data and service layers?
In my example, all dependencies flow from top to bottom. I used the [Dependency Inversion Principle](http://www.objectmentor.com/resources/articles/dip.pdf) (PDF link) to avoid the problem you speak of.
> If the role of the factory class is
> for object crea... | [
0.4782586097717285,
-0.16881825029850006,
0.10219980776309967,
0.13742582499980927,
-0.0670221745967865,
0.1165567934513092,
0.33947989344596863,
-0.16931553184986115,
-0.422123521566391,
-0.6413325071334839,
-0.06341870129108429,
0.4715837240219116,
-0.5575894117355347,
0.3189199268817901... | |
does fit.
In the example I scribbled here, I imagine that coming up with an Itinerary for the Order would involve multiple domain objects. The OrderFactory could delegate to such a service.
BTW, the hierarchy you described should probably be UI > App > Domain Services > Domain > Infrastructure (Data)
> I've asked a... | [
0.2971298396587372,
0.03976234793663025,
0.10776879638433456,
0.2137473225593567,
0.04731116071343422,
0.02175120823085308,
0.3082157373428345,
-0.2994702458381653,
-0.4952124357223511,
-0.7772513628005981,
0.01639859564602375,
0.02970770001411438,
-0.26928994059562683,
0.10321259498596191... | |
a great compliment to Eric Evans' [Domain-Driven Design](https://rads.stackoverflow.com/amzn/click/com/0321125215). It has lots of code examples, though I don't know if there is an emphasis on layering. Layering can be tricky and is almost a topic separate from DDD.
In the Evans book, there is a very small example of ... | [
0.2341519296169281,
0.07882063090801239,
-0.02462945692241192,
0.049033015966415405,
-0.027843257412314415,
-0.29321178793907166,
-0.08950728178024292,
0.08494193851947784,
-0.3740679621696472,
-0.6695119142532349,
-0.04341241344809532,
0.18913224339485168,
-0.3985147774219513,
0.004504905... | |
The default behavior of a WPF `ContextMenu` is to display it when the user right-clicks. I want the `ContextMenu` to show when the user left-clicks. It seems like this should be a simple property on `ContextMenu`, but it is not.
I rigged it, so that I handle the `LeftMouseButtonDown` event in the code-behind and then ... | [
0.03332551568746567,
-0.3205876350402832,
0.5521957874298096,
-0.23388352990150452,
0.017394782975316048,
-0.38633641600608826,
0.3098844587802887,
-0.512653112411499,
-0.254147469997406,
-0.511587917804718,
-0.12284862250089645,
0.8196230530738831,
-0.2839701175689697,
0.00859297439455986... | |
or properties in the XAML.
Any ideas or solutions to this issue?
What I would suggest doing is making a new static class with attached DependencyProperty. Call the class LeftClickContextMenu and the property Enabled (just ideas). When your registering the DependencyProperty add an on changed callback. Then in the pro... | [
0.26346054673194885,
-0.11088400334119797,
0.4092889726161957,
0.004657062701880932,
0.15099534392356873,
-0.14054818451404572,
0.09373755753040314,
-0.12343434244394302,
-0.13849346339702606,
-0.7786630392074585,
-0.2521640658378601,
0.7377867698669434,
-0.3097352087497711,
0.111629895865... | |
/>
```
This technique is called an attached behavior and you can read more about it in this code project article: <http://www.codeproject.com/KB/WPF/AttachedBehaviors.aspx> | [
0.43598952889442444,
-0.06339700520038605,
0.15001314878463745,
0.013675623573362827,
-0.07890000194311142,
-0.1646040678024292,
0.23971547186374664,
-0.05688896402716637,
-0.2436670958995819,
-0.2099698781967163,
-0.3559548556804657,
0.3635181486606598,
-0.25047773122787476,
0.31667575240... | |
Search for a term on amazon.com, for example "stack overflow", and the search results come back very quickly.
On the left hand side of the window, there is a faceted search that shows in certain categories, the count of products that match that term.
You can then drill into those terms. For example, there are 1094 bo... | [
0.2614886164665222,
0.06414791941642761,
0.4326379895210266,
0.49942484498023987,
-0.05052521452307701,
-0.15894286334514618,
-0.014151261188089848,
0.025020454078912735,
-0.3869363069534302,
-0.4356946349143982,
-0.10602188855409622,
0.35643184185028076,
0.047610510140657425,
0.5139604806... | |
each node knows about a few products?
Incidentally, I saw that "stack overflow" appears in the text of "Soul of a New Machine", a book I remember from 1981
The short answer is, a lot of indexing.
The longer answer is, a lot of indexing, a lot of redundancy, a lot of caching, and smart partitioning.
The real answer is... | [
-0.196474090218544,
0.2035577893257141,
0.316057413816452,
0.26271772384643555,
0.22465699911117554,
-0.1746336817741394,
-0.017219163477420807,
0.08231031149625778,
-0.32173216342926025,
-0.5415366888046265,
-0.1722009778022766,
0.15286670625209808,
-0.18695078790187836,
0.241932466626167... | |
I have been using jQuery IntelliSense in VS2008 and it has been great. Recently I added a reference to jQuery UI and since then, the jQuery IntelliSense has went away. I found that once you reference another .js file in your document, the IntelliSense goes away. Any way to avoid this?
If there are errors in any refernc... | [
0.08991344273090363,
-0.18026404082775116,
0.5402024388313293,
-0.011961550451815128,
-0.3164975047111511,
-0.19292938709259033,
0.2277509719133377,
0.298523873090744,
-0.04733889549970627,
-0.7898468375205994,
0.1258751004934311,
0.6375307440757751,
-0.1829448789358139,
0.1608300358057022... | |
we prevented us from making VS9 external references more robust.
In the meantime, use the following workaround. Install SP1 from the link Slace gave you. If you have a reference a file named .js and there is a file named -vsdoc.js in the same location, then JS intellisense will pick up the -vsdoc version. If that scri... | [
0.1477084457874298,
-0.16551555693149567,
0.7193349599838257,
0.21626421809196472,
-0.1405337005853653,
-0.30908018350601196,
0.1866959184408188,
-0.06182030588388443,
-0.13798415660858154,
-0.9567608833312988,
-0.09475166350603104,
0.5454540252685547,
-0.4465337097644806,
0.01212413515895... | |
work.
Anything you put in the vsdoc version will show up in intellisense. You could put spoofed versions of the data structures that you want to display in intellisense if you want to. | [
0.6452155709266663,
-0.4128530025482178,
0.3999652862548828,
0.3978428244590759,
0.16411292552947998,
-0.5734725594520569,
0.04005160182714462,
0.3774043023586273,
-0.293846070766449,
-0.881308376789093,
-0.1892722249031067,
0.5828572511672974,
-0.28357842564582825,
-0.1239883229136467,
... | |
I have my config.inc.php file, and have set my host name to localhost. Unfortunately, I have no idea what my username/password should be. Is that something I need to configure on the MySql side? I tried creating an arbitrary username/password (admin/password), but when I try to log into phpMyAdmin with those credential... | [
0.10177083313465118,
0.15261483192443848,
0.4665469825267792,
0.18742169439792633,
0.02796311303973198,
-0.17443880438804626,
0.5626614689826965,
0.5330905318260193,
-0.19507546722888947,
-0.9630647897720337,
0.18744051456451416,
0.3053639829158783,
0.19033508002758026,
0.2983924448490143,... | |
have the default privileges in mysql, and how to change them.
<http://dev.mysql.com/doc/refman/5.0/en/default-privileges.html> | [
0.2921775281429291,
-0.1208774521946907,
0.44212931394577026,
0.22220490872859955,
0.07343501597642899,
-0.44608554244041443,
-0.16399215161800385,
0.2474212646484375,
-0.34879663586616516,
-0.48690783977508545,
-0.3771888315677643,
0.565735399723053,
0.23648490011692047,
-0.03448107466101... | |
What is the common theory behind thread communication? I have some primitive idea about how it should work but something doesn't settle well with me. Is there a way of doing it with interrupts?
Really, it's just the same as *any* concurrency problem: you've got multiple threads of control, and it's indeterminate which ... | [
0.25725969672203064,
0.18983866274356842,
-0.0979171097278595,
0.16897626221179962,
0.017684608697891235,
-0.11985436826944351,
0.41714125871658325,
0.1643476039171219,
-0.6612732410430908,
-0.21580290794372559,
0.33423784375190735,
0.32741978764533997,
-0.46490222215652466,
0.429474353790... | |
processes" in the old days.) That happens when there are shared memory areas,
To ensure correctness, what you need to do is ensure that these data areas get updated in a way that can't cause errors. To do this, you need to identify "critical sections" of the program, where sequential operation must be guaranteed. Thos... | [
0.11275950074195862,
0.36992982029914856,
-0.03634766489267349,
0.3854876160621643,
0.3333783447742462,
0.10377968102693558,
0.31541842222213745,
-0.1435079425573349,
-0.8260156512260437,
-0.6013022065162659,
-0.17285294830799103,
0.22160017490386963,
-0.16940559446811676,
0.17698764801025... | |
to use a *semaphore*, which is an atomic statement that only allows one thread of control past at a time. These were invented by Edsgar Dijkstra, and so have names that come from the Dutch, *P* and *V*. When you come to a *P*, only one thread can proceed; all other threads are queued and waiting until the executing thr... | [
0.3519609570503235,
-0.024051178246736526,
-0.017594385892152786,
0.07868866622447968,
0.12636275589466095,
0.14005102217197418,
0.2172929346561432,
-0.31440383195877075,
-0.3995704650878906,
-0.3890686333179474,
-0.006250630132853985,
0.19942669570446014,
-0.557847261428833,
0.07118079066... | |
has operations which are guaranteed atomic; they can be implemented with semaphores. Monitors are pretty much what Java `synchronized` statements are based on; they make an object or code block have that particular behavir -- that is, only one thread can be "in" them at a time -- with simpler syntax.
There are other m... | [
0.07404884696006775,
-0.10786784440279007,
0.08452145755290985,
0.02195669151842594,
-0.10253358632326126,
-0.3507370352745056,
0.224476620554924,
0.16710186004638672,
-0.378863126039505,
-0.3008808493614197,
-0.1571020483970642,
0.23337098956108093,
-0.6040341258049011,
-0.151680335402488... | |
means that when there *is* an assignment, you're guaranteed the assignment is atomic and reversible.
So that's it in a nutshell. To really learn about it, the best places to look at Operating Systems texts, like, eg, [Andy Tannenbaum's text](https://rads.stackoverflow.com/amzn/click/com/0136006639). | [
0.1587708741426468,
0.16546516120433807,
-0.12206929922103882,
0.34107705950737,
0.47195830941200256,
-0.5044714212417603,
0.24546223878860474,
0.05453990772366524,
-0.5005950927734375,
0.10933408886194229,
-0.36218082904815674,
0.43306469917297363,
-0.18311874568462372,
-0.143758222460746... | |
Is it possible to dynamically define methods in Objective-C like we would in Ruby?
```
[:failure, :error, :success].each do |method|
define_method method do
self.state = method
end
end
```
Actually it is possible to do this, although it's not supported by the obj-c syntax, the obj-c runtime provides functions ... | [
-0.06982489675283432,
-0.09209288656711578,
0.13582901656627655,
0.0024356881622225046,
-0.07055836915969849,
0.040892280638217926,
0.2387559711933136,
-0.11936885118484497,
-0.38262465596199036,
-0.4702404737472534,
0.14852118492126465,
0.5635119676589966,
-0.5317491292953491,
-0.11374840... | |
SEL cmd, NSString* message)
{
NSLog(message);
return nil;
}
int main(int argc, char *argv[])
{
class_addMethod([MyClass class], @selector(newMethod:), (IMP)myMethod, "v@:#");
[[[MyClass alloc] init] newMethod:@"Hello World"];
return 0;
}
```
Now strictly speaking i think `myMethod` should be var... | [
-0.018874147906899452,
0.1949426829814911,
0.2852551341056824,
-0.2732739746570587,
-0.11041967570781708,
0.014174902811646461,
0.5973045229911804,
0.06598984450101852,
-0.13108287751674652,
-0.8094176650047302,
-0.3264352083206177,
0.44909825921058655,
-0.32812654972076416,
0.275863826274... | |
how do i define the success and failure function of an ajax $.post?
The documentation is here: <http://docs.jquery.com/Ajax/jQuery.ajax>
But, to summarize, the ajax call takes a bunch of options. the ones you are looking for are error and success.
You would call it like this:
```
$.ajax({
url: 'mypage.html',
suc... | [
-0.019555941224098206,
0.1453108936548233,
0.2859426736831665,
0.11338057368993759,
-0.3931232690811157,
-0.0059533147141337395,
0.12052880227565765,
-0.0818716287612915,
-0.00878723245114088,
-0.7037110328674316,
-0.005633722059428692,
0.6929882764816284,
-0.1263577938079834,
-0.089118197... | |
requested will be in the data argument. | [
0.04278748854994774,
0.037278350442647934,
0.7216051816940308,
0.25781136751174927,
0.3061051070690155,
-0.022189920768141747,
-0.44809985160827637,
-0.4300854206085205,
0.13476961851119995,
-0.4244455099105835,
-0.579537034034729,
0.44139066338539124,
0.28178656101226807,
0.08029973506927... | |
Is there a way without looping all the IEnumerable to get back the data inside the object (that inherited BindingList)?
```
MyListObject--> Transformed with Linq --> Back the data inside MyListObject
```
I know that I can do .ToList but it doesn't do what I would like.
Any idea? Thank :)
I'm not sure exactly what y... | [
0.3925924599170685,
0.03802317753434181,
0.4315463900566101,
0.12603802978992462,
-0.09618440270423889,
-0.2950010895729065,
-0.004988911096006632,
-0.5207286477088928,
-0.09902641922235489,
-0.6262096166610718,
0.03565745800733566,
0.44760850071907043,
-0.5389459133148193,
0.0499934777617... | |
something similar to this:
```
public class MyListObject<T> : BindingList<T>
{
public MyListObject() : base() { }
public MyListObject(IList<T> list) : base(list) { }
}
// ...
MyListObject<int> yourList = new MyListObject<int> { 1, 2, 3, 4, 5 };
yourList = new MyListObject<int>(yourList.Select(s => s * 2).ToL... | [
0.06371282786130905,
-0.15420539677143097,
0.5899136066436768,
-0.3306938409805298,
0.19520696997642517,
0.07710469514131546,
0.019040165469050407,
-0.3275447189807892,
-0.3865380883216858,
-0.797338604927063,
-0.31387534737586975,
0.4089556634426117,
-0.45414048433303833,
0.13776670396327... | |
I'm writing a program that downloads information from the web and part of that is images.
At the moment I'm having a problem as the code to download the images is a different part to the code that displays them (under mvc). If a 404 is issued or the image download fails some way the display code pops a message propmt... | [
0.6180602312088013,
0.17454373836517334,
0.422765851020813,
0.25540730357170105,
-0.1884126216173172,
-0.45554715394973755,
0.24219214916229248,
0.26929426193237305,
-0.3058156669139862,
-0.6061779260635376,
0.03932884335517883,
0.5689946413040161,
-0.24323439598083496,
0.08016297221183777... | |
to see if it is valid image format.
Do you want to check whether the download would be successful? Or do you want to check that what is downloaded is, in fact, an image?
In the former case, the only way to check is to try to access it and see what kind of HTTP response code you get. You can send an HTTP `HEAD` request... | [
0.6330913305282593,
-0.2449301779270172,
0.5901386737823486,
0.49624764919281006,
-0.12491955608129501,
-0.1882823258638382,
0.04815762862563133,
-0.04187016189098358,
-0.3963090181350708,
-0.5687481760978699,
-0.04696730151772499,
0.6813206076622009,
-0.08211158961057663,
-0.1174804121255... | |
of time (and bandwidth).
Alternatively, if you really want to check that what you're downloading is a valid image file, you have to read the whole file to check it for corruption. But if you just want to check that the file extension is accurate, it should be enough to check the first few bytes of the file. All GIF im... | [
0.417664498090744,
-0.15442238748073578,
0.7202961444854736,
0.35462790727615356,
-0.18888433277606964,
-0.03797151893377304,
-0.2115684300661087,
0.06920599937438965,
-0.26365742087364197,
-0.6280003786087036,
-0.5058193206787109,
0.4329438805580139,
-0.2699791491031647,
0.166473627090454... | |
looked at. (You should do some research and check that, try Wikipedia for links) Keep in mind, though, that to get even the first few bytes of the image, you will need to send an HTTP request which could return a 404 (and in that case you don't have any image to check). | [
0.305795282125473,
-0.10193748027086258,
0.3150893747806549,
0.3813958466053009,
-0.10127224773168564,
-0.13064761459827423,
0.24848419427871704,
0.43320560455322266,
-0.46277689933776855,
-0.696022093296051,
0.007148335222154856,
0.3292113244533539,
0.06822697818279266,
-0.023249957710504... | |
I'm looking for a reliable 3D scenegraph API for Java with good documentation, an active community and a license that allows for commercial use.
I ruled out [com.sun.scenegraph](https://scenegraph.dev.java.net/) because it's GPL (and seemingly dead), Java3D because of [this](https://java3d.dev.java.net/servlets/NewsIt... | [
0.2431141585111618,
0.07912790030241013,
0.504787027835846,
-0.12733601033687592,
-0.19894006848335266,
-0.10327167063951492,
0.1974831372499466,
0.11332786828279495,
-0.17657852172851562,
-0.7561966776847839,
0.03387272357940674,
0.42606765031814575,
-0.38795995712280273,
0.17396163940429... | |
I'm running windows vista and want to get the appearance to look like regular vista programs. Are there any really good tutorials/articles on how to build Vista Style apps? I would also like to learn how to use the native code and convert it to C# like in [this](http://bartdesmet.net/blogs/bart/archive/2006/09/26/4470.... | [
0.6595064997673035,
0.34602317214012146,
0.35787707567214966,
-0.07915417850017548,
-0.010271799750626087,
0.03169221058487892,
-0.027030903846025467,
-0.1823180764913559,
-0.10666031390428543,
-0.8987605571746826,
0.21705235540866852,
0.6064817309379578,
-0.0671520084142685,
-0.2442465126... | |
Common Open and Save dialogs,
> Application Recovery and Restart,
> Known Folders, Network Lists, Power
> Management, User Account Control,
> CommandLink control, Aero Wizard
> Control, System provided icons etc.
Additionally, you can check out **[Aero.Controls](http://factormystic.net/projects/code/aero.controls... | [
0.1008416935801506,
0.10380876809358597,
0.0726437121629715,
0.4130455255508423,
0.15344636142253876,
-0.195981964468956,
-0.0034245240967720747,
-0.3126000761985779,
0.05977724492549896,
-0.7468966245651245,
-0.09256497025489807,
0.7614949941635132,
-0.16098599135875702,
-0.13580644130706... | |
I want to use CURL library but I don't want to install it in a hard way
I just want to do something like this
```
require_once('curl.php');
```
I am not sure if this possible or not? and where can I found this CURL class?
thanks
PHP requires that its built with the cURL library, see:
<http://www.php.net/manual/en... | [
0.4799570143222809,
0.12872609496116638,
0.39420127868652344,
-0.027723316103219986,
-0.15562623739242554,
-0.45444056391716003,
0.11392626911401749,
-0.08542235195636749,
0.06074661388993263,
-0.7744698524475098,
0.07046385854482651,
0.5667271614074707,
-0.46574321389198303,
-0.0400053970... | |
i start out by querying an exchange server 2003 with:
```
POSH>get-wmiobject -class Exchange_mailbox -namespace Root\MicrosoftExchangeV2 -server srv02
```
to get the users. One of the properties available is the mailboxguid. so for testing, I run
```
POSH> get-qaduser -identity <mailboxguid>
```
however it do... | [
-0.05253178998827934,
0.22117404639720917,
0.45285555720329285,
-0.13123995065689087,
-0.3615855574607849,
-0.1505729705095291,
0.08573059737682343,
0.07400216162204742,
0.23428437113761902,
-0.9861509799957275,
0.3941897749900818,
0.4352523684501648,
-0.38263335824012756,
0.25516244769096... | |
What is the difference between
```
private void DoSomething(int value) {
value++;
}
```
and
```
private int DoSomething(int value) {
return value++;
}
```
when used as either
```
DoSomething(value);
```
versus
```
value = DoSomething(value);
```
You are talking about the difference between **passing b... | [
0.3350830674171448,
-0.23489905893802643,
0.2684633731842041,
-0.18206234276294708,
-0.05489242449402809,
-0.019406717270612717,
0.3459641933441162,
-0.6131161451339722,
-0.05473155900835991,
-0.7005324363708496,
0.21179883182048798,
0.6364158987998962,
-0.3503151834011078,
0.2687178254127... | |
unchanged.
However, if you are passing in something other than a value type (say object foo), you are actually **passing a reference** to the original object. Anything you do to it inside DoSomething() will take effect outside the method as well, since you are still referring to the same object.
You can accomplish wh... | [
0.16400757431983948,
-0.2791341543197632,
0.7435587048530579,
-0.08788508921861649,
0.01721075549721718,
-0.0675477460026741,
0.2829042673110962,
-0.37312769889831543,
-0.5090944170951843,
-0.640097439289093,
-0.12884044647216797,
0.4793766736984253,
-0.39574089646339417,
0.140758216381073... | |
appropriately), by returning `value++` you are returning and then incrementing. To return the incremented value, use `++value`. | [
-0.08440642058849335,
0.0015153820859268308,
0.430409699678421,
-0.30518126487731934,
-0.11025191843509674,
0.1715010106563568,
0.2984926402568817,
-0.5414417386054993,
0.2086443305015564,
-0.31215327978134155,
-0.2831968069076538,
0.6873651146888733,
-0.30325332283973694,
0.22299218177795... | |
`Const` is baked into the client code. `Readonly` isn't. But `const` is faster. May be only slightly though.
The question is, is there ever any scenario where you should prefer `const` over `readonly`? Or to rephrase, are we not practically *always* better off using a `readonly` instead of a `const` (keeping in mind t... | [
0.3198835551738739,
0.23468096554279327,
0.11616047471761703,
-0.01377048622816801,
-0.1218344196677208,
-0.02158227190375328,
0.20320406556129456,
0.23528465628623962,
0.025002142414450645,
-0.9603245854377747,
-0.3340754210948944,
0.8943279981613159,
-0.034707121551036835,
-0.14604677259... | |
will never change, and clients can certainly hard-code that into their compiled apps without worrying that you'll need to change the value later.
If there's any chance at all you need to change the value in future versions, don't use const.
Oh! And never assume const is faster than a readonly field unless you've meas... | [
0.09810216724872589,
-0.013896874152123928,
0.4208444058895111,
0.350685715675354,
0.20390881597995758,
-0.08873702585697174,
0.3031606078147888,
0.38669952750205994,
-0.3531719744205475,
-0.6470828652381897,
0.052659306675195694,
0.6842883825302124,
-0.21274855732917786,
-0.32912987470626... | |
Is it possible to do a cross-site call, in Javascript, to a WCF service?
I don't mind if it's a POST or a GET.
But I've heard that these days, browsers don't allow cross-site calls with either POST or GET.
How can I circumvent this and still call a *WCF Service*?
There's not a whole lot you can do to circumvent the ... | [
0.4489303231239319,
0.11309461295604706,
0.33194053173065186,
0.05422777682542801,
-0.17516948282718658,
-0.2244977355003357,
0.30134037137031555,
-0.28700780868530273,
-0.19055338203907013,
-0.5413085222244263,
0.02304942160844803,
0.6164419651031494,
-0.2307681441307068,
0.25662186741828... | |
references a src that is a cross-site URL. You'll pass all your RPC method arguments to this "script" which will return some JavaScript that will be executed, telling you success or failure.
There's no way to do a POST in this manner, the src URL must be a GET, so you can pass arguments that way. I'm not sure if WCF ... | [
0.49106985330581665,
0.3680947422981262,
0.5101006031036377,
0.1751171201467514,
-0.0599551796913147,
-0.31955304741859436,
0.3788973391056061,
0.08916167914867401,
-0.05792827159166336,
-0.2829147279262543,
0.006734838709235191,
0.23534609377384186,
-0.5555047392845154,
0.5374264717102051... | |
you'll get JavaScript errors.
Another common method of circumventing cross-site scripting is to write a proxy for your requests. In other words, if you want to access domain test.com from scripts hosted on example.com, then make some URL on example.com that proxies the request over to test.com in the proper way.
Fo... | [
0.6020306944847107,
0.16340215504169464,
0.013328439556062222,
0.3318995535373688,
-0.1636127233505249,
-0.38432303071022034,
0.40623655915260315,
0.15876328945159912,
-0.19361355900764465,
-0.6316777467727661,
0.2066888064146042,
0.1068715751171112,
-0.11369964480400085,
0.441977649927139... | |
A newbie question from me, please.
I have a large data set that I **prefer** to be submitted as an object instead of an array; e.g.
```
foo = bar = baz = {};
$.ajax({
url: "index",
type: "post",
data: { foo: foo, bar: bar, baz: baz },
dataType: "json"
});
```
Upon submit, Firebug tells me that I hav... | [
0.28174611926078796,
0.22910372912883759,
0.3469046354293823,
0.06771188974380493,
0.05647864192724228,
-0.10537821799516678,
0.10224846005439758,
-0.3781507611274719,
0.05554177984595299,
-0.6622638702392578,
-0.20742078125476837,
0.4944482445716858,
-0.44135406613349915,
0.06698949635028... | |
arrays, which I do not prefer?
No. Everything that is submitted via HTTP is basically a string or an array of strings. You *can* use [JSON](http://www.json.org/) to convert each object into a string representation, which may be what you want. | [
0.3212316334247589,
-0.053000252693891525,
0.21572637557983398,
0.12388928979635239,
-0.4110504984855652,
0.02190711535513401,
-0.12066186219453812,
-0.0761362835764885,
-0.3514740765094757,
-0.7443956136703491,
-0.14883270859718323,
0.4341740906238556,
-0.23513543605804443,
-0.03518573194... | |
I want to make a installation which can be both new installation and update installation.
When it was used as an update installation, I want some files to be updated regardless the version and modified datetime. And some files would never be updated.
What I tried:
Set the "REINSTALLMODE" to "amus". And set the "Never ... | [
0.40018606185913086,
0.10351208597421646,
0.6661345958709717,
0.005218553356826305,
0.27307379245758057,
-0.11462995409965515,
0.5058030486106873,
-0.2380460947751999,
-0.23790861666202545,
-0.6699644923210144,
-0.2916772663593292,
0.8313947916030884,
-0.23255480825901031,
0.31701633334159... | |
specific [File replacement logic](http://blogs.msdn.com/astebner/archive/2005/08/30/458295.aspx) ([Archived link](https://web.archive.org/web/20100118152341/http://blogs.msdn.com/astebner/archive/2005/08/30/458295.aspx)).
I would look into doing a [Major upgrade](http://msdn.microsoft.com/en-us/library/aa369786(VS.85)... | [
-0.10071652382612228,
0.0725521519780159,
0.31570056080818176,
-0.08105188608169556,
0.03747261315584183,
-0.4155643880367279,
0.44338133931159973,
-0.20384065806865692,
-0.4382683336734772,
-0.2139342576265335,
-0.49550867080688477,
0.8658981919288635,
-0.34052249789237976,
0.219199001789... | |
when doing
```
#include <string>
class MyString : public std::string
{
public:
MyString() {}
};
```
But the usage below:
```
MyString s = "Happy day";
MyString s("Happy Day");
MyString s = (MyString)"Happy day";
```
neither of them works.
It seems that there's something to do with constructors/operator... | [
0.07011684775352478,
0.19436797499656677,
0.573294997215271,
-0.13409645855426788,
0.1257840096950531,
-0.11749445647001266,
0.2946564257144928,
0.16888558864593506,
-0.04254536330699921,
-0.5695911049842834,
-0.44692617654800415,
0.664300799369812,
-0.34200677275657654,
0.040767852216959,... | |
for you:
```
MyString() : std::string() { }
MyString(const MyString &other) : std::string(other) { }
```
To allow construction from string literals, you need a constructor that takes a `const char*`:
```
MyString(const char* other) : std::string(other) { }
```
A constructor that takes a `const std::string&` would... | [
-0.23210342228412628,
0.10739122331142426,
0.3204284608364105,
-0.2556304335594177,
-0.09523490816354752,
0.045374467968940735,
0.4088840186595917,
-0.30484142899513245,
0.04037358984351158,
-0.46940547227859497,
-0.34079331159591675,
0.7241178154945374,
-0.3648000955581665,
-0.09635044634... | |
I'm trying to display an image using a PHP script. Basically so the php script is passed on the full path to the image, and it then displays that image in the browser. I've checked to make sure the image exists, it is being read correctly, etc, however in the browser i just see the broken image box (e.g the small red c... | [
0.3216538429260254,
0.16560429334640503,
0.5784458518028259,
-0.13567593693733215,
-0.24609911441802979,
0.012433627620339394,
0.44219863414764404,
-0.07041449099779129,
-0.0262256171554327,
-0.9367287755012512,
-0.16560141742229462,
0.29976126551628113,
-0.350519061088562,
0.1680678725242... | |
echoing `file_get_contents($file)` but it didn't work either.
What is the problem, any thoughts?
I found the answer, i had some extra whitespace after the `?>` tag which was causing the header to not work. grrrrrrr | [
0.24058829247951508,
0.24884890019893646,
0.43251684308052063,
0.12412837892770767,
-0.28792956471443176,
-0.033669549971818924,
0.3070962429046631,
0.03518528491258621,
-0.43344777822494507,
-0.2110101282596588,
0.11349289864301682,
0.49431872367858887,
-0.30566471815109253,
0.38298618793... | |
I have done xml parsing same as SeismicXML example. But now it gives me memory leak problem.
When i tested SeismicXML with instruments, it also give same memory leak.
In SeismicXML, EarthQuake example is there, it contains all the string and array which come from xml parsing. SO 'Leak' instruments showing all this st... | [
-0.001580167911015451,
0.196563720703125,
-0.024301894009113312,
0.018452011048793793,
-0.3439635932445526,
-0.10629495233297348,
-0.07015971094369888,
-0.19938533008098602,
-0.3734864890575409,
-0.1764887273311615,
0.3168766498565674,
0.6455718278884888,
-0.2186831384897232,
0.37941563129... | |
WHERE UNIQUE_CONSTRAINT_NAME =
(SELECT CONSTRAINT_NAME
FROM INFORMATION_SCHEMA.KEY_COLUMN_USAGE
WHERE TABLE_NAME = @TableName AND COLUMN_NAME = @ColumnName)
```
To get the Constraint Name by Foreing Key:
```
SELECT CONSTRAINT_NAME
FROM INFORMATION_SCHEMA.KEY_COLUMN_USAGE
WHERE TABLE_NAME = @TableName... | [
-0.7178525924682617,
0.3886229693889618,
0.3474498987197876,
-0.005533571355044842,
-0.002087872475385666,
0.2810650169849396,
-0.3809255361557007,
-0.4282938838005066,
-0.27797001600265503,
-0.3019823729991913,
-0.24845337867736816,
0.6459075212478638,
-0.34710392355918884,
0.268935471773... | |
@ConstraintName)
``` | [
0.04920857772231102,
0.16552194952964783,
0.34230321645736694,
-0.0888909101486206,
-0.054441578686237335,
-0.26112881302833557,
0.6409071683883667,
0.27061840891838074,
-0.19941338896751404,
-0.6218724846839905,
-0.44924643635749817,
0.7560303807258606,
-0.288686066865921,
0.3043808937072... | |
Is there any helper method (Other than [default rails breadcrumb](http://wiki.rubyonrails.org/rails/pages/Breadcrumbs)) that generates bread crumb navigation dynamically for a particular page without having to pass trivial parameters in RESTful application? That is, something that figures out automatically where the us... | [
-0.13652853667736053,
-0.049917902797460556,
0.6589716076850891,
0.007363002281636,
-0.071397565305233,
0.08941556513309479,
0.3163045346736908,
0.012657294981181622,
-0.11874090880155563,
-0.770727276802063,
-0.0958254337310791,
0.49000000953674316,
-0.49304795265197754,
-0.24469652771949... | |
there exists a method 'name' for every model object corresponding to each resource in the RESTful url. Whatever that the method 'name' returns is shown as breadcrumb name. If it is not found, it is shown as it is without making it link to anything. Separator used is '->' You may change it to suit your requirement.
```... | [
-0.10341490805149078,
0.08011931926012039,
0.4554769694805145,
0.07330075651407242,
0.16409020125865936,
0.1185658872127533,
0.03214166685938835,
-0.07084869593381882,
-0.20836900174617767,
-0.6663668155670166,
-0.3693575859069824,
0.19368013739585876,
-0.24925418198108673,
0.4331144988536... | |
if i%2 == 0
begin
breadcrumb += "<a href='#{sofar}'>" + eval("#{elements[i - 1].singularize.camelize}.find(#{elements[i]}).name").to_s + '</a>'
rescue
breadcrumb += elements[i]
end
else
breadcrumb += "<a href='#{sofar}'>#{elements[i].pluralize}</a>"
end
... | [
-0.39776575565338135,
0.20183774828910828,
0.16799218952655792,
-0.5310436487197876,
0.21555295586585999,
0.5799165368080139,
0.4417665898799896,
-0.745567262172699,
0.12144768238067627,
-0.6965882182121277,
-0.6668144464492798,
0.26027676463127136,
-0.3243859112262726,
-0.0442489162087440... | |
end
breadcrumb
rescue
'Not available'
end
end
```
The method generally accepts request.url (Which given url of the current page) as the parameter. The method purposefully accepts the url for customization purposes. To generate the breadcrumb, simply add following code in your view -
`<%= get_bread_crumb(... | [
-0.027208248153328896,
0.1344049572944641,
0.597701370716095,
-0.03499508276581764,
-0.09016887098550797,
-0.05270770937204361,
0.2193523347377777,
-0.06023498252034187,
-0.1452944576740265,
-0.7696108818054199,
-0.11709592491388321,
0.42337319254875183,
-0.14907477796077728,
0.15282498300... | |
Is there any crossplatform way (Windows, Linux, MacOSX) to change screen resolution? Neither Java nor .Net-Mono can do it. Only through native API invocation. It's very strange situation: there are clear (managed) methods to obtain screen resolution, but method for setting is absent. Is this feature very dangerous or c... | [
0.3420200049877167,
-0.22337408363819122,
0.3203085660934448,
0.11758174747228622,
-0.18232077360153198,
-0.39734625816345215,
-0.005401049740612507,
0.13056856393814087,
-0.511633038520813,
-1.0043748617172241,
0.10240866988897324,
0.5036764144897461,
-0.45934441685676575,
0.1050409972667... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.