text stringlengths 0 30.5k | title stringclasses 1
value | embeddings listlengths 768 768 |
|---|---|---|
I have the following html
```
<div id="menu">
<ul class="horizMenu">
<li id="active"><a href="#" id="current">About</a></li>
<li><a href="#">Archive</a></li>
<li><a href="#">Contact</a></li>
<li><a href="#">Item four</a></li>
<li><a href... | [
-0.1623164266347885,
0.18861016631126404,
0.4863816201686859,
-0.1777486801147461,
-0.2342931032180786,
0.49767619371414185,
-0.024852771311998367,
-0.28065234422683716,
0.11396970599889755,
-0.7996513843536377,
-0.13136979937553406,
0.38399967551231384,
-0.37735942006111145,
0.00844217371... | |
</ul>
</div>
```
and in the css I have
```
.horizMenu li
{
display: inline;
list-style-type: none;
padding-right: 20px;
}
#menu
{
text-align:center;
margin-bottom:10px;
letter-spacing:7px;
}
#menu a
{
color:red;
}
#menu a:hover
{
color:blue;
font-weight:bold;
}
```
Ev... | [
-0.6074265837669373,
0.25124529004096985,
0.41731682419776917,
-0.4490390419960022,
-0.3021523952484131,
0.32110315561294556,
0.10802897810935974,
0.023221826180815697,
-0.00740123400464654,
-0.9039828181266785,
-0.3564870059490204,
0.6684368848800659,
-0.5339441299438477,
-0.1921623349189... | |
move slightly and then move back when you mouse-off. Is there an easy way to stop this from happening?
Not sure who -1ed, but Mauro's answer is essentially correct: you can't trivially make an item with automatic width depend on what the width would have been if the font inside weren't bold.
However, a 'float: left;' ... | [
0.2574382722377777,
-0.08316632360219955,
0.5823063850402832,
0.06724701821804047,
-0.06676021218299866,
0.24300505220890045,
0.0983099713921547,
-0.4073356091976166,
-0.1735672950744629,
-0.2172178030014038,
0.09258705377578735,
0.5574865937232971,
0.03271867334842682,
-0.1573310941457748... | |
In Model-View-Presenter pattern where should we write validations of user input.
Domain specific rules/validations should be in the Model. You can have a model.validate() to let you know if the rules are not violated. Look at Rails model (ActiveRecord) classes for a good implementation of this concept.
The View should... | [
0.11100560426712036,
-0.06150296330451965,
0.3460337817668915,
0.1374790072441101,
-0.2941793203353882,
-0.09883501380681992,
0.32020384073257446,
-0.3941497802734375,
-0.3592351973056793,
-0.43626269698143005,
0.2634294629096985,
0.6044285297393799,
-0.24834659695625305,
0.068512462079525... | |
the model.. at the same time you may want to slot in a spinner in the UI with the minValue and maxValue range set to 1-100. | [
0.03260684758424759,
-0.7558280229568481,
1.0020960569381714,
0.34717875719070435,
-0.10677589476108551,
0.17054979503154755,
0.08277687430381775,
-0.3903379738330841,
-0.11350272595882416,
-0.46714577078819275,
0.24738670885562897,
0.44427651166915894,
0.36689457297325134,
0.2152944952249... | |
I would like to know if there is a way to disable automatic loading of child records in nHibernate ( for one:many relationships ).
We can easily switch off lazy loading on properties but what I want is to disable any kind of automatic loading ( lazy and non lazy both ). I only want to load data via query ( i.e. HQL or... | [
0.16011224687099457,
0.14845556020736694,
0.05388345196843147,
0.21938492357730865,
-0.2589980959892273,
0.007090995088219643,
-0.04684166982769966,
-0.16274899244308472,
-0.08237728476524353,
-0.5940003991127014,
0.29573777318000793,
0.2893139123916626,
-0.0887318029999733,
0.550682902336... | |
be loaded as part of the parent record unless a query on the parent record
explicitly states that ( via eager fetch, etc ).
Example:
Fetching Department record from the database should not fetch all employee records from the database because it may never be needed.
One option here is to set the Employees collection ... | [
0.32025349140167236,
-0.3167235851287842,
0.22440078854560852,
0.003569980151951313,
-0.3212144672870636,
-0.16218069195747375,
0.15744733810424805,
-0.14395570755004883,
-0.2536887228488922,
-0.36526116728782654,
-0.20973466336727142,
0.559792160987854,
-0.5422408580780029,
0.331002503633... | |
it does not seem to be working at all times and does not do a deep evict on the object.
Plus it abstracts the lazy loaded property type with a proxy class that plays havoc later in the code where we are trying to operate on the object via reflection and it encounters unexpended type on the object.
I am a beginner to n... | [
-0.05101083591580391,
-0.1398729681968689,
0.3004905581474304,
0.18259179592132568,
-0.10448405891656876,
-0.19023406505584717,
0.17540091276168823,
0.25955644249916077,
-0.08720245212316513,
-0.6100988984107971,
0.262506365776062,
0.36096277832984924,
-0.25544607639312744,
0.3876707553863... | |
hit to find the employees of a database.
*Aplogies if these code examples don't work out of the box, I'm not near a compiler at the moment*
So, your department class might look like:
```
public class Department
{
public int Id { get; protected set; }
public string Name { get; set; }
/* Equality an... | [
0.22954346239566803,
-0.005495748016983271,
0.0069711580872535706,
0.18735724687576294,
-0.4644213318824768,
0.20562449097633362,
0.15127474069595337,
-0.15714892745018005,
0.05420512333512306,
-0.6620083451271057,
0.08596041053533554,
0.5836108326911926,
-0.4616187512874603,
0.03650161623... | |
Name { get; set; }
public Department Department { get; set; }
/* Equality and GetHashCode here */
}
```
Any time you wanted to find Employees for a department, you've have to call:
```
/*...*/
session.CreateCriteria(typeof(Employee))
.Add(Restrictions.Eq("Department", department)
.List<Employee>()... | [
0.366018146276474,
-0.12784546613693237,
0.5117766857147217,
0.16873042285442352,
-0.16227205097675323,
-0.04486138001084328,
0.05784643813967705,
0.1919344812631607,
-0.268961638212204,
-0.42753592133522034,
-0.22760070860385895,
0.3194862902164459,
-0.4421365261077881,
0.4170470535755157... | |
for more information | [
0.5481971502304077,
0.038303181529045105,
-0.08733410388231277,
0.35123759508132935,
0.07756010442972183,
-0.4964873790740967,
0.20779184997081757,
0.7367731332778931,
-0.2528668940067291,
-0.2915046215057373,
-0.023087477311491966,
-0.21499010920524597,
0.1636137068271637,
0.3257263600826... | |
I've been using jQuery to do the whole AJAX magic in my web based applications.
But I came to a decision that I don’t need all these amazing features jQuery has, except its AJAX functions (like `$.ajax()`, `$.get()`, `$.post`, `getJSON()` and `load();`).
Can you recommend a lightweight crossbrowser AJAX library/frame... | [
0.27148178219795227,
0.009989005513489246,
0.1775669902563095,
0.022041387856006622,
-0.17122754454612732,
-0.1721225380897522,
0.09377255290746689,
-0.14627093076705933,
-0.09122835099697113,
-0.6955661177635193,
0.055709343403577805,
0.6240224838256836,
0.020764105021953583,
-0.187198892... | |
Is there a way in Delphi to get the currect application's exe size in one or two lines of code?
Just for grins...you can also do this with streams Just slightly more than 2 lines of code. Generally the application filename including path is also stored into Paramstr(0).
```
var
fs : tFilestream;
begin
fs := tFiles... | [
-0.031844478100538254,
-0.13744933903217316,
0.7344656586647034,
0.006788355298340321,
-0.0024239446502178907,
0.12956616282463074,
0.5705784559249878,
-0.6832960844039917,
-0.09869620949029922,
-0.5159180164337158,
-0.4088015556335449,
0.5557218790054321,
-0.2608560621738434,
-0.247122377... | |
Anyone have any idea how to get the value of "Language for Non-Unicode Programs" in Control Panel Regional Settings programmatically using c#?
Already tried CultureInfo, RegionInfo and getting the default encoding using the Encoding object, but I can only get the Standards and Formats value or the main code page.
[Get... | [
-0.08318022638559341,
0.2154485583305359,
0.2696680724620819,
0.00232270872220397,
0.033935338258743286,
0.1882580667734146,
0.5959299206733704,
0.20664744079113007,
-0.3012203276157379,
-0.6379488110542297,
-0.19538410007953644,
0.5426516532897949,
0.10101069509983063,
-0.1531102061271667... | |
I build VBA applications for both Word and Excel, is there any way to access the progress bar that sometimes appears in the Office status bar.
The following will simulate a progress bar in Excel's status bar:
```
Public Sub UpdateStatusBar(percent As Double, Optional Message As String = "")
Const maxBars As Long ... | [
0.2809489667415619,
0.012246153317391872,
0.784595251083374,
-0.2080395370721817,
-0.03959805518388748,
0.2892328202724457,
0.3220958411693573,
-0.5408489108085632,
-0.027169406414031982,
-0.48386338353157043,
-0.02550647221505642,
0.706581175327301,
-0.23356637358665466,
0.074380114674568... | |
notBar = Chr(151)
numBars = percent * maxBars
Application.StatusBar = _
before & Application.Rept(bar, numBars) & Application.Rept(notBar, maxBars - numBars) & after & " " & _
Message & " (" & PercentageToString(percent) & "%)"
DoEvents
End Sub
``` | [
-0.07554789632558823,
0.5928250551223755,
0.9126240015029907,
-0.19225451350212097,
0.36204448342323303,
0.44388848543167114,
0.48313963413238525,
-0.602604329586029,
0.03486813232302666,
-0.6238183975219727,
-0.2005777209997177,
0.4143499732017517,
0.16095267236232758,
0.22819341719150543... | |
Apart from just inserting and parsing text into a blank Word field, is there any way to programmatically build user-defined fields and field codes into my own templates with VBA? Furthermore, is there a way to make these fields show up in the list of available fields?
I recently developed a solution that used Word's MA... | [
0.5069583654403687,
-0.05700676888227463,
0.2111266553401947,
-0.13932235538959503,
-0.046664610505104065,
0.18483693897724152,
-0.02218259684741497,
-0.15239179134368896,
-0.18082822859287262,
-0.5731045007705688,
-0.014970647171139717,
0.5292555093765259,
-0.3198077976703644,
0.129968330... | |
And it would do nothing when the user double-clicked on it, because I have purposefully not defined a macro named "NoMacro".
The ADDIN field does not display (except when display field codes is turned on) and stores a hidden string in its field.data property. Using this field I could have a hidden field the contents o... | [
0.01731524057686329,
-0.18303240835666656,
0.3300522267818451,
-0.01006624847650528,
0.11455933004617691,
-0.1999090611934662,
0.2023899406194687,
0.08033857494592667,
-0.11582060158252716,
-0.35166648030281067,
-0.1119171753525734,
0.5124906301498413,
-0.22683393955230713,
0.2860842347145... | |
field.)
I found these pages useful:
* [Using MacroButton fields](http://word.mvps.org/FAQs/TblsFldsFms/UsingMacroButton.htm)
* [Using Addin Fields](http://word.mvps.org/FAQs/TblsFldsFms/AddinFields.htm) | [
0.12522877752780914,
0.16774241626262665,
0.14719149470329285,
-0.11745664477348328,
0.029008720070123672,
0.2590405344963074,
0.13645188510417938,
-0.23984292149543762,
-0.1877429485321045,
-0.48303842544555664,
-0.2487359493970871,
0.5659909844398499,
-0.3121938407421112,
-0.186158418655... | |
I am working on a 2D scrolling game for iPhone. I have a large image background, say 480×6000 pixels, of only a part is visible (exactly one screen’s worth, 480×320 pixels). What is the best way to get such a background on the screen?
Currently I have the background split into several textures (to get around the maxim... | [
0.08146987855434418,
0.014782923273742199,
0.5295290350914001,
0.04180774837732315,
0.2487691193819046,
0.24056822061538696,
0.04016336798667908,
0.02751428447663784,
-0.32057565450668335,
-0.6736342310905457,
0.41415536403656006,
0.4444286823272705,
-0.01698199473321438,
-0.04140855744481... | |
I just wanted a working code before I get to optimizing.
I thought that maybe the OpenGL implementation would be smart enough to discard the invisible portion of the background, but according to some measuring code I wrote it looks like background takes 7 ms to draw on average and 84 ms at maximum. (This is measured i... | [
0.34582266211509705,
-0.2823896110057831,
0.4054470360279083,
0.07468660175800323,
-0.07499174773693085,
0.20474308729171753,
0.26016563177108765,
0.03833535313606262,
-0.2694002389907837,
-0.6647814512252808,
0.3681320548057556,
0.650994598865509,
0.13984136283397675,
-0.46225446462631226... | |
the best way to get closer to such performance?
That's the fast way of doing it. Things you can do to improve performance:
* Try different texture-formats. Presumably the SDK docs have details on the preferred format, and presumably smaller is better.
* Cull out entirely offscreen tiles yourself
* Split the image into... | [
0.5416803956031799,
-0.0736929178237915,
0.1467408984899521,
0.281368225812912,
-0.016580352559685707,
0.10334554314613342,
0.08867291361093521,
0.2534928619861603,
-0.3393421471118927,
-0.9726649522781372,
0.16986846923828125,
0.7602932453155518,
0.39664772152900696,
-0.28008460998535156,... | |
I have a .NET web-service client that has been autogenerated from a wsdl-file using the wsdl.exe tool.
When I first instantiate the generated class, it begins to request a bunch of documents from w3.org and others. The first one being <http://www.w3.org/2001/XMLSchema.dtd>
Besides not wanting to cause unnecessary tra... | [
0.16393044590950012,
0.32915839552879333,
0.31988269090652466,
-0.0528254471719265,
-0.23511335253715515,
-0.2677616775035858,
0.22085946798324585,
-0.12192504853010178,
-0.2998775839805603,
-0.6611959338188171,
0.056405238807201385,
0.385610431432724,
-0.11050184816122055,
0.4638736546039... | |
'www.w3.org'"
at System.Net.HttpWebRequest.GetResponse()
at System.Xml.XmlDownloadManager.GetNonFileStream(Uri uri, ICredentials credentials)
at System.Xml.XmlDownloadManager.GetStream(Uri uri, ICredentials credentials)
at System.Xml.XmlUrlResolver.GetEntity(Uri absoluteUri, String role, Type ofObjectToRet... | [
-0.15234607458114624,
-0.013865778222680092,
0.5022342205047607,
0.045003559440374374,
-0.2664726972579956,
0.24346059560775757,
0.30611321330070496,
-0.4928765892982483,
-0.2111305296421051,
-0.8166876435279846,
-0.4088422656059265,
0.4333290755748749,
-0.18796302378177643,
0.078120522201... | |
System.Xml.Schema.Parser.Parse(XmlReader reader, String targetNamespace)
at System.Xml.Schema.XmlSchemaSet.ParseSchema(String targetNamespace, XmlReader reader)
at System.Xml.Schema.XmlSchemaSet.Add(String targetNamespace, XmlReader schemaDocument)
at [...]WebServiceClientType..cctor() in [...]
```
I needed t... | [
-0.18167626857757568,
-0.04229496791958809,
0.49182188510894775,
0.13726961612701416,
-0.1214597225189209,
-0.04278727248311043,
0.09264553338289261,
-0.2945203483104706,
-0.2836024761199951,
-0.5395427346229553,
-0.11341152340173721,
0.5353435277938843,
-0.3789204955101013,
0.014239610172... | |
_schema = new XmlSchemaSet();
_schema.Add(null, XmlResourceResolver.GetXmlReader("http://www.w3.org/TR/2002/REC-xmldsig-core-20020212/xmldsig-core-schema.xsd"));
_schema.Add(null, XmlResourceResolver.GetXmlReader("http://www.w3.org/TR/2002/REC-xmlenc-core-20021210/xenc-schema.xsd"));
_schema.Compile()... | [
-0.5517088770866394,
0.12100977450609207,
0.37942585349082947,
-0.12959307432174683,
-0.26845771074295044,
-0.05140641704201698,
0.47684136033058167,
-0.46466660499572754,
-0.09361609071493149,
-0.479943186044693,
-0.18830442428588867,
0.6279463768005371,
-0.5285499095916748,
0.25680148601... | |
Is there any good way to use a windows application written in C# to display/control a powerpoint slideshow? Ultimately I would like to show thumbnails in a form and clicking these thumbnails would advance the slides shown on a second monitor (similar to using Powerpoint itself to show a slideshow on a second monitor).
... | [
0.4360692501068115,
-0.031109366565942764,
0.35743919014930725,
0.4864387512207031,
-0.031562644988298416,
-0.2236076295375824,
-0.042243245989084244,
-0.005931097548455,
-0.18345028162002563,
-0.5892866253852844,
0.28601065278053284,
0.7059014439582825,
-0.28155317902565,
0.08247979730367... | |
that there is an object model accessable by adding a reference to Microsoft.Office.InterOp.Powerpoint, but I want to be able to distribute the resulting program without having Microsoft Office as a prerequisite, that was why I mentioned Powerpoint Viewer because it can be distributed freely.
This kb lays out the basics... | [
0.3158991038799286,
0.2360667884349823,
0.3653567135334015,
0.2066376805305481,
0.02657684125006199,
-0.17202214896678925,
-0.03280239552259445,
-0.07749734073877335,
-0.02166075073182583,
-0.41791555285453796,
-0.16814258694648743,
0.5548374652862549,
-0.10495772957801819,
0.3137455284595... | |
working with Powerpoint 2007, then you can add editing functionality by using the System.XML and related namespaces to work with the presentation file as an open xml file.
Regarding the comments about UNO/openoffice.org, I think these miss the point, as you cannot use UNO for working with powerpoint, it is for openoff... | [
0.16849938035011292,
-0.18308760225772858,
0.303019642829895,
0.38845545053482056,
-0.4879481792449951,
-0.3466239273548126,
0.09629570692777634,
-0.17444844543933868,
-0.2445058673620224,
-0.5568356513977051,
0.11154666543006897,
0.8418306112289429,
-0.21282321214675903,
-0.05746401846408... | |
displaying and previewing and existing slide show. (you will need one copy of Powerpoint so that you can author the presentation from scratch, plus Visual Studio to create the VSTO project). | [
0.4555349349975586,
-0.3709750175476074,
0.4717842936515808,
0.3696450889110565,
-0.11928755044937134,
-0.042479462921619415,
-0.2759060561656952,
-0.22835449874401093,
-0.17590279877185822,
-0.7026685476303101,
-0.11031797528266907,
0.5961847901344299,
-0.01337912306189537,
-0.15787167847... | |
Below are lines from "the c++ programming language"
```
template<class T > T sqrt(T );
template<class T > complex<T> sqrt(complex<T>);
double sqrt(double);
void f(complex<double> z )
{
s q r t (2 ); // sqrt<int>(int)
sqrt(2.0) ; // sqrt(double)
sqrt(z) ; // sqrt<double>(complex<double>)
}
```
I dont understand why s... | [
0.26749879121780396,
0.03119717724621296,
0.36420440673828125,
-0.053659599274396896,
-0.18063896894454956,
-0.10774820297956467,
0.16126732528209686,
-0.4428728222846985,
0.14638204872608185,
-0.4411861300468445,
-0.17262542247772217,
0.3648124039173126,
-0.5376750230789185,
0.13428138196... | |
the template instance and not in the overloading process. | [
0.09544379264116287,
-0.092706598341465,
-0.12389105558395386,
0.10688833147287369,
-0.16556881368160248,
-0.35864314436912537,
0.1726255863904953,
-0.0498054102063179,
0.01315266452729702,
-0.6410532593727112,
-0.34700706601142883,
0.2856602072715759,
-0.3324829041957855,
0.03619807958602... | |
Is there any class in the .NET framework that can read/write standard .ini files:
```
[Section]
<keyname>=<value>
...
```
Delphi has the `TIniFile` component and I want to know if there is anything similar for C#?
The creators of the .NET framework want you to use XML-based config files, rather than INI files. So no... | [
0.23760701715946198,
-0.3046073615550995,
-0.4054211676120758,
0.0062432619743049145,
-0.49160221219062805,
-0.05955696851015091,
0.09044072031974792,
-0.060350142419338226,
-0.04524092748761177,
-0.685288667678833,
-0.030026094987988472,
0.4632507562637329,
-0.5283219814300537,
-0.1664744... | |
bad or good. See e.g. [an INI file handling class using C#, P/Invoke and Win32](http://www.codeproject.com/KB/cs/cs_ini.aspx). | [
0.13609933853149414,
0.040267590433359146,
-0.3875425457954407,
-0.010048498399555683,
-0.2674820125102997,
0.04807630181312561,
0.33904382586479187,
0.43444231152534485,
-0.24646984040737152,
-0.3976981043815613,
-0.4115208089351654,
0.46366462111473083,
-0.3730664849281311,
0.34678432345... | |
I am a big fan of letting the compiler do as much work for you as possible. When writing a simple class the compiler can give you the following for 'free':
* A default (empty) constructor
* A copy constructor
* A destructor
* An assignment operator (`operator=`)
But it cannot seem to give you any comparison operators... | [
0.4769965708255768,
0.22474317252635956,
0.07438316941261292,
-0.16799227893352509,
-0.11563657969236374,
-0.10370142757892609,
0.4508956968784332,
-0.3727266192436218,
-0.010641093365848064,
-0.6041101217269897,
-0.4567919075489044,
0.5836396813392639,
-0.45159444212913513,
-0.07831192016... | |
== f2) // Fails
{ }
if (f3 != f2) // Fails
{ }
```
Is there a good reason for this? Why would performing a member-by-member comparison be a problem? Obviously if the class allocates memory then you'd want to be careful, but for a simple class surely the compiler could do this for you?
The compiler wouldn't know wh... | [
-0.06821079552173615,
0.15445305407047272,
-0.2597736418247223,
0.07566916942596436,
-0.04631924629211426,
0.03968629986047745,
0.3088138699531555,
-0.39847344160079956,
-0.2551877498626709,
-0.6082128882408142,
-0.023859355598688126,
0.6072242259979248,
-0.4001278579235077,
0.098639436066... | |
I've got a text box bound to an object's property (in fact several text boxes) on a form. This for is an editor for an object. When i'm editing some objects and modify values in the one of the text boxes i can't exit from the text box (neither by tab nor clicking on another text box). However that's not always the case... | [
0.5849029421806335,
-0.019083824008703232,
0.4464876055717468,
-0.014707054942846298,
0.177852064371109,
-0.18446296453475952,
0.3076487183570862,
-0.31922125816345215,
-0.1146852895617485,
-0.6560090184211731,
-0.07785491645336151,
0.7360110878944397,
-0.1710534691810608,
0.04207983240485... | |
form have their CausesValidation properties set to true or false.
Also check the AutoValidate property on the form. It is probably set to EnablePreventFocusChange (which is the default).
It may also be the case that the value being supplied in the text box can not be converted to the type of the property it is bound ... | [
0.14244580268859863,
0.0887659564614296,
0.46358537673950195,
0.05246355012059212,
0.07354132831096649,
-0.5047126412391663,
0.41040104627609253,
-0.3471727669239044,
0.12581562995910645,
-0.5153034329414368,
-0.17111876606941223,
0.8024477958679199,
-0.20757004618644714,
-0.18485303223133... | |
I have been trying to read a picture saved in Access DB as a OLE object in a PictureBox in a C# windows Application.
The code that does this is presented below:
```
string connString = @"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=D:\Rajesh\SampleDB_2003.mdb;";
OleDbConnection oConn = new OleDbConnec... | [
0.01838218979537487,
0.08876442164182663,
0.6029974222183228,
-0.3613322377204895,
0.08076021820306778,
-0.09623382240533829,
0.1474113017320633,
-0.0378820039331913,
-0.0387345515191555,
-0.713516354560852,
-0.1433294415473938,
0.5111262798309326,
-0.3176909387111664,
0.319912850856781,
... | |
OleDbDataReader oReader = oCmd.ExecuteReader(CommandBehavior.SequentialAccess);
while (oReader.Read())
{
txtID.Text = ((int)oReader.GetValue(0)).ToString();
txtName.Text = (string)oReader.GetValue(1);
txtAge.Text = ((int)oReader.GetValue(2)).ToString();
t... | [
-0.007256689947098494,
-0.25061699748039246,
0.6292908191680908,
-0.22276026010513306,
0.2871425747871399,
0.3171282112598419,
0.5134516358375549,
-0.2766840159893036,
-0.06801643967628479,
-0.5279221534729004,
-0.38176408410072327,
0.9906105995178223,
-0.6561500430107117,
0.11774666607379... | |
MemoryStream ms = new MemoryStream();
ms.Write(imageBytes, 0, imageBytes.Length);
Bitmap bmp = new Bitmap(ms);
pbPassport.Image = bmp;
}
```
When I execute the above code, an 'Parameter is not valid' exception is thrown at the line:
```
Bitmap bmp = new Bitmap(ms)
```
Fr... | [
-0.15666049718856812,
-0.21458138525485992,
0.85985267162323,
-0.24891789257526398,
0.1020069494843483,
0.176079660654068,
0.2394770383834839,
-0.1750529706478119,
-0.47177430987358093,
-0.6545400023460388,
-0.28888624906539917,
0.5794063806533813,
-0.5523577928543091,
0.044524479657411575... | |
recognisable. Any suggestion to get past this?
Your bytestream is corrupted somehow, becouse I tried the exact method of yours but filled the byte array with PNG data from a file instead.
I would suggest creating two streams, one from the database, and one from the file that was the source of the image in the database... | [
0.49333104491233826,
-0.029419032856822014,
0.19899356365203857,
0.27950650453567505,
-0.2882743775844574,
0.12628895044326782,
0.026454415172338486,
0.24475504457950592,
-0.1201304942369461,
-0.6806737184524536,
0.21083250641822815,
0.4832204580307007,
-0.3562432527542114,
0.3496205806732... | |
I have had a bug recently that only manifested itself when the library was built as a release build rather than a debug build. The library is a .NET dll with a COM wrapper and I am using CoCreateInstance to create a class from the dll in an unmanaged c++ app. When I finally tracked the bug down it was caused by accessi... | [
0.19144207239151,
0.18755117058753967,
-0.09623926877975464,
-0.21748019754886627,
0.019480684772133827,
-0.20427891612052917,
0.46142810583114624,
0.17726346850395203,
-0.10956747084856033,
-0.7970573902130127,
0.027089696377515793,
0.4649409055709839,
-0.5885878801345825,
0.5485610961914... | |
get
{
return s_instance;
}
}
```
this was failing. Changing it to:
```
private static MyObjectType s_instance;
public static MyObjectType Instance
{
get | [
-0.3727184236049652,
0.06592500954866409,
0.22244225442409515,
-0.12653344869613647,
-0.12980300188064575,
0.004647868685424328,
0.35486719012260437,
-0.02531910128891468,
0.002028760267421603,
-0.592167854309082,
-0.41665762662887573,
0.5448039770126343,
-0.40462908148765564,
-0.040928564... | |
{
if (s_instance==null)
{
s_instance = new MyObjectType();
}
return s_instance; | [
-0.28243762254714966,
-0.12828655540943146,
0.266232967376709,
-0.4292201101779938,
0.0713263526558876,
0.09623405337333679,
0.607841432094574,
-0.18048889935016632,
-0.026248954236507416,
-0.6745433807373047,
-0.4363110661506653,
0.439627081155777,
-0.36973968148231506,
0.2992899715900421... | |
}
}
```
fixed the issue. Any ideas why the initial usage didn't work and if there are any downsides to doing it either way?
The release dll seemed to be perfectly usable from another managed app.
Try adding an (empty) static constructor, or initialize the singleton *in* a static constructor.
Jon Skeet has a f... | [
0.4938967823982239,
0.0059942142106592655,
-0.14091968536376953,
-0.064415842294693,
-0.06284685432910919,
-0.04626865312457085,
0.1527758687734604,
0.3484405279159546,
-0.4476221203804016,
-0.7264788746833801,
-0.07829784601926804,
0.5354170203208923,
-0.48413723707199097,
0.1367871314287... | |
`beforefieldinit`, but this symptom seems to fit some of the symptoms discussed [here](https://csharpindepth.com/articles/BeforeFieldInit). | [
-0.22646832466125488,
-0.21829380095005035,
0.17268286645412445,
-0.6416878700256348,
-0.15668408572673798,
0.11857352405786514,
0.3493725061416626,
0.07477521896362305,
-0.3715408146381378,
-0.09794832766056061,
0.1882471740245819,
0.27975425124168396,
-0.13908475637435913,
0.449791550636... | |
Is there a way to Deserialize Expressions in C#, I would like to store Expressions in a Database and load them at run time.
I continued work on the library that was mentioned by [Serializing and Deserializing Expression Trees in C#](https://stackoverflow.com/questions/217961/serializing-and-deserializing-expression-tre... | [
0.06245154142379761,
-0.2402624785900116,
0.16889970004558563,
0.00855090469121933,
0.028864499181509018,
-0.07695142179727554,
0.2891601026058197,
-0.07290660589933395,
-0.2390781044960022,
-0.4950313866138458,
0.1395876407623291,
0.6425087451934814,
-0.49726051092147827,
-0.2068463116884... | |
I need to migrate Access databases to SQL Server 2005. Since this needs to be done from within a setup so that a customers' installation is transparently migrated to SQL Server 2005, I wonder if it is possible to automate the SSMA toolkit from Microsoft.
I continued work on the library that was mentioned by [Serializin... | [
-0.021590929478406906,
0.08359726518392563,
0.43174809217453003,
-0.06644725054502487,
0.0032856259495019913,
-0.14654958248138428,
0.4308754801750183,
-0.25385358929634094,
-0.17624858021736145,
-0.5531112551689148,
0.20548789203166962,
0.6411164999008179,
-0.37338146567344666,
0.00227417... | |
I am using a satellite assembly to hold all the localization resources in a C# application.
What I need to do is create a menu in the GUI with all the available languages that exists for the application. Is there any way to get information dynamically?
This function returns an array of all the installed cultures in th... | [
0.5547988414764404,
0.05112087354063988,
0.9090514183044434,
-0.12779538333415985,
0.3385176658630371,
0.245294988155365,
0.2768547832965851,
-0.02193581871688366,
-0.23165547847747803,
-0.8420525789260864,
-0.2117939442396164,
0.18087786436080933,
-0.3368152379989624,
0.18150421977043152,... | |
"*.resx", SearchOption.TopDirectoryOnly))
{
string name = file.Split('\\').Last();
name = name.Split('.')[1];
cultures.Add(name != "resx" ? name : "auto"); \\Change "auto" to something else like "en-US" if needed.
}
return cultures.ToArray();
}
```
You could also use this one for ... | [
0.5885564088821411,
-0.28134885430336,
0.7989702224731445,
-0.047113075852394104,
0.21102166175842285,
0.2533925771713257,
0.10217955708503723,
-0.20910966396331787,
-0.29241132736206055,
-0.5745789408683777,
-0.23631201684474945,
0.294840544462204,
-0.42198890447616577,
0.4071519374847412... | |
{
string name = file.Split('\\').Last();
name = name.Split('.')[1];
string culture = name != "resx" ? name : "en-US";
cultures.Add(new CultureInfo(culture));
}
return cultures.ToArray();
}
``` | [
0.4700000584125519,
-0.21684135496616364,
0.5885305404663086,
-0.1547282338142395,
0.5051085352897644,
0.13263003528118134,
0.12069692462682724,
-0.1299775242805481,
-0.11439023911952972,
-0.6524619460105896,
-0.4316343367099762,
0.2631223201751709,
-0.22137312591075897,
0.5051119327545166... | |
I was wondering if there is a native C++ (or STL/Boost) function which will search a CString for a specified string?
e.g.
```
CString strIn = "Test number 1";
CString strQuery = "num";
bool fRet = SomeFn(strIn, StrQuery);
if( fRet == true )
{
// Ok strQuery was found in strIn
...
```
I have found a small numbe... | [
-0.028872022405266762,
0.08734242618083954,
0.19531376659870148,
-0.0248930174857378,
-0.15470457077026367,
-0.007697226945310831,
0.46424224972724915,
-0.03266655281186104,
-0.1962350457906723,
-0.4573071599006653,
-0.19086953997612,
0.5024158358573914,
-0.14688093960285187,
-0.0115311387... | |
found
``` | [
0.06967037171125412,
0.41363540291786194,
0.09161071479320526,
0.13904109597206116,
0.33171185851097107,
-0.19976067543029785,
-0.00812546443194151,
0.3812170624732971,
-0.28377318382263184,
-0.6258401274681091,
-0.33205410838127136,
0.25346067547798157,
0.12460646033287048,
0.125807300209... | |
I have a question with fluent interfaces.
We have some objects that are used as parameter objects for a SQL interface, here's an example:
```
using (DatabaseCommand cmd = conn.CreateCommand(
"SELECT A, B, C FROM tablename WHERE ID = :ID",
SqlParameter.Int32(":ID", 1234)))
{
...
}
```
For some of these p... | [
0.013608710840344429,
-0.006591172888875008,
0.38792553544044495,
0.09032337367534637,
-0.10945311188697815,
0.0398896187543869,
0.31744953989982605,
-0.12481940537691116,
0.12176652252674103,
-0.5815010666847229,
0.22756268084049225,
0.8889792561531067,
-0.34414079785346985,
-0.1830409765... | |
.Precision(15)
)
```
I know these two options doesn't make sense for this type of parameter, but that's not what the question is about.
In the above case, Substitute would have to be a static property (or method if I just add some parenthesis) on the SqlParameterOption class, whereas Precision would have to be an in... | [
0.07634825259447098,
0.1787806749343872,
0.2162773758172989,
0.09849902242422104,
-0.14491353929042816,
0.17555169761180878,
-0.05684635415673256,
-0.47624585032463074,
-0.0457640066742897,
-0.293185830116272,
0.1873624473810196,
0.6740028262138367,
-0.3114091157913208,
0.10645993053913116... | |
name.
How do I do this? Am I completely on the wrong track here?
While re-reading the question, I had an idea, would this different syntax below make more sense?
```
SqlParameter.Int32(":ID", 1234).With
.Precision(15)
.Substitute
```
In this case both would be instance methods on whatever With returns, whi... | [
0.19979003071784973,
0.1960090696811676,
0.19936734437942505,
-0.006792564410716295,
-0.23616136610507965,
-0.008182891644537449,
0.3958006203174591,
-0.2681650221347809,
-0.022438067942857742,
-0.4448823630809784,
0.10912292450666428,
0.5293706059455872,
-0.3092126250267029,
0.24413822591... | |
they tend to show examples like this:
```
order
.AddFreeShipping()
.IncludeItem(15)
.SuppressTax();
```
(lifted from [this page](http://blog.troyd.net/PermaLink,guid,5cdd4862-857a-488d-a577-c6d21b548f19.aspx))
---
**Edit**: Followup after responses
From [@marxidad](https://stackoverflow.com/users/1... | [
-0.12061317265033722,
0.08205781131982803,
0.42578575015068054,
-0.017192209139466286,
-0.18158212304115295,
0.25414568185806274,
0.32292404770851135,
-0.5537171959877014,
-0.24736997485160828,
-0.49531471729278564,
-0.29571324586868286,
0.512912392616272,
-0.46988290548324585,
0.098765768... | |
.Precision(15)
.Substitute());
```
With this approach, With would have to take the object, and apply it to the parameter. I'm fine with that.
If I used the syntax I added as an example, it would be like this:
```
SqlParameter.Int32(":ID", 1234).With | [
0.09872910380363464,
-0.07693982869386673,
0.2108900099992752,
-0.12711098790168762,
-0.09605275839567184,
0.04947950318455696,
0.11630473285913467,
-0.4676361680030823,
0.0767994374036789,
-0.2529909312725067,
0.19095313549041748,
0.7032437920570374,
-0.382085919380188,
0.0258281752467155... | |
.Precision(15)
.Substitute());
```
In this case, With wouldn't know when the chain ended, so each option would have to apply its effect directly.
What is preferred? That the options build up an effect object that will have to be applied later, or that each effect applies its effect dir... | [
0.10338908433914185,
-0.1043594628572464,
0.44615593552589417,
-0.07330319285392761,
0.056319598108530045,
0.2474101334810257,
-0.1707553267478943,
-0.3998361825942993,
-0.3246973156929016,
-0.2778203785419464,
0.1395394504070282,
0.43457111716270447,
-0.13263441622257233,
0.18458606302738... | |
if the changes are irreversible, and could potentially be subject to a reversal, building up state and failing at some point with an exception is the way I'll go.
However, in this case, I'm going with a simpler approach that modifies the SqlParameter object directly.
In this case, my code will look like this:
```
Sq... | [
0.15369823575019836,
0.11942684650421143,
0.3331141173839569,
-0.19202709197998047,
0.12011998891830444,
0.2307642251253128,
0.2548399865627289,
-0.450981080532074,
-0.18239299952983856,
-0.530005693435669,
0.18475590646266937,
0.6179405450820923,
-0.3176993131637573,
0.1271105855703354,
... | |
.Substitute());
```
**Edit:** Gah, that's how it goes when I focus on just one thing.
I can't use that syntax, I'll go with the following, as suggested by [@marxidad](https://stackoverflow.com/users/1659/marxidad):
```
SqlParameter.Int32(":ID", 1234).With(new SqlParameterOption()
... | [
-0.016662713140249252,
0.019416414201259613,
0.39789459109306335,
-0.10224764049053192,
-0.20213043689727783,
0.47574689984321594,
0.003953937906771898,
-0.3187814950942993,
-0.22803443670272827,
-0.46514856815338135,
0.14665178954601288,
0.44011712074279785,
-0.3585352301597595,
0.1117235... | |
.Substitute());
```
The reason is of course that the method that takes the SqlParameter object as an argument is unable to cope with the object returned by With, so although the SqlParameter object is constructed and set up properly, it became incompatible with the intended usage.
`SqlParameterOption's` methods can a... | [
-0.0863938108086586,
-0.06447155028581619,
0.42177650332450867,
0.11057274788618088,
-0.10833782702684402,
0.43578508496284485,
0.10535705089569092,
-0.6064583659172058,
0.04723263531923294,
-0.3792126178741455,
-0.15659265220165253,
0.441577285528183,
-0.5540758967399597,
0.00672045629471... | |
SqlParameterOption Substitute() {/* ... */; return this;}
/* ... */
}
/* ... */
SqlParameter.Int32(":ID", 1234).With(new SqlParameterOption()
.Precision(15) | [
-0.07393033057451248,
-0.2872072756290436,
0.4903213679790497,
0.08553608506917953,
-0.11213566362857819,
0.38484179973602295,
0.10390965640544891,
-0.6282101273536682,
-0.11062871664762497,
-0.2994193434715271,
-0.018395982682704926,
0.4045531451702118,
-0.22704355418682098,
-0.0379793085... | |
.Substitute());
```
**Re: building up state to be applied later vs. applying directly with each call**, if there's no real irreverisible side-effects in either case, then it doesn't matter and it's up to your personal taste. If the options are commited with each method call and there's a chance you might want to undo... | [
0.28592583537101746,
0.08161964267492294,
0.24026289582252502,
-0.05003003031015396,
-0.07231668382883072,
0.15193864703178406,
0.41756516695022583,
-0.46398282051086426,
-0.008740488439798355,
-0.46137887239456177,
-0.26921704411506653,
0.6746999025344849,
-0.31733229756355286,
0.04222581... | |
application so you'll get validation feedback right way. | [
0.5577410459518433,
0.21879178285598755,
0.6156809329986572,
0.1535349041223526,
0.1303400844335556,
-0.3919431269168854,
0.23790740966796875,
-0.3665091097354889,
0.0241387989372015,
-0.49195396900177,
-0.07076525688171387,
0.28280720114707947,
0.32493263483047485,
-0.1679428666830063,
... | |
I quite often see on the Internet various complaints that other peoples examples of currying are not currying, but are actually just partial application.
I've not found a decent explanation of what partial application is, or how it differs from currying. There seems to be a general confusion, with equivalent examples ... | [
0.41165828704833984,
-0.018499737605452538,
0.14050407707691193,
-0.21234053373336792,
-0.33852124214172363,
0.2118396759033203,
-0.028846288099884987,
0.1043885126709938,
-0.15542186796665192,
-0.7121111154556274,
-0.10819317400455475,
0.17966370284557343,
-0.29226285219192505,
0.42805916... | |
curried, becomes:
```
function f(x) { lambda(y) { lambda(z) { z(x(y)); } } }
```
In order to get the full application of f(x,y,z), you need to do this:
```
f(x)(y)(z);
```
Many functional languages let you write `f x y z`. If you only call `f x y` or *f(x)(y)* then you get a partially-applied function—the return ... | [
-0.07559514045715332,
-0.024332890287041664,
0.6046117544174194,
-0.4327910244464874,
0.05511224642395973,
0.3400035500526428,
0.03946433588862419,
-0.5388903617858887,
-0.08970440924167633,
-0.33050844073295593,
-0.282789021730423,
0.34425026178359985,
-0.2715620994567871,
0.0836064293980... | |
curry(fold)(lambda(accum,_){1+accum})(empty-list);
function reverse = curry(fold)(lambda(accum,e){concat(e,accum)})(empty-list);
/* ... */
@list = [1, 2, 3, 4]
sum(list) //returns 10
@f = fold(lambda(accum,e){e+accum}) //f = lambda(accumulator,list) {/*...*/}
f(0,list) //returns 10
@g = f(0) //same as sum
g(list) //r... | [
-0.2732100188732147,
-0.09559420496225357,
0.8075312376022339,
-0.7133350372314453,
-0.12823109328746796,
0.5229054093360901,
0.014107443392276764,
-0.8139148354530334,
0.16291926801204681,
-0.556843638420105,
-0.13821253180503845,
0.4233567416667938,
-0.4413788616657257,
-0.10846270620822... | |
When debugging, a trick I do whenever I want to exit the current method without running of its any statements, I move the current execution pointer to the end of the method, then click F10/11.
Is there a keyboard shortcut (or can I program one) to accomplish this?
(I don't mean shift-F11 (step out) - that does run al... | [
-0.1782238781452179,
0.08236552029848099,
0.17071425914764404,
-0.355966717004776,
0.00848662294447422,
0.12606897950172424,
0.45791423320770264,
-0.36574962735176086,
-0.2799719274044037,
-0.12145120650529861,
-0.17528434097766876,
0.5346462726593018,
-0.4015439450740814,
0.02486893348395... | |
current method)
2. `Right arrow` (skips past the collapsed parameter list)
3. `Ctrl+]` (Edit.GotoBrace: goes to the opening brace)
4. `Ctrl+]` (Edit.GotoBrace: goes to the closing brace)
5. `Ctrl+Shift+F10` (Debug.SetNextStatement: sets the next statement to the closing brace at the end of the function)
6. `F10` (Debug... | [
-0.34828174114227295,
-0.08038881421089172,
0.7742062211036682,
-0.23768766224384308,
0.26794272661209106,
0.06914616376161575,
0.4289759695529938,
-0.5346766114234924,
0.1352982372045517,
-0.12426154315471649,
-0.5789865255355835,
0.6176667809486389,
-0.4606836140155792,
-0.23247131705284... | |
SVN merging is very time consuming (especially on large code bases) and error prone. Eclipse and Netbeans plugins don't serve me very well. At the moment I'm using a combination of manual "svn merge" and the graphical diff [Meld](http://meld.sourceforge.net/). Are there better alternatives (non-win32)?
Actually there a... | [
0.02361367829144001,
0.039898309856653214,
0.1901976317167282,
0.053160808980464935,
-0.2901831865310669,
-0.25673186779022217,
0.3277570903301239,
-0.05886014178395271,
-0.10569015890359879,
-1.04490327835083,
-0.10287748277187347,
0.7035988569259644,
-0.2184472382068634,
0.08736736327409... | |
Is there a class in the standard library of .NET that gives me the functionality to create random variables that follow Gaussian distribution?
Jarrett's suggestion of using a Box-Muller transform is good for a quick-and-dirty solution. A simple implementation:
```
Random rand = new Random(); //reuse this if you are ge... | [
0.09321687370538712,
-0.5249025225639343,
0.03361528366804123,
0.01100513432174921,
-0.1879609078168869,
-0.015426188707351685,
0.028388535603880882,
-0.4599032402038574,
-0.24080398678779602,
-0.3817950487136841,
0.23706072568893433,
0.5230557322502136,
-0.2303861826658249,
0.248007342219... | |
* randStdNormal; //random normal(mean,stdDev^2)
``` | [
-0.04775678738951683,
-0.1578114926815033,
0.14294812083244324,
0.04195429012179375,
-0.18694068491458893,
-0.024394111707806587,
0.22045180201530457,
-0.14934277534484863,
-0.27133288979530334,
-0.3627914488315582,
-0.10687078535556793,
0.5332106351852417,
-0.038961607962846756,
0.1666586... | |
Looking at the C# and VB.NET language specs I think it says that the logical Xor/Or/And operations have different precendence in the two languages. Am I reading that right? I was expecting them to have the same precendence.
For example in C#
```
100 | 200 ^ 300 & 400
```
is the same as...
```
100 | (200 ^ (300 & ... | [
0.23228278756141663,
0.16472002863883972,
0.1381756216287613,
0.06733834743499756,
-0.1449330449104309,
-0.08842456340789795,
-0.11087485402822495,
-0.019122648984193802,
0.04303668066859245,
-0.3135506510734558,
0.021991373971104622,
0.8052353858947754,
-0.11895875632762909,
-0.2002213448... | |
Today when I was in computer organization class, teacher talked about something interesting to me. When it comes to talk about Why cache memory works, he said that:
```
for (i=0; i<M; i++)
for(j=0; j<N; j++)
X[i][j] = X[i][j] + K; //X is double(8 bytes)
```
it is not good to change the first line with the s... | [
-0.0016856910660862923,
0.39588457345962524,
-0.06801871955394745,
0.11447016149759293,
0.15126653015613556,
0.25249162316322327,
0.25599321722984314,
-0.09300672262907028,
-0.32038530707359314,
-0.6779888272285461,
0.05653183162212372,
0.04774326831102371,
-0.27523133158683777,
0.36220714... | |
page from memory into the cache and adjacent address references will likely refer to that same page. If you increment by the row index in the inner loop it is possible that these rows will be on different pages (since they are separated by j doubles each) and the cache may have to constantly bring in and throw away pag... | [
0.1971922516822815,
0.080228790640831,
0.1712823510169983,
0.20890402793884277,
0.09235678613185883,
-0.0627594143152237,
0.5482096672058105,
-0.27943238615989685,
-0.22443881630897522,
-0.5612047910690308,
-0.08625617623329163,
0.2781320810317993,
-0.21845577657222748,
0.39043301343917847... | |
it's still good practice.
[EDIT] The answer above is specific to C and may differ for other languages. The only one that I know is different is FORTRAN. FORTRAN stores things in column major order (the above is row major) and it would be correct to change the order of the statements in FORTRAN. If you want/need effici... | [
0.06010343134403229,
0.2732563614845276,
-0.032388485968112946,
0.0576140359044075,
-0.2765113115310669,
-0.18717807531356812,
0.16736507415771484,
-0.09394127130508423,
-0.31715571880340576,
-0.45079299807548523,
-0.05890778452157974,
0.5772892832756042,
-0.14760670065879822,
-0.233965948... | |
When I asked [this question](https://stackoverflow.com/questions/167575/should-a-project-manager-enforce-coding-standards) I got almost always a definite yes you should have coding standards.
What was the strangest coding standard rule that you were ever forced to follow?
And by strangest I mean funniest, or worst, ... | [
0.6076496839523315,
-0.051801104098558426,
-0.18704533576965332,
0.2736451029777527,
-0.21351101994514465,
-0.21768271923065186,
0.2926787734031677,
0.015737708657979965,
-0.32818612456321716,
-0.1871766597032547,
0.04208888113498688,
0.05296814441680908,
-0.2424934208393097,
0.08453553169... | |
I want to deserialize an object but don't know the class up front. So, consider the following code...
```
IFormatter formatter = new BinaryFormatter();
Stream stream = new FileStream("MyFile.bin", FileMode.Open, FileAccess.Read, FileShare.Read);
MyObject obj = (MyObject)formatter.Deserialize(stream);
```
What could ... | [
0.0377684161067009,
-0.07774883508682251,
0.34670329093933105,
-0.16803833842277527,
0.2110447734594345,
0.09891357272863388,
0.39222463965415955,
-0.3104898929595947,
-0.07555485516786575,
-0.8374842405319214,
-0.29631462693214417,
0.7296250462532043,
-0.42562389373779297,
0.1342424303293... | |
Type t = result.GetType();
``` | [
0.34167250990867615,
-0.11509692668914795,
0.02202627994120121,
-0.20811177790164948,
-0.07444345951080322,
-0.17121703922748566,
0.3190402090549469,
-0.13655388355255127,
0.17320366203784943,
-0.2770228683948517,
-0.4384968876838684,
0.6119473576545715,
-0.6336767077445984,
0.354617595672... | |
Is there a nicer way of styling a `<hr />` tag using CSS, that is cross-browser consistent and doesn't involve wrapping a `div` around it? I'm struggling to find one.
The best way I have found, is as follows:
**CSS**
```
.hr {
height:20px;
background: #fff url(nice-image.gif) no-repeat scroll center;
}... | [
0.24867907166481018,
0.03443002700805664,
0.635424017906189,
0.00046588305849581957,
-0.2703332304954529,
0.04896477609872818,
0.050703033804893494,
-0.30510810017585754,
0.016760539263486862,
-0.6839284300804138,
-0.06839042156934738,
0.4936341345310211,
-0.20189006626605988,
-0.234674468... | |
the need for extra markup:
For non MSIE browsers:
```
hr {
border : 0;
height : 15px;
background : url(hr.gif) 0 0 no-repeat;
margin : 1em 0;
}
```
Additionally for MSIE:
```
hr {
display : list-item;
list-style : url(hr.gif) inside;
filter : alpha(opacity=0);
width : 0;
}
```
See [entry... | [
-0.11696260422468185,
-0.2766478657722473,
0.7089330554008484,
-0.014542254619300365,
-0.25975409150123596,
0.07299067080020905,
0.5340290069580078,
-0.30972230434417725,
-0.26852166652679443,
-0.3786182999610901,
-0.13880355656147003,
0.3493173122406006,
-0.1793065369129181,
-0.1134149581... | |
I have the following arrays in PHP (okay they are a bit bigger but the idea is what counts).
```
$array1 = array(1 => 'a', 2 => 'b');
$array2 = array(3 => 'c', 4 => 'd');
```
Essentially I want to combine the two arrays as if it were something like this
```
$array3 = array(1 => 'a', 2 => 'b', 3 => 'c', 4 => 'd');
... | [
0.1974898725748062,
0.13511711359024048,
0.23794636130332947,
-0.3563246428966522,
-0.2795952260494232,
0.2586797773838043,
0.32118839025497437,
-0.6271676421165466,
-0.28086909651756287,
-0.5523749589920044,
0.09792249649763107,
0.4780755639076233,
-0.2989860773086548,
-0.1447895169258117... | |
b
[3] => c
[4] => d
)
print_r(array_merge($a1, $a2));
Array
(
[0] => a
[1] => b
[2] => c
[3] => d
)
```
Note the different indexing. | [
-0.026830974966287613,
0.06213679537177086,
0.07685419172048569,
-0.386695921421051,
0.06306350231170654,
0.05529395863413811,
0.2191278636455536,
-0.6398327350616455,
-0.09450927376747131,
-0.3677128553390503,
-0.3964117169380188,
0.5740623474121094,
-0.5230427384376526,
-0.03310002014040... | |
Object-relational mapping has been well discussed, including on here. I have experience with a few approaches and the pitfalls and compromises. True resolution seems like it requires changes to the OO or relational models themselves.
If using a functional language, does the same problem present itself? It seems to me ... | [
-0.07834021002054214,
0.09764913469552994,
-0.02297179587185383,
0.36668431758880615,
-0.3038541376590729,
-0.04347102344036102,
-0.0927991196513176,
0.03308848291635513,
-0.21534676849842072,
-0.6452152132987976,
0.1534407138824463,
0.7511422038078308,
-0.1038498729467392,
-0.008903273381... | |
problems of extending the relational database are extended transactions, data-type mismatches, automated query translation and things like [N+1 Select](http://ayende.com/Blog/archive/2006/05/02/CombatingTheSelectN1ProblemInNHibernate.aspx) that are fundamental problems of leaving the relational system and -- in my opin... | [
-0.1842840015888214,
0.1307048201560974,
0.3022110164165497,
-0.03522467985749245,
0.11674614250659943,
-0.05038540065288544,
0.05580974742770195,
-0.032437555491924286,
-0.2203836590051651,
-0.17658013105392456,
-0.03549007698893547,
0.46151092648506165,
-0.17816956341266632,
0.5187295675... | |
I've noticed that when generating a new C++ project using MS Visual Studio 2008, the **Release** build contains debugging symbols - specifically the following settings are enabled:
* The C++/General/Debug Information Format is set to **Program Database**.
* The Linker/Debugging/Generate Debug Info setting is set to **... | [
0.16380520164966583,
0.12963594496250153,
0.18919970095157623,
0.039822906255722046,
-0.2291731834411621,
-0.04181696102023125,
0.05032351240515709,
-0.11915411055088043,
-0.19617916643619537,
-0.4239344000816345,
-0.28602835536003113,
0.7769599556922913,
-0.213680699467659,
-0.12980432808... | |
the dump along with some other information and emails it (with the user's consent) to a company inbox. This has helped us find problems that would have taken us *forever* to reproduce and find otherwise.
Although it's slightly off topic, here's a link to an excellent contribution someone made that gives you an easy wa... | [
0.5907225608825684,
0.2868790030479431,
-0.07720955461263657,
0.36925509572029114,
0.034765154123306274,
-0.4423156976699829,
-0.018333682790398598,
0.199140727519989,
-0.15500429272651672,
-0.19302359223365784,
-0.21987462043762207,
0.2832527756690979,
-0.29724982380867004,
0.104975536465... | |
the future. If a PDB file is used that wasn't built with the same code that built the exe, the stack you see when you try to debug the dmp will be wrong. | [
0.4267134964466095,
-0.39196664094924927,
0.5624209046363831,
0.20963110029697418,
0.5783926248550415,
0.023626869544386864,
-0.34319931268692017,
0.16413240134716034,
-0.21181975305080414,
-0.9536945819854736,
-0.10043290257453918,
0.5847168564796448,
-0.3217938542366028,
0.25951239466667... | |
Is there support in Ruby for (for lack of a better word) non-escaped (verbatim) strings?
Like in C#:
```
@"c:\Program Files\"
```
...or in Tcl:
```
{c:\Program Files\}
```
Yes, you need to prefix your string with `%` and then a single character delineating its type.
The one you want is `%q{c:\program files\}`.
... | [
0.04403223097324371,
-0.1970931887626648,
-0.0457143671810627,
0.0605851449072361,
-0.29598313570022583,
0.11524327844381332,
-0.2583007216453552,
-0.020434588193893433,
-0.13046962022781372,
-0.25145238637924194,
-0.2314494401216507,
0.35421115159988403,
-0.45134586095809937,
-0.119768068... | |
I would like to create an iPhone app that can open the google maps app and place a pin on the map.
I have the exact location of the pin, specified by its longitude and latitude.
I also have a name for the pin e.g. 'location 1' that should be displayed along with the pin.
I know that UIApplication:openURL can be used ... | [
0.18043841421604156,
0.3144593834877014,
0.7688925266265869,
0.22635149955749512,
-0.040089964866638184,
0.06971751153469086,
-0.06770846247673035,
0.047269001603126526,
-0.2519885003566742,
-0.5168082118034363,
-0.046901531517505646,
-0.1559046059846878,
-0.13090988993644714,
0.4303537905... | |
I used to be able to do the following in Preview 3
```
<%=Html.BuildUrlFromExpression<AController>(c => c.AnAction(par1, par2)%>
```
How am I supposed to create urls in a strongly typed way with the MVC Beta?
The only thing so far I have found is
```
<%= Html.ActionLink("aName", "ActionName", "ControllerName")%>
... | [
0.24138806760311127,
-0.3312177360057831,
0.7743238210678101,
-0.0733029916882515,
-0.13394293189048767,
-0.003251522546634078,
0.22718562185764313,
-0.14358112215995789,
-0.4597480297088623,
-0.653285562992096,
-0.18683108687400818,
0.3121364116668701,
-0.4353443384170532,
0.2245239615440... | |
i'm fairly new to NHibernate and although I'm finding tons of infos on NHibernate mapping on the web, I am too silly to find this piece of information.
So the problem is, i've got the following Model:

this is how I'd like it to look. One clean person that has two Add... | [
-0.3888428211212158,
0.20349672436714172,
0.4132255017757416,
-0.16139250993728638,
-0.33197203278541565,
0.03433523327112198,
0.08738767355680466,
-0.002228658879175782,
-0.17150530219078064,
-0.9610667824745178,
0.12996327877044678,
0.6044577360153198,
-0.08114631474018097,
0.14716699719... | |
XML Configuration.
Thanks in advance!
Update: I found the solution to this by myself. This can be done through the node and works rather straightforward.
To achieve the mapping of Address and ShippingAddress I just had to add the following to the
```
<component name="Address" class="Address">
<property name="Str... | [
-0.05168157070875168,
0.07794065773487091,
0.7446767091751099,
-0.03865913674235344,
-0.039200279861688614,
-0.13039085268974304,
-0.39620617032051086,
-0.3296288847923279,
-0.11969761550426483,
-0.9656278491020203,
-0.3230378329753876,
0.5263975858688354,
0.04629326984286308,
-0.101687967... | |
<property name="Streetname"></property>
<property name="Zip"></property>
<property name="City"></property>
<property name="Country"></property>
</component>
<component name="ShippingAddress" class="Address">
<property name="Streetname" column="ShippingStreetname" />
<property name="Zip" column="ShippingZip" ... | [
-0.0322752371430397,
0.18396158516407013,
0.49752482771873474,
-0.11440569162368774,
0.34627529978752136,
0.37570899724960327,
-0.28908035159111023,
-0.18783369660377502,
-0.5933809280395508,
-0.46565428376197815,
-0.27460169792175293,
0.36099836230278015,
0.0714963898062706,
0.26795792579... | |
I have a custom class that implements that IComparable. This class is stored in a Generic List. I now need to compare to lists to see which objects are in list A but not in list B.
I thought the most simple way of doing this would be to iterate through list B and do A.contains().
I do not know how to get it to use m... | [
0.09508691728115082,
-0.060900092124938965,
0.1637379676103592,
0.16841597855091095,
-0.2004280537366867,
-0.1301891952753067,
0.2783348560333252,
-0.10153702646493912,
-0.16960668563842773,
-0.8465822339057922,
0.303646445274353,
0.43820685148239136,
-0.35478702187538147,
0.56147402524948... | |
the objects are actually the same (i.e. points to the same place in memory).
Could anyone help me please?
Why don't you just override the `Equals` method of your class to be consistent in meaning with `CompareTo(other) == 0`? This is the simplest way and also the most idiomatic since, as you've noticed, `Contains` com... | [
0.05281965807080269,
0.08576465398073196,
0.11348210275173187,
0.2917355000972748,
-0.02923458255827427,
-0.18494069576263428,
0.2706965506076813,
0.08297641575336456,
-0.10092411190271378,
-0.8274458050727844,
0.173765629529953,
0.4810805916786194,
-0.20298385620117188,
0.1710097491741180... | |
provide a class that implements a custom equality relation for your class type. However, I think the first method is more appropriate in your case. | [
0.08970122784376144,
-0.06366148591041565,
-0.35214391350746155,
0.315267413854599,
-0.20151248574256897,
-0.027894260361790657,
0.005060823168605566,
0.06401697546243668,
0.014082219451665878,
-0.6606209874153137,
-0.089594267308712,
0.5003501772880554,
-0.2542700469493866,
-0.07237437367... | |
I've been testing an application using my machine as a server, and everything's going fine with it, but when I try to set it up to run on the test server, I get this error:
> Retrieving the COM class factory for
> component with CLSID {XXXX} failed due
> to the following error: 80040154.
Any ideas?
Thanks
First: P... | [
0.3064568340778351,
0.3454098105430603,
0.224924236536026,
0.05553724616765976,
0.07980654388666153,
0.16922321915626526,
0.3434847295284271,
0.13740132749080658,
-0.25552526116371155,
-0.8668141961097717,
-0.0441557839512825,
0.6313850283622742,
-0.08825930953025818,
0.2524266242980957,
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.