text stringlengths 0 30.5k | title stringclasses 1
value | embeddings listlengths 768 768 |
|---|---|---|
rep.GetUsers();
// do business logic
return users.ToList();
}
}
```
Would you test both the UserService and the UserRepository or do you think testing just the Service would suffice? I figure since the service is using the repository it should be fun, but it does kill code coverage.
You should tes... | [
0.5199975967407227,
0.08584567904472351,
0.25748053193092346,
0.16946162283420563,
-0.23723682761192322,
-0.1791478544473648,
0.22077031433582306,
-0.1794814020395279,
-0.4194393754005432,
-0.4746064841747284,
0.006749721243977547,
1.1544076204299927,
-0.2759423553943634,
0.108483269810676... | |
I have a few questions about data synchronization. The architecture
does not seem to be clear about this:
1. Does Google Gears provide from automatic synchronization of data
(from client to server and server to client)?
2. If it does provide for automatic data synchronization, then can i
write functions to hook into t... | [
-0.03140103071928024,
0.10429556667804718,
0.43178603053092957,
0.34659260511398315,
-0.013509868644177914,
-0.006856823340058327,
-0.04900697246193886,
-0.04468055069446564,
-0.10507577657699585,
-0.6177752017974854,
0.13393811881542206,
0.5717933177947998,
-0.27360251545906067,
-0.116527... | |
only those rows which contain the hostname of the client trying to
download the data should be downloaded to it)
Basically what I am looking for is: does Google Gears Synchronization
support the data synchronization features like SQL Server Merge
replication?
[ <http://technet.microsoft.com/en-us/library/ms152746.aspx... | [
-0.06144171208143234,
0.061477746814489365,
0.3255915939807892,
0.222035750746727,
-0.017358848825097084,
0.1405598521232605,
-0.08527741581201553,
0.23781386017799377,
0.015803972259163857,
-0.49780958890914917,
0.08662889152765274,
0.38471099734306335,
-0.44203120470046997,
0.08911329507... | |
it's important to note that because the database portion of Gears is really just a client-side database accessible from javascript, there's nothing in Gears that specifies a specific server-side implementation, or even a specific server api. Thus, doing things like the data partitioning you describe are up to the devel... | [
0.3535481095314026,
-0.09818553179502487,
-0.22293248772621155,
0.590290904045105,
-0.14555320143699646,
0.06110081076622009,
-0.15130500495433807,
-0.018542462959885597,
0.005980597343295813,
-0.6822304129600525,
0.09428942948579788,
0.6440030932426453,
0.07173783332109451,
-0.09796222299... | |
Smashed my head against this a bit too long. How do I prevent a user from browsing a site's pages after they have been logged out using FormsAuthentication.SignOut? I would expect this to do it:
```
FormsAuthentication.SignOut();
Session.Abandon();
FormsAuthentication.RedirectToLoginPage();
```
But it doesn't. If I ... | [
0.540537416934967,
0.48489779233932495,
0.659224808216095,
-0.05008465051651001,
0.1895517259836197,
-0.46694958209991455,
0.45807406306266785,
-0.19287003576755524,
-0.36612600088119507,
-0.6396996974945068,
-0.09080012887716293,
0.6352050304412842,
-0.04453800991177559,
0.408407121896743... | |
don't, bug?
Its exactly the same with `Session.Abandon()`, cookie is still there.
You should change your code to this:
```
FormsAuthentication.SignOut();
Session.Abandon();
// clear authentication cookie
HttpCookie cookie1 = new HttpCookie(FormsAuthentication.FormsCookieName, "");
cookie1.Expires = DateTime.Now.AddY... | [
0.3282390236854553,
-0.049657002091407776,
0.3333972692489624,
0.06902927160263062,
0.5123493671417236,
-0.20882289111614227,
0.6833761930465698,
0.10858195275068283,
-0.3580184578895569,
-0.6059970259666443,
-0.25862547755241394,
0.606379508972168,
-0.7959006428718567,
0.20798973739147186... | |
I know downcasting like this won't work. I need a method that WILL work. Here's my problem: I've got several different derived classes all from a base class. My first try was to make an array of base class. The program has to select (more or less at random) different derived classes. I had tried casting from a base cla... | [
0.6024661660194397,
-0.16284248232841492,
-0.20826445519924164,
0.13396082818508148,
-0.37992018461227417,
0.18917657434940338,
-0.06317324191331863,
-0.029561663046479225,
-0.10805390030145645,
-0.5747820138931274,
0.4714776575565338,
0.4219866096973419,
-0.3554021418094635,
0.21189609169... | |
derived classes. Is there any better way to do this that I'm just brainfarting on?
If y'all need code examples or more information, just let me know. It all makes sense to me, but It's late and it may not make sense to everybody else heh.
Any help is very much appreciated, guys.
Not sure what you mean. Sounds like ... | [
0.4693896770477295,
-0.11320587992668152,
-0.13656534254550934,
0.5523484945297241,
-0.2504897713661194,
0.17766012251377106,
0.09153388440608978,
0.13262151181697845,
0.019699711352586746,
-0.5788444876670837,
0.0933312475681305,
0.2860479950904846,
-0.09798367321491241,
0.281473964452743... | |
sliced away. But i think you want to have a array of pointers to base:
```
Base * bases[NUM_ITEMS];
for(int i=0; i<NUM_ITEMS; i++) {
int r = get_random_integer();
if(r == 0)
bases[i] = new Derived1;
else if(r == 1)
bases[i] = new Derived2;
// ...
}
```
If you ever haved worked with po... | [
0.17726999521255493,
-0.1400347352027893,
-0.0660596713423729,
-0.06483013182878494,
-0.26848873496055603,
0.36285799741744995,
0.067886121571064,
-0.2504982352256775,
-0.416800320148468,
-0.6478087902069092,
-0.03670842573046684,
0.46367448568344116,
-0.18801113963127136,
0.05571224167943... | |
on them to free the memory and call the destructor of the objects. You can use shared\_ptr, and it will manage that for you:
```
shared_ptr<Base> bases[NUM_ITEMS];
for(int i=0; i<NUM_ITEMS; i++) {
int r = get_random_integer();
if(r == 0)
bases[i].reset(new Derived1);
else if(r == 1)
bases[i... | [
0.25835859775543213,
-0.08379160612821579,
0.47384437918663025,
0.012020327150821686,
-0.1070961058139801,
0.24696698784828186,
0.0914698988199234,
-0.5749091506004333,
-0.38352054357528687,
-0.5223188400268555,
-0.02867543324828148,
0.4507753551006317,
-0.1887083202600479,
0.2704342305660... | |
to the objects go out of scope. Ideally, you would also replace the raw array by std::vector:
```
std::vector< shared_ptr<Base> > bases;
for(int i=0; i<NUM_ITEMS; i++) {
int r = get_random_integer();
if(r == 0)
bases.push_back(shared_ptr<Base>(new Derived1));
else if(r == 1)
bases.push_back... | [
0.17059466242790222,
-0.5413841605186462,
0.35993942618370056,
-0.168153315782547,
-0.05466911569237709,
0.1704237163066864,
-0.02844969742000103,
-0.6158934235572815,
-0.32886385917663574,
-0.5925796031951904,
-0.113990917801857,
0.3902308940887451,
-0.4380169212818146,
0.1094226986169815... | |
`shared_ptr` [here](http://www.boost.org/doc/libs/1_37_0/libs/smart_ptr/shared_ptr.htm).
Conversion from a Base class to a Derived class should *only be done when absolutely necessary*. Normally, you want to use a technique called `polymorphism`, which means you call a function on the base pointer, but it will actuall... | [
0.44537800550460815,
-0.33164843916893005,
0.04315931349992752,
-0.04236234351992607,
-0.18526522815227509,
-0.23556509613990784,
0.06019600108265877,
-0.3964954614639282,
-0.17968226969242096,
-0.3578527569770813,
-0.13948175311088562,
0.4312308728694916,
-0.43709754943847656,
0.153308629... | |
wrong type (i.e the type you cast is not the type that was created and assigned to the base pointer), you get an exception thrown by the operator. For the shared\_ptr case, there are ways too:
```
shared_ptr<Derived1> d = dynamic_pointer_cast<Derived1>(bases[x]);
if(d) {
// conversion successful, it pointed to a d... | [
0.11330287903547287,
-0.3297435939311981,
0.14348188042640686,
-0.08228087425231934,
0.033184245228767395,
0.042283039540052414,
0.16073623299598694,
-0.2235448658466339,
-0.09978288412094116,
-0.41470348834991455,
-0.03649585694074631,
0.36426135897636414,
-0.473557710647583,
0.2174312621... | |
I've been playing with Python for a while and wrote a little program to make a database to keep track of some info (its really basic, and hand written). I want to add the ability to create a website from the data that I will then pass to my special little place on the internet. What should I use to build up the website... | [
0.6231380105018616,
0.31562894582748413,
0.08557970821857452,
0.13897418975830078,
0.2140907198190689,
-0.23377060890197754,
0.13004302978515625,
0.5000826716423035,
-0.3946990966796875,
-0.2662467956542969,
0.33295804262161255,
0.545225977897644,
-0.02887324057519436,
-0.11088050901889801... | |
one or more HTML (or different format) files?
I would generate a page or two of HTML using a template engine ([Jinja](http://jinja.pocoo.org/2/) is my personal choice) and just stick them in your `public_html` directory or wherever the webserver's root is. | [
0.4153313636779785,
0.04827631264925003,
0.12767325341701508,
0.18848462402820587,
-0.2565351724624634,
-0.15677528083324432,
0.0011199136497452855,
0.19442994892597198,
-0.27686139941215515,
-0.7041638493537903,
0.04613124951720238,
0.2560819685459137,
-0.19516010582447052,
0.054696060717... | |
Is there a way to undefine the += on strings and wstrings for chars and wchar\_t?
Basically I want to avoid bugs like the following:
```
int age = 27;
std::wstring str = std::wstring(L"User's age is: ");
str += age;
std::string str2 = std::string("User's age is: ");
str2 += age;
```
The above code will add the as... | [
-0.10969407856464386,
0.6513873338699341,
0.24927063286304474,
-0.6970078349113464,
0.15300139784812927,
0.42767196893692017,
0.2958923578262329,
-0.0664757490158081,
-0.04934021458029747,
-0.5882848501205444,
0.018577871844172478,
0.2737625241279602,
-0.06509091705083847,
0.17918361723423... | |
do. I want to completely disallow this operator on these operands.
**You cannot deactivate a specific function** of a class (here std::basic\_string) as it is it's interface that clearly (and officially) allow that manipulation. Trying to overload the operator will only mess things up.
Now, **you can "wrap" std::basic... | [
0.2613653838634491,
0.042477935552597046,
0.31283149123191833,
-0.11862588673830032,
0.09622953832149506,
-0.3173641860485077,
0.2674669921398163,
-0.1402614265680313,
-0.09657290577888489,
-0.5343348979949951,
-0.36570870876312256,
0.5423089861869812,
-0.5502294898033142,
0.29282069206237... | |
your application compile fine after having replaced std::string and std::wstring by myapp::String and myapp::UTFString (those are example names), you define the wrapper class somewhere :
```
namespace myapp
{
/** std::basic_string with limited and controlled interface.
*/
template< class _Elem, class _Traits,... | [
0.23729421198368073,
0.042429327964782715,
0.6872295141220093,
-0.026584455743432045,
0.0027445198502391577,
-0.08928267657756805,
0.3659658133983612,
0.00293407472781837,
-0.12236956506967545,
-0.9879087805747986,
-0.08213967829942703,
0.6661808490753174,
-0.4176888167858124,
0.0165003631... | |
for easier writing
private:
_String m_string; // here the real std::basic_string object that will do all the real work!
public:
// constructor proxies... (note that those ones are not complete, it should be exactly the same as the original std::basic_string
// see some STL docs to get... | [
0.026571521535515785,
-0.15881694853305817,
0.5733597874641418,
-0.08221875131130219,
0.10519333183765411,
-0.02520417422056198,
0.3561377227306366,
-0.2082599252462387,
-0.2204529196023941,
-0.7636035084724426,
-0.2797940969467163,
0.6906018257141113,
-0.29039695858955383,
-0.269181400537... | |
l_string ) : m_string( l_string.m_string ) {}
limited_string( const _Elem* raw_string ) : m_string( raw_string ) {}
//... etc...
// operator proxies...
_MyType& operator= ( const _MyType& l_string )
{
m_string = l_string.m_string;
}
// etc... | [
-0.0030132406391203403,
-0.5139344334602356,
0.5753807425498962,
-0.5712006092071533,
0.5351402163505554,
0.2259032279253006,
0.11920274049043655,
-0.323083758354187,
0.03289210796356201,
-0.77129065990448,
-0.4925552010536194,
0.7570983171463013,
-0.4989089369773865,
-0.2017480880022049,
... | |
// but we don't want the operator += with int values so we DON'T WRITE IT!
// other function proxies...
size_t size() const { return m_string.size(); } // simply forward the call to the real string!
// etc...you know what i mean...
// to work automatically with other STL algorithm and ... | [
-0.18037095665931702,
-0.2743530869483948,
0.5502690076828003,
-0.22982613742351532,
0.06045873463153839,
0.06355832517147064,
0.2047300785779953,
-0.5755689740180969,
-0.06745727360248566,
-0.5088780522346497,
-0.33074209094047546,
0.9437317848205566,
-0.41576746106147766,
-0.120821811258... | |
{ return m_string.c_str(); }
// etc..
};
}
```
...then, you simply replace those lines :
```
// instead of those lines...
//typedef std::string String;
//typedef std::wstring UTFString;
// use those ones
typedef limited_string< char, std::char_traits<char>, std::allocator<ch... | [
-0.1781613826751709,
-0.3261212110519409,
0.6115627288818359,
-0.20113910734653473,
-0.0029749854002147913,
0.23070263862609863,
-0.047878507524728775,
-0.26019835472106934,
-0.26204630732536316,
-0.8215630054473877,
-0.37615326046943665,
0.43226099014282227,
-0.3667871952056885,
0.0964898... | |
UTFString; // like std::wstring typedef
```
... and your example will crash :
```
error C2676: binary '+=' : 'myapp::UTFString' does not define this operator or a conversion to a type acceptable to the predefined operator
error C2676: binary '+=' : 'myapp::String' does not define this operator or a conversion to a ... | [
-0.20407292246818542,
0.026330385357141495,
0.4504798650741577,
-0.18978355824947357,
0.011554733850061893,
0.12144174426794052,
0.5000898838043213,
-0.4420750141143799,
-0.17768019437789917,
-0.7515862584114075,
-0.11030504107475281,
0.5703569650650024,
-0.55547034740448,
-0.1802390515804... | |
class limited_string
{
public:
typedef std::basic_string< _Elem , _Traits, _Ax > _String; // this is for easier writing
typedef limited_string< _Elem, _Traits, _Ax > _MyType; // this is for easier writing
private:
_String m_string; // here the real std::basic_string object that wil... | [
-0.1455567628145218,
-0.3819601833820343,
0.31116920709609985,
-0.14493149518966675,
-0.08779771625995636,
-0.07188088446855545,
0.035919997841119766,
-0.03122524358332157,
-0.17389942705631256,
-0.5923200249671936,
-0.2941979467868805,
0.5823875665664673,
-0.41413605213165283,
-0.15143549... | |
complete, it should be exactly the same as the original std::basic_string
// see some STL docs to get the real interface to rewrite)
limited_string() : m_string {}
limited_string( const _MyType& l_string ) : m_string( l_string.m_string ) {}
limited_string( const _Elem* raw_string ) : m_s... | [
-0.11088848114013672,
-0.4392716884613037,
0.6961674690246582,
-0.14453409612178802,
0.19557225704193115,
-0.1426674872636795,
0.24437639117240906,
-0.3127775490283966,
-0.007973588071763515,
-0.8882286548614502,
-0.3142848312854767,
0.6915038824081421,
-0.2200668305158615,
-0.247577816247... | |
_MyType& operator= ( const _MyType& l_string )
{
m_string = l_string.m_string;
}
// etc...
// but we don't want the operator += with int values so we DON'T WRITE IT!
// other function proxies...
size_t size() const { return m_string.size(); } // simply forwa... | [
-0.14107665419578552,
-0.2474086433649063,
0.6318564414978027,
-0.537779688835144,
0.2984183132648468,
0.23485979437828064,
0.29911378026008606,
-0.4798756241798401,
0.04306991770863533,
-0.372925341129303,
-0.250264436006546,
0.7616718411445618,
-0.47114458680152893,
-0.02755434811115265,... | |
call to the real string!
// etc...you know what i mean...
// to work automatically with other STL algorithm and functions we add automatic conversion functions:
operator const _Elem*() const { return m_string.c_str(); }
// etc..
};
// instead of those lines...
//... | [
-0.13205744326114655,
-0.3723067343235016,
0.5164411067962646,
-0.21435926854610443,
-0.07591322809457779,
-0.09175632148981094,
0.2498994618654251,
-0.23462846875190735,
-0.01693979650735855,
-0.5707117319107056,
-0.41286778450012207,
0.9010358452796936,
-0.6444419026374817,
-0.0503161214... | |
// use those ones
typedef limited_string< char, std::char_traits<char>, std::allocator<char> > String; // like std::string typedef
typedef limited_string< wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> > UTFString; // like std::wstring typedef
}
int main()
{
using namespa... | [
-0.09924516081809998,
0.18299539387226105,
0.4181147813796997,
-0.6124966144561768,
0.4105864465236664,
0.5448770523071289,
0.1546209454536438,
-0.018473494797945023,
-0.326939195394516,
-0.8200931549072266,
-0.20394818484783173,
0.15362262725830078,
-0.23432667553424835,
0.573588132858276... | |
str2 = String("User's age is: ");
str2 += age; // compilation error!
std::cout << str2 << std::endl;
std::cin.ignore();
return 0;
}
```
I think it would cleanly resolve your problem, but you'll have to wrapp all the functions. | [
-0.04536663740873337,
0.3029230237007141,
0.4409547746181488,
-0.5726035237312317,
0.42558619379997253,
0.04223855584859848,
0.5341160297393799,
-0.30749940872192383,
-0.17399592697620392,
-0.47204795479774475,
-0.43096819519996643,
0.46946221590042114,
-0.203151673078537,
0.31288710236549... | |
What are the best practices for implementing temporary transaction password feature for website?
For e.g in banking/finance scenarios like
- While transfering funds from one account to another, a transaction password is required
- While commiting a trade, a transaction password is required
- etc.
The password should ... | [
0.03043147176504135,
-0.10031641274690628,
0.3557940125465393,
0.3001543879508972,
0.24289114773273468,
-0.2543560266494751,
0.012897772714495659,
0.08798477053642273,
-0.4431260824203491,
-0.685716986656189,
0.0950106680393219,
0.6009544730186462,
-0.09374967962503433,
-0.0516931414604187... | |
Based on question from 'lassevk'
1. The password would be communicated by email/phone/sms.
2. There is no third site involved.
I require this for additional level of security for critical points in the application.
This may also be called as "AuthenticationCode".
**You cannot deactivate a specific function** of a cla... | [
-0.10717051476240158,
0.05002385005354881,
0.26358988881111145,
-0.017910119146108627,
-0.0569939948618412,
-0.3297770917415619,
0.7252187132835388,
-0.18674345314502716,
-0.0908583328127861,
-0.4615294933319092,
-0.5111196041107178,
0.5345178246498108,
-0.43756237626075745,
0.088399328291... | |
to be usable.
I recommand first replacing you string types with typedefs :
```
namespace myapp
{
typedef std::string String;
typedef std::wstring UTFString;
}
```
Then once your application compile fine after having replaced std::string and std::wstring by myapp::String and myapp::UTFString (those are examp... | [
0.2051880955696106,
0.02332458272576332,
0.6338493824005127,
0.04124588891863823,
0.10900662839412689,
0.05403416231274605,
0.20767155289649963,
-0.1744321584701538,
-0.13135413825511932,
-1.0850961208343506,
-0.24374349415302277,
0.5581067204475403,
-0.43362680077552795,
0.150296941399574... | |
_Ax > _String; // this is for easier writing
typedef limited_string< _Elem, _Traits, _Ax > _MyType; // this is for easier writing
private:
_String m_string; // here the real std::basic_string object that will do all the real work!
public:
// constructor proxies... (note that those one... | [
-0.03641435131430626,
-0.0488162524998188,
0.36046862602233887,
-0.10584098845720291,
-0.08411697298288345,
-0.1499435156583786,
0.4554729163646698,
-0.26935482025146484,
-0.1649792343378067,
-0.5409602522850037,
-0.37223339080810547,
0.7921942472457886,
-0.3047981262207031,
-0.31027662754... | |
the real interface to rewrite)
limited_string() : m_string {}
limited_string( const _MyType& l_string ) : m_string( l_string.m_string ) {}
limited_string( const _Elem* raw_string ) : m_string( raw_string ) {}
//... etc...
// operator proxies...
_MyType& operator= ( const... | [
0.04748750105500221,
-0.20923300087451935,
0.8454959392547607,
-0.1365995556116104,
0.2790765166282654,
0.1841028928756714,
0.534521758556366,
-0.3872109055519104,
0.18264514207839966,
-0.824029803276062,
-0.08899740129709244,
0.901502788066864,
-0.39808449149131775,
-0.03232569992542267,
... | |
m_string = l_string.m_string;
}
// etc...
// but we don't want the operator += with int values so we DON'T WRITE IT!
// other function proxies...
size_t size() const { return m_string.size(); } // simply forward the call to the real string!
// etc...you know what i mean.... | [
-0.012292015366256237,
-0.27530986070632935,
0.634543240070343,
-0.5364489555358887,
0.29848650097846985,
-0.016911515966057777,
0.34198933839797974,
-0.3793553113937378,
-0.29760512709617615,
-0.2982082962989807,
-0.3016173243522644,
0.9322510361671448,
-0.499837726354599,
0.0633441954851... | |
// to work automatically with other STL algorithm and functions we add automatic conversion functions:
operator const _Elem*() const { return m_string.c_str(); }
// etc..
};
}
```
...then, you simply replace those lines :
```
// instead of those lines...
//typedef std::string Stri... | [
-0.25190839171409607,
-0.329482764005661,
0.5368451476097107,
-0.11476809531450272,
-0.07832758128643036,
0.08665021508932114,
0.014226370491087437,
-0.4246647357940674,
-0.040693435817956924,
-0.8979505896568298,
-0.3316791355609894,
0.5913420915603638,
-0.3378310799598694,
-0.14843310415... | |
String; // like std::string typedef
typedef limited_string< wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> > UTFString; // like std::wstring typedef
```
... and your example will crash :
```
error C2676: binary '+=' : 'myapp::UTFString' does not define this operator or a conversion to a type ... | [
-0.20128414034843445,
0.27668359875679016,
0.2717539966106415,
-0.13611891865730286,
0.10507810860872269,
0.19611644744873047,
0.47073084115982056,
-0.35454878211021423,
-0.14078289270401,
-0.43667057156562805,
-0.07498782873153687,
0.5632497668266296,
-0.4484328031539917,
-0.1246457025408... | |
/** std::basic_string with limited and controlled interface.
*/
template< class _Elem, class _Traits, class _Ax >
class limited_string
{
public:
typedef std::basic_string< _Elem , _Traits, _Ax > _String; // this is for easier writing
typedef limited_string< _Elem, _Traits, _Ax > _My... | [
-0.292117178440094,
-0.17767879366874695,
0.33278968930244446,
-0.07034003734588623,
-0.23037247359752655,
0.18661874532699585,
0.2357749193906784,
-0.05762238800525665,
-0.05172985792160034,
-0.7634423971176147,
-0.31363818049430847,
0.5793433785438538,
-0.45458948612213135,
-0.0678309872... | |
will do all the real work!
public:
// constructor proxies... (note that those ones are not complete, it should be exactly the same as the original std::basic_string
// see some STL docs to get the real interface to rewrite)
limited_string() : m_string {}
limited_string( const _MyTy... | [
0.27047082781791687,
-0.4705885946750641,
0.6934773325920105,
0.05858635902404785,
0.43075641989707947,
-0.07072026282548904,
0.1403011828660965,
-0.2726667523384094,
0.08526762574911118,
-1.0614651441574097,
-0.2927296459674835,
0.7417011260986328,
-0.30581462383270264,
-0.384845823049545... | |
{}
//... etc...
// operator proxies...
_MyType& operator= ( const _MyType& l_string )
{
m_string = l_string.m_string;
}
// etc...
// but we don't want the operator += with int values so we DON'T WRITE IT! | [
-0.13185925781726837,
-0.22465570271015167,
0.4370010495185852,
-0.3361161947250366,
0.5107221603393555,
0.06664713472127914,
0.562282383441925,
-0.4215545058250427,
0.058727145195007324,
-0.39133477210998535,
-0.38788166642189026,
0.9008198976516724,
-0.6348419189453125,
-0.39124569296836... | |
// other function proxies...
size_t size() const { return m_string.size(); } // simply forward the call to the real string!
// etc...you know what i mean...
// to work automatically with other STL algorithm and functions we add automatic conversion functions:
operator const _Elem*() con... | [
0.004490814171731472,
-0.3329540193080902,
0.47282665967941284,
-0.26203683018684387,
0.024495182558894157,
0.1656987965106964,
0.08832255750894547,
-0.4931705594062805,
-0.11650189757347107,
-0.4962327778339386,
-0.3582632839679718,
0.9772880673408508,
-0.43426886200904846,
-0.10959386080... | |
};
// instead of those lines...
//typedef std::string String;
//typedef std::wstring UTFString;
// use those ones
typedef limited_string< char, std::char_traits<char>, std::allocator<char> > String; // like std::string typedef
typedef limited_string< wchar_t, std::char_traits<w... | [
-0.2175481915473938,
-0.17481303215026855,
0.49526897072792053,
-0.5620511770248413,
0.005728378426283598,
0.40962472558021545,
0.2031281739473343,
-0.11975535750389099,
-0.27075424790382385,
-0.6519997119903564,
-0.3415674567222595,
0.21279841661453247,
-0.3751143217086792,
0.235206767916... | |
= UTFString(L"User's age is: ");
str += age; // compilation error!
std::wcout << str << std::endl;
String str2 = String("User's age is: ");
str2 += age; // compilation error!
std::cout << str2 << std::endl;
std::cin.ignore();
return 0;
}
```
I think it would cleanly resolve your problem... | [
-0.05368184670805931,
0.10699211061000824,
0.5625362396240234,
-0.5903859734535217,
0.5202153921127319,
0.09287896007299423,
0.4205380380153656,
-0.17794980108737946,
-0.1433231383562088,
-0.694603443145752,
-0.43740737438201904,
0.4362640380859375,
-0.23582462966442108,
0.5115811228752136... | |
I am currently studying for a career in embedded real time engineering.
But find it somewhat difficult to find good training material.
Especially because you cannot experience embedded development as you would with desktop application development.
Are there any books and or kits that would be useful for basic training... | [
0.5421725511550903,
0.2766837179660797,
-0.18273404240608215,
0.3295915424823761,
0.5042579770088196,
0.0818227082490921,
-0.24185991287231445,
0.08655291050672531,
-0.05606650933623314,
-0.7166210412979126,
0.1753622442483902,
0.8491750955581665,
0.06810568273067474,
-0.14298737049102783,... | |
more you learn the mindset of embedded programming.
Since you are in Japan it is probably best to check locally what controller is popular, so you get good community support and can easily buy parts.
Here in Germany it is AVR ATMEGA, and I think it is a good choice. It has the best support by GNU tools, it is availab... | [
0.5122332572937012,
0.27870020270347595,
-0.09308362752199173,
0.13383740186691284,
-0.08385616540908813,
-0.26000094413757324,
0.2460756152868271,
0.051877520978450775,
-0.2931825518608093,
-0.4669898748397827,
-0.23052288591861725,
0.539534866809845,
0.052665747702121735,
0.0074855638667... | |
Renesas, which might be more popular in Japan. It is harder to get the GNU tools running, I had to build them myself from source. For MS-Windows there is the free IAR Kickstart suite with code size limited to 4KB. It can be programmed with a serial interface (but with TTL levels), I got a FTDI USB-to-Serial module for ... | [
0.47590312361717224,
-0.08472546190023422,
0.10810987651348114,
0.27758169174194336,
0.15206953883171082,
-0.1972806304693222,
0.25656360387802124,
-0.2231123298406601,
0.03829675912857056,
-0.34323984384536743,
-0.031093519181013107,
0.838691234588623,
-0.3503866195678711,
-0.155501753091... | |
I've got some data manipulation code which spits out csv at the end.
I started upgrading it to add units of measure everywhere, but I now have a problem with my csv function:
```
val WriteCSV : string -> 'a list array -> 'b list -> string -> unit
```
(the parameters are fileName, column array, column headers, separ... | [
0.2666074335575104,
0.251570463180542,
0.4017649292945862,
-0.20705708861351013,
-0.2177456170320511,
0.03600391000509262,
0.31369760632514954,
-0.3494817912578583,
-0.33416250348091125,
-0.5395870804786682,
0.1006942167878151,
0.0776224434375763,
-0.2381240874528885,
0.3576114773750305,
... | |
to work?
* Is there another way to solve this particular problem?
If I got your Problem right, casting it to "pure" float removes the Unit.
For Example:
```
[<Measure>] type m
[<Measure>] type km
let removeUnit (x:float<_>) =
float x
let foo = removeUnit 2.6<m>
let foo2 = removeUnit 2.1<km>
```
> val removeUni... | [
0.34600988030433655,
-0.15862464904785156,
0.34341511130332947,
-0.26707199215888977,
0.1199805811047554,
0.3249855041503906,
0.20805177092552185,
-0.65752774477005,
-0.0697857066988945,
-0.424406498670578,
0.07572135329246521,
0.4662517011165619,
-0.2512778639793396,
0.09837477654218674,
... | |
Can anyone give me an idea how can we *show* or embed a YouTube video if we just have the URL or the Embed code?
You have to ask users to store the 11 character code from the youtube video.
For e.g. <http://www.youtube.com/watch?v=Ahg6qcgoay4>
The eleven character code is : Ahg6qcgoay4
You then take this code and pl... | [
0.4661569595336914,
0.1883576214313507,
0.5744892358779907,
0.14044268429279327,
-0.16136705875396729,
0.26707321405410767,
0.0446733683347702,
-0.2415752112865448,
-0.05752775818109512,
-0.4640737473964691,
0.11188700795173645,
0.48823827505111694,
-0.1965082436800003,
0.09610197693109512... | |
I am developing a PHP/MySQL application using vertrigoserver. I need to enter the German text in tables. The problem is when I read the tables from PHP, some of character didn't show the exact typed one. Do I need additional steps to display all characters effectively?
You should set your database fields to `utf8_gener... | [
0.12346471101045609,
0.36452892422676086,
0.5177499651908875,
-0.07153937965631485,
-0.27571895718574524,
-0.18391472101211548,
0.46072834730148315,
-0.1806662231683731,
0.049668341875076294,
-0.7575830817222595,
-0.18710672855377197,
0.3653629422187805,
-0.3551727533340454,
0.023705542087... | |
I have the following use case, a struct with some boolean and int variables
```
struct a {
int field1;
bool field2;
bool field3;
};
```
I am refactoring this code, and writing a constructor for the struct , the problem is the default initialization of fields.
I am not criticizing any language construc... | [
-0.18654820322990417,
0.11325014382600784,
0.0819726213812828,
-0.4379023313522339,
-0.3402109742164612,
-0.1418302059173584,
0.2056424766778946,
-0.21849174797534943,
0.09792590141296387,
-0.22501638531684875,
-0.296025812625885,
0.5352641344070435,
-0.5081517696380615,
-0.048958431929349... | |
the only way to do in C++ is
```
a: field1(-1), field2(false), field3(false) {}
```
You can do
```
struct a {
a():field1(), field2(), field3() { }
int field1;
bool field2;
bool field3;
};
```
And all fields will be zero and false respectively. If you want to say that the fields have an indetermin... | [
-0.22975069284439087,
0.11651766300201416,
0.22863228619098663,
-0.42626333236694336,
-0.09991516172885895,
-0.291615754365921,
0.13878732919692993,
-0.33527618646621704,
0.10425825417041779,
-0.02426820620894432,
-0.5076095461845398,
0.7127411365509033,
-0.31038761138916016,
-0.2057496607... | |
Access the values with `*field_name`. Test for a none value with `field == boost::none` or `if(field) { ... }`. | [
-0.32679951190948486,
0.02756166271865368,
0.024873744696378708,
0.07870839536190033,
0.33063605427742004,
-0.19542235136032104,
0.21838095784187317,
-0.13144804537296295,
0.09868502616882324,
-0.1442226618528366,
-0.3368570804595947,
0.5847375988960266,
-0.10142664611339569,
0.05534771084... | |
We have a HEAD branch, and a feature branch that was created off the HEAD branch.
I develop on the feature branch, and constantly merge changes from HEAD to my branch.
When I'm finished with the feature, I try to merge it back to HEAD. This is supposed to be a 0-pain operation, as all conflicts were already resolved o... | [
0.29647937417030334,
-0.20080575346946716,
0.22863927483558655,
0.13613933324813843,
0.3413808047771454,
0.032940104603767395,
0.17071513831615448,
-0.047025732696056366,
0.1595412641763687,
-0.7153890132904053,
0.15137310326099396,
0.4443989098072052,
-0.3606564998626709,
-0.0720018520951... | |
or am I doing something wrong?
You can do
```
struct a {
a():field1(), field2(), field3() { }
int field1;
bool field2;
bool field3;
};
```
And all fields will be zero and false respectively. If you want to say that the fields have an indeterminate value, i'm afraid you have to use other techniques. ... | [
0.2929382920265198,
0.14302539825439453,
0.2598428726196289,
-0.314645379781723,
0.018729213625192642,
-0.016153568401932716,
0.43691545724868774,
-0.48639601469039917,
-0.0268972497433424,
0.08407139033079147,
-0.19056746363639832,
0.7573826909065247,
-0.4206118881702423,
-0.0605588480830... | |
a none value with `field == boost::none` or `if(field) { ... }`. | [
-0.5094688534736633,
0.048015691339969635,
0.18218079209327698,
-0.03938765451312065,
0.15612328052520752,
-0.2749480605125427,
-0.12330234795808792,
0.0069191004149615765,
0.1872568279504776,
0.17877861857414246,
-0.706400990486145,
0.4801185727119446,
-0.276213139295578,
0.19097769260406... | |
which method do you prefer for creating dynamic sql queries?
formating or streaming?
Is it just preference or there any reason one is better than other?Or any special library you use to it.
EDIT:
Please answer in case of c++.
There is some thing called [SOCI - The C++ Database Access Library](http://soci.sourceforge.n... | [
0.1808299571275711,
-0.21625429391860962,
0.12986867129802704,
0.3709726929664612,
-0.057486068457365036,
-0.14732150733470917,
-0.3831784129142761,
0.12853294610977173,
-0.5029106736183167,
-0.44895198941230774,
-0.08965088427066803,
0.4809555411338806,
-0.35311388969421387,
-0.2028296589... | |
I have a DependencyObject in C# that is used in an array. Example shown below:
```
private KeywordTag[] tags = new KeywordTag[] {
new KeywordTag { Tag = "test", IncidenceCount = 2076 },
new KeywordTag { Tag = "oi", IncidenceCount = 2052 },
new KeywordTag { Tag = "hmm", IncidenceCount = 1887 },
new Keyw... | [
0.5498254299163818,
-0.017514359205961227,
0.7140786051750183,
-0.14274698495864868,
-0.2710728645324707,
-0.18567420542240143,
0.2212020456790924,
-0.32362520694732666,
-0.10437007248401642,
-0.6306942701339722,
0.031225265935063362,
0.5172162652015686,
-0.4006967544555664,
0.047732692211... | |
a "WITH" after the constructors.
```
Private tags() As KeywordTag = { _
New KeywordTag() WITH {.Tag = test", .IncidentCount = 2076}, _
New KeywordTag() WITH {.Tag = "oi", .IncidentCount = 2052}, _
New KeywordTag() WITH {.Tag = "hmm", .IncidentCount = 1887}, _
New KeywordTag() WITH {.Tag = "grr", .Incid... | [
-0.35177934169769287,
-0.0745738297700882,
0.8275076746940613,
-0.16867798566818237,
-0.09810849279165268,
0.1268302947282791,
0.27840712666511536,
-0.4813174605369568,
-0.37836021184921265,
-0.4209139049053192,
-0.5604252815246582,
0.5253726243972778,
-0.3506625294685364,
0.28995448350906... | |
I have an xml that has text within "word" elements e.g
```
<word>Police</word>
<word>confirmed</word>
<word>they are</word>
<word>questioning</word>
<word>a</word>
<word>man</word>
```
The problem is when I apply the xslt the text appears like "Policeconfirmedthey arequestioningaman".
Here is the xslt snippet that ... | [
0.007966738194227219,
-0.07851657271385193,
0.3734360635280609,
0.16865800321102142,
-0.36663004755973816,
-0.05440649017691612,
0.31161078810691833,
-0.46754446625709534,
-0.1478399783372879,
-0.7530363202095032,
0.03521295264363289,
0.6644793152809143,
-0.07400283962488174,
0.08292979001... | |
Does anyone have any ideas on how to read the MSDTC configuration on the current machine? I am specifically trying to check that the user has performed the following steps:
1. Open Component Management (Start > All Programs > Administrative Tools > Component Services)
2. Double-click on Component Services, then expand... | [
0.2831113338470459,
-0.056407324969768524,
0.9285392761230469,
0.2883463501930237,
0.3098674416542053,
-0.3783978223800659,
0.3428872525691986,
-0.1528235226869583,
-0.1736655831336975,
-0.890592634677887,
-0.15794502198696136,
0.8051254749298096,
-0.1273059993982315,
0.09186746925115585,
... | |
to validate end-user configuration. I don't think I would attempt to fix it if it were wrong: just point the user at the help file - so only read only is needed.
I'm not sure if you can do this programmatically from any API, or WMI.
At least you can check the registry information at:
```
HKEY_LOCAL_MACHINE\SOFTWARE\Mi... | [
0.3615598976612091,
0.2752630114555359,
0.22256633639335632,
0.09935256093740463,
0.34600576758384705,
-0.16312500834465027,
0.21675536036491394,
0.22849057614803314,
-0.1217210665345192,
-0.57208651304245,
-0.1474219262599945,
0.8246254920959473,
-0.08432982116937637,
-0.09686154872179031... | |
I seem to run into this very often. I need to build a Hash from an array using an attribute of each object in the array as the key.
Lets say I need a hash of example uses ActiveRecord objecs keyed by their ids
Common way:
```
ary = [collection of ActiveRecord objects]
hash = ary.inject({}) {|hash, obj| hash[obj.id] =... | [
-0.23089873790740967,
0.16341692209243774,
0.256011962890625,
-0.1106400415301323,
-0.12114301323890686,
0.10434753447771072,
0.24783097207546234,
-0.18446455895900726,
-0.23950788378715515,
-0.7538832426071167,
-0.11545493453741074,
0.5382981300354004,
-0.42370274662971497,
-0.00977115985... | |
is already a method in ActiveSupport that does this.
```
['an array', 'of active record', 'objects'].index_by(&:id)
```
And just for the record, here's the implementation:
```
def index_by
inject({}) do |accum, elem|
accum[yield(elem)] = elem
accum
end
end
```
Which could have been refactored into (if... | [
-0.1527782529592514,
0.11737630516290665,
0.4106200039386749,
-0.09978640079498291,
0.2865610122680664,
-0.33651646971702576,
0.1520046442747116,
-0.38458284735679626,
-0.2862303853034973,
-0.2854785919189453,
-0.2259169965982437,
0.7165149450302124,
-0.30718547105789185,
0.085554905235767... | |
I'm looking for apps/environments similar to [Nodebox](http://nodebox.net/code/index.php/Tutorial). Nodebox is so cool and I want to know if there were other similar apps out there.
They don't have to be graphics-related; I'm interested in software that uses programming languages in a new way.
[http://processing.org/... | [
0.3030011057853699,
-0.006007146090269089,
0.06493344157934189,
0.05052496865391731,
-0.21690231561660767,
0.31434956192970276,
-0.30899927020072937,
0.480927050113678,
-0.32704517245292664,
-0.8853459358215332,
0.12905380129814148,
0.2326107770204544,
-0.3740643262863159,
-0.0642482936382... | |
I'm reading a .gz file from some slow source (like FTP Server) and am processing the received data right away. Looks something like this:
```
FtpWebResponse response = ftpclientRequest.GetResponse() as FtpWebResponse;
using (Stream ftpStream = response.GetResponseStream())
using (GZipStream unzipped = new GZipStream(f... | [
-0.04966270551085472,
-0.09020395576953888,
0.8600525856018066,
-0.23424044251441956,
0.04820901155471802,
0.13820171356201172,
0.20796087384223938,
-0.26098790764808655,
-0.1508675217628479,
-0.8155699372291565,
-0.34620437026023865,
0.6539505124092102,
-0.27445968985557556,
0.06397789716... | |
how many uncompressed bytes I read, but I don't know how this does relate to the compressed file size.
So, is there any way to get from GZipStream how far the file pointer is advanced into the compressed file? I only need the current position, the gz file size I can fetch before reading the file.
You can plug a stream... | [
0.24562576413154602,
-0.14625248312950134,
0.5654999613761902,
-0.11616203188896179,
0.14998292922973633,
0.16801221668720245,
0.06467806547880173,
-0.21583084762096405,
-0.31789693236351013,
-0.8003503680229187,
-0.017127012833952904,
0.4944513142108917,
-0.30411043763160706,
0.0676295161... | |
{
_baseStream = s;
}
public override bool CanRead
{
get { return _baseStream.CanRead; }
}
public override bool CanSeek
{
get { return false; }
}
public override bool CanWrite
{
get { return false; }
}
public override void Flush()
{ | [
0.48536190390586853,
-0.22145964205265045,
0.2791846990585327,
-0.2739540636539459,
0.12858667969703674,
-0.2622227668762207,
0.49312856793403625,
-0.2607530355453491,
0.11890742182731628,
-0.39820319414138794,
-0.40002286434173584,
0.619367778301239,
-0.2932501435279846,
-0.03134462237358... | |
_baseStream.Flush();
}
public override long Length
{
get { throw new NotImplementedException(); }
}
public override long Position
{
get
{
throw new NotImplementedException();
}
set
{
throw new NotImplementedException(); | [
0.11576160043478012,
-0.5432394742965698,
0.3350369930267334,
-0.375639408826828,
0.17969578504562378,
-0.049439143389463425,
0.26501893997192383,
-0.4490656852722168,
0.0779254361987114,
-0.2980725169181824,
-0.24556241929531097,
0.6542465686798096,
-0.14966166019439697,
0.102371908724308... | |
}
}
public override int Read(byte[] buffer, int offset, int count)
{
int rc = _baseStream.Read(buffer, offset, count);
BytesRead += rc;
return rc;
}
public override long Seek(long offset, SeekOrigin origin)
{
throw new NotImplementedException();
}
public override ... | [
0.33007171750068665,
-0.34108585119247437,
0.3920947313308716,
-0.2667940855026245,
0.40320125222206116,
0.05653052031993866,
0.20861338078975677,
-0.5908927321434021,
-0.10196284204721451,
-0.0900924801826477,
-0.31187424063682556,
0.711035966873169,
-0.38366419076919556,
0.38310346007347... | |
}
public override void Write(byte[] buffer, int offset, int count)
{
throw new NotImplementedException();
}
}
// usage
FtpWebResponse response = ftpclientRequest.GetResponse() as FtpWebResponse;
using (Stream ftpStream = response.GetResponseStream())
using (ProgressStream progressStream = new Progr... | [
-0.1577601432800293,
-0.34958139061927795,
0.6533955931663513,
-0.2917991578578949,
0.2961765229701996,
0.20284244418144226,
0.2175784856081009,
-0.37784215807914734,
-0.389110803604126,
-0.5655965209007263,
-0.43868038058280945,
0.6912117004394531,
-0.4020123779773712,
0.16154472529888153... | |
I am experimenting with Beep function on Windows:
```
#include <windows.h>
...
Beep(frequency, duration);
```
The computer then beeps with some frequency for some duration. How would I do this on a Linux computer?
Edit: It IS important to output different frequencies.
Check out the source code for beep available wi... | [
0.7364720106124878,
0.2022518515586853,
0.12931804358959198,
-0.3338494300842285,
0.11549245566129684,
-0.21274124085903168,
0.2702811658382416,
-0.015620284713804722,
-0.3166998326778412,
-0.5307537913322449,
0.11281141638755798,
0.7068570256233215,
-0.545570969581604,
0.2516155242919922,... | |
What is wrong with `rs` definition in first where section?
```
palindrome :: [a] -> [a]
palindrome xs = con xs rs
where con a b = rev (rev a []) b
rs = rev xs -- here
where rev [] rs = rs
rev (x:xs) rs = rev xs (x:rs)
```
I'm just | [
0.4234820306301117,
0.4165690839290619,
0.6697381734848022,
-0.2180478721857071,
-0.23926334083080292,
0.07325254380702972,
0.4183257818222046,
-0.19946961104869843,
-0.25128108263015747,
-0.17910675704479218,
-0.14620321989059448,
0.5094361305236816,
-0.7327038049697876,
0.408613324165344... | |
learning Haskell but its syntax rules confuse me. The error message is
```
[1 of 1] Compiling Main ( pelindrome.hs, interpreted )
pelindrome.hs:5:8: parse error on input `rs'
```
Your indentation was wrong and i think you can only have one `where` in there (i could be very well wrong. I'm not a haskell g... | [
-0.187775120139122,
-0.02020927704870701,
0.3175790011882782,
0.1029653400182724,
-0.22016066312789917,
-0.32708385586738586,
0.6462591290473938,
0.12976224720478058,
0.15377984941005707,
-0.5602321028709412,
-0.09079736471176147,
0.713127076625824,
-0.46217429637908936,
-0.099643021821975... | |
rs = rev xs [] -- here
rev [] rs = rs
rev (x:xs) rs = rev xs (x:rs)
main = print (palindrome "hello")
```
Prints out:
```
"helloolleh"
```
I'm going to try to understand it now. Anyway, have fun!
Edit: Makes perfect sense to me now. I think that's the right version. For ... | [
-0.22849877178668976,
0.43772852420806885,
0.716302216053009,
-0.3774351179599762,
-0.25261491537094116,
-0.15416069328784943,
0.7869386076927185,
-0.21560518443584442,
-0.33597198128700256,
-0.4717863202095032,
-0.29460546374320984,
0.4642585217952728,
-0.6054376363754272,
0.0603815354406... | |
Can anyone point me to a site, or give me some wisdom on how you go about choosing names for interfaces, classes and perhaps even methods and properties relating to what that object or method does?
This is specifically for Microsoft development, so Java-esque "doGet" and so on isn't really used, however some general r... | [
0.2960277795791626,
0.1591210961341858,
0.030626138672232628,
0.16269174218177795,
-0.19039411842823029,
0.05668396130204201,
0.19159527122974396,
0.10390893369913101,
-0.10096505284309387,
-0.6789373755455017,
0.18779253959655762,
0.39117059111595154,
-0.256093293428421,
0.022862995043396... | |
ruleset for this, for consistency? Aside from the obvious verbs for methods.
**Edit:** Though the example is an interface, I'm not limiting this to just interfaces. The general guideline is classes are nouns, methods verbs, properties nouns. I suppose what I mean is choice of the synonym. Is throwing "Entity" everywhe... | [
-0.02421828918159008,
-0.11042194068431854,
0.05855755880475044,
0.24451138079166412,
-0.2373155653476715,
-0.3638683557510376,
0.2816213071346283,
-0.17793171107769012,
-0.25988414883613586,
-0.7271625399589539,
-0.04258322715759277,
0.3968936800956726,
-0.2759779691696167,
-0.00692638149... | |
I currently have a library of UserControls which I use in a lot of our web applications. I would like to update these controls so that I can use IOC to help seperate the logic.
So I would have something similar to the following on the web page itself:
```
<prefix:ControlName ID="myControl" runat="server" property="va... | [
0.25912046432495117,
0.22680504620075226,
0.0028828694485127926,
0.3202818036079407,
-0.12083611637353897,
-0.12268339097499847,
0.037270065397024155,
-0.2614172101020813,
-0.051276303827762604,
-0.6092026233673096,
0.10799160599708557,
0.38254880905151367,
-0.12166006863117218,
0.06709115... | |
there is no one answer to this question, many IOC containers contain some implementation of injecting control properties but there is no way (currently) of actually creating a control without a parameterless constructor. | [
-0.018118295818567276,
0.022479750216007233,
-0.4669736325740814,
0.6026228070259094,
-0.06193294748663902,
-0.2634628117084503,
0.011422050185501575,
-0.0186548363417387,
0.044360656291246414,
-0.2371017038822174,
-0.12038641422986984,
-0.06678114831447601,
-0.1545594334602356,
0.08059204... | |
I have a Visual Studio solution that comprises of several projects and are separated into different directories.
In my C# or VB.NET code, I want to determine the base directory (or the directory that the solution is in).
A dirty solution would be to call the directory `parent.parent.parent` until I find a file \*.sl... | [
0.5544264912605286,
0.04299714043736458,
0.11274769902229309,
0.1143704354763031,
0.04801895096898079,
-0.10185655206441879,
0.20986956357955933,
0.12180119752883911,
-0.2074451893568039,
-0.71302330493927,
-0.04784417897462845,
0.3108935058116913,
-0.16857287287712097,
0.2564295828342438,... | |
the target machine - why are you trying to find it at all?
If you still want to use the sln- try at [EnvDTE Namespace](http://msdn.microsoft.com/en-us/library/envdte._solution_members(VS.80).aspx)
> EnvDTE.DTE dte = (EnvDTE.DTE) System.Runtime.InteropServices.Marshal.GetActiveObject("VisualStudio.DTE");
>
> str... | [
0.1709332913160324,
-0.5299323797225952,
0.7341923117637634,
0.45907464623451233,
0.00016602221876382828,
0.1766427755355835,
0.19364328682422638,
0.06994880735874176,
-0.11643800139427185,
-0.8616561889648438,
-0.24992704391479492,
0.42114827036857605,
-0.3906055986881256,
-0.217245444655... | |
How do I split a number by the decimal point in php?
I've got $num = 15/4; which turns $num into 3.75. I would like to split out the 3 and the 75 parts, so $int = 3 and $dec = 75. My non-working code is:
```
$num = 15/4; // or $num = 3.75;
list($int, $dec) = split('.', $num);
```
but that results in empty $int and ... | [
0.2722102105617523,
0.187588170170784,
0.15418577194213867,
-0.17342744767665863,
-0.1444147676229477,
0.2632812559604645,
0.11039195954799652,
-0.2268078327178955,
-0.5103030204772949,
-0.2709707021713257,
0.12821809947490692,
0.40040111541748047,
0.13198985159397125,
-0.1781279742717743,... | |
the non-programming ones :).
If you *do* mind (for computations e.g.), you can use the `floor` function:
```
$num = 15/4
$intpart = floor( $num ) // results in 3
$fraction = $num - $intpart // results in 0.75
```
Note: this is for positive numbers. For negative numbers you can invert the sign, use the positive a... | [
0.0015548967057839036,
0.20692406594753265,
0.20526742935180664,
-0.25188255310058594,
-0.12640990316867828,
0.14197762310504913,
0.08305181562900543,
-0.31835663318634033,
-0.343008428812027,
-0.4255952835083008,
-0.07807129621505737,
0.4529396593570709,
-0.020594216883182526,
-0.07723958... | |
I have to display a column chart in a user form in VBA. Exporting the chart to GIF and importing in a picture box works; but I cannot use it because the chart needs to be modified based on options chosen by the user from the same form. I have been searching and people have commented that default OLE/OCX controls provid... | [
0.1845964938402176,
0.13440202176570892,
0.7335434556007385,
-0.0454491563141346,
-0.06756310909986496,
-0.11930229514837265,
0.10657060146331787,
-0.06143094599246979,
-0.3300173282623291,
-0.7482404708862305,
0.04166112467646599,
0.5979931950569153,
-0.505429208278656,
0.1235510483384132... | |
Excel 2003 ... the control is called "Microsoft Office Chart 11.0"
If you have Excel 2007, Microsoft did not ship the chart control. But you can still [download Microsoft Office Chart 11.0](http://www.microsoft.com/downloads/details.aspx?FamilyId=7287252C-402E-4F72-97A5-E0FD290D4B76&displaylang=en). It's in a file cal... | [
-0.4105018675327301,
0.07965826988220215,
0.889958381652832,
0.0782071053981781,
-0.09584473818540573,
-0.00609915005043149,
-0.049518898129463196,
-0.09784382581710815,
-0.27477744221687317,
-0.393713116645813,
0.07633137702941895,
0.4627344012260437,
-0.3925589919090271,
-0.0395098179578... | |
I'm using OOB functionality to upload files to sharepoint. I'm using `<module`> tags and feature which wraps all data. (it is described [here](http://msdn.microsoft.com/en-us/library/ms441170.aspx))
Here is example of module in my elements.xml file:
```
<Module Name="SampleImages" Url="Style Library/Images/SampleImag... | [
0.2957834005355835,
0.03171854838728905,
0.43754544854164124,
-0.16945995390415192,
0.023888586089015007,
-0.19753877818584442,
0.2716456949710846,
-0.412950724363327,
-0.3101319968700409,
-0.6723337769508362,
-0.0728626400232315,
0.46357008814811707,
-0.39198005199432373,
0.12834969162940... | |
manner?
I believe the way you are doing it is the only way. | [
0.35143616795539856,
0.2513459026813507,
0.1146385595202446,
0.1904408037662506,
-0.28149041533470154,
0.5717911124229431,
0.6254055500030518,
0.05744750052690506,
-0.1129712462425232,
-1.0299783945083618,
0.30896005034446716,
0.8067000508308411,
0.2726689279079437,
-0.09317415952682495,
... | |
I've **deleted** the Windows 6 SDK folder and now my VS refuses to build my Deployment Project. I need to get the filed back to get working again.
> **Could not find required file** 'setup.bin' in 'C:\Program Files\Microsoft SDKs\ **Windows\v6.0A** \Bootstrapper\Engine'
I've searched around the internet and all I can... | [
0.5529654026031494,
0.29437676072120667,
0.28560754656791687,
0.14481273293495178,
-0.08925442397594452,
-0.20688101649284363,
0.46849822998046875,
-0.22584882378578186,
-0.2627545893192291,
-0.6613650321960449,
0.00604162085801363,
0.6537197232246399,
-0.03362051770091057,
0.2914475202560... | |
My code:
```css
body {
font-family:"Verdana",Arial,Helvetica,sans-serif;
}
.myfont {
font-family:"Verdana",Arial,Helvetica,sans-serif;
}
```
```html
<body>
Hello
<select>
<option>
Hello
</option>
</select>
<select class="myfont">
<option>
... | [
0.0505388081073761,
0.3841663599014282,
0.5976318120956421,
-0.15894871950149536,
0.016796274110674858,
0.5837950110435486,
0.14792877435684204,
0.018235212191939354,
0.08081670850515366,
-0.8263847827911377,
-0.3671726882457733,
0.2968238890171051,
-0.13597504794597626,
-0.014140325598418... | |
the specification for `<body>`?
If I have to change the font for a `<select>` why do I have to copy the style?
If you use:
```
select {
font-family: inherit;
}
```
It'll work fine. CSS is a little quirky when it comes to form controls. | [
0.41965335607528687,
0.05503442883491516,
0.17468903958797455,
0.0937764048576355,
-0.05902274325489998,
-0.05837336555123329,
-0.03799022361636162,
-0.10729439556598663,
0.19807755947113037,
-0.6714955568313599,
0.013627401553094387,
0.5445185899734497,
-0.31975576281547546,
-0.1006575152... | |
I want to use MOSS 2007's single sign-on feature, but read that the server needs to be in an Active Directory environment. This I understand, but does this mean all my users HAVE TO be Active Directory users? Can I not use MOSS2007 Single Sign-on if my users are authenticated using Forms Authentication (using a custom ... | [
-0.012647002004086971,
-0.07850280404090881,
0.4943086802959442,
-0.2006216049194336,
-0.20055197179317474,
-0.23896430432796478,
0.3669990301132202,
-0.03906027972698212,
-0.4077010154724121,
-0.3959774374961853,
-0.02783006802201271,
0.14385485649108887,
-0.15452861785888672,
-0.06254572... | |
Unfortunately, despite having tried to learn regex at least one time a year for as many years as I can remember, I always forget as I use them so infrequently. This year my new year's resolution is to not try and learn regex again - *So this year to save me from tears I'll give it to Stack Overflow*. (Last Christmas re... | [
0.05029302090406418,
0.3537863492965698,
0.8742774128913879,
0.11587012559175491,
-0.21415580809116364,
0.07846187055110931,
0.40331003069877625,
0.1244773343205452,
-0.549155056476593,
-0.4451914131641388,
-0.2063203752040863,
0.24109771847724915,
0.4130876958370209,
0.5046707987785339,
... | |
regular quotes (i.e. ', ") into LaTeX/TeX quotes (i.e. `', ``'')](https://stackoverflow.com/questions/346567/how-can-one-turn-regular-quotes-i-e-into-latex-tex-quotes-i-e)
* [Regex: To pull out a sub-string between two tags in a string](https://stackoverflow.com/questions/1237/regex-to-pull-out-a-section-a-substing-fro... | [
-0.23871836066246033,
-0.1312238872051239,
0.49593403935432434,
-0.06141233816742897,
-0.13378022611141205,
0.14272728562355042,
0.2172546237707138,
-0.11062279343605042,
-0.15002262592315674,
-0.16470207273960114,
-0.5646137595176697,
0.5260581374168396,
-0.4242062568664551,
-0.1073176339... | |
poster: If it *has* to be a regex, use `/{([^}]*)}/` if you want to allow empty strings, or `/{([^}]+)}/` if you want to only match when there is at least one character between the curly braces. Breakdown:
* `/`: start the regex pattern
+ `{`: a literal curly brace
- `(`: start capturing
* `[`: start defining a ... | [
0.345335990190506,
-0.5236189365386963,
0.34529832005500793,
0.31221863627433777,
-0.06356805562973022,
-0.21138755977153778,
-0.08939632773399353,
0.0814916118979454,
-0.24553517997264862,
-0.5760749578475952,
0.14377029240131378,
0.2592202126979828,
-0.4490772783756256,
0.007500129286199... | |
pattern | [
0.15725868940353394,
0.01643931120634079,
0.020283859223127365,
-0.27350738644599915,
-0.07454369962215424,
0.16765639185905457,
0.4006147086620331,
0.09848279505968094,
-0.6463675498962402,
-0.6716044545173645,
0.11415132135152817,
-0.25205865502357483,
-0.3065206706523895,
0.302679777145... | |
In SQL you can run a ISNULL(null,'') how would you do this in a linq query?
I have a join in this query:
```
var hht = from x in db.HandheldAssets
join a in db.HandheldDevInfos on x.AssetID equals a.DevName into DevInfo
from aa in DevInfo.DefaultIfEmpty()
select new
{
AssetID =... | [
0.46455350518226624,
-0.13829076290130615,
0.5335156917572021,
0.07946259528398514,
-0.008790004067122936,
-0.1579105406999588,
0.12465030699968338,
-0.3618330955505371,
0.10018268972635269,
-0.6525881290435791,
0.2677503526210785,
0.8513393998146057,
0.08511030673980713,
0.282779961824417... | |
};
```
but I have a column that has a bit type that is non nullable (xx.online) how can I set this to false if it is null?
Since `aa` is the set/object that might be null, can you check `aa == null` ?
(`aa` / `xx` might be interchangeable (a typo in the question); the original question talks about `xx` but only defi... | [
-0.04533448815345764,
-0.007728887721896172,
0.033155303448438644,
-0.20967186987400055,
0.04565160721540451,
0.1590554118156433,
0.19281625747680664,
-0.2640329897403717,
-0.17153243720531464,
-0.7245591282844543,
-0.26921629905700684,
0.7494949698448181,
-0.22958096861839294,
-0.05929087... | |
= x.AssetID,
Status = aa == null ? false : aa.Online;
}
```
---
Update; in response to the downvote, I've investigated more... the fact is, this is the right approach! Here's an example on Northwind:
```
using(var ctx = new DataClasses1DataContext())
{
ctx.Log = Console.Out;
... | [
-0.09506512433290482,
-0.07214610278606415,
0.49117037653923035,
-0.044098034501075745,
0.33333978056907654,
-0.11941041797399521,
0.18167050182819366,
-0.18681246042251587,
-0.28906092047691345,
-0.5319685339927673,
-0.1368868201971054,
0.6663081645965576,
-0.14720788598060608,
0.33879923... | |
join grunt in ctx.Employees
on boss.EmployeeID equals grunt.ReportsTo into tree
from tmp in tree.DefaultIfEmpty()
select new | [
-0.006263270508497953,
-0.27207764983177185,
0.3260030448436737,
-0.08903404325246811,
-0.08709415048360825,
0.14340336620807648,
0.2592407166957855,
-0.06503333896398544,
-0.42167389392852783,
-0.7794692516326904,
-0.1876317858695984,
0.6654499173164368,
-0.32291460037231445,
0.0282340776... | |
{
ID = boss.EmployeeID,
Name = tmp == null ? "" : tmp.FirstName | [
-0.2638368010520935,
-0.061809759587049484,
-0.15179568529129028,
-0.039900366216897964,
0.36543089151382446,
0.1654077023267746,
-0.18610192835330963,
0.00912264734506607,
-0.1637255996465683,
-0.579312801361084,
-0.23068898916244507,
0.3423781991004944,
-0.5298951864242554,
0.21724006533... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.