text stringlengths 0 30.5k | title stringclasses 1
value | embeddings listlengths 768 768 |
|---|---|---|
a project midways? How did this work out?
What was your reaction and what did you do (or intended to do) to avoid such things in the future? Like "From now on it's scrum or bust", "Darn, I will never do xyz again", "hm, does my insurance cover *that*" or maybe even "shit happens, stop whining and get over it"?
That ... | [
0.8016740679740906,
-0.2519369423389435,
0.0696880891919136,
0.587051272392273,
-0.19925960898399353,
-0.6493728160858154,
0.008225496858358383,
0.03555234894156456,
-0.16975300014019012,
-0.2766707241535187,
0.21928352117538452,
0.3298822045326233,
0.11801312118768692,
0.3391494154930115,... | |
are looking to perform computations, do it in your code and away from your stored procedures. If you need to use cursors to pull the data together, so be it, but using them to do calculations and other non-retrieval functions I think should be shied away from.
**Edit**: This [Answer](https://stackoverflow.com/question... | [
-0.05836919695138931,
-0.0981447771191597,
0.35532402992248535,
0.21727965772151947,
0.035187941044569016,
0.04715798795223236,
-0.08532050997018814,
-0.130605086684227,
-0.4012414515018463,
-0.5118475556373596,
-0.07579756528139114,
0.4899362325668335,
-0.20641878247261047,
-0.14563453197... | |
in the stored procedure. | [
0.08353987336158752,
-0.06812013685703278,
0.07818121463060379,
0.025439081713557243,
0.3440069258213043,
-0.12250133603811264,
-0.22352461516857147,
0.10842567682266235,
-0.1725681722164154,
-0.339261531829834,
-0.5029829144477844,
0.5860229134559631,
-0.07395205646753311,
0.0264941100031... | |
I couldn't find documentation on an equivalent of Java's `final` in Python, is there such a thing?
I'm creating a snapshot of an object (used for restoration if anything fails); once this backup variable is assigned, it should not be modified -- a final-like feature in Python would be nice for this.
Having a variable ... | [
0.006429443135857582,
-0.07399845123291016,
0.15605390071868896,
-0.17118512094020844,
-0.18712040781974792,
-0.26861700415611267,
0.2696117162704468,
0.012000431306660175,
-0.23875384032726288,
-0.5855481624603271,
-0.08869332075119019,
0.48602768778800964,
-0.11549384891986847,
0.1414194... | |
new LinkedList<String>();
public void addMessage()
{
messages.add("Hello World!"); // this mutates the messages list
}
```
but the following wouldn't even compile:
```
public final List<String> messages = new LinkedList<String>();
public void changeMessages()
{
messages = new ArrayList<String>(); // can'... | [
-0.15700584650039673,
-0.22538098692893982,
0.5866363644599915,
-0.2509607970714569,
0.042786892503499985,
-0.11506416648626328,
0.38462597131729126,
-0.07715160399675369,
-0.55635005235672,
-0.7644440531730652,
-0.5037757754325867,
0.3356153666973114,
-0.6661046743392944,
0.21599029004573... | |
concentrate on making sure that you don't write any code which mutates these objects after they're assigned. | [
0.4847971498966217,
0.16620296239852905,
-0.3913300931453705,
0.22183741629123688,
0.03911671042442322,
-0.11200304329395294,
0.23929420113563538,
0.1731407195329666,
-0.18435829877853394,
-0.6029237508773804,
-0.07872987538576126,
0.5503242015838623,
-0.005471399053931236,
0.1259578615427... | |
I wrote my code using [this article at msdn](http://msdn.microsoft.com/en-us/library/fx6588te.aspx) as a primary helper
My code:
```
private ManualResetEvent _AllDone = new ManualResetEvent(false);
internal void Initialize(int port,string IP)
{
IPEndPoint _Point = new IPEndPoint(IPAddress.Parse(I... | [
-0.11664629727602005,
0.16548575460910797,
0.889541506767273,
-0.18745221197605133,
0.12205778062343597,
0.42817020416259766,
0.46436697244644165,
-0.19355186820030212,
-0.16250891983509064,
-0.6820080876350403,
-0.08247564733028412,
0.5125830173492432,
-0.30015161633491516,
0.091189220547... | |
_AllDone.Reset();
_Accpt.BeginAccept(null, 0, new AsyncCallback(Accept), _Accpt);
_AllDone.WaitOne(); <<crash here
}
}
```
This is what happens,I set a breakpoint at BeginAccept(I thought there's the problem),but it steps it normally.However,when I try to step "\_AllDone.WaitOne()... | [
-0.10706427693367004,
0.16341137886047363,
0.4621329605579376,
-0.2743759751319885,
0.2821016311645508,
-0.25474071502685547,
0.6243322491645813,
-0.29830408096313477,
-0.15643884241580963,
-0.5362959504127502,
-0.30644506216049194,
0.8414590358734131,
-0.41503477096557617,
0.1943179368972... | |
go there,I set a breakpoint there,but it won't go.
```
private void Accept(IAsyncResult async)
{
_AllDone.Set();
Socket _Accpt = (Socket)async.AsyncState;
Socket _Handler = _Accpt.EndAccept(async);
StateObject _State = new StateObject();
_State.workSocket = _Handler;
... | [
-0.2682908773422241,
0.18555369973182678,
0.2544202208518982,
-0.25422459840774536,
0.22968974709510803,
0.01398931723088026,
0.44033175706863403,
-0.3997901976108551,
-0.06572239845991135,
-0.43629300594329834,
-0.4507511556148529,
0.6127239465713501,
-0.42121899127960205,
0.2132722735404... | |
as soon as a socket connection is received, and not wait until `Accept` is done, and that's why you don't use the sync version of `Accept`.
So you are saying that it does not fire your Accept method when you connect a socket to the specified address and port? Because that's what Accept does: it accepts a new incoming... | [
0.13588564097881317,
-0.03646502271294594,
-0.012962992303073406,
0.11266394704580307,
-0.07027538120746613,
-0.4321545362472534,
0.435930073261261,
0.03681740164756775,
-0.09762707352638245,
-0.6093115210533142,
-0.23514366149902344,
0.3801789879798889,
-0.26901161670684814,
0.27663382887... | |
listening to incoming connections, you don't need any ManualWaitEvent:
```
internal void Initialize(int port,string IP) {
IPEndPoint _Point = new IPEndPoint(IPAddress.Parse(IP), port);
Socket _Accpt = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
_Accpt.Bind(_Point);
_Acc... | [
-0.23035456240177155,
0.021286360919475555,
0.5728936195373535,
-0.13103382289409637,
0.10527262091636658,
0.09955208003520966,
0.7504898309707642,
-0.4367313086986542,
0.018945777788758278,
-0.6824308037757874,
-0.3822650611400604,
0.9173636436462402,
-0.44615110754966736,
0.2672013044357... | |
}
StateObject _State = new StateObject();
_State.workSocket = _Handler;
_Handler.BeginReceive(_State.buffer, 0, StateObject.BufferSize, 0, new AsyncCallback(ReadCallback), _State);
}
```
**Note:** You will also need an exit condition, so that the BeginAccept is not called (for instance when you want to ... | [
-0.2858232855796814,
-0.07525493204593658,
0.23048052191734314,
-0.4849478304386139,
0.47819122672080994,
-0.04355989396572113,
0.5917448997497559,
-0.17099513113498688,
-0.0851992666721344,
-0.6888927221298218,
-0.4371880888938904,
0.45694032311439514,
-0.26314184069633484,
0.458016425371... | |
In HTML/CSS you can define a style which can be applied to many types of elements, e.g.:
```
.highlight {
color:red;
}
```
can be applied to both P and DIV, e.g.:
```
<p class="highlight">this will be highlighted</p>
<div class="highlight">this will also be highlighted</div>
```
but in XAML you seem to have t... | [
0.39536693692207336,
-0.02401534654200077,
0.5157724618911743,
-0.0581664964556694,
-0.2667471468448639,
-0.14462487399578094,
-0.0050729443319141865,
-0.23760546743869781,
-0.33614665269851685,
-0.6481589674949646,
-0.391827791929245,
0.13897494971752167,
-0.501496434211731,
-0.2370570749... | |
type so that WPF can resolve the properties in the setters to the dependency properties of that type.
You can set the target type to base classes that contain the properties you want and then apply that style to derived classes. For example, you could create a style for Control objects and then apply it to multiple ty... | [
0.32595202326774597,
-0.37862303853034973,
0.5039474368095398,
0.05611100047826767,
-0.28879690170288086,
-0.0016335747204720974,
-0.12462273985147476,
-0.6798479557037354,
-0.07947266101837158,
-0.8041436672210693,
-0.10709593445062637,
0.2925057113170624,
-0.43368327617645264,
-0.1455023... | |
It seems that MSMQ doesn't use any Database management system to manage messages.
How does MSMQ manage messages?
Does it store the messages in flat file?
I'm trying to implement a messages management system.
MSMQ uses flat files located in %windir%\system32\msmq.
If you want to implement your own queueing, I s... | [
-0.15240050852298737,
-0.14428119361400604,
0.47002655267715454,
-0.13020940124988556,
-0.07735441625118256,
0.02560056373476982,
0.13045282661914825,
-0.06781425327062607,
-0.998636782169342,
-0.4082894027233124,
0.15817376971244812,
-0.11114365607500076,
-0.5117678642272949,
0.5063598752... | |
I have a Maven2 project, and I need to add, in a properties file, the current version and the current date.
For the current version, I've used `${project.version}`, which works correctly.
My question is how can I set the current date (i.e. the date when the build is done by Maven2) in my properties file:
```
client.... | [
-0.05734096094965935,
0.244458869099617,
0.4996705651283264,
-0.4505082368850708,
0.21706622838974,
-0.11244387179613113,
0.12345773726701736,
-0.131334587931633,
-0.20450547337532043,
-0.8818634748458862,
-0.03397069498896599,
0.3800505995750427,
0.18665869534015656,
0.20769137144088745,
... | |
<executions>
<execution>
<phase>initialize</phase>
<goals>
<goal>create</goal>
</goals>
</execution>
</executions>
<configuration>
<doCheck>false</doCheck>
<doUpdate>false</doUpdate>
<timestampFormat>{0,date,yyyy-MM-dd HH:mm:s... | [
0.08498521894216537,
-0.385316401720047,
0.18259361386299133,
0.22189413011074066,
-0.004048001021146774,
0.26814404129981995,
0.12556150555610657,
-0.5753659009933472,
-0.7038734555244446,
-0.6573352813720703,
-0.028121506795287132,
-0.19064198434352875,
-0.25959673523902893,
0.3569211065... | |
</configuration>
</plugin>
</plugins>
</build>
```
The date is then available in the property ${buildNumber}. | [
0.41742342710494995,
0.13334159553050995,
0.5266426205635071,
-0.3490689694881439,
0.23253987729549408,
-0.3267764449119568,
-0.045118022710084915,
0.01967746391892433,
0.21043530106544495,
-0.6741496324539185,
-0.49609073996543884,
0.58255934715271,
0.3079453706741333,
0.22662679851055145... | |
I'm running the following code to get a random entry from a dictionary:
```
SELECT * FROM tbl_dict WHERE 1 ORDER BY RAND() LIMIT 1
```
This works great, but as soon as I expand there WHERE clause the query fails. What I need is something like...
```
SELECT * FROM tbl_dict WHERE 1 and lock='0' ORDER BY RAND() LIMIT ... | [
0.31354519724845886,
0.38553372025489807,
0.0900709256529808,
0.04611392319202423,
0.020708879455924034,
-0.2327195703983307,
0.046643294394016266,
0.1875891238451004,
-0.3510337173938751,
-0.6248438954353333,
0.14223545789718628,
0.5133550763130188,
-0.4028262794017792,
0.4164775907993316... | |
You might also be interested in <http://jan.kneschke.de/projects/mysql/order-by-rand>.
ORDER BY Rand() might or might not be a bit too suboptimal in your case when it comes to speed. | [
0.16116389632225037,
-0.18959923088550568,
-0.21033775806427002,
0.4546942710876465,
-0.09356121718883514,
-0.09271608293056488,
-0.1943192034959793,
0.18095360696315765,
-0.5166988372802734,
-0.4876258969306946,
-0.0016608417499810457,
0.4973647892475128,
0.29284870624542236,
-0.039762817... | |
I'm trying to serialize an object to XML that has a number of properties, some of which are readonly.
```
public Guid Id { get; private set; }
```
I have marked the class [Serializable] and I have implemented the ISerializable interface.
Below is the code I'm using to serialize my object.
```
public void SaveMyObj... | [
-0.09887521713972092,
0.04564175754785538,
0.6465625166893005,
-0.18489313125610352,
0.17099693417549133,
0.1024998277425766,
0.3203901946544647,
-0.09408766776323318,
-0.05917445570230484,
-0.7867850065231323,
-0.176640123128891,
0.42217275500297546,
-0.4853343963623047,
0.279011696577072... | |
or indexer 'MyObject.Id' cannot be assigned to -- it is read only
If I set the Id property to public it works fine. Can someone tell me if I'm doing something, or at least if its even possible?
You could use `DataContractSerializer` (but note you can't use xml attributes - only xml elements):
```
using System;
using ... | [
0.19071154296398163,
-0.18416036665439606,
0.25209176540374756,
0.10434266924858093,
0.2824792265892029,
-0.13513776659965515,
0.013863226398825645,
-0.06861608475446701,
-0.13792721927165985,
-0.5531973838806152,
-0.21495743095874786,
0.6298623085021973,
-0.526671290397644,
0.232811361551... | |
var ser = new DataContractSerializer(typeof(MyObject));
var obj = new MyObject(Guid.NewGuid());
using(XmlWriter xw = XmlWriter.Create(Console.Out)) {
ser.WriteObject(xw, obj);
}
}
}
```
Alternatively, you can implement `IXmlSerializable` and do everything yourself - but this wo... | [
-0.2650863826274872,
-0.12965027987957,
0.8707675337791443,
-0.180929496884346,
-0.2867971956729889,
0.1750238984823227,
0.1603596955537796,
-0.30371540784835815,
-0.017105303704738617,
-0.9106170535087585,
-0.2736155092716217,
0.33062443137168884,
-0.3788003921508789,
0.24424991011619568,... | |
This may be a stupid question, but is it possible to keep a right `UIBarButtonItem` across multiple views managed by a `UINavigationController`? I have a progression of views that often share the same right `UIBarButtonItem`, but when I push a new view to my `UINavigationController`, I have to redefine the button every... | [
0.37450525164604187,
-0.08172984421253204,
0.45286160707473755,
0.09117695689201355,
-0.06686802208423615,
0.20762157440185547,
0.3744968771934509,
0.3445585072040558,
-0.4920156002044678,
-0.7740691900253296,
-0.141659677028656,
0.3376990556716919,
0.028303949162364006,
0.1718167960643768... | |
`UIButton` as a subview of my `UINavigationBar` and accomplish a "right bar button" effect this way?
We did this in our app. We created a single UIBarButtonItem that we swap from one UIViewController to another as the user navigates. The trick was to use UINavigationControllerDelegate, the navigationController:willShow... | [
0.02133943699300289,
-0.3850552439689636,
0.9806921482086182,
0.2751365602016449,
-0.07869146019220352,
0.0550178661942482,
0.0030309194698929787,
-0.11880490183830261,
0.02500498853623867,
-0.8086224794387817,
0.005296970717608929,
0.6365799903869629,
-0.28452053666114807,
0.1628339439630... | |
If I have a auto\_ptr I can pass it for a reference?Like:
```
auto_ptr<MyClass>Class(new MyClass);
void SetOponent(MyClass& oponent);
//So I pass SetOponent(Class)
```
And what is odd copy behavior of auto\_ptrs?
No you can't, you would have to dereference it:
```
SetOponent( * Class )
```
As for the copying beha... | [
0.25142449140548706,
0.2186996042728424,
0.16575632989406586,
-0.07074564695358276,
-0.053432293236255646,
-0.0833655297756195,
0.14809978008270264,
-0.21894019842147827,
-0.056439243257045746,
-0.3231045603752136,
-0.10070592910051346,
0.5837955474853516,
-0.6126295924186707,
0.1548850536... | |
owns the pointer to the Foo object.
```
auto_ptr <Foo> p2( p1 );
```
After the copy, p2 owns the pointer and **p1 is changed** so that it now holds a NULL pointer. This is important, because copying occurs in lots of places in C++. You should never, for example, pass auto\_ptrs by value to functions, or attempt to ... | [
-0.029357891529798508,
0.36343246698379517,
0.2797856628894806,
-0.2728135287761688,
0.21297955513000488,
-0.19357599318027496,
-0.045078445225954056,
-0.18756169080734253,
-0.2608034610748291,
-0.08968011289834976,
-0.2537603974342346,
0.47135719656944275,
-0.5921013951301575,
0.142436832... | |
I'm trying to implement class inheritance hieararchy with NHibernate and SQL server. I made it work fine with the table per hierarchy strategy (one table and several subclass elements in the mapping file).
However the table per subclass strategy (N + 1 tables and N joined-subclass elements in one mapping file) makes m... | [
-0.19278739392757416,
-0.06035301834344864,
0.09736817330121994,
0.18835856020450592,
-0.2693796157836914,
0.00842891726642847,
0.24919089674949646,
-0.11620569974184036,
-0.16207706928253174,
-0.6823551058769226,
0.06435757875442505,
0.33920958638191223,
-0.2474805861711502,
0.40766558051... | |
between the tables. I tried to put the FK constraint from the subclass PK to the master class PK but it still doesn't work. I get the following exception:
NHibernate.Exceptions.GenericADOException: could not insert: [Jobflow.Models.Entities.ContactPerson][SQL: INSERT INTO ContactPersons (Email, Company, PersonID) VALU... | [
-0.39020779728889465,
0.012241996824741364,
0.32596027851104736,
0.024148840457201004,
-0.0331597737967968,
0.22946780920028687,
-0.12411975860595703,
-0.09680455923080444,
-0.2625049352645874,
-0.5045713186264038,
0.1472669392824173,
0.13574174046516418,
-0.39763227105140686,
0.3171269297... | |
of the identity value. Your foreign keys/primary keys are fine, this is the only issue you need to tackle.
NHibernate will insert into Persons, get the new identity value using SCOPE\_IDENTITY(), and then use that value explicitly for the insert into ContactPersons. | [
0.029247788712382317,
0.006184370256960392,
0.5099542140960693,
-0.056026946753263474,
0.39206549525260925,
-0.1750771403312683,
0.09055009484291077,
-0.02290581725537777,
-0.04076090082526207,
-0.38996145129203796,
-0.09133820235729218,
0.7850024104118347,
-0.5170469880104065,
0.045924820... | |
```
public class Person
{
public string name { get; set; }
public Email email { get; set; }
}
public class Email
{
public string desc { get; set; }
}
public static IEnumerable<T> Sort<T>(this IEnumerable<T> source, string sortExpression, bool desc)
{
var param = Expression.Parameter(typeo... | [
0.0384814590215683,
-0.0587993785738945,
0.20029763877391815,
-0.18474456667900085,
-0.08666696399450302,
0.06816588342189789,
0.47970181703567505,
-0.3823169469833374,
0.000018942777387565002,
-0.5926693677902222,
-0.6179879903793335,
0.6306698322296143,
-0.3299145996570587,
0.22189727425... | |
if (desc)
{
return source.AsQueryable<T>().OrderByDescending<T, object>(sortLambda);
}
return source.AsQueryable<T>().OrderBy<T, object>(sortLambda);
}
catch (ArgumentException)
{
return source;
}
}
List<Person> vet = new List<Person>();
Per... | [
-0.04501501843333244,
-0.6289217472076416,
0.28775104880332947,
-0.13901282846927643,
0.0677492618560791,
0.480376660823822,
0.19150541722774506,
-0.46623173356056213,
-0.24690763652324677,
-0.7622796893119812,
-0.3873461186885834,
0.39634498953819275,
-0.3006863296031952,
0.42871227860450... | |
name = "aaa", email = new Email { desc = "bbb@aaa.com" } };
Person pp = new Person { name = "bbb", email = new Email { desc = "aaa@aaa.com" } };
vet.Add(p);
vet.Add(pp);
vet.Sort("name",true); //works
vet.Sort("email.desc",true) // doesnt work
```
---
someone can help me?
If ... | [
0.46166157722473145,
0.004243339877575636,
0.3180033564567566,
-0.046994924545288086,
-0.038560882210731506,
0.0795203447341919,
0.21023276448249817,
-0.5320375561714172,
-0.25582945346832275,
-0.5990389585494995,
0.03892749547958374,
0.6146930456161499,
-0.04649592563509941,
-0.0054382532... | |
want.
While Lambda's are type safe there are times when you might want to generate on the fly the query as opposed to having every possible combination that a user can sort for example.
**Edit**
I fixed your method. Basically you need to create an expression for each member access.
```
public static IEnumerable<... | [
0.40001529455184937,
-0.17765052616596222,
0.5258782505989075,
-0.04203279688954353,
0.16745243966579437,
0.32925358414649963,
0.20318561792373657,
-0.6735230684280396,
-0.34007108211517334,
-0.4958847761154175,
0.09526904672384262,
0.5828969478607178,
-0.5663464069366455,
-0.0614617913961... | |
var fields = sortExpression.Split('.');
Expression property = null;
Expression parentParam = param;
foreach (var field in fields)
{
property = Expression.Property(parentParam, field);
parentParam = | [
-0.01846149004995823,
-0.22748148441314697,
0.11681192368268967,
-0.41868725419044495,
0.15314999222755432,
0.3767054080963135,
0.41980668902397156,
-0.5881806015968323,
-0.011259904131293297,
-0.2005804479122162,
-0.6102417707443237,
0.583838701248169,
-0.3405832350254059,
0.2543564736843... | |
property;
}
var sortLambda =
Expression.Lambda<Func<T, object>>(
Expression.Convert(property, typeof(object)), param);
if (desc)
{ | [
0.17366796731948853,
-0.46740448474884033,
0.16397257149219513,
-0.24477972090244293,
0.10505589097738266,
0.1422579437494278,
0.38448411226272583,
-0.7658323049545288,
-0.21818269789218903,
-0.5104209184646606,
-0.39268556237220764,
0.5487443208694458,
-0.3725663125514984,
0.3170106709003... | |
return source.AsQueryable<T>().
OrderByDescending<T, object>(sortLambda);
}
return source.AsQueryable<T>().
OrderBy<T, object>(sortLambda);
}
catch (ArgumentException)
{ | [
-0.29918643832206726,
-0.3960458040237427,
0.2893076241016388,
-0.24857285618782043,
0.020019972696900368,
0.3299380838871002,
0.3698888421058655,
-0.264257550239563,
-0.29087063670158386,
-0.4284607470035553,
-0.4385327994823456,
0.21557928621768951,
-0.576755940914154,
0.3375239670276642... | |
throw;
}
}
``` | [
-0.046178288757801056,
0.19473440945148468,
-0.15148955583572388,
-0.38286012411117554,
-0.09695889055728912,
-0.33790865540504456,
0.4051741063594818,
0.10540060698986053,
0.06391702592372894,
-0.3641255795955658,
-0.42212793231010437,
0.46996942162513733,
-0.3138248920440674,
0.352495580... | |
I'm working on a Windows Service that watches a few folders for changes, creations, and deletions. It all works well with the exception of one watcher that watches a single file (XML File with Configuration Settings) for minor changes.
I tried taking the Windows Service code and putting it into a simple windows applic... | [
0.5210399627685547,
-0.01357337087392807,
0.6505668759346008,
-0.07504366338253021,
0.25102025270462036,
-0.13884598016738892,
0.18511582911014557,
-0.2784745693206787,
-0.3757631182670593,
-0.8629468679428101,
0.04261898249387741,
0.6309674382209778,
-0.22845807671546936,
0.19644175469875... | |
ReloadEventReferences
AddHandler XmlEventReferences.Created, AddressOf ReloadEventReferences
AddHandler XmlEventReferences., AddressOf ReloadEventReferences
XmlEventReferences.EnableRaisingEvents = True
```
That was some of the code and this is a sample of the XML File:
```
<EventReference>
<ER_EL_NUMBER>1</ER_E... | [
-0.011042691767215729,
-0.09879685938358307,
0.6593116521835327,
-0.09380009025335312,
0.07052114605903625,
-0.08872316032648087,
0.30506011843681335,
-0.5336115956306458,
-0.4726036787033081,
-0.6045064330101013,
-0.2755192220211029,
0.581143856048584,
-0.2541338801383972,
-0.214636787772... | |
on MSDN for more info.
Note: As Joshua Belden points out, you don't even need to set the `NotifyFilter` property at all because as [MSDN](http://msdn.microsoft.com/en-us/library/system.io.filesystemwatcher.notifyfilter.aspx) states: "The default is the bitwise OR combination of LastWrite, FileName, and DirectoryName."... | [
0.49073126912117004,
-0.33864206075668335,
0.14613723754882812,
-0.05786227807402611,
0.22936107218265533,
-0.5661925673484802,
0.34692293405532837,
0.041711173951625824,
-0.43946486711502075,
-0.49969205260276794,
-0.3543570041656494,
0.5822337865829468,
-0.5975021123886108,
-0.0599007308... | |
I've developed a website testing on localhost Cassini and it has always run fine, now when I deploy to my webserver I intermittently get the following error:
> Global.Application\_Error Error: Exception occurred during request:
> <http://....blah.aspx> Unable to validate data. at
> System.Web.Configuration.MachineKe... | [
-0.05138566717505455,
0.09782598167657852,
0.29756876826286316,
0.038787588477134705,
-0.07667197287082672,
-0.0013247209135442972,
0.3743804097175598,
-0.01855083554983139,
-0.4642837345600128,
-0.8456496000289917,
0.12594972550868988,
0.2073647677898407,
-0.2219245731830597,
0.3834579885... | |
error intermittently and one of them stores a bool in the ViewState, but it is not modified apart from that.
Has anyone come across this before?
<http://dotnetcoderoom.wordpress.com/2008/11/07/unable-to-validate-data-aspnet-error/>
Cause:
The basic reason of this is the difference of key while encrypting and decrypti... | [
-0.06770095229148865,
-0.14565593004226685,
0.4687899947166443,
-0.08385805785655975,
-0.10072726756334305,
0.11567037552595139,
0.5884274840354919,
0.024939483031630516,
-0.45273077487945557,
-0.713458240032196,
-0.10110165923833847,
0.5379549264907837,
-0.28668463230133057,
0.36797609925... | |
occur when you open a page for along time and after that do some events on that.
Solution
Fix the key in your web.config file, so that only one key is used to encrypt and decrypt the viewstate data.
For more information visit:
<http://www.experts-exchange.com/Programming/Programming_Languages/Dot_Net/ASP_DOT_NET/Q_2... | [
-0.1738128513097763,
-0.06811541318893433,
0.49424004554748535,
0.13241100311279297,
0.4160585403442383,
-0.17852818965911865,
0.5105067491531372,
-0.1495790034532547,
-0.4522659480571747,
-0.7348587512969971,
-0.5261558294296265,
0.45977160334587097,
-0.27891358733177185,
0.28372713923454... | |
I have a `.jsp` that contains an IFrame with a page that has some embedded JavaScript. This JavaScript accesses some DOM elements in the parent page (the one containing the IFrame).
The embedded page is going to be on a seperate sub-domain from the parent page, and I realize that there are some security implications. ... | [
0.11403800547122955,
0.49526894092559814,
0.4873270094394684,
-0.20650506019592285,
0.07070481777191162,
-0.21184612810611725,
0.1115078255534172,
0.06007426604628563,
-0.048362791538238525,
-0.6592274308204651,
-0.05504988506436348,
0.31014931201934814,
-0.2503702938556671,
0.435248672962... | |
domain
```
It then proceeds to access DOM elements in the parent document.
I am currently testing this, and have modified the hosts file on the Windows machine serving the parent page with the following entry:
```
127.0.0.1 domain.com
```
The goal is to trick JavaScript on the parent page into believing that the ... | [
0.2641502618789673,
0.287095308303833,
0.6773883104324341,
-0.18543411791324615,
0.07173746824264526,
-0.5203534960746765,
0.38336193561553955,
-0.20951975882053375,
0.004976063501089811,
-0.6459445357322693,
-0.10864637792110443,
0.6347836256027222,
-0.2209058552980423,
0.5092697143554688... | |
properties from JavaScript running in the embedded page.
Am I missing something?
Even though the "document.domain" properties look the same, from [the MSDN documentation](http://msdn.microsoft.com/en-us/library/cc196989(VS.85).aspx) is sounds like you still have to explicity set them to be the same:
> All the pages o... | [
0.11003978550434113,
0.20864835381507874,
0.3544764220714569,
0.25042831897735596,
-0.2135118842124939,
-0.3571554720401764,
0.12332049757242203,
-0.021826937794685364,
-0.2778276205062866,
-0.8157909512519836,
-0.08971584588289261,
0.4494665265083313,
-0.214518204331398,
0.482097029685974... | |
on another host named
> msdn.microsoft.com to "microsoft.com,"
> that the two pages could communicate
> with each other. However, this is not
> the case, **unless you explicitly set
> the domain property of the page on
> microsoft.com to "microsoft.com."** | [
0.025390921160578728,
0.04869021102786064,
0.3876614570617676,
0.21373111009597778,
-0.24362249672412872,
-0.13817277550697327,
0.3274907171726227,
0.503896951675415,
-0.087270088493824,
-0.9433023929595947,
-0.043354228138923645,
0.04664578661322594,
-0.3421560525894165,
0.387879371643066... | |
What's the best and easiest way to build (for Linux) a C++ application which was written in Visual Studio? The code itself is ready - I used only cross-platform libs.
Is it possible to prepare everything under Windows in Visual Studio and then build it with a CLI tool under Linux? Are there any docs describing this?
... | [
0.14903290569782257,
0.15105773508548737,
0.18079344928264618,
0.18649135529994965,
0.060330577194690704,
-0.2083103507757187,
0.016439467668533325,
-0.12421247363090515,
-0.06059935688972473,
-0.6165491938591003,
-0.14660459756851196,
0.491468608379364,
-0.17038631439208984,
-0.2032542824... | |
so you can just create your CMake file as the origin of platform-specific IDE files. The KDevelop generator is fine, so you can edit and compile in KDevelop (which will in turn call Make).
On the other hand, if you have nothing fancy, you can use CMake or just Make to build the thing on Linux, if you want to stay with... | [
0.43545278906822205,
0.009184339083731174,
-0.13131998479366302,
0.33225759863853455,
0.03139428794384003,
-0.2538082003593445,
0.04731665179133415,
-0.12896519899368286,
-0.2794063687324524,
-0.5239368677139282,
0.0700545683503151,
0.07902751863002777,
-0.2578883171081543,
0.1379764974117... | |
so the CMake solution is in my opinion a good thing for cross-platform development. | [
-0.021543018519878387,
0.35341039299964905,
0.160964697599411,
0.19828392565250397,
-0.009214680641889572,
-0.27081435918807983,
-0.19064714014530182,
0.2951858937740326,
-0.10429756343364716,
-0.37100332975387573,
0.04963304474949837,
0.28006115555763245,
0.15036378800868988,
-0.062629722... | |
Is there a way to view data that is returned from db by looking at DataSource or DataSourceView object in codebehind? I'm trying to view DataSourceView in debug but I don't see the data returned.
```
DataView dv = (DataView) YourDataSourceObject.Select(DataSourceSelectArguments.Empty);
for (int i = 0; i < dv.Table.Rows... | [
0.21289382874965668,
-0.11253570765256882,
0.3725251853466034,
-0.18987874686717987,
-0.20279055833816528,
0.15682733058929443,
0.35278478264808655,
-0.31615814566612244,
-0.02740153670310974,
-0.5213301777839661,
-0.16946323215961456,
0.7401262521743774,
-0.2151932567358017,
0.24756486713... | |
I have a disabled TextBox that I am editing the value of on the client side with JavaScript. When I try to retrieve the value on the server side it does not reflect the change made on the client side. If I set the TextBox's enabled attribute to true I can retrieve the value, but the user is able to put focus and edit t... | [
0.4270421266555786,
0.2985890507698059,
0.14487092196941376,
0.07554390281438828,
-0.03504981845617294,
-0.014340836554765701,
0.5882465243339539,
0.012957108207046986,
-0.11648005247116089,
-0.4888443350791931,
0.03397860378026962,
0.5824753046035767,
-0.30344918370246887,
0.1589379459619... | |
this is to hook onto form submission, and re-enable the input as the form is being submitted; the user won't have a chance to edit the value, and it should get posted with the rest of the request.
An alternative might be to inject a hidden element into the form; this could either be maintained by your script, mirrorin... | [
0.5058906078338623,
-0.2863035798072815,
0.22065745294094086,
0.13956205546855927,
0.07678040862083435,
-0.29336023330688477,
0.19265486299991608,
0.009999551810324192,
-0.020581120625138283,
-0.4951740503311157,
-0.274919718503952,
0.32581964135169983,
-0.05814577266573906,
-0.08559326827... | |
I am looking to display something like:
Hello, you've reached this site by looking for [google keyword(s)]
I'm pretty sure I've seen this done before but I am having troubles figuring out how to grab the keywords that were used to lead a user to my site. Anyone know the answer?
You need to get the referring URL and t... | [
0.5285749435424805,
0.34582728147506714,
0.3432278037071228,
0.08960197120904922,
-0.03606254234910011,
-0.22751666605472565,
0.29926571249961853,
0.4960991144180298,
-0.0430113859474659,
-0.5031032562255859,
0.01171723660081625,
0.2969472408294678,
-0.020036129280924797,
0.469488590955734... | |
In Ruby, is there a way to redefine a method of a particular instance of a class using a proc? For example:
```
class Foo
def bar()
return "hello"
end
end
x = Foo.new
y = Foo.new
```
(Something like):
```
y.method(:bar) = lambda { return "goodbye" }
x.bar
y.bar
```
Producing:
```
hello
goodbye
```
Th... | [
-0.15904386341571808,
0.11357606947422028,
0.3661973178386688,
-0.26457199454307556,
-0.2458873987197876,
-0.07976897060871124,
0.44413113594055176,
-0.3037939667701721,
-0.1777389645576477,
-0.3238321840763092,
-0.26562851667404175,
0.3304325342178345,
-0.5313818454742432,
0.0580523274838... | |
||= callable
metaclass = class << self; self; end
metaclass.send(:define_method, name, block)
end
end
p = proc { "foobar!" }
y.define_singleton_method(:bar, p)
#or
y.define_singleton_method(:bar) do
"foobar!"
end
```
or, if you want to define your proc inline, this may be more readable
```
class << y
... | [
-0.24120716750621796,
0.04951100796461105,
0.34299710392951965,
-0.13843603432178497,
-0.2442014217376709,
-0.15885312855243683,
0.4232580065727234,
-0.22253689169883728,
0.1383027583360672,
-0.33591601252555847,
-0.2731969654560089,
0.40969404578208923,
-0.5795141458511353,
0.023902107030... | |
I have the following scenario:
1. Entities are loaded from the database.
2. One of them is presented to the user in a Form (a WPF UserControl) where the user can edit properties of that entity.
3. The user can decide to apply the changes to the entity or to cancel the editing.
How would I implement something like thi... | [
0.17221829295158386,
-0.027006562799215317,
0.6846494078636169,
0.00382565357722342,
-0.023607924580574036,
-0.23526564240455627,
0.22619496285915375,
-0.330348938703537,
-0.07248423993587494,
-0.5826247930526733,
-0.051515400409698486,
0.4774087369441986,
-0.2575122117996216,
0.2275949865... | |
successfully.
I thought about loading the Entities with `NoTracking` and calling `ApplyPropertyChanges` after the detached entity has been validated, but I'm not entirely sure about the correct way to do that. The docu of the EntityFramework at MSDN is very sparse.
Another way I could think of is to `Refresh` the ent... | [
-0.009671207517385483,
0.1669800877571106,
0.48839884996414185,
-0.2182830423116684,
0.35068097710609436,
-0.11633957177400589,
0.2847311794757843,
-0.2761598825454712,
-0.4036644399166107,
-0.3689666986465454,
-0.1687413901090622,
0.7329223155975342,
-0.2911454141139984,
0.043166853487491... | |
and nothing is actually happening in the context.
Now when you want actually make the change you can do this:
```
// get the value from the database
var original = ctx.Customers.First(c => c.ID == customer.ID);
// copy values from the changed entity onto the original.
ctx.ApplyPropertyChanges(customer); .
ctx.SaveCh... | [
0.052306853234767914,
-0.035468291491270065,
0.8189116716384888,
-0.0960141271352768,
0.21908038854599,
-0.09182722121477127,
-0.16534754633903503,
-0.1540474146604538,
-0.22281451523303986,
-0.4761524796485901,
-0.2990710437297821,
0.7018274068832397,
-0.5374313592910767,
0.35662442445755... | |
entry =
ctx.ObjectStateManager.GetObjectStateEntry(entity);
// get all the property names
var propertyNames =
from s in entry.CurrentValues.DataRecordInfo.FieldMetadata
select s.FieldType.Name;
// mark every property as modified
foreach(var propertyName in pro... | [
0.0874156802892685,
0.13515064120292664,
0.5309446454048157,
-0.10165368020534515,
0.25409916043281555,
-0.0065688444301486015,
0.34603485465049744,
-0.4740666151046753,
-0.11552899330854416,
-0.60927814245224,
-0.33313459157943726,
0.5151479244232178,
-0.19293592870235443,
0.5746033787727... | |
this:
```
ctx.Customers.MergeOption = MergeOption.NoTracking;
var customer = ctx.Customers.First();
// make changes to the customer in the form
ctx.AttachAsModified("Customers", customer);
ctx.SaveChanges();
```
And now you have no concurrency or extranous queries.
The only problem now is dealing with FK properties... | [
0.12234313786029816,
0.17627853155136108,
0.7410545349121094,
-0.05209578201174736,
0.0641816183924675,
0.09044136106967926,
0.19953647255897522,
-0.1430320143699646,
-0.3523329198360443,
-0.375169038772583,
0.14088913798332214,
0.2969893217086792,
-0.23970703780651093,
0.14706577360630035... | |
I have written a program that uses qhttp to get a webpage. This works fine on Linux, but does not work on my Windows box (Vista). It appears that the qhttp done signal is never received.
The relevant code is:
```
Window::Window()
{
http = new QHttp(this);
connect(http, SIGNAL(done(bool)), this, SLOT(httpD... | [
-0.1611078381538391,
0.005751034244894981,
0.7023100256919861,
-0.26251521706581116,
-0.2191789597272873,
-0.008207515813410282,
0.6489786505699158,
-0.17458564043045044,
0.021133603528141975,
-0.7979893684387207,
-0.3777219355106354,
0.5619240403175354,
-0.2106131762266159,
0.387702614068... | |
//Never gets here!
}
```
Any help would be appriecated.
Matt
You can use SQL Agent on the MSDE version of SQL Server 2000 to schedule jobs. You will have to use a licensed copy of SQL Server, either the one that comes with MSDN or a retail copy and install the tools from it and then remotely connect to the MSDE ins... | [
0.2740830183029175,
0.17559048533439636,
0.48256394267082214,
0.0744202733039856,
0.012813272885978222,
-0.3672752380371094,
0.595061182975769,
0.4015062153339386,
-0.10086233168840408,
-0.741204023361206,
0.08757659047842026,
0.6590526103973389,
-0.22061297297477722,
0.15801897644996643,
... | |
I need to do a lot of things with UISlider. First of all I want to know what are all the things are possible and what are not. Please give me ideas for the doable ones.
I need to add a slider control in my iPhone application (that should resemble the one which is displayed in the iphone when the phone is getting charg... | [
0.3334196209907532,
-0.01312519796192646,
0.677055299282074,
0.1926167756319046,
0.015412719920277596,
0.04113972187042236,
0.30457788705825806,
-0.404838889837265,
-0.31181469559669495,
-0.542719304561615,
0.20212294161319733,
0.5311229825019836,
-0.2596563994884491,
0.061565205454826355,... | |
car stating sound) and when the sliding ends the sound should be stopped. is this possible? if yes, please gimme ideas to do this. 3. vibration should also happen while sliding (possible?)
Thanks in advance!!!
All of these can be done via the public API. Read the docs :-)
1. The button is called the "thumb image"; th... | [
0.4283336102962494,
-0.029579205438494682,
0.6630029678344727,
0.37018975615501404,
0.11608844995498657,
-0.12341852486133575,
-0.10619474202394485,
-0.39333394169807434,
-0.2554537355899811,
-0.23998969793319702,
0.0010688351467251778,
0.9386234879493713,
-0.12990881502628326,
-0.05842160... | |
We are currently evaluation our hosting options and the cheapest suitable option we've found only has SQL Server 2000 MSDE as the db server.
What is the max size of a db on the server? Is there a max total size for dbs combined?
I like the third way; I don't think it looks like overkill at all. If you need an even sho... | [
-0.031839519739151,
0.052840035408735275,
0.4081115126609802,
0.02183392085134983,
-0.2098526507616043,
-0.03140994906425476,
0.06240914762020111,
-0.36843642592430115,
0.04672830179333687,
-0.7146598696708679,
0.1566954404115677,
0.21317589282989502,
-0.3326040506362915,
0.311610728502273... | |
-1;
};
// Using it:
el.currentStyle.display.matches('block,inline-block,table-cell');
``` | [
-0.09710628539323807,
-0.0942624881863594,
0.51028972864151,
-0.25260603427886963,
0.22326073050498962,
-0.09728488326072693,
-0.06846028566360474,
-0.428717702627182,
0.09069385379552841,
-0.4812780022621155,
-0.08301155269145966,
-0.023305067792534828,
-0.43184414505958557,
0.08294766396... | |
I have a piece of dynamic SQL I need to execute, I then need to store the result into a variable.
I know I can use `sp_executesql` but can't find clear examples around about how to do this.
If you have OUTPUT parameters you can do
```
DECLARE @retval int
DECLARE @sSQL nvarchar(500);
DECLARE @ParmDefinition nvarcha... | [
0.170917809009552,
-0.01557718962430954,
0.914299726486206,
-0.3109400272369385,
-0.08550796657800674,
0.08683110028505325,
0.308555543422699,
-0.8151594996452332,
-0.3121891915798187,
-0.3841617703437805,
-0.06090579926967621,
0.5722842216491699,
-0.20205311477184296,
0.10926158726215363,... | |
value
create table #temptable (ID int null)
insert into #temptable exec mysp 'Value1', 'Value2'
select * from #temptable
```
Not pretty, but works. | [
0.21478721499443054,
-0.03490348160266876,
0.14819037914276123,
-0.009188159368932247,
0.3332917094230652,
0.0725189745426178,
0.21545906364917755,
-0.11356417089700699,
0.355713814496994,
-0.40305086970329285,
-0.04529046639800072,
0.6044056415557861,
-0.160373717546463,
-0.05303611233830... | |
I may be asking this incorrectly, but can/how can you find fields on a class within itself... for example...
```
public class HtmlPart {
public void Render() {
//this.GetType().GetCustomAttributes(typeof(OptionalAttribute), false);
}
}
public class HtmlForm {
private HtmlPart _FirstPart = new HtmlPart(); ... | [
0.1853458136320114,
-0.18571314215660095,
0.31836745142936707,
-0.15001343190670013,
-0.2463747262954712,
-0.10651565343141556,
0.525837779045105,
-0.40698325634002686,
-0.07079917192459106,
-0.7215095162391663,
-0.09132873266935349,
0.5148369073867798,
-0.2647118866443634,
-0.166278690099... | |
find attribute information *without knowing/accessing the parent class!*
If I understand your question correctly, I think what you are trying to do is not possible...
In the `Render` method, you want to get a possible attribute applied to the object. The attribute belongs to the field `_SecondPart` witch belongs to th... | [
-0.07964466512203217,
-0.09047747403383255,
0.7007922530174255,
0.07985711842775345,
0.21583524346351624,
0.028070930391550064,
0.21169660985469818,
-0.3060242831707001,
0.2813986539840698,
-0.7602799534797668,
-0.0686430111527443,
0.5750747919082642,
-0.2314266860485077,
0.011737234890460... | |
| BindingFlags.Public | BindingFlags.Instance);
foreach (var fi in infos)
{
if (fi.GetValue(obj) == this && fi.IsDefined(typeof(OptionalAttribute), true))
Console.WriteLine("Optional is Defined");
}
}
}
``` | [
0.030829794704914093,
-0.3249180018901825,
0.8009269833564758,
-0.3588108718395233,
0.45549172163009644,
-0.1409359723329544,
0.33075281977653503,
-0.5361848473548889,
0.12017710506916046,
-0.630310595035553,
-0.45275530219078064,
0.736853301525116,
-0.43799373507499695,
-0.023321555927395... | |
I have a small (200 rows / 400kb) table with 4 columns - nvarchar(MAX), nvarchar(50), and two ints. I'm having a problem with one particular row in which I can select and update the int fields, but when I attempt to select or update the nvarchar fields, the query runs indefinitely (at least 45 minutes before I cancel).... | [
0.0076711890287697315,
0.14552278816699982,
0.46772322058677673,
-0.09217200428247452,
0.08570770174264908,
0.41676896810531616,
0.22528855502605438,
-0.19098806381225586,
-0.38024410605430603,
-0.6038851141929626,
0.11149904131889343,
0.29353067278862,
-0.17188423871994019,
0.380385130643... | |
can free them up through the Activity Monitor. It is located in the Management folder of the database you are looking at.
Expand that, right click on Activity Monitor, and select View Processes. You can right click on processes and kill them there.
This isn't always the best solution, especially with a production dat... | [
0.41995012760162354,
-0.5142311453819275,
0.1517331302165985,
0.564298152923584,
0.3220292031764984,
-0.27428531646728516,
-0.09591389447450638,
0.0052447328343987465,
-0.8111087083816528,
-0.5815311074256897,
-0.14105212688446045,
0.5641495585441589,
-0.39833036065101624,
0.20770223438739... | |
Does anyone have a ballpark percentage breakdown of Windows versions currently being used out there?
For example, 60% are using Vista, 30% XP etc etc.
We are currently building an installer and we need to know what will give us the most coverage. What we are particularly interested in is the prevalance of .NET versi... | [
0.45667412877082825,
-0.20688235759735107,
0.3730408549308777,
0.28457018733024597,
-0.18857713043689728,
-0.2079276740550995,
0.05227014049887657,
0.2262389212846756,
-0.27824652194976807,
-0.7117404937744141,
0.2859309911727905,
0.4249172508716583,
-0.09699132293462753,
-0.12336950749158... | |
I read [this](http://guides.rubyonrails.org/routing.html) article about how you can prefix routes in ruby on rails. I want to be able to do the same thing with asp.net mvc
So I want to be able to define a route like :
```
/photographers/1/photos/2 //photo 2 of photographer with id 1
/photographers/1/photos //al... | [
0.39294320344924927,
-0.2617703974246979,
0.4540499448776245,
0.20346102118492126,
-0.22899262607097626,
-0.257415235042572,
0.2839648425579071,
-0.3775639533996582,
-0.35347187519073486,
-0.7932246923446655,
0.25859078764915466,
0.32265469431877136,
-0.43071314692497253,
-0.05423572659492... | |
= "Photographers", action = "Photo", photoID = null });
```
Then define your controller action like this:
```
public ActionResult Photo(int id, int? photoID)
{
// If photoID is not null, show just that photo.
// Otherwise, show all photographs.
}
``` | [
0.11629670858383179,
-0.7067602276802063,
0.19738531112670898,
0.016614219173789024,
0.15010634064674377,
-0.12678998708724976,
0.11294139176607132,
-0.5538665652275085,
-0.46291014552116394,
-0.17979000508785248,
-0.24201369285583496,
0.6618193984031677,
-0.7616309523582458,
-0.3167000114... | |
I understand the purpose of events, especially within the context of creating user interfaces. I think this is the prototype for creating an event:
```
public void EventName(object sender, EventArgs e);
```
What do event handlers do, why are they needed, and how do I to create one?
To understand event handlers, you ... | [
0.20001988112926483,
0.15214453637599945,
0.02023681439459324,
0.28559133410453796,
-0.009251763112843037,
-0.09153269231319427,
-0.025436662137508392,
-0.10371245443820953,
-0.2493320107460022,
-0.4606180489063263,
-0.14106839895248413,
0.07036334276199341,
-0.1803583949804306,
0.24730364... | |
the input arguments. For example, if we create a delegate `void MyDelegate(object sender, EventArgs e)`, it can only point to methods which return `void`, and take an `object` and `EventArgs`. Kind of like a square hole and a square peg. So we say these methods have the same signature, or shape, as the delegate.
So kn... | [
0.17062599956989288,
0.01562642678618431,
-0.13088661432266235,
0.25412222743034363,
-0.030377980321645737,
-0.008459792472422123,
0.22599537670612335,
-0.01560822781175375,
-0.2226722538471222,
-0.42872774600982666,
-0.22323347628116608,
0.36555397510528564,
-0.31284692883491516,
0.225915... | |
code we want to be executed. The glue between the event and the methods to be executed are the delegates. The event must internally store a "list" of pointers to the methods to call when the event is raised.\* Of course, to be able to call a method, we need to know what arguments to pass to it! We use the delegate as t... | [
0.5026099681854248,
-0.098509281873703,
-0.01679605431854725,
0.18036624789237976,
0.005348740145564079,
-0.10554639995098114,
0.1292552798986435,
-0.151454359292984,
0.08245079219341278,
-0.3216475248336792,
-0.2635510265827179,
0.597526490688324,
-0.24364560842514038,
0.02761476486921310... | |
*which shape of method* (EventHandler) that event will invoke, by specifying a delegate:
```
//This delegate can be used to point to methods
//which return void and take a string.
public delegate void MyEventHandler(string foo);
//This event can cause any method which conforms
//to MyEventHandler to be called.
public... | [
0.3025589883327484,
0.12665970623493195,
0.267046183347702,
-0.21771647036075592,
0.010099570266902447,
-0.045256052166223526,
0.3597013056278229,
-0.5237811803817749,
-0.2373126596212387,
-0.43103817105293274,
-0.12101822346448898,
0.3755873143672943,
-0.23899000883102417,
0.2432090193033... | |
an event is really, under the covers, just a list of methods of the same "shape". The list is stored where the event lives. When the event is "raised", it's really just "go through this list of methods and call each one, using these values as the parameters". Assigning an event handler is just a prettier, easier way of... | [
0.40930697321891785,
-0.1696934700012207,
-0.11593138426542282,
0.45712119340896606,
-0.08998002856969833,
-0.06358038634061813,
-0.043682947754859924,
-0.11353646963834763,
-0.24868710339069366,
-0.3652445673942566,
0.11667156964540482,
0.34369099140167236,
-0.1208941638469696,
-0.0253271... | |
My coworkers and I cannot seem to agree on a solution to the following issue:
We are working on moving our application to the .net framework. It will be a standalone application (not a web application) that will consist of many custom forms used for making changes to our extensive database. So, in summary, without a d... | [
0.5316981673240662,
0.27549752593040466,
0.0219881609082222,
0.09824590384960175,
0.3486003875732422,
-0.22162458300590515,
0.16953246295452118,
0.1992035210132599,
-0.20514123141765594,
-0.6289137601852417,
0.06788992136716843,
0.4942283034324646,
-0.2805083096027374,
0.28310251235961914,... | |
custom forms (categorized by team). It will also include a "My Forms" section and a "Recent Forms" section that will be changed by the user (my forms) and the system (recent forms) on a regular basis.
My question is this: what is the best place for storing these custom user-specific-settings? An XML file located local... | [
0.8894389867782593,
0.06319737434387207,
0.6900606155395508,
0.22313912212848663,
0.08063439279794693,
0.03677153214812279,
0.0886911079287529,
-0.24322178959846497,
-0.6304018497467041,
-0.7042506337165833,
0.3077368140220642,
0.3150678277015686,
0.1431385725736618,
-0.05346069112420082,
... | |
the app requires the database to be functional, I'd add them to the database. Why add some new concept to the app, just keep storage of data in a single place. Your app will be able to run with lower privileges as well. If you're using the asp.net membership model (yes, for the desktop app) then you'll be able to take ... | [
0.8579000234603882,
0.043029267340898514,
0.22560273110866547,
0.45129403471946716,
-0.03524516150355339,
-0.3778682351112366,
0.1634654402732849,
-0.1316344290971756,
-0.32928282022476196,
-0.35354113578796387,
0.17072740197181702,
0.47847747802734375,
-0.267322838306427,
-0.1912319511175... | |
I'm working on a seam application (2.1.1.GA under JBoss AS 4.2.2) where a particular has a number of (sometimes large) sections that do not need to be rendered untill the user interacts with that particular section, think along the lines of an article title where the user clicks on the title and it expands to show a bo... | [
0.3426923155784607,
0.162363201379776,
0.44623345136642456,
-0.14459794759750366,
-0.05574931204319,
-0.21933874487876892,
0.09657596051692963,
0.3144834637641907,
-0.26699361205101013,
-0.917029082775116,
-0.23632346093654633,
0.23273420333862305,
-0.010076314210891724,
0.0838769152760505... | |
not contain richfaces controls themselves) to be downloaded on demand using ajax?
Thanks.
Lots of ways.
Just set rendered="false" on the box and then reRender it's parent container when you click the title.
eg. Where you have a boolean called showContent in your backing Bean that is toggled by the toggleContent() m... | [
0.04508992284536362,
-0.07220347225666046,
0.6242794394493103,
0.11472902446985245,
-0.2173127830028534,
-0.38145333528518677,
0.32805582880973816,
0.06756921112537384,
-0.08974380046129227,
-0.6731102466583252,
-0.34805944561958313,
0.7171981930732727,
-0.34298253059387207,
-0.16099125146... | |
do it would be to use the a4j:jsFunction (very handy) and some javascript.
```
<h1 onclick="toggleContent(this);">This is a title</h1>
<a4j:outputPanel id="contentDiv">
<a4j:outputPanel rendered="#{someBackingBean.showContent}">
This is some text that is not rendered when the page loads
</a4j:outputPanel>
... | [
-0.022870177403092384,
0.01169172115623951,
0.38084307312965393,
-0.10836200416088104,
-0.04481169953942299,
-0.26072895526885986,
0.3699638843536377,
-0.03856528922915459,
-0.13744476437568665,
-0.528210461139679,
-0.2658633291721344,
0.414246141910553,
-0.2314574122428894,
-0.14389216899... | |
I'm offering a search option for my users. They can search on city name. The problem is that my city names I have stored are things like "Saint Louis". But I want to find Saint Louis even if the user types in "St. Louis" or "St Louis". Any suggestions on how I could create a lookup table to take that into account someh... | [
0.5151358246803284,
-0.030251724645495415,
0.31707674264907837,
0.36729052662849426,
0.022015560418367386,
-0.013853685930371284,
0.07827091962099075,
0.37714114785194397,
-0.3371415436267853,
-0.8897339701652527,
0.03721259534358978,
0.259718120098114,
-0.2055005431175232,
0.2770899236202... | |
relationship between city and city\_names.
Now the only problem is distinguishing the one name, for each city, that is the preferred name. We can do that a couple of ways: 1) the first table could have a fk to the second table, that holds to id of the preferred name. This creates a circular dependency, though. So bett... | [
-0.020523961633443832,
-0.06363079696893692,
0.6879244446754456,
0.22640587389469147,
-0.2260332554578781,
0.1667172908782959,
-0.20759056508541107,
-0.1469380110502243,
-0.0777871310710907,
-0.6926634907722473,
-0.2080436497926712,
0.11758481711149216,
-0.5081614851951599,
0.4716212153434... | |
to get all names, with the preferred name first:
```
select name from city_names where city_id = ?
order by is_preffered desc, name;
```
This has an additional advantage: if you don't cover every city and town, you can use the second table to map towns/villages/counties you don't cover to the major cities you... | [
-0.04119924455881119,
-0.06173533573746681,
0.49888476729393005,
0.2322913259267807,
0.029017338529229164,
-0.04360105097293854,
0.025048380717635155,
0.06976182758808136,
-0.2576703727245331,
-0.6762368679046631,
-0.5110694766044617,
0.3223845064640045,
-0.23582208156585693,
0.08291151374... | |
I use the following code to Invoke and access properties on my from from a different thread.
```
public static void PFA(Action<frmain> action)
{
var form = Form.ActiveForm as frmain;
if (form != null)
{
form.PerformAction(action);
}
}
public void PerformActi... | [
0.2352045774459839,
-0.3230917155742645,
0.7049795985221863,
-0.47758087515830994,
0.12355219572782516,
0.1257621794939041,
0.33097967505455017,
-0.622991144657135,
-0.1205206885933876,
-0.5286003351211548,
-0.27875441312789917,
0.4992489814758301,
-0.33995407819747925,
0.10244636237621307... | |
if (InvokeRequired)
Invoke(action, this);
else
action(this);
}
```
My Question:
If I call `PFA(form => form.Richbox1.Text = "Test")` - I want PFA() to check if the action is (Richbox1.Text) and if so then Add "\n" to the text("Test").
The Idea is to call
```
PFA(form => form.Ri... | [
0.0866340845823288,
-0.28610438108444214,
0.2516162097454071,
-0.24644771218299866,
-0.18450847268104553,
0.4205130636692047,
0.37885430455207825,
-0.5747030973434448,
-0.13277657330036163,
-0.4781166613101959,
-0.4504242241382599,
0.3072870075702667,
-0.5418844223022461,
-0.36394837498664... | |
"Richbox1.Text ="
How I do that? I never worked with actions before.
What if you did:
```
PFA(form => UpdateTextBox(form.Richbox1,"Test"));
public void UpdateTextBox(RichTextBox box,string text)
{
if (box.Name=="Richbox1")
{
text+="\n";
}
box.AppendText(text);
}
```
Your not going to be able t... | [
-0.051476020365953445,
-0.20350182056427002,
0.11654651910066605,
-0.3037395775318146,
0.04923021420836449,
0.05450369790196419,
0.3645142912864685,
-0.6769895553588867,
-0.11109886318445206,
-0.5156521201133728,
-0.45378378033638,
0.5110294818878174,
-0.7896795868873596,
-0.35942983627319... | |
Right now I have two fields for cost. One for dollars and one for cents. This works, but it is a bit ugly. It also doesn't allow the user to enter the term "free" or "no cost" if they want. But if I only have one field, I might have to make my parser a bit smarter. What do you think?
On the server side, I combine doll... | [
0.6864254474639893,
-0.03476955369114876,
-0.10422936081886292,
0.5440088510513306,
-0.037988096475601196,
0.2648856043815613,
-0.41714271903038025,
0.024309905245900154,
-0.24298985302448273,
-0.526252031326294,
0.5799922943115234,
0.6330747604370117,
0.148335799574852,
0.2996419370174408... | |
Then whenever I actually use the cost for stats or other purposes, I would convert it to a decimal at that point. Or am I on the right track?
There is a rule in database design that states that "atomic data" should not be split. By this rule a price, or cost is such an example of atomic data and therefore it should nev... | [
0.6171252727508545,
-0.027050696313381195,
-0.057546477764844894,
0.6266484260559082,
0.12056932598352432,
-0.005530305206775665,
-0.3334205150604248,
0.027130868285894394,
-0.20737391710281372,
-0.1574423909187317,
0.33026039600372314,
0.4206976890563965,
0.13759854435920715,
0.2191052287... | |
work and it's supported by all ANSI SQL compliant database products!
You can consult Joe Celko's ["Thinking In Sets"](https://rads.stackoverflow.com/amzn/click/com/0123741378) book for a discussion of this topic. See [section 1.6.2, pages 21-22](http://www.google.com/url?sa=t&source=web&ct=res&cd=5&url=http%3A%2F%2Fbo... | [
0.5577613115310669,
-0.08370433747768402,
0.40026289224624634,
0.04278082773089409,
-0.11356036365032196,
0.44538360834121704,
-0.04297851398587227,
-0.6875273585319519,
-0.1322675496339798,
-0.6075018644332886,
-0.1830020397901535,
0.8310993909835815,
-0.08431053906679153,
-0.286935180425... | |
parse the validated string to a Decimal type in your language, or just pass it as a string into your database - SQL will know how to cast it to a DECIMAL type. | [
0.2454434484243393,
0.3074701428413391,
-0.10589788854122162,
0.29662808775901794,
-0.16028256714344025,
-0.13767346739768982,
0.10604087263345718,
0.19790413975715637,
0.091555155813694,
-0.04714217409491539,
-0.1282220035791397,
0.23155230283737183,
-0.22036902606487274,
-0.2409368306398... | |
We have an object that derives from DependencyObject, and implements some DependencyProperties.
Basically something like this:
```
class Context : DependencyObject {
public static readonly DependencyProperty NameProperty =
DependencyProperty.Register ("Name", typeof (string), typeof (Context), new PropertyMetad... | [
0.11214590817689896,
-0.25012731552124023,
0.3127578794956207,
-0.041182972490787506,
0.3317704200744629,
-0.1705215722322464,
0.13498049974441528,
-0.18754197657108307,
0.17110669612884521,
-0.6100952625274658,
-0.3680649697780609,
0.8908653259277344,
-0.35777679085731506,
0.2747667133808... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.