text stringlengths 0 30.5k | title stringclasses 1
value | embeddings listlengths 768 768 |
|---|---|---|
I am using Simple Mail from PHP. Now I have the intention of knowing the life time of an email.
If a user wishes to send email one day after submitting the form, how can I achieve this in PHP?
```
$headers = 'From: '.$Name.''. "\r\n" .
'Reply-To: '.$_POST['email'].'' . "\r\n" .
'X-Mailer: PHP/' . phpversion(... | [
0.492205411195755,
0.25661367177963257,
0.40726175904273987,
-0.224027618765831,
-0.24609267711639404,
0.04571961984038353,
0.49923795461654663,
-0.028323711827397346,
-0.08229664713144302,
-0.6280884146690369,
0.10263454914093018,
0.16977007687091827,
-0.1183118000626564,
0.05179062113165... | |
message.
You can save the email message in a database and run a cron job every day to check for emails that has to be sent that day and send them.
The life time of the email is different. For example, if you have sent an email and for some reason if the message was not delivered, it will queued. And the server will t... | [
0.20358794927597046,
-0.18559570610523224,
0.5024434328079224,
-0.01528596319258213,
-0.2297344207763672,
0.13811542093753815,
0.3774622678756714,
0.4209601879119873,
-0.8641640543937683,
-0.5780729651451111,
-0.0010073932353407145,
0.2827386260032654,
-0.3497760593891144,
0.35876226425170... | |
A number of features were introduced into C# 3.0 which made me uneasy, such as object initializers, extension methods and implicitly typed variables. Now in C# 4.0 with things like the dynamic keyword I'm getting even more concerned.
I know that each of these features **CAN** be used in appropriate ways **BUT** in my ... | [
0.08342250436544418,
0.28869765996932983,
0.03929916396737099,
-0.13629788160324097,
-0.40181413292884827,
-0.05657893046736717,
0.25629928708076477,
0.46158337593078613,
-0.3522350788116455,
-0.5176510810852051,
-0.022649556398391724,
0.705843448638916,
-0.45721229910850525,
0.09892815351... | |
demands on my coding standards and forces me to structure things in an OOP way.
Here are a few examples of my concerns for the features mentioned above:
Object constructors can do important logic that is not exposed to the consumer. This is in the control of the object developer. Object initializers take this control... | [
0.4852295219898224,
-0.07819618284702301,
-0.39617541432380676,
0.2288648933172226,
-0.03596564754843712,
0.012255711480975151,
0.20928700268268585,
-0.17757780849933624,
-0.0896412804722786,
-0.37899428606033325,
-0.24308711290359497,
0.5744494795799255,
-0.2600908875465393,
-0.1198009625... | |
forward.
Allowing developers to extend built-in types using extension methods allows all and sundry to start adding their favourite pet methods to the string class, which can end up with a bewildering array of options, or requires more policing of coding standards to weed these out.
Allowing implicitly typed variable... | [
0.30210381746292114,
-0.032282065600156784,
0.20189253985881805,
0.0943991094827652,
-0.2016042172908783,
0.1837599277496338,
0.5415627956390381,
-0.4393952190876007,
-0.2799679934978485,
-0.3570622205734253,
0.08696932345628738,
0.6647012233734131,
-0.3287859857082367,
-0.0646594911813736... | |
are satisfied.
Personally I feel they add very little:
```
Person p1 = new Person("Fred");
p1.Age = 30;
p1.Height = 123;
Person p2 = new Person("Fred")
{
Age = 30;
Height = 123;
};
```
I know a lot of people dislike the 'var' keyword. I can understand why as it is an openly inviting abuse, but I do not min... | [
0.2897879481315613,
0.1816268414258957,
0.647936224937439,
-0.13931076228618622,
0.06169407069683075,
0.1294289082288742,
0.37279415130615234,
-0.509861946105957,
-0.09256483614444733,
-0.42468708753585815,
-0.5048752427101135,
0.7280739545822144,
-0.2566700279712677,
0.0630941092967987,
... | |
they are very useful for extending the .NET types with convenience methods, especially IEnumerable, ICollection and String. String.IsNullOrEmpty() as an extension method is very nice, as it can be called on null references.
I do not think you need to worry, good developers will always use their tools with respect and ... | [
0.23404459655284882,
-0.18263666331768036,
0.3969489336013794,
0.17222918570041656,
-0.07799564301967621,
-0.32829031348228455,
0.194143608212471,
-0.08869010955095291,
-0.17141251266002655,
-0.7483332753181458,
0.32236626744270325,
0.7667616605758667,
-0.2138615846633911,
0.06059958040714... | |
I am self-studying a C# reference and it gives the following information:
1.21.4. Declaring Generic Parameters
Generic parameters can be introduced in the declaration of classes, structs, interfaces, delegates (see the upcoming "Delegates" section), and methods. Other constructs, such as properties, cannot introduce a... | [
0.48154082894325256,
-0.11142360419034958,
0.16843421757221222,
0.09489918500185013,
-0.30370065569877625,
-0.36516255140304565,
0.32961419224739075,
-0.27877122163772583,
-0.00643695704638958,
-0.21628066897392273,
-0.28164583444595337,
0.4611448049545288,
-0.3846008777618408,
0.222691014... | |
wrong and I correct it by adding "set;", I cannot seem to format a call to it successfully.
I'm not sure if you just picked a bad example for your struct name (since Nullable is a framework struct), but if not, the error is due to the fact that you have no set accessor in your property. Automatic properties (added in C... | [
0.4006803631782532,
0.06943615525960922,
0.15668939054012299,
-0.1571938842535019,
-0.07538367807865143,
-0.24144086241722107,
0.48606154322624207,
-0.15829233825206757,
0.032201606780290604,
-0.46743905544281006,
-0.0897405818104744,
0.7093144059181213,
-0.5697289109230042,
0.351116329431... | |
an instance, you could use:
```
Nullable<int> i = new Nullable<int>();
```
This will make it compile. However, as both Jon and Cerebrus has pointed out, it's probably just an example to show the workings of generics. | [
0.2253870815038681,
0.08144952356815338,
-0.2215770184993744,
-0.052042923867702484,
-0.37367135286331177,
-0.363246887922287,
0.608643114566803,
0.11560451239347458,
-0.19961847364902496,
-0.45587924122810364,
0.010764207690954208,
0.34139201045036316,
-0.5846788287162781,
0.4121741056442... | |
In my project I found a piece of code in which a method was getting called in constructor's initializer list.
```
Test2(Test* pTest):m_pTest(pTest), m_nDuplicateID(pTest->getTestID())
{
}
```
I observed that there is a chance that the users of Test2 might pass NULL to the constructor. Since the pointer is u... | [
0.13005541265010834,
0.14036555588245392,
-0.344073086977005,
-0.07586679607629776,
-0.16299717128276825,
0.042749401181936264,
0.39849236607551575,
-0.2747383713722229,
0.010579947382211685,
-0.5887449979782104,
0.11518503725528717,
0.33348655700683594,
-0.4923955798149109,
0.147653520107... | |
the unique ID and returns the same with API getTestID
class Test
{
public:
Test(int nID):m_nID(nID){
}
int getTestID() const
{
return m_nID;
}
private:
int m_nID;
};
class Test2
{
public:
Test2(Test* pTest)
try :m_pTest(pTest), m_nDuplicateID(pTest->getTestID())
... | [
0.1155310869216919,
-0.3055650293827057,
-0.10390840470790863,
-0.03235863521695137,
0.10950132459402084,
0.11785037815570831,
0.18658524751663208,
-0.38345950841903687,
0.013405044563114643,
-0.5950385928153992,
-0.259002149105072,
0.46209484338760376,
-0.22978399693965912,
0.201024681329... | |
}
void printDupID()
{
cout<<"Duplicate ID" << m_nDuplicateID << endl;
}
private:
Test* m_pTest;
int m_nDuplicateID;
};
int main(int argc, char* argv[])
{
Test* pTest = new Test(10);
Test2 aTest2(pTest);
aTest2.printDupID();
delete pTest;
return 0;
}
```
This code... | [
0.10713347792625427,
-0.1902267336845398,
0.21466891467571259,
-0.2508925199508667,
0.4639662802219391,
0.3553275167942047,
0.48011162877082825,
-0.14117386937141418,
-0.08010418713092804,
-0.689337432384491,
-0.13234810531139374,
0.5561818480491638,
-0.41372451186180115,
0.377971887588501... | |
in constructor's initializer list does not strictly confirms to C++ standards. In that case, how do we handle the exceptions in constructor's initializers list (standard way of handling )?
Thanks.
Firstly, if you dereference the NULL pointer standard C++ does not guarantee that that an exception will be thrown, so yo... | [
-0.13388827443122864,
0.2073943167924881,
-0.3150448203086853,
-0.04753265529870987,
-0.30565309524536133,
-0.1550547033548355,
0.38713884353637695,
-0.2848960757255554,
-0.28671500086784363,
-0.44934675097465515,
-0.026712648570537567,
0.32642504572868347,
-0.3731379210948944,
0.073309898... | |
I have a Windows Forms application that allows only one instance to be running at the time. I have implemented Singleton by using Mutex. The Application must be startable from commandline (with or without parameters). Application is started and exited by script. User can not take any action on it.
So, application purp... | [
0.2458072006702423,
0.16090357303619385,
0.245237797498703,
-0.23170553147792816,
-0.13224618136882782,
-0.11789797246456146,
0.2049124836921692,
-0.08634141087532043,
-0.010111306793987751,
-0.9587611556053162,
0.008267020806670189,
0.2836431860923767,
-0.24778452515602112,
0.325728803873... | |
etc.).
To put it simply:
How can I exit the current running application when someone tries to run same application with exit commandline parameter?
```
bool quit = (args.Length > 0 && args[0] == "quit") ? true : false;
using (Mutex mutex = new Mutex(false, sExeName))
{
if (!mutex.WaitOne(0, true))
{
... | [
0.43498146533966064,
-0.14285515248775482,
0.2963789701461792,
-0.3374355733394623,
0.5369389057159424,
0.04564724490046501,
0.5318276882171631,
-0.5232088565826416,
-0.21758805215358734,
-0.1336011439561844,
-0.16029343008995056,
0.8215159773826599,
-0.4110264480113983,
0.2982442378997803... | |
can I get reference to "previous" launced
// Windows Forms application and call it's Exit() method.
}
}
else
{
if (!quit)
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false); | [
0.08514293283224106,
-0.20682568848133087,
0.5514762997627258,
-0.3006856143474579,
0.23738591372966766,
-0.1501273363828659,
0.3725058138370514,
-0.33583614230155945,
0.2071923166513443,
-0.5401440858840942,
-0.43673020601272583,
0.6541681885719299,
-0.308206170797348,
0.2191232591867447,... | |
Application.Run(new Form1());
}
}
}
```
The .NET framework offers a very good generic solution for this. Check the bottom of this [MSDN magazine article](http://msdn.microsoft.com/en-us/magazine/cc163741.aspx). Use the StartupNextInstanceHandler() event handler to pass arbitrary commands to the running ins... | [
0.2981509566307068,
-0.39092904329299927,
0.0048758708871901035,
0.011652303859591484,
0.22702406346797943,
-0.5851765275001526,
0.2889048457145691,
-0.07495344430208206,
-0.16901995241641998,
-0.6247299909591675,
-0.3025924563407898,
0.8068540096282959,
-0.6456013917922974,
0.118095010519... | |
Previously I posted a question so I could confirm our current (albeit archaic) version of Informix here:
[How do you identify Informix version on Solaris?](https://stackoverflow.com/questions/682154/how-do-you-identify-informix-version-on-solaris)
(Thank you Jonathan and RET for clearing that up)
We are definitely p... | [
0.6491132974624634,
0.2383861094713211,
-0.08914580196142197,
0.03324275091290474,
-0.31929031014442444,
-0.41527101397514343,
0.023429879918694496,
0.13581286370754242,
-0.04298091307282448,
-0.6606847643852234,
-0.008418803103268147,
0.6237819194793701,
-0.26670894026756287,
0.0409298129... | |
if we upgrade Informix (currently using 7.13), will we need to modify our embedded sql C programs? If not, then it makes a lot of sense to stick with Informix. Because if we went with Sybase/Oracle etc, we'd have a lot of work on our hands to update the back-end programs.
But if switching to another database can offer... | [
0.5960884690284729,
0.36951306462287903,
0.3523562550544739,
0.30441156029701233,
0.006247113924473524,
-0.3887467086315155,
-0.004260730929672718,
-0.01824628747999668,
0.015493521466851234,
-0.6769168972969055,
0.058666326105594635,
1.0520955324172974,
-0.20223325490951538,
-0.0912490636... | |
have to do major surgery to move them to other systems. You would need to decide which alternative interface to use - your cross-platform choice (with C as the basic language) is ODBC, but Oracle provides the OCI and Sybase provides the TDS as alternatives.
By contrast, with Informix ESQL/C, an upgrade to the current ... | [
0.13641971349716187,
-0.03693398833274841,
0.48623061180114746,
0.17147096991539001,
0.0277157723903656,
-0.12165515869855881,
-0.11597158014774323,
0.14558348059654236,
-0.1580873280763626,
-0.5738937854766846,
-0.21261584758758545,
0.6840491890907288,
-0.31706345081329346,
-0.04913978278... | |
In part, the complexity depends on which data types you use. (Character strings migrate easily; date and time values less easily, for example.) But migrating the applications would require a lot of work, as you say, unless you were extraordinarily prescient and wrote a really good data abstraction layer.
An upgrade to... | [
0.209420844912529,
0.08865948766469955,
0.3775603771209717,
0.31939440965652466,
0.06116247549653053,
-0.14179116487503052,
-0.2976093292236328,
-0.16548676788806915,
-0.134718656539917,
-0.8528916239738464,
-0.03297652676701546,
0.5704948902130127,
-0.2672821879386902,
-0.0773061215877533... | |
for the new).
An upgrade to Informix Dynamic Server (IDS) 11.50 would require you to export the data (DB-Export) from SE and import it (DB-Import) into IDS. This would be very simple too, once you have IDS up and running. Getting IDS up and running takes more effort than SE, but is not all that hard.
Clearly, my reco... | [
0.49647417664527893,
-0.12454346567392349,
0.24068616330623627,
0.11119978129863739,
-0.22317609190940857,
-0.4310402572154999,
-0.18398259580135345,
-0.464914470911026,
0.10118943452835083,
-0.7973928451538086,
-0.12658676505088806,
0.6039397120475769,
-0.34656503796577454,
-0.01290029659... | |
The places I can think of where there are differences are primarily edge case stuff:
* SE has extra syntax to CREATE TABLE for locating C-ISAM files for the database; IDS has a wholly different set of extensions. The basic CREATE TABLE is the same (though IDS has types that SE doesn't, such as VARCHAR), but the adornm... | [
0.2456187903881073,
0.06990471482276917,
0.19063836336135864,
0.14826209843158722,
0.014070392586290836,
-0.3506583273410797,
0.05170086398720741,
-0.35609909892082214,
-0.12893210351467133,
-0.6332994103431702,
-0.18400047719478607,
0.35812950134277344,
-0.3027866780757904,
-0.09264435619... | |
management. IDS has unlogged, logged and 'LOG MODE ANSI' database, as does SE. In IDS, you are encouraged to use a logged database - that would be a strong recommendation. IDS provides atomic statements in a logged database - either the statement works as a whole or it fails as a whole. However, many SE applications ar... | [
0.012628077529370785,
0.2615680396556854,
0.1214563176035881,
0.17969796061515808,
-0.14020538330078125,
-0.7660688161849976,
0.2024846076965332,
-0.34369441866874695,
-0.30565977096557617,
-0.47266408801078796,
-0.028994394466280937,
0.6351137757301331,
-0.18273399770259857,
-0.2379495948... | |
to IDS. Also, you cannot lock a table except in a transaction, and you cannot unlock a table except by COMMIT or ROLLBACK.
How much of a problem this will be depends on what you were using in SE and how the programs were designed (if they were designed rather than thrown together). An IDS unlogged database and an SE u... | [
0.12511175870895386,
0.005226680543273687,
0.048672787845134735,
0.4776196777820587,
0.13541385531425476,
-0.5457159280776978,
-0.3387155532836914,
-0.2022777795791626,
-0.5852168798446655,
-0.685981273651123,
-0.0004932985175400972,
0.3138985335826874,
-0.38640832901000977,
0.146913394331... | |
3.50 should be just a recompile unless you've managed to do some really excruciatingly awful things. | [
0.5052621960639954,
0.18618105351924896,
-0.10831116884946823,
0.072119802236557,
-0.09230267256498337,
0.11437840759754181,
0.5615684390068054,
-0.010841967537999153,
0.17192447185516357,
-0.22045114636421204,
0.23512397706508636,
0.47500765323638916,
0.24287505447864532,
-0.1926197111606... | |
I have the following code in accessing a database via nhibernate:
```
ISessionFactory factory =
new NHibernate.Cfg.Configuration().Configure().BuildSessionFactory();
using (ISession session = factory.OpenSession())
{
ICriteria sc = session.CreateCriteria(typeof(Site));
... | [
0.023712288588285446,
-0.00854389276355505,
0.5573743581771851,
-0.2541694939136505,
0.19350175559520721,
0.16797135770320892,
0.5152320861816406,
-0.3800494968891144,
-0.16581769287586212,
-0.8684473633766174,
-0.02665555290877819,
0.148509219288826,
-0.3864395320415497,
0.729472041130065... | |
}
factory.Close();
```
I wonder whether it is possible to wrap it in this way:
```
using (var factory= new NHibernate.Cfg.Configuration().Configure().BuildSessionFactory())
{
var session = factory.OpenSession();
ICriteria sc = session.CreateCriteria(typeof(Site));
... | [
0.11814059317111969,
-0.11853941529989243,
0.42988643050193787,
-0.3645395338535309,
0.37061426043510437,
0.28998881578445435,
0.6048986315727234,
-0.2805007994174957,
-0.3983273506164551,
-0.67222660779953,
-0.19869139790534973,
0.29673218727111816,
-0.5507819652557373,
0.5750241875648499... | |
}
```
As far as I understand, all the connection inside the using() block will be automatically closed. So I guess that the second statement is fully equivalent to the first.
Am I right?
This is what you usually do:
```
using (ISession session = factory.OpenSession()) {
ICriteria sc = session.... | [
0.48312070965766907,
0.15047286450862885,
0.17202536761760712,
-0.23929429054260254,
0.20877577364444733,
-0.03534773737192154,
0.4202827513217926,
-0.14752376079559326,
-0.47735321521759033,
-0.7766755819320679,
-0.1049269586801529,
0.4633467197418213,
-0.39975395798683167,
0.352686762809... | |
at the start of application. You should not really bother by closing it (unless some specific cases) since it's the application end that cleans it up.
Your factory usually resides in one well defined place - as a singleton.
And to help you understand - using is just c# construct which equals to following:
```
try {
... | [
0.40413999557495117,
0.2836947441101074,
0.41941705346107483,
-0.2978515326976776,
0.2662249207496643,
-0.2236337661743164,
0.18086335062980652,
-0.07297314703464508,
-0.42550426721572876,
-0.6587887406349182,
-0.5226337313652039,
0.3654659390449524,
-0.3136293590068817,
0.3855750560760498... | |
I am creating a Label in a Datagrid itemRenderer(extended from UIComponent) and right now I am setting the width of the label to some static value. I would like to create the label with 100% width. I do not want to use unScaledWidth because I am using link for the label so the link will be visible in the entire cell.
... | [
0.29816439747810364,
-0.20145131647586823,
0.48961326479911804,
0.0010362104512751102,
0.08884906023740768,
-0.29888179898262024,
0.3743914067745209,
-0.16285274922847748,
-0.41811275482177734,
-0.8314738273620605,
0.055623795837163925,
0.19445514678955078,
-0.39749887585639954,
0.70127499... | |
siteList = sc.List();
}
```
However you open build your factory just once - at the start of application. You should not really bother by closing it (unless some specific cases) since it's the application end that cleans it up.
Your factory usually resides in one well defined place - as a singleton.
And to h... | [
0.41146811842918396,
0.23898105323314667,
0.5620315670967102,
-0.34699955582618713,
0.16208891570568085,
-0.288962185382843,
0.3094283938407898,
-0.005195107311010361,
-0.605102002620697,
-0.9345792531967163,
-0.4272678792476654,
0.2660127282142639,
-0.411811888217926,
0.30772238969802856,... | |
I'm learning Python and Django using the Eclipse Pydev plugin. I want the internal or external browser to launch or refresh with the URL http:/127.0.0.1 when I press Run or Debug. I've seen it done with the PHP plugins but not Pydev.
Here are the steps to set up an external launch configuration to launch IE:
1. Select... | [
0.2721833884716034,
0.2579987943172455,
0.3358057737350464,
-0.28365233540534973,
-0.16073180735111237,
-0.1293513923883438,
0.03184932842850685,
0.11676456779241562,
0.00022698524117004126,
-0.9530272483825684,
-0.342107355594635,
0.5804213285446167,
0.01873679645359516,
-0.14027327299118... | |
the **Arguments** field.
7. To run the external configuration, select **Run**.
If you want to share the configuration you can use these optional steps:
6. Select the **Common** tab
7. Select the **Shared file:** option in the **Save As** section.
8. Select a location to save the configuration (saving it to an otherwi... | [
0.38155633211135864,
-0.2760010063648224,
0.30762892961502075,
0.07892956584692001,
0.060338038951158524,
0.09257777035236359,
0.00832031574100256,
-0.1824965626001358,
-0.20343495905399323,
-0.779604971408844,
-0.29926902055740356,
0.8814047574996948,
-0.1320146918296814,
0.14966078102588... | |
in the list, otherwise pick the appropriate number) | [
0.035927966237068176,
0.2106667459011078,
0.3811778128147125,
0.008973718620836735,
0.1444881111383438,
0.046881090849637985,
0.08958807587623596,
-0.3271678686141968,
-0.40002602338790894,
-0.3508791923522949,
-0.4961853623390198,
0.3058127462863922,
-0.25136905908584595,
0.14734272658824... | |
Can MySql database be used as a back-end of a desktop application. What are the various possible ways to do it?
To add to [nstehr's answer](https://stackoverflow.com/questions/697164/what-are-the-various-possibilities-to-use-mysql-in-a-desktop-applicaion/697183#697183), see:
* [SQLite vs MySQL](https://stackoverflow.c... | [
-0.03697129338979721,
0.0027828309684991837,
0.38079726696014404,
0.2139551043510437,
0.19380125403404236,
0.09152515977621078,
-0.23641552031040192,
-0.041084423661231995,
-0.3806486129760742,
-0.4338754713535309,
-0.13878683745861053,
0.36111485958099365,
-0.2658863961696625,
0.103524565... | |
I'm running SQuirreL SQL (2.6.8) on Max OS X.
I'm running out of heap space when trying to create a Table script.
How to configure SQuirreL SQL to start up with a higher JVM heap size?
Assuming you have the SQuirreL in your Dock you can do following:
2. Cmd-Click on the SQuirreL icon in the Dock, the Finder windo... | [
0.2670026123523712,
0.0719088762998581,
0.2921096384525299,
-0.017874956130981445,
0.02032838948071003,
0.14351262152194977,
0.38986092805862427,
0.21591272950172424,
-0.19106516242027283,
-0.7733567953109741,
0.3577479124069214,
0.3409329354763031,
-0.43027999997138977,
-0.128750711679458... | |
<key>VMOptions</key>
> <array>
> <string>-Xms128m</string>
> <string>-Xmx512m</string>
> </array>
> </dict>
>
> ```
Here you get 128M at the start time with maximal SQuirreL.
Save the Info.plist file and restart the application. | [
-0.15397684276103973,
-0.15342029929161072,
0.3511553108692169,
0.24219246208667755,
0.20279234647750854,
-0.06826295703649521,
0.4328807294368744,
0.004644527565687895,
-0.7183130979537964,
-0.6807672381401062,
-0.25718027353286743,
0.5450616478919983,
-0.4184633791446686,
-0.016935946419... | |
Is there any mapping tool for nhibernate-mysql? I want a mapping tool that
1. Takes in a MySQL database
2. General the relevant hbm.xml file
3. Create the data access layer class that maps to each table.
Is there any such tools available?
[CodeSmith](http://www.codesmithtools.com/) has such a tool available. | [
0.16989748179912567,
-0.05464387312531471,
-0.019124500453472137,
0.012194675393402576,
-0.22556094825267792,
-0.25919583439826965,
-0.07686234265565872,
-0.06871375441551208,
-0.02096833474934101,
-0.7205011248588562,
0.03219621628522873,
0.23523467779159546,
-0.40408918261528015,
0.29455... | |
Why is there so may ways to convert to a string in .net? The ways I have seen are .ToString, Convert.ToString() and (string). What is the Difference.
`Convert.ToString(obj)`
-----------------------
Converts the specified value to its equivalent String representation. Will return `String.Empty` if specified value is `n... | [
0.06466897577047348,
-0.17565442621707916,
0.30339884757995605,
-0.11760469526052475,
-0.17672856152057648,
-0.05270672217011452,
0.29325395822525024,
-0.007130062207579613,
0.01479010283946991,
-0.4955879747867584,
-0.2667711675167084,
0.3073122203350067,
-0.6089260578155518,
0.0874741226... | |
Object.
This method can be overridden in a derived class to return values that are meaningful for that type. For example, the base data types, such as Int32, implement ToString so that it returns the string form of the value that the object represents. Derived classes that require more control over the formatting of ... | [
-0.010957865044474602,
-0.1762438416481018,
0.21093006432056427,
-0.11294181644916534,
0.00043181137880310416,
-0.2199363112449646,
0.22805184125900269,
-0.030496858060359955,
-0.04618815705180168,
-0.38956233859062195,
-0.11528655886650085,
0.43911805748939514,
-0.5491949915885925,
0.1930... | |
convert it to a string. Will return `null` if the object is `null AND of type String or of type which implements custom cast to string operator. See examples.`
`obj as string`
---------------
Safe cast operation. Same as above, but instead of throwing an exception it will return `null` if cast operation fails.
---
... | [
0.09529569000005722,
-0.12258444726467133,
0.32606086134910583,
-0.12491555511951447,
-0.1263798326253891,
0.3119809627532959,
0.3431271016597748,
-0.29466190934181213,
0.18409442901611328,
-0.46984371542930603,
-0.17498129606246948,
0.35951563715934753,
-0.4999673068523407,
0.175390839576... | |
// doesn't implement explicit cast to string oper.
Convert.ToString(null); // null
(string) null; // null
(string) test; // wont't compile, "test" is not a string and
// doesn't implement custom cast to string operator
(string) test; | [
0.37245747447013855,
-0.030168572440743446,
0.15135407447814941,
-0.24854065477848053,
-0.09946520626544952,
0.02121523767709732,
0.5405921936035156,
-0.3242639899253845,
0.283530592918396,
-0.2116319239139557,
-0.18237149715423584,
0.5502008199691772,
-0.488700270652771,
-0.11258059740066... | |
// most likely NullReferenceException,
// "test" is not a string,
// implements custom cast operator but is null
(string) test; // some value, "test" is not a string, | [
0.3916808068752289,
-0.04238717257976532,
-0.13590162992477417,
0.0938604474067688,
-0.06199110671877861,
0.05389266088604927,
0.4134540259838104,
-0.13843441009521484,
0.19142504036426544,
-0.2608944773674011,
-0.15896236896514893,
0.4101905822753906,
-0.26149627566337585,
-0.008005246520... | |
// implements custom cast to string operator
null as string; // null
```
Here is an example of custom cast operator:
```
public class Test
{
public static implicit operator string(Test v)
{
return "test";
}
}
``` | [
0.4764976501464844,
-0.18913383781909943,
-0.2316354513168335,
-0.12467456609010696,
-0.1809772402048111,
0.21447016298770905,
0.3155062198638916,
-0.4445575177669525,
0.16414931416511536,
-0.2378789633512497,
-0.0757424458861351,
0.5999677777290344,
-0.35837507247924805,
0.009078782983124... | |
After one hour of trying to find a bug in my code I've finally found the reason. I was trying to add a very small float to 1f, but nothing was happening. While trying to figure out why I found that adding that small float to 0f worked perfectly.
Why is this happening?
Does this have to do with 'orders of magnitude'?
... | [
0.16310596466064453,
0.08306349068880081,
0.4191175103187561,
0.05722516030073166,
-0.02917151153087616,
0.06864669173955917,
0.34358423948287964,
0.06345672160387039,
-0.2802969217300415,
-0.36434248089790344,
0.06704022735357285,
0.2028464376926422,
-0.07120613753795624,
0.33809819817543... | |
value you are adding is essentially zero, at least when added to `1`. The value itself, however, can effortlessly stored in a float since the exponent is small in that case. But to successfully add it to `1` you have to use the exponent of the larger number ... and then the digits after the zeroes disappear in rounding... | [
0.39709025621414185,
-0.04383373260498047,
0.07202651351690292,
-0.001443315064534545,
0.03879110515117645,
0.06700191646814346,
-0.04099953919649124,
-0.16776840388774872,
-0.2949080765247345,
-0.37533095479011536,
0.023438703268766403,
0.6144399642944336,
-0.1921987235546112,
0.168289422... | |
not an option you could use [Kahan summation](http://en.wikipedia.org/wiki/Kahan_summation), as [akuhn](https://stackoverflow.com/users/24468/akuhn) pointed out in a comment.
Another option may be to perform intermediary calculations in double-precision and afterwards cast to `float` again. This will only help, howeve... | [
0.19460341334342957,
-0.09766119718551636,
0.003515635384246707,
0.06322401762008667,
-0.05812835693359375,
0.11752218008041382,
-0.020169630646705627,
-0.30351772904396057,
-0.2346746027469635,
-0.09056035429239273,
-0.17058297991752625,
0.28918564319610596,
-0.02273140661418438,
-0.10777... | |
I have the following simple script.
```
<script>
SPC = {
a : [10],
b : 10,
t: function()
{
y = this.a;
z = this.b;
y[0]++;
z++;
alert('this.a[0] = ' + this.a[0] + '\nthis.b = ' + this.b)
}
}
SPC.t();
SPC.t();
</script>
```
Running it in your browser will ... | [
0.23405009508132935,
-0.10423264652490616,
0.7242609262466431,
-0.3921505808830261,
-0.006614054087549448,
0.021466873586177826,
0.4566923975944519,
-0.17943955957889557,
-0.13954457640647888,
-0.6890000700950623,
-0.2651987075805664,
0.6100313067436218,
-0.5019125938415527,
-0.05826761946... | |
10
and
this.a[0] = 12
this.b = 10
The question is, why does the value of this.a[0] increment? I'm assigning "y = this.a" and updating element of "y" as "y[0]++;"?
At the same time, exactly the same thing is happening with "b": "z = this.b; z++". Yet, "this.b" remains equal to 10.
How can I change value of "y[0]" i... | [
0.3091208040714264,
0.12139351665973663,
0.4353337585926056,
-0.29934850335121155,
-0.24612070620059967,
0.14119723439216614,
0.15491485595703125,
-0.14843259751796722,
-0.2116340547800064,
-0.48949581384658813,
0.006884748116135597,
0.6078603863716125,
-0.24479202926158905,
-0.06459490954... | |
way).
(Or, if you only need `a[0]`, you can set `y = a[0]`. Subsequent changes to `y` will not affect `a[0]`, since you are copying the value.)
See the "Javascript Arrays Are Assigned By Reference" and "Passing Arrays As Values" sections of [this article](http://www.hunlock.com/blogs/Mastering_Javascript_Arrays) for ... | [
0.3399336338043213,
-0.056898847222328186,
0.13736343383789062,
-0.22877386212348938,
0.041013043373823166,
-0.25159117579460144,
0.12757045030593872,
-0.38949915766716003,
-0.44926825165748596,
-0.42274320125579834,
-0.18488837778568268,
0.5294678211212158,
-0.3703579604625702,
-0.0929350... | |
I can only assume it's an infinite loop.
Can I leave out any of the three expressions in a for loop? Is there a default for each when omitted?
It is indeed an infinite loop.
Under the hood the compiler/jitter will optimize this to (effectively) a simple JMP operation.
It's also effectively the same as:
```
while (t... | [
0.2956238389015198,
-0.24944181740283966,
0.13537755608558655,
-0.04327687621116638,
0.069889135658741,
-0.07438734173774719,
0.7572584748268127,
0.18466658890247345,
-0.3547649085521698,
-0.1777029186487198,
-0.08065821975469589,
0.7513456344604492,
-0.4253116250038147,
-0.094584770500659... | |
Given a class C in Python, how can I determine which file the class was defined in? I need something that can work from either the class C, or from an instance off C.
The reason I am doing this, is because I am generally a fan off putting files that belong together in the same folder. I want to create a class that use... | [
0.4901062548160553,
0.09947334975004196,
-0.36798882484436035,
-0.0378149151802063,
-0.1777450293302536,
-0.29460662603378296,
0.019860422238707542,
0.051542170345783234,
-0.07249243557453156,
-0.6205874085426331,
-0.0770988017320633,
0.46706458926200867,
-0.3912798762321472,
0.10683631896... | |
"base/artifacts.py", then I want the default behaviour to be that the template name is "base/LocationArtifact.html".
You can use the [inspect](http://docs.python.org/library/inspect.html#inspect.getfile) module, like this:
```
import inspect
inspect.getfile(C.__class__)
``` | [
0.5983619093894958,
0.03180451691150665,
0.17829330265522003,
-0.017091792076826096,
-0.11300676316022873,
-0.4157284200191498,
0.05820617079734802,
-0.16864049434661865,
-0.12019556015729904,
-0.4622589349746704,
-0.09357983618974686,
0.44107505679130554,
-0.2851797640323639,
0.1929085999... | |
Some time ago I found [this site](http://www.c-point.com/javascript_vector_draw.htm) which has an API to draw stuff in javascript using divs.
I've tried to use it, but noticed that as the number of divs increased, the stability of the page (especially doing select,copy,paste) decreased.
Now I'm about to write a web-a... | [
0.6040054559707642,
-0.05616012588143349,
0.5825595259666443,
-0.1592874377965927,
-0.3396696150302887,
0.13704542815685272,
-0.1555684506893158,
0.04462559148669243,
-0.12973260879516602,
-0.6667300462722778,
0.4244198799133301,
0.4347270131111145,
-0.36110031604766846,
-0.057737592607736... | |
each javascript application is unique in its use of divs, I don't think there's a hard limit.
For some designs on some browsers, it'll be a low number, while the same designs on other browsers might be higher, and different designs may be opposite.
There are several different factors to take into account:
* DOM han... | [
0.5687644481658936,
0.13457751274108887,
0.03221907839179039,
0.01567520946264267,
-0.17289286851882935,
-0.1494043916463852,
0.3519713580608368,
-0.26079127192497253,
-0.16399404406547546,
-0.7189555764198303,
0.11299481242895126,
0.5672895908355713,
-0.20602573454380035,
-0.1799178272485... | |
to avoid extra divs, though, take it. | [
0.4169187545776367,
0.25859153270721436,
-0.1131436750292778,
-0.1714426577091217,
0.05572992563247681,
-0.1768665611743927,
-0.10392502695322037,
0.2368997186422348,
0.16540004312992096,
-0.2057872712612152,
0.3741947412490845,
0.25439950823783875,
0.10482864826917648,
-0.3301219046115875... | |
I have just been learning about how styles and control templates in WPF can affect the appearance of buttons,
I'm trying to set the Button's FlatStyle, in the resources I've seen I can't find anything that tells me how I can do this, in Windows Forms this is set through `FlatStyle = Flat`.
How would one do this in WP... | [
0.31515204906463623,
-0.4703076183795929,
0.5104164481163025,
-0.11613738536834717,
-0.12025076150894165,
0.1436983197927475,
-0.10844479501247406,
-0.08479224890470505,
-0.25276607275009155,
-0.7844280004501343,
0.14673063158988953,
0.7224025726318359,
-0.3549167215824127,
0.0096383336931... | |
why it doesn't have such a specific `FlatStyle` property on the `Button` control. | [
0.12676505744457245,
-0.09825965762138367,
0.25275933742523193,
0.1444622427225113,
0.2626244127750397,
-0.04401711747050285,
-0.05686994269490242,
0.04255644977092743,
-0.40009811520576477,
-0.07525895535945892,
0.03632717579603195,
0.26651403307914734,
-0.03338794410228729,
0.29234293103... | |
I am writing a small app that finds all the folders IIS is referencing.
To do this I take the IIS config file and parse the xml looking for elements called IIsWebVirtualDir and look for the Path attribute.
Here is my code
```
XDocument doc = XDocument.Load(xmlPath);
IEnumerable<XElement> elements = ... | [
0.1683361679315567,
0.11038928478956223,
0.5830587148666382,
-0.034129444509744644,
0.13082590699195862,
-0.1588079035282135,
0.3265761733055115,
-0.4412779211997986,
0.14998610317707062,
-0.9524132609367371,
0.06504075974225998,
0.31663164496421814,
-0.3271764814853668,
0.0491407327353954... | |
elementCount++;
foreach (XAttribute attribute in element.Attributes())
{
if(attribute.Name == "Path") | [
-0.3432006537914276,
-0.23336632549762726,
0.32452788949012756,
-0.26103416085243225,
0.2018786519765854,
-0.05573023483157158,
0.2945842444896698,
-0.3339543342590332,
0.2604857087135315,
-0.47782933712005615,
-0.18866346776485443,
0.40388575196266174,
-0.3542468249797821,
-0.012055289000... | |
{
pathsFound++;
String path = attribute.Value + ","; | [
-0.15794827044010162,
-0.03553348034620285,
0.3227017819881439,
-0.18600375950336456,
0.10132938623428345,
-0.04474026709794998,
0.28578224778175354,
-0.3757975995540619,
0.03833765909075737,
-0.456949383020401,
-0.11586279422044754,
0.7271182537078857,
-0.3772672414779663,
0.0056848693639... | |
Console.WriteLine(path);
pathsAsStr.Append(path);
}
}
}
```
I have also tried using
IEnumerable elements = doc.Elements().Descendants("IIsWebVirtualDir");
The code compiles but I | [
-0.18607789278030396,
0.06643284112215042,
0.5156220197677612,
-0.2565440535545349,
0.4724098742008209,
-0.15407492220401764,
0.5648311376571655,
-0.4582999646663666,
0.14584939181804657,
-0.9593691825866699,
-0.0797252506017685,
0.5394647717475891,
-0.18562278151512146,
0.1969529092311859... | |
never find more than one element. Why is this? What am I doing wrong?
I would attach the xml but its too big
With TCP connections for applications like Telnet there is no such concept as the end of the transmission. You'll often find telnet clients that send each key press one at a time as the user enters them and it'... | [
0.27797529101371765,
-0.3519989550113678,
0.43313804268836975,
0.19210758805274963,
0.14360639452934265,
-0.22891902923583984,
0.22821390628814697,
-0.20616218447685242,
-0.4302295446395874,
-0.28362151980400085,
-0.1068536788225174,
0.485197514295578,
-0.40153124928474426,
0.1997675299644... | |
be looking for line feeds to indicate the end of a transmission.
```
do
{
bytes = this.Stream.Read(readBuffer, 0, readBuffer.Length);
responseData = String.Concat(responseData, System.Text.Encoding.ASCII.GetString (readBuffer, 0, bytes));
} while (this.Stream.DataAvailable && !r... | [
0.194183811545372,
-0.48024338483810425,
0.4643172025680542,
-0.06640459597110748,
0.26225289702415466,
-0.00391495181247592,
0.3910609781742096,
-0.32334303855895996,
-0.1473441869020462,
-0.5392289757728577,
-0.5130539536476135,
0.6029372811317444,
-0.5708304643630981,
0.2991926968097687... | |
I have two independant threads F1 and F2 (to be precise, two instances of java.util.concurrent.FutureTask) that are running in parallel.
F1 do some processing, and then copy the result in a XML file. Then, it repeats these steps until it has nothing to do (many XML files are created).
F2 looks in the F1 output directo... | [
0.07831782102584839,
-0.08074231445789337,
0.11564204096794128,
0.06070757284760475,
-0.05593784153461456,
0.2148311585187912,
-0.03203950077295303,
0.13582737743854523,
-0.06954856961965561,
-0.698881208896637,
0.12888042628765106,
0.32784003019332886,
-0.19875650107860565,
0.163687765598... | |
is not always reproductible, and the files that are truncated are not always the same.
Because of that, I am thinking that while F1 is writing one file on the disk, F2 is trying to read the same file. That's why sometimes I get this kind of error.
**My question**: I am wondering if there is some mechanism that locks (... | [
-0.060562752187252045,
0.2665364146232605,
-0.10995080322027206,
0.08238589018583298,
-0.006552740000188351,
-0.037296973168849945,
0.28864240646362305,
-0.015625080093741417,
-0.6896331310272217,
-0.4039040505886078,
-0.30490297079086304,
0.4551953673362732,
-0.004380902275443077,
0.30329... | |
will be welcome !
F1 is writing the file this way:
```
try {
file = new File("some-file.xml");
FileUtils.writeStringToFile(file, xmlDataAsString);
} catch (IOException ioe) {
LOGGER.error("Error occurred while storing the XML in a file.", ioe);
}
```
F2 is reading the file this way:
```
private File ge... | [
-0.051381874829530716,
0.021045202389359474,
0.8373667597770691,
-0.32220032811164856,
0.11925201117992401,
-0.19353242218494415,
0.20572565495967865,
-0.35156431794166565,
0.03950919583439827,
-0.9334959387779236,
-0.4415232241153717,
0.6210891604423523,
-0.1560581773519516,
-0.2852731049... | |
name.toLowerCase().endsWith(".xml");
}
});
if (files.length > 0) {
return files[0];
}
return null;
}
// Somewhere in my main method of F2
...
f = getNextFileToMap();
Node xmlNode = null;
try {
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
DocumentBuilder... | [
0.028029590845108032,
-0.2998015582561493,
0.7952477335929871,
-0.24007797241210938,
0.41705521941185,
0.057117290794849396,
0.35722094774246216,
-0.7008787393569946,
-0.23807142674922943,
-0.5405369400978088,
-0.4787966310977936,
0.4386536478996277,
-0.05717001110315323,
0.314287334680557... | |
LOGGER.error("Error while getting the XML from the file " + f.getAbsolutePath(), e);
}
```
Since you're already filtering for `.xml` files in F2, have F1 output to a `.temp` file, then rename it to `.xml` as a final step. That way, F2 will ignore the file F1 is making until F1 is completely done with it. | [
-0.20220693945884705,
-0.11086486279964447,
0.13984134793281555,
-0.11536824703216553,
-0.038580868393182755,
-0.29582303762435913,
0.20145660638809204,
-0.13965973258018494,
-0.06381656974554062,
-0.5535426735877991,
-0.4749012291431427,
0.5422810316085815,
-0.6053369641304016,
-0.1892654... | |
This is what I mean:
```
class mycalss
{
string myfunc()
{
string str="hello";
return str;
}
}
...
static void main()
{
string str2;
str2=myfunc();
...
...
}
```
In this case is there a risk that the garbage collector might delete the contents of str2 because str went out of scope?
N... | [
-0.043852441012859344,
0.17012548446655273,
0.496324747800827,
-0.332069993019104,
0.23910441994667053,
-0.2764222323894501,
0.3972429633140564,
0.09134048968553543,
-0.2492702156305313,
-0.4950503706932068,
-0.35632413625717163,
0.5480905771255493,
-0.4015794098377228,
0.5036450624465942,... | |
Is there an easy way to create Word documents (.docx) in a Ruby application? Actually, in my case it's a Rails application served from a Linux server.
A gem similar to [Prawn](http://prawn.majesticseacreature.com/) but for [DOCX](http://en.wikipedia.org/wiki/DOCX) instead of PDF would be great!
As has been noted, the... | [
0.4277248680591583,
0.07299098372459412,
0.05903047323226929,
0.3191506266593933,
-0.46252092719078064,
-0.1472809910774231,
0.2844415605068207,
-0.023196997120976448,
-0.11595304310321808,
-0.6193535923957825,
-0.0320766307413578,
0.5145777463912964,
-0.043283384293317795,
0.1675424724817... | |
is a ZIP file that contains various parts in a directory hierarchy. Have a DOCX "template" that contains all the parts and tree structure that you want to send to `all` users (with no real content), then simply create new (or modify existing) pieces that contain the user-specific content you want and inject it into the... | [
0.35906773805618286,
-0.08153538405895233,
0.43556299805641174,
0.02534881979227066,
0.2485867142677307,
-0.20791015028953552,
-0.2342817783355713,
-0.09417373687028885,
-0.04064178094267845,
-0.543164074420929,
-0.5462564826011658,
0.010705159045755863,
-0.4249180555343628,
0.335809051990... | |
all the images and other parts you want in the Word document) and send that resulting document to the user.
Note that if you rename a `.docx` file to `.zip` it is trivial to explore the structure and format of the parts inside. You can remove or replace images or other parts very easily with any ZIP manipulation tools... | [
0.931235134601593,
0.018954584375023842,
0.10454043745994568,
0.14619144797325134,
-0.0377410352230072,
-0.24036459624767303,
0.2869153320789337,
-0.3055631220340729,
-0.31786128878593445,
-0.46342799067497253,
-0.49802008271217346,
0.35188382863998413,
-0.45620837807655334,
0.221006497740... | |
then use VB.NET, C# or [IronRuby](http://www.ironruby.net/) to create your Open XML documents using the [Open XML Format SDK 1.0](http://msdn.microsoft.com/en-us/library/bb448854.aspx). Since you would just be using the [Microsoft.Office.DocumentFormat.OpenXml.Packaging Namespace](http://msdn.microsoft.com/en-us/librar... | [
0.6691356897354126,
0.05689498409628868,
0.13505619764328003,
-0.08921182155609131,
-0.12921158969402313,
-0.33280840516090393,
-0.049897387623786926,
-0.3094845712184906,
-0.2010163962841034,
-0.6346435546875,
-0.23990212380886078,
0.5786445736885071,
-0.11474823206663132,
0.0120342681184... | |
I’m looking to split '1,2,3,4,5,6,7,8,9,10,11,12,13,14,15...' (comma delimited) into a table or table variable.
Does anyone have a function that returns each one in a row?
Here is somewhat old-fashioned solution:
```
/*
Splits string into parts delimitered with specified character.
*/
CREATE FUNCTION [dbo].[SDF_... | [
-0.12203621864318848,
-0.19780315458774567,
0.4386743903160095,
-0.2016647756099701,
-0.06463631242513657,
0.19529440999031067,
0.34130480885505676,
-0.442688524723053,
-0.3270776569843292,
-0.3906969130039215,
-0.3054622709751129,
0.21622981131076813,
-0.44650954008102417,
0.4756488502025... | |
begin
set @iStart = 2
insert into @tParts
values( null )
end
else
set @iStart = 1
while 1=1
begin
set @iPos = charindex( @cDelimiter, @sString, @iStart )
if @iPos = 0
set @iPos | [
0.10830395668745041,
-0.2443283200263977,
0.42688435316085815,
0.03816598653793335,
0.10905738919973373,
-0.0745641440153122,
0.08669167757034302,
-0.47240760922431946,
0.09642527252435684,
-0.5042834281921387,
-0.31837034225463867,
0.17058494687080383,
-0.42936989665031433,
-0.18611922860... | |
= len( @sString )+1
if @iPos - @iStart > 0
insert into @tParts
values ( substring( @sString, @iStart, @iPos-@iStart ))
else
insert into @tParts
values( null ) | [
-0.14942562580108643,
-0.760434627532959,
0.07255316525697708,
-0.12755683064460754,
-0.10681769996881485,
0.18950426578521729,
0.1493789255619049,
-0.24932806193828583,
-0.04400268569588661,
-0.3409896492958069,
0.05537250638008118,
0.29408296942710876,
-0.30230215191841125,
0.01302293501... | |
set @iStart = @iPos+1
if @iStart > len( @sString )
break
end
RETURN
END
```
In SQL Server 2008 you can achieve the same with .NET code. Maybe it would work faster, but definitely this approach is easier to manage. | [
0.05994304269552231,
-0.37852853536605835,
0.37179186940193176,
0.20616261661052704,
-0.19820040464401245,
-0.41988831758499146,
0.01727358065545559,
-0.37768325209617615,
-0.09271586686372757,
-0.6143002510070801,
-0.04385344311594963,
0.4751923978328705,
-0.41256871819496155,
-0.00406439... | |
In an SSIS package, I have a For Loop Container task with the EvalExpression set to true (so that it runs forever). If any tasks inside the For Loop Container fail, then the package must fail -- except for the Execute Package task (that calls a child package). If that fails, then the parent package should move onto the... | [
-0.0344204381108284,
-0.40603283047676086,
0.352438360452652,
-0.14821788668632507,
0.16625870764255524,
-0.14929042756557465,
0.7168588638305664,
-0.2550569772720337,
0.0423302985727787,
-0.735005795955658,
-0.20603904128074646,
0.4026281535625458,
-0.43468472361564636,
0.0213467627763748... | |
Loop Container task.
Any idea how I can ignore errors on only the Execute Package task -- within a For Loop Container.
The answer is to use the FailPackageOnFailure property for all the tasks that should cause the package to stop and set the MaximumErrorCount of the For Loop Container task to 0.
I got the answer here... | [
-0.027982546016573906,
-0.07891819626092911,
0.2505075931549072,
-0.046033672988414764,
0.13279220461845398,
-0.1621195673942566,
0.6197093725204468,
-0.23642997443675995,
-0.12313488125801086,
-0.5318524241447449,
-0.1610073298215866,
0.3717270493507385,
-0.3320336639881134,
0.04066184163... | |
I've got an SSRS report that I'm dynamically writing to an HTML page. The report looks great in IE, but it keeps none of its formatting in Firefox.
I've done a bit of research on this, and found that I can insert rectangles inside of all of my matrix data fields, which will keep the formatting. This seems to me like ... | [
0.22938217222690582,
0.1137886717915535,
0.324524849653244,
0.05269264802336693,
-0.09912687540054321,
-0.18579603731632233,
0.2697380483150482,
-0.07819534838199615,
-0.5782820582389832,
-0.6953901052474976,
0.034138429909944534,
0.3009803593158722,
-0.19280415773391724,
-0.27642229199409... | |
Try setting the CanGrow = false; for the textbox.
* Are the problems with the display? With the width and height lost? Look at this [thread](http://forums.asp.net/p/1194312/2063445.aspx#2063445)
* CSS file entry as follows:
**make this change in the css file**
```
/* Fix report IFRAME height for Firefox */
.DocMapAn... | [
0.1785344034433365,
0.13085979223251343,
0.5093310475349426,
-0.1547529101371765,
0.21172794699668884,
0.09102918207645416,
0.3831261098384857,
-0.3305133581161499,
-0.36923423409461975,
-0.6902625560760498,
-0.008216241374611855,
0.6271140575408936,
-0.15233416855335236,
-0.08552146703004... | |
Is there any difference in these two? If so, what exactly is the difference? Assume they are in a C function that may be called multiple times.
1. declare and assign in same statement
`static uint32_t value = x;` `// x varies and may be passed into function.`
2. declare in one statement and assign in next statment.
... | [
0.37804460525512695,
-0.30062025785446167,
0.34061968326568604,
-0.13702085614204407,
-0.023257125169038773,
-0.08508158475160599,
0.010752804577350616,
-0.19864165782928467,
-0.2238575518131256,
-0.4105505645275116,
-0.2545357346534729,
0.699927031993866,
-0.508993923664093,
0.03090124949... | |
the line executes, `value` will remain the same. I am not sure about (2) but clarification on both will be very helpful
EDIT: Compiler ARM(ADS1.20).
EDIT: A follow up question on (2) from the answers given so far. Is the declaration(not the assignment) repeated on every call or just the first time?
The first should no... | [
0.1426752507686615,
-0.2626069486141205,
0.36147254705429077,
-0.2149130403995514,
-0.234310120344162,
0.06770545989274979,
0.2934251129627228,
-0.27223238348960876,
-0.1323615312576294,
-0.20184290409088135,
-0.36684510111808777,
0.4473823606967926,
-0.5220170021057129,
-0.072725363075733... | |
once when the program starts and would thereafter only take new values when the code changed it. The second notation still sets `value` on each call to the function, and so renders the use of `static` pointless. (Well, if you try hard enough, you can devise scenarios under which the second version has a use for static.... | [
0.18409107625484467,
-0.2219725102186203,
0.24776218831539154,
-0.198320671916008,
0.12934237718582153,
-0.21595966815948486,
0.4170551300048828,
0.018637439236044884,
-0.1996055692434311,
-0.11713617295026779,
-0.3633628189563751,
0.5590386986732483,
-0.2706918716430664,
0.158904999494552... | |
I've always used typedef in embedded programming to avoid common mistakes:
`int8_t` - 8 bit signed integer
`int16_t` - 16 bit signed integer
`int32_t` - 32 bit signed integer
`uint8_t` - 8 bit unsigned integer
`uint16_t` - 16 bit unsigned integer
`uint32_t` - 32 bit unsigned integer
The recent embedded... | [
0.18247203528881073,
0.11202855408191681,
0.20836275815963745,
-0.054612599313259125,
-0.24892465770244598,
0.09314712882041931,
0.10755670815706253,
0.04214015603065491,
-0.06420521438121796,
-0.7334650754928589,
0.016041839495301247,
0.5201378464698792,
0.016001302748918533,
0.0707055553... | |
but it would actually be implemented as an `int32_t` on a 32 bit processor, or `int64_t` on a 64 bit processor as those would be the fastest types of at least 16 bits on those platforms. On an 8 bit processor it would be `int16_t` bits to meet the minimum size requirement.
Having never seen this usage before I wanted ... | [
0.059950292110443115,
-0.21046197414398193,
0.17884698510169983,
0.11951266974210739,
-0.08819344639778137,
0.08979973196983337,
0.3000553548336029,
0.10800334066152573,
-0.30890464782714844,
-0.5581903457641602,
0.029433734714984894,
0.4668024778366089,
-0.36262384057044983,
-0.1236427575... | |
an
> int32\_t on a 32 bit processor, or
> int64\_t on a 64 bit processor as those
> would be the fastest types of at least
> 16 bits on those platforms
That's what int is for, isn't it? Are you likely to encounter an 8-bit CPU any time soon, where that wouldn't suffice?
How many unique datatypes are you able to *... | [
0.13386255502700806,
0.08787674456834793,
0.07461366057395935,
0.02656671591103077,
-0.11983843892812729,
0.33088210225105286,
0.3229082524776459,
0.03097596764564514,
-0.4500765800476074,
-0.7477437853813171,
0.18147268891334534,
0.5831565856933594,
-0.030094392597675323,
0.00836798921227... | |
is going to write a function which returns a `int16fast_t`, and then someone else is going to come along and store that variable into an `int16_t`.
Which means that in the obscure case where the *fast* variants are actually beneficial, it may change the behavior of your code. It may even cause compiler errors or warni... | [
0.17268986999988556,
-0.22334399819374084,
-0.013549190945923328,
0.2919023931026459,
0.05684828758239746,
-0.084525465965271,
0.3943046033382416,
0.44705402851104736,
-0.2767319679260254,
-0.5579328536987305,
-0.22255834937095642,
0.6129143238067627,
-0.3601987063884735,
0.084446802735328... | |
I'd link to transform XML with attributes like the 'name' attribute in the following:
```
<books>
<book name="TheBumperBookOfXMLProgramming"/>
<book name="XsltForDummies"/>
</books>
```
into elements called what was in the name attribute:
```
<books>
<TheBumperBookOfXMLProgramming/>
<XsltForDummies/>
</book... | [
0.0889512151479721,
0.09563693404197693,
0.19656674563884735,
0.036054179072380066,
-0.37533608078956604,
0.2950494885444641,
0.12210728228092194,
-0.5656121969223022,
0.19167302548885345,
-0.6630236506462097,
0.24684381484985352,
0.22903931140899658,
-0.3251773416996002,
0.229334831237792... | |
After I do the .post thing, I want to hide the first div with a left slide, then show the second with a right slide. My right-slide was working fine and then I went and tried to put in the left slide and I broke it all.
```
if(hasError == false) {
$.post("/process-email-signups",{email_address: email_addressVal},
... | [
0.09924260526895523,
0.08631987869739532,
0.7081269025802612,
-0.250129371881485,
0.12991082668304443,
0.0918525904417038,
0.33926457166671753,
-0.31793490052223206,
0.026128949597477913,
-0.6610265374183655,
-0.07389464974403381,
0.574478268623352,
-0.3792743384838104,
0.09233681112527847... | |
$("#thank_you_message").show("slide", { direction: "right" }, 1000);
});
}
);
}
```
I'm not sure what the extra function() is doing, maybe try removing that?
```
if(hasError == false) {
$.post("/process-email-signups",{email_address: email_addressVal},
function(data... | [
0.16555853188037872,
0.11026056110858917,
0.8001592755317688,
-0.39761340618133545,
0.20200763642787933,
0.10269210487604141,
0.3831830322742462,
-0.38701727986335754,
0.07199646532535553,
-0.40132156014442444,
-0.3499487042427063,
0.5992512702941895,
-0.37394312024116516,
0.03272296115756... | |
direction: "left" }, 1000);
$("#thank_you_message").show("slide", { direction: "right" }, 1000);
}
);
}
``` | [
-0.09768084436655045,
0.24291068315505981,
1.0228389501571655,
-0.1813693344593048,
0.2947961688041687,
0.011942391283810139,
0.2600100040435791,
-0.16736914217472076,
0.15175531804561615,
-0.35470497608184814,
-0.4607749581336975,
0.5841435194015503,
-0.22057411074638367,
0.16234984993934... | |
I am working with the WPF Toolkit data grid and it is scrolling extremely slow at the moment. The grid has 84 columns and 805 rows. (Including 3 fixed columns and the header is fixed.) Scrolling both horizontally and vertically is extremely slow. Virtualization is turned on and I have enabled column virtualization and ... | [
-0.012334268540143967,
0.2006620168685913,
0.7215556502342224,
0.030000057071447372,
-0.021850788965821266,
0.17677965760231018,
0.17127497494220734,
-0.07829447090625763,
-0.5140393972396851,
-0.9396421909332275,
0.3180305063724518,
0.3115081787109375,
-0.14982230961322784,
0.120339922606... | |
be effecting anything? (I also dynamically create the celltemplate at the same time so that my bindings are set right.)
Below is the code from the template for most of the cells that get generated. Basically for the columns I need to dynamically add (which is most of them), I loop through my list and add the columns u... | [
0.5083950757980347,
-0.19001877307891846,
0.5187305808067322,
-0.18660300970077515,
-0.12041456997394562,
-0.07464053481817245,
0.19118760526180267,
-0.33801084756851196,
0.02836211398243904,
-0.7077608108520508,
0.18192103505134583,
0.2520001232624054,
-0.5309306979179382,
0.0541298277676... | |
It seems like I was able to squeeze out a little bit more performance by changes the bindings to OneWay:
```
private void AddColumn(string s, int index)
{
DataGridTemplateColumn column = new DataGridTemplateColumn();
column.Header = s;
//Set template for inner cell's two rectangles
... | [
0.23382049798965454,
-0.0344325490295887,
0.6623039245605469,
-0.2333313375711441,
0.21764980256557465,
0.07535884529352188,
0.15744103491306305,
-0.7489693760871887,
-0.0942683145403862,
-0.7476994395256042,
0.17671382427215576,
0.340006947517395,
-0.2185831069946289,
-0.00411893986165523... | |
(Style)dgMatrix.Resources["HeaderRotateStyle"];
column.Width = DataGridLength.Auto;
dgMatrix.Columns.Add(column);
}
//this method builds the template for each column in order to properly bind the rectangles to their color
private static DataTemplate CreateFactViewModelTemplate(int index)
... | [
0.0019281002460047603,
-0.03762097656726837,
0.7160431742668152,
-0.1436501145362854,
-0.3003385365009308,
0.08804318308830261,
-0.04734161123633385,
-0.44984135031700134,
-0.23583917319774628,
-0.4742632210254669,
-0.19141310453414917,
0.2633766531944275,
-0.21406053006649017,
0.105958469... | |
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition />
<ColumnDefinition />
</Grid.ColumnDefinitions>
<TextBlock Grid.Column=""0"" MinHeight=""10"" MinWidth=""10"" HorizontalAlignment=""Stretch"" Padding=""3 1 3 1"" TextAlignment=""Center"" Foreground=""... | [
-0.16413502395153046,
-0.5685780644416809,
0.8242630958557129,
0.048222433775663376,
0.3311917185783386,
0.32841581106185913,
-0.27453017234802246,
-0.3957650661468506,
-0.20794688165187836,
-0.8467859029769897,
-0.25587472319602966,
0.2621263265609741,
-0.0493396557867527,
-0.123429536819... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.