text stringlengths 0 30.5k | title stringclasses 1
value | embeddings listlengths 768 768 |
|---|---|---|
files
c.train(open("code.rb").read, :ruby)
c.train(open("code.py").read, :python)
c.train(open("code.cs").read, :csharp)
# Test it on another file
c.classify(open("code2.py").read) # => :python (hopefully)
``` | [
0.7577124834060669,
-0.13740183413028717,
-0.2094830572605133,
0.3877814710140228,
0.07775211334228516,
-0.0775083377957344,
0.5008513331413269,
-0.5583095550537109,
0.10477527230978012,
-0.5753071308135986,
-0.1753900945186615,
0.1434767246246338,
-0.004278720356523991,
-0.102557085454463... | |
A table that extends onto multiple printed pages will have its thead and tfoot sections reprinted in firefox. This is usually great, however, is there a way to turn off this behavior with CSS?
[UPDATE] Thanks for the response so far. I would like to have the tfoot print once at the bottom of the table but not at the e... | [
0.3524331748485565,
0.07887857407331467,
0.5226269364356995,
0.062341783195734024,
-0.045120783150196075,
-0.15546104311943054,
0.01812141016125679,
-0.10926852375268936,
-0.3819880783557892,
-0.7381286025047302,
-0.01258189044892788,
0.5069578886032104,
-0.362903356552124,
-0.290383607149... | |
**UPDATE 3:**
I created a Visual Studio 2008 test project and tried to create a service reference to shared site WCF service reference and received the following error:
> There was an error downloading
> '<http://apps.mydomain/MyService.svc>'.
> The request failed with HTTP status
> 400: Bad Request. Metadata co... | [
-0.22113727033138275,
0.16640520095825195,
0.9310377836227417,
-0.1484992504119873,
-0.48982226848602295,
0.07116027921438217,
0.5894715189933777,
-0.6074514985084534,
-0.08810171484947205,
-0.722514271736145,
-0.20574474334716797,
0.6291855573654175,
-0.5004870295524597,
-0.04196777939796... | |
'application/soap+xml; charset=utf-8'
> was not the expected type 'text/xml;
> charset=utf-8'.. If the service is
> defined in the current solution, try
> building the solution and adding the
> service reference again.
**UPDATE 2:**
@Nick - I tried your suggestion of explictly setting the address of each endpo... | [
0.3767855763435364,
-0.032669782638549805,
0.47381603717803955,
0.04365972429513931,
-0.1901475340127945,
-0.10480974614620209,
0.7929137945175171,
-0.37550482153892517,
0.17042610049247742,
-0.8877738118171692,
-0.22398187220096588,
0.68454909324646,
-0.3808440864086151,
0.172889262437820... | |
setting conflicts between <http://apps1.mydomain> and <http://apps2.mydomain> and was able to get past the "Server Application Unavailable" error.
Now I am getting a 404 error when I tried to browse to the shared site (<http://apps.mydomain>), but I am able to browse to the <http://apps1.mydomain> and <http://apps2.m... | [
-0.1692797839641571,
0.3499593138694763,
0.6771089434623718,
-0.18645775318145752,
-0.013048412278294563,
0.02069833315908909,
0.19221127033233643,
-0.005209839902818203,
-0.3811333179473877,
-0.550334095954895,
0.08717391639947891,
0.5827685594558716,
-0.4242861270904541,
0.14437973499298... | |
web application you are attempting to
> access on this web server is currently
> unavailable. Please hit the "Refresh"
> button in your web browser to retry
> your request.
>
>
> Administrator Note: An error message
> detailing the cause of this specific
> request failure can be found in the
> application eve... | [
0.2045530378818512,
0.27915075421333313,
0.7309293746948242,
-0.0510379858314991,
0.06633733212947845,
0.09633861482143402,
0.5817795991897583,
0.0006917820428498089,
-0.2948641777038574,
-0.9693344831466675,
-0.20136229693889618,
0.42600443959236145,
-0.2520236372947693,
0.203054830431938... | |
browse to the service on each server, I do not receive that error.
The service is currently using a anonymous basicHttpBinding.
Has anyone else experienced this issue?
**History**
Before this error started occurring, I received the following error when I broswed to all three domain name (<http://apps.mydomain>, <... | [
0.38259536027908325,
0.38793593645095825,
0.7862993478775024,
-0.31019750237464905,
-0.07647988200187683,
0.13376864790916443,
0.569939136505127,
-0.08255016803741455,
-0.3988719880580902,
-1.0011085271835327,
-0.11811588704586029,
0.31127575039863586,
-0.21979179978370667,
0.3611882030963... | |
class MyFactory : ServiceHostFactory
{
protected override ServiceHost CreateServiceHost(Type serviceType, Uri[] baseAddresses)
{
return new ServiceHost(serviceType, baseAddresses[0]);
}
}
<%@ ServiceHost Language="C#" Factory="MyFactory" Debug="true" Service="MyService" CodeBehind="~/App_Code/MySer... | [
0.14844824373722076,
0.28508010506629944,
0.7587812542915344,
-0.36508333683013916,
-0.12438726425170898,
0.3936622738838196,
0.614377498626709,
-0.2604086101055145,
0.17090952396392822,
-1.1268290281295776,
-0.13906240463256836,
0.5479235649108887,
-0.3408306837081909,
0.4135532081127167,... | |
If I have a Windows executable, how can I find out which dlls it will load?
I'm just talking about which ones that will be loaded statically, not ones it might load dynamically with something like LoadLibrary.
There are utilities that will do this for you.
In the past I've used the MS tool (depends.exe) that came wit... | [
0.22552025318145752,
-0.21824997663497925,
0.3763164281845093,
0.006189355626702309,
-0.10432467609643936,
-0.22190310060977936,
-0.09219954162836075,
0.13548582792282104,
-0.4869063198566437,
-0.6273854374885559,
-0.3281077742576599,
0.6226631999015808,
-0.08140169084072113,
0.28445011377... | |
I'm trying to strip all punctuation out of a string using a simple regular expression and the php preg\_replace function, although I get the following error:
> Compilation failed: POSIX named classes are supported only within a class at offset 0
I guess this means I can't use POSIX named classes outside of a class a... | [
0.38418883085250854,
0.06669918447732925,
0.3650723993778229,
-0.24364762008190155,
-0.19330184161663055,
0.27290648221969604,
0.3718579113483429,
-0.21532940864562988,
-0.0805310532450676,
-0.4429645240306854,
-0.10352921485900879,
0.6812976002693176,
-0.33877402544021606,
-0.125685930252... | |
expect [Perl compatible regular expressions](http://en.wikipedia.org/wiki/Perl_Compatible_Regular_Expressions) with delimiters. So try this:
```
preg_replace('/[[:punct:]]/', ' ', $string)
``` | [
0.19884631037712097,
-0.3043736219406128,
0.4659374952316284,
-0.1975167691707611,
-0.07939786463975906,
0.06004132330417633,
-0.013484085910022259,
-0.06915231794118881,
0.03643602877855301,
-0.44639748334884644,
-0.1762528270483017,
0.9003778696060181,
-0.34836503863334656,
-0.6788867712... | |
This is for MySQL and PHP
I have a table that contains the following columns:
```
navigation_id (unsigned int primary key)
navigation_category (unsigned int)
navigation_path (varchar (256))
navigation_is_active (bool)
navigation_store_id (unsigned int index)
```
Data will be filled like:
```
1, 32, "4/32/", 1, 32
... | [
-0.4609362781047821,
0.21878060698509216,
0.9387397170066833,
-0.09607633948326111,
0.04045295715332031,
0.1873183250427246,
0.20578324794769287,
-0.3817206621170044,
-0.08371957391500473,
-0.5658017992973328,
-0.08745746314525604,
0.20721504092216492,
-0.4008799195289612,
-0.0736380442976... | |
the parents of the category 33 (in this case 4 and 32)
Then, a group of elements that are a child of category 33 (in this case 34, 35, and 36)
Then the rest of the "root" categories under category 4 (in this case 37).
So the following query will return the correct results:
```
SELECT * FROM navigation
WHERE naviga... | [
-0.38856297731399536,
0.3119674324989319,
0.2185666859149933,
-0.018826555460691452,
0.2159925252199173,
0.4077198803424835,
0.0975225418806076,
-0.42249101400375366,
-0.17617549002170563,
-0.5944708585739136,
-0.393803209066391,
0.2760128378868103,
-0.3770241141319275,
-0.0167382117360830... | |
of categories in the order listed above (parents of 33 first, children of 33 second, and parents of the root node last). So if they meet the first condition, order them first, if they meet the second condition order them second and if they meet the third (and fourth) condition order them last.
You can see an example o... | [
-0.10845369100570679,
0.11796962469816208,
0.3062897026538849,
-0.044977523386478424,
-0.07711853086948395,
0.13853205740451813,
0.08114811778068542,
-0.3205437660217285,
-0.5245368480682373,
-0.21538153290748596,
-0.17410576343536377,
0.3093237578868866,
-0.12842236459255219,
0.0354433022... | |
PHP. Using this new table I am solving another issue that I have with magento but would also like to improve my performance at the same time. The best way I see this being accomplished is putting all three queries together and having PHP work less by having the results sorted properly.
Thanks
**EDIT**
Alright, it wo... | [
0.07747746258974075,
-0.2613506615161896,
0.7276927828788757,
0.0842459499835968,
-0.13896659016609192,
-0.19226934015750885,
0.453059583902359,
-0.2882791757583618,
-0.019487563520669937,
-0.8726429343223572,
0.3221316635608673,
0.8036590218544006,
-0.23395781219005585,
-0.386907547712326... | |
$select = $this->getSelect();
$id = $cat->getId();
$root = Mage::app()->getStore()->getRootCategoryId();
$commaPath = implode(", ", explode("/", $path));
$where = new Zend_Db_Expr(
"(navigation_category IN ({$commaPath})
OR navigation_parent = {$id} | [
-0.07379315793514252,
-0.4605698883533478,
0.7507079243659973,
-0.06124497577548027,
0.19564378261566162,
0.08902980387210846,
0.3771807849407196,
-0.5018320679664612,
-0.24716752767562866,
-0.4210130572319031,
-0.3496032655239105,
0.5969083309173584,
-0.6202830076217651,
0.172184392809867... | |
OR (navigation_parent = {$root}
AND navigation_category <> {$cat->getId()}))");
$order = new Zend_Db_Expr("
CASE
WHEN navigation_category IN ({$commaPath}) THEN 1 | [
-0.24725577235221863,
-0.4607873857021332,
0.7602176666259766,
-0.179378479719162,
0.33887606859207153,
0.1280432790517807,
0.13966433703899384,
-0.3673207759857178,
-0.05576207861304283,
-0.5390844345092773,
-0.4161222577095032,
0.48975715041160583,
-0.4654689431190491,
0.0379766039550304... | |
WHEN navigation_parent = {$id} THEN 2
ELSE 3
END, LENGTH(navigation_path), navigation_name");
$select->where($where)->order($order);
return $this;
}
```
Then I consume it with the following code found in my Category block:
```
// get our data | [
-0.04494849592447281,
0.089046910405159,
0.9172369837760925,
0.023895852267742157,
0.46136775612831116,
-0.05687861517071724,
0.075405552983284,
-0.20268264412879944,
0.11946316808462143,
-0.787280261516571,
-0.15173953771591187,
0.5295032858848572,
-0.21371281147003174,
0.3229429721832275... | |
$navigation = Mage::getModel("navigation/navigation")->getCollection();
$navigation->
addStoreFilter(Mage::app()->getStore()->getId())->
addCategoryFilter($currentCat);
// put it in an array
$node = &$tree;
$navArray = array();
foreach ($navigation as $ca... | [
-0.2917051315307617,
-0.32023653388023376,
0.7737008333206177,
-0.15585221350193024,
0.21054707467556,
0.12966209650039673,
0.39500150084495544,
-0.5841822028160095,
-0.263466477394104,
-0.5015352368354797,
-0.2456427812576294,
0.3534707725048065,
-0.48791447281837463,
0.035189591348171234... | |
$navArray[] = $cat;
}
$navCount = count($navArray);
$i = 0;
// skip passed the root category
for (; $i < $navCount; $i++)
{
if ($navArray[$i]->getNavigationCategory() == $root)
{ | [
-0.36561402678489685,
-0.4071255326271057,
0.3772132396697998,
-0.20715098083019257,
-0.0729096382856369,
0.051485542207956314,
0.6130770444869995,
-0.31755444407463074,
-0.4550951421260834,
-0.10968075692653656,
-0.18155920505523682,
0.2019186168909073,
-0.38340887427330017,
0.14797057211... | |
$i++;
break;
}
}
// add the parents of the current category
for (; $i < $navCount; $i++)
{
$cat = $navArray[$i]; | [
-0.0495305135846138,
-0.23273496329784393,
0.41669949889183044,
-0.2770964503288269,
0.20424297451972961,
0.13012194633483887,
0.24202312529087067,
-0.19429096579551697,
-0.11955458670854568,
-0.4929555654525757,
-0.12410911917686462,
0.3137097954750061,
-0.5344879627227783,
0.501012802124... | |
$node[] = array("cat" => $cat, "children" => array(),
"selected" => ($cat->getNavigationCategory() == $currentCat->getId()));
$node = &$node[0]["children"];
if ($cat->getNavigationCategory() == $currentCat->getId())
{
$i++; | [
-0.5213674902915955,
-0.46155744791030884,
0.3857366740703583,
-0.09835836291313171,
0.37265244126319885,
0.11663159728050232,
0.2651403248310089,
-0.22328528761863708,
-0.07863743603229523,
-0.5375158190727234,
-0.48176637291908264,
0.28895291686058044,
-0.3543979227542877,
0.216807991266... | |
break;
}
}
// add the children of the current category
for (; $i < $navCount; $i++)
{
$cat = $navArray[$i];
$path = explode("/", $cat->getNavigationPath()); | [
-0.0551077201962471,
-0.41015756130218506,
0.2714599668979645,
-0.16128645837306976,
0.3040637969970703,
0.03768018260598183,
0.4617520272731781,
-0.28205275535583496,
-0.29600614309310913,
-0.27373620867729187,
-0.36372876167297363,
0.3805486559867859,
-0.4328879117965698,
0.0226528383791... | |
if ($path[count($path) - 3] != $currentCat->getId())
{
break;
}
$node[] = array("cat" => $cat, "children" => array(),
"selected" => ($cat->getNavigationCategory() == $currentCat->getId()));
} | [
-0.4475661814212799,
-0.6130878329277039,
0.241151824593544,
0.0051385750994086266,
0.45145973563194275,
-0.10748157650232315,
0.32366636395454407,
-0.32359859347343445,
-0.35859692096710205,
-0.3341084122657776,
-0.495779424905777,
0.2766498327255249,
-0.3677484393119812,
0.05938966944813... | |
// add the children of the root category
for (; $i < $navCount; $i++)
{
$cat = $navArray[$i];
$tree[] = array("cat" => $cat, "children" => array(),
"selected" => ($cat->getNavigationCategory() == $currentCat->getId()));
} | [
-0.33317655324935913,
-0.36099377274513245,
0.21987271308898926,
-0.021788332611322403,
0.16216984391212463,
0.4858739376068115,
0.366060733795166,
-0.24330854415893555,
-0.3026149272918701,
-0.43082624673843384,
-0.3759526312351227,
0.27149224281311035,
-0.28762388229370117,
0.09527574479... | |
return $tree;
```
If I could accept two answers I would accept the first and last one, and if I could accept an answer as "interesting/useful" I would do that with the second.
:)
The [`preg_*` functions](http://docs.php.net/manual/en/ref.pcre.php) expect [Perl compatible regular expressions](http://en.wikipedia.org/... | [
-0.18488377332687378,
-0.074462890625,
0.4896160364151001,
-0.13260957598686218,
0.01294019166380167,
0.1850932389497757,
0.08616360276937485,
-0.2122603952884674,
-0.03237146884202957,
-0.3027248680591583,
-0.40102458000183105,
0.8459057807922363,
-0.32940465211868286,
-0.4876247644424438... | |
If there is truly a 'best' way, what *is* the best way to ship a python app and ensure people can't (easily) reverse engineer your algorithms/security/work in general?
If there isn't a 'best' way, what are the different options available?
Background:
I love coding in Python and would love to release more apps with it... | [
0.8040089011192322,
0.19145886600017548,
-0.36340153217315674,
0.18037499487400055,
0.11864148080348969,
-0.1576269418001175,
0.2929311990737915,
0.5042064189910889,
-0.1955820918083191,
-0.2931138277053833,
0.04054521024227142,
0.6356637477874756,
-0.0057557313703000546,
-0.33570396900177... | |
if this problem is just a fact of life.
Security through obscurity *never* works. If you must use a proprietary license, enforce it through the law, not half-baked obfuscation attempts.
If you're worried about them learning your security (e.g. cryptography) algorithm, the same applies. Real, useful, security algorithm... | [
0.6458938717842102,
0.16452491283416748,
0.22732403874397278,
0.2557472884654999,
0.36219921708106995,
-0.5469476580619812,
0.6471922397613525,
0.22017842531204224,
-0.3069233298301697,
-0.27781519293785095,
-0.47148919105529785,
0.6232444047927856,
-0.2513810992240906,
0.07322467863559723... | |
the directory structure I'm trying to achieve would be this:
```
application/default/views/layouts/layout.phtml
application/default/views/scripts/index/index.phtml
application/admin/views/layouts/layout.phtml
application/admin/views/scripts/index/index.phtml
library/Zend
config/config.ini
public/index.php (bootstrap)
... | [
0.07058127969503403,
0.008170885033905506,
0.8154256343841553,
-0.16039010882377625,
0.3698253929615021,
-0.019432689994573593,
0.08950237184762955,
-0.8857027292251587,
-0.2758675217628479,
-0.7706422209739685,
-0.2868931293487549,
0.6943764686584473,
-0.46116071939468384,
0.1084840372204... | |
Zend_Controller_Front::getInstance()->dispatch();
} catch (Exception $exception) {
echo '<html><body><center>' . 'An exception occured while dispatching the front controller.';
if (defined('APPLICATION_ENVIRONMENT') && APPLICATION_ENVIRONMENT != 'production' ) {
echo '<br /><br />' . $exception->ge... | [
0.041773274540901184,
-0.3404761552810669,
0.34549081325531006,
0.07625152170658112,
0.3141058385372162,
-0.0961330384016037,
0.23800544440746307,
-0.6320765018463135,
-0.1632317453622818,
-0.3431900143623352,
-0.25365138053894043,
0.4018440842628479,
-0.14781928062438965,
0.21389988064765... | |
post a more up-to-date solution to this question (i.e. ZF 1.8+), please do so! It would be helpful to others who are looking for a solution to this.
You should check out [Per Module Zend\_Layout](http://dustint.com/archives/28), in this article, the author covers exactly what you are trying to achieve. His methodology ... | [
0.37320035696029663,
0.1070876196026802,
0.1619034856557846,
-0.04530436918139458,
-0.026371492072939873,
-0.5198653340339661,
0.08932822942733765,
-0.2780771851539612,
-0.16340966522693634,
-0.6037577390670776,
-0.12898515164852142,
0.35137373208999634,
-0.17693683505058289,
-0.0290822237... | |
stripslashes() ? That's lame and so 4.0. What's the 5.0 counterpart of mysqli::real\_escape\_string that strips all slashes added for SQL queries?
Got some other questions:
1. Tried to update a record and added a single quote in a text field, turns out phpMyAdmin escapes the string with single quotes instead of slash... | [
0.28798726201057434,
-0.10868826508522034,
0.372113972902298,
0.02247486636042595,
-0.4356560707092285,
0.10044095665216446,
0.4556269645690918,
-0.055097561329603195,
-0.3847143352031708,
-0.5426534414291382,
-0.06733623892068863,
0.49560683965682983,
-0.5618895292282104,
-0.0092612728476... | |
Cause' you know it's slashed at insertion. But I thought I don't have to.
Any ideas, thanks!
If you don't want to go with PDO, and you are using mysqli, you should be using prepared statements, so you don't have to worry about escaping quotes with things like mysql\_real\_escape\_string\_i\_mean\_it\_this\_time.
More... | [
0.15158721804618835,
-0.1664505898952484,
0.24799774587154388,
-0.11994744092226028,
-0.22429795563220978,
0.19173666834831238,
0.22153304517269135,
-0.6001038551330566,
-0.14838919043540955,
-0.7725049257278442,
0.010905701667070389,
0.4985242486000061,
-0.4309066832065582,
-0.10473949462... | |
I have been working with PostgreSQL, playing around with Wikipedia's millions of hyperlinks and such, for 2 years now. I either do my thing directly by sending SQL commands, or I write a client side script in python to manage a million queries when this cannot be done productively (efficiently and effectively) manually... | [
0.370741605758667,
0.46883705258369446,
0.13189712166786194,
-0.18365676701068878,
-0.2126707136631012,
-0.049487654119729996,
0.3006831109523773,
0.1990795135498047,
-0.1068473532795906,
-0.6688535213470459,
0.08464302867650986,
0.5665533542633057,
-0.023969190195202827,
0.112838782370090... | |
me to level up. I need to learn to server-side script using a procedural language (PL); I really need to reduce network traffic and its inherent serializing overhead.
Now, I really do not feel like researching all the PLs. Knowing that I already know python, and that I am looking for the means between effort and lang... | [
0.5099560022354126,
0.1759810447692871,
0.014501172117888927,
0.23325233161449432,
-0.22876547276973724,
-0.18720994889736176,
-0.07774998247623444,
0.37048178911209106,
-0.36545270681381226,
-0.46074816584587097,
0.22183892130851746,
0.5155044794082642,
-0.08486036956310272,
-0.1125245317... | |
natural extension of that.
PL/SQL feels like SQL, just with all the stuff that you would expect from SQL anyway, like variables for whole rows and the usual control structures of procedural languages. It fits the way you usually interact with the database, but it's not the most elegant language of all time. I can't sa... | [
0.2063944935798645,
-0.09033293277025223,
0.17585305869579315,
-0.031836964190006256,
-0.16319924592971802,
-0.06560441851615906,
-0.1532721370458603,
0.3857312500476837,
-0.4247094392776489,
-0.548408031463623,
0.16011925041675568,
0.5891247987747192,
-0.2669016122817993,
-0.0204344522207... | |
How do you pass parameters in a URL? I'm trying to design a login system similar to Twitter's. Notice how you can either login to the main page of www.twitter.com or you can go directly to customised pages such as www.twitter.com/lancearmstrong and www.twitter.com/rails . That's exactly what I need for my project. Than... | [
0.43010789155960083,
-0.2357984036207199,
0.5462413430213928,
0.28666964173316956,
-0.2974836528301239,
-0.18635502457618713,
0.3333938419818878,
-0.35953059792518616,
-0.4258699119091034,
-0.6424374580383301,
0.1081303283572197,
0.052884772419929504,
-0.37785932421684265,
0.05870554596185... | |
the incoming URL. so if you have a rule like:
```
map.connect '/foo', :controller => 'foo', :action => 'bar'
```
it will need to come before the login rule. - bear in mind that if you do this you will have to disallow 'foo' as a username :) | [
-0.18069228529930115,
-0.03157036006450653,
0.671802282333374,
-0.07817588001489639,
0.17600150406360626,
-0.45152390003204346,
0.11307494342327118,
0.19404128193855286,
-0.18862029910087585,
-0.6025267839431763,
-0.3681613504886627,
0.4255577325820923,
-0.4886186718940735,
0.3132107853889... | |
Can someone provide some light on how to do this? I can do this for regular text or byte array, but not sure how to approach for a pdf. do i stuff the pdf into a byte array first?
Use [`File.ReadAllBytes`](http://msdn.microsoft.com/en-us/library/system.io.file.readallbytes.aspx) to load the PDF file, and then encode th... | [
0.08568356186151505,
0.1030249297618866,
0.6101605296134949,
0.1629425436258316,
-0.08779650926589966,
-0.3735273480415344,
-0.22624148428440094,
-0.13001608848571777,
-0.10398034751415253,
-0.7471711039543152,
-0.13894207775592804,
0.5123812556266785,
0.03348077833652496,
-0.0919457152485... | |
I am trying to figure out a way to let the user sort records (etc. a list of friends).
I want to give the user the opportunity to move a record (friend) straight to the top or bottom of the list, or by entering a number (in between).
First I thought of just adding a column called SortOrder (int) to the table with all... | [
0.29320478439331055,
0.061629120260477066,
0.24840311706066132,
0.2644105851650238,
0.10762466490268707,
0.2232593446969986,
-0.13996392488479614,
0.00786920078098774,
-0.6531026363372803,
-0.6942222714424133,
0.09875702112913132,
0.05725955218076706,
-0.2003018856048584,
0.144234180450439... | |
400 to be at position 1 in the list, then I will have to update every single record with a new SortOrder.
All data is stored in an MS SQL database.
I hope someone out there have a magic solution for this?
Use **floating point numbers** for the sort column.
Set the initial items as 0.0, 1.0 etc.
Moving to top, use m... | [
0.21156802773475647,
-0.08204086869955063,
0.7201352715492249,
0.20010551810264587,
0.29462170600891113,
0.217015340924263,
0.08161981403827667,
-0.14232760667800903,
-0.2789362072944641,
-0.7148898243904114,
-0.09054570645093918,
0.35306471586227417,
0.19667312502861023,
0.158045202493667... | |
adjancted values grow to close. I have no idea how soon this happens in practice, but I expect it to be very infrequent, so this can be done with any maintenance task.
---
**[edit]** FWIW, this problem came back to me a few times, so [here's a way that does roughly the same, but with strings](http://www.codeproject.... | [
0.050015889108181,
0.0733323022723198,
0.4011373817920685,
-0.31963783502578735,
-0.05926757678389549,
-0.16851657629013062,
0.4485865831375122,
-0.29591578245162964,
-0.17447955906391144,
-0.3659602105617523,
0.003944996278733015,
0.5219292640686035,
-0.5076485276222229,
0.129419118165969... | |
I have a field object and I create a list of fields:
```
class Field {
string objectName;
string objectType;
string fieldName;
string fieldValue;
//constructor...
}
List<Field> fieldList = new List<Field>();
```
Suppose I wanted to query this list to return a collection of distinct object names (to then be inser... | [
0.04671979695558548,
0.14121150970458984,
0.389602929353714,
-0.3494974672794342,
0.029212484136223793,
0.013598443008959293,
0.14948055148124695,
-0.667768120765686,
-0.007526705972850323,
-0.37619516253471375,
-0.15759794414043427,
0.6472710967063904,
-0.36733806133270264,
0.055322054773... | |
=> f.objectName )
.Distinct()
.ToList() );
```
If accessing the | [
-0.2210712730884552,
-0.1184409111738205,
0.4791596829891205,
-0.3982839286327362,
0.2224765121936798,
-0.036530204117298126,
0.3885484039783478,
-0.26770129799842834,
-0.005337608978152275,
-0.3259021043777466,
-0.5278105139732361,
0.4159195125102997,
-0.21001486480236053,
0.4501301348209... | |
checkedListBox as a ListControl doesn't give access to the DataSource (sometimes the [docs](http://msdn.microsoft.com/en-us/library/system.windows.forms.checkedlistbox.aspx) lie), you could try:
```
cbListBox.Items.AddRange( fieldList.Select( f => f.objectName )
.Distinct()
... | [
0.1078852042555809,
0.0018678685883060098,
0.41137993335723877,
-0.21417824923992157,
0.032129138708114624,
-0.16178451478481293,
0.08011706173419952,
-0.3057621717453003,
-0.49861592054367065,
-0.5347273945808411,
-0.13967575132846832,
0.21546334028244019,
-0.49252811074256897,
0.15258482... | |
I'm developing a business application, using Silverlight for the UI and a WCF webservice for the back-end. In the database I have a number of lookup tables. When the WCF service returns a business object, one of the properties contains the entire row out of the lookup table instead of just the foreign key, so in the UI... | [
0.3402511477470398,
0.254963755607605,
0.48391345143318176,
-0.04701882600784302,
0.16067102551460266,
-0.012303624302148819,
-0.008053307421505451,
-0.33511802554130554,
-0.11000338941812515,
-0.8179035186767578,
0.1419486552476883,
0.447470486164093,
-0.25779443979263306,
0.3072011768817... | |
update properly. The business object I'm dealing with in this example is called Session and the lookup is called SessionType.
Below is the definition of the combobox. The DataContext is set to an instance of Session. I am setting an ItemTemplate because the combobox is displaying more than just a list of strings.
```... | [
0.16102474927902222,
-0.05022425949573517,
0.733001708984375,
-0.19498085975646973,
0.06687848269939423,
-0.09384635835886002,
0.35641950368881226,
-0.458478718996048,
0.027914946898818016,
-0.7840628623962402,
-0.06604588031768799,
0.9391198754310608,
-0.43949124217033386,
-0.076142795383... | |
be updated with the correct SessionType if the combobox selection is changed.
What seems to be happening is that the SelectedItem binding cant match the SessionType in Session to its equivalent in the SessionType list. The object values are the same but the references are not.
The workaround I have found is to load ... | [
0.35754910111427307,
0.019248658791184425,
0.4442027509212494,
-0.04542412608861923,
-0.12493866682052612,
-0.3493282198905945,
0.5266936421394348,
-0.39650440216064453,
0.06828451156616211,
-0.83094322681427,
0.051947906613349915,
1.0117831230163574,
-0.31815052032470703,
0.10694511234760... | |
determine when everything is available. Here's how I'm doing that:
In the code-behind of my Silverlight user control:
```
// incremented every time we get data back during initial form load.
private volatile int m_LoadSequence = 0;
...
// Loaded event, called when the form is er... loaded.
private void UserControl_... | [
0.13211992383003235,
-0.2110331505537033,
0.4526733160018921,
-0.21266959607601166,
0.2686779201030731,
-0.20381055772304535,
0.42042580246925354,
-0.4421084523200989,
-0.21306243538856506,
-0.5976729393005371,
-0.24296922981739044,
0.7647422552108765,
-0.35463428497314453,
-0.072388134896... | |
IncrementLoadSequence();
};
sessionTypes.LoadAsync();
}
// start loading another lookup table, same as above
// omitted for clarity
// set our DataContect to our business object (passed in when form was created)
this.LayoutRoot.DataContext = this.m_Session;
IncrementLoadSequenc... | [
0.24691066145896912,
-0.1737619936466217,
0.7375301122665405,
-0.39713266491889954,
0.2067326009273529,
-0.19915904104709625,
0.4133562743663788,
-0.2593379616737366,
-0.07720134407281876,
-0.5121022462844849,
-0.060594700276851654,
0.6105514764785767,
-0.45338955521583557,
0.2030180543661... | |
any more service calls to complete.
if (++m_LoadSequence < 3)
return;
// set lookup values on m_Session to the correct one in SessionType list.
// Get SessionType list from page resources
var sessionTypes = this.Resources["AllSessionTypes"] as Lookups.AllSessionTypes;
// Find the matching... | [
0.25268542766571045,
0.17058546841144562,
0.8064327836036682,
-0.4122358560562134,
-0.08536535501480103,
0.14031432569026947,
0.7297620177268982,
-0.6851428747177124,
-0.39551758766174316,
-0.6664966940879822,
-0.14981749653816223,
0.7977496981620789,
-0.4016159772872925,
0.225316479802131... | |
I get data back from the webservice. Since I'm expecting 3 things (core business object + 2 lookup tables), when that counter gets to 3 I match up the references.
To me, this seems very hacky. I would rather see the combobox specify a ValueMemberPath and SelectedValue to match the selected item with one in the list.
... | [
0.3625483214855194,
0.015602261759340763,
0.5355887413024902,
0.2885526120662689,
0.08501990884542465,
-0.13017374277114868,
0.2797253131866455,
-0.15061615407466888,
-0.2498304694890976,
-0.7455607652664185,
0.15566755831241608,
0.45706748962402344,
-0.1210964024066925,
0.0838055759668350... | |
all the items you need in one call? (even if you have to wrap the 3 in a new DTO class), then you can just update the current session type using a complete event. It's still not perfect, but at least you don't have to keep any counters.
I'd also move all that logic to a ViewModel and just bind to that, but that's just... | [
0.366837739944458,
-0.3738850951194763,
0.31406697630882263,
0.4279851019382477,
-0.08396613597869873,
-0.11085924506187439,
0.24972999095916748,
-0.2797689735889435,
-0.22157765924930573,
-0.4739757776260376,
0.06456129997968674,
0.6987366080284119,
-0.14546647667884827,
-0.38459387421607... | |
I wonder if I can test landscape view using simulator?

Under the Hardware Menu you will find the rotation items which correspond to CMD+Left and CMD+Right | [
0.33935919404029846,
-0.1444646418094635,
0.568605363368988,
0.1990736573934555,
-0.04362591356039047,
0.18920595943927765,
0.0018326296703889966,
-0.11134914308786392,
-0.2614227533340454,
-0.6213898658752441,
0.16919220983982086,
0.5818888545036316,
0.3117603063583374,
-0.025885773822665... | |
Is it possible to create an application (not a game) on the PS3? I know that there are ways to install Linux and all that but I was hoping there's something which you can just download from the net and run. I'd want the app to run like a server/daemon and be able to access the network.
You might find the following to b... | [
0.3932414650917053,
0.1270993947982788,
-0.033625487238168716,
0.1494928002357483,
0.05814601853489876,
-0.17018410563468933,
0.1489563137292862,
-0.24466466903686523,
-0.29445624351501465,
-0.27564749121665955,
-0.1368483453989029,
0.47874170541763306,
-0.3559907078742981,
-0.266780108213... | |
on the PLAYSTATION 3](http://www.ibm.com/developerworks/power/library/pa-linuxps3-1/index.html?S_TACT=105AGX16&S_CMP=EDU)
* Part 2: [Program the synergistic processing elements of the Sony PLAYSTATION 3](http://www.ibm.com/developerworks/power/library/pa-linuxps3-2/index.html?S_TACT=105AGX16&S_CMP=EDU)
* Part 3: [Meet ... | [
-0.19579070806503296,
-0.11799169331789017,
0.4481413960456848,
0.0743727907538414,
-0.2266939878463745,
-0.010171924717724323,
-0.19019486010074615,
-0.35884973406791687,
-0.032606881111860275,
-0.14822369813919067,
-0.25938576459884644,
0.5544843077659607,
-0.20931875705718994,
-0.526845... | |
I have a requirement to save an image file in various formats.
The list of formats is subject to change quite often, so I wish the saving would be very extensible.
Also, the saving can take place in many places (hard disk, ftp, http, etc). The list of saving *locations* is going to change very often too.
I thought I w... | [
0.4096282124519348,
-0.05936498939990997,
0.3333635926246643,
0.21328802406787872,
-0.03724208101630211,
-0.1373891681432724,
-0.04326863959431648,
-0.045876163989305496,
-0.1940508931875229,
-0.8190200924873352,
-0.017675749957561493,
0.7025995254516602,
-0.1990557760000229,
0.11154041439... | |
share, etc)?
I would like something like this:
```
var image=ImageBase.GetImageFromDisk(path);
//some casting to subclass maybe??
var tiffImage=image as TiffImage;
tiffImage.Location=new FtpLocation();//not sure if this is a good idea
tiffImage.Save();
```
The problem here, is that concrete image implementation sho... | [
0.6502842903137207,
-0.11269282549619675,
0.45753127336502075,
-0.16625003516674042,
-0.13602228462696075,
-0.01054040715098381,
0.005784920416772366,
-0.13879738748073578,
-0.20007017254829407,
-0.9819116592407227,
0.19039328396320343,
0.7016802430152893,
-0.6353307366371155,
0.0648997426... | |
to simply accept streams and write them down onto your appropriate techniques (ftp, file etc.)
That way you end up with extensible images (if you can get a stream to it you can do many, many things) and you end up with a saving infrastructure that is extensible as well (anything that can go to a stream can be saved)
... | [
0.40421298146247864,
-0.08133997023105621,
-0.13785472512245178,
0.31803828477859497,
-0.165709987282753,
-0.257294625043869,
0.23380093276500702,
0.1045789122581482,
-0.2739379107952118,
-0.8305772542953491,
0.05403447896242142,
0.5826773643493652,
-0.3628820776939392,
-0.1697721332311630... | |
Is there a (Qt) way to determine the platform a Qt application is running on at runtime?
Note that the Q\_WS\_\* macros are defined at compile time, but QSysInfo gives some run time details.
To extend gs's function to get the specific windows version at runtime, you can do
```
#ifdef Q_WS_WIN
switch(QSysInfo::windows... | [
-0.010662388056516647,
-0.23132075369358063,
0.7127377390861511,
-0.04132077097892761,
-0.09598398953676224,
-0.17891022562980652,
0.1606234312057495,
-0.20882529020309448,
0.06532515585422516,
-0.7959226965904236,
-0.19554249942302704,
0.7698225975036621,
-0.3537025451660156,
0.0261648576... | |
[here](https://doc.qt.io/qt-5/qoperatingsystemversion.html). There is also a [QSysInfo](https://doc.qt.io/qt-5/qsysinfo.html) class which can do some additional functionalities.
```
#ifdef Q_WS_WIN
#include <QOperatingSystemVersion>
switch(QOperatingSystemVersion::current())
{
case QOperatingSystemVersion::Windows7... | [
0.0016247673192992806,
-0.26712095737457275,
0.5386916995048523,
-0.1691163182258606,
0.19473248720169067,
-0.09903714805841446,
-0.001000133459456265,
-0.1681237816810608,
-0.16838353872299194,
-0.7031842470169067,
-0.3591221272945404,
0.6452659368515015,
-0.20491422712802887,
0.282198965... | |
I have a Java string of XML content. I use Velocity to generate some HTML reports, and this XML needs to be included into one of those HTML files. It would be nice if this XML is syntax colored and formatted. Does anyone know of a Java library to do this?
<https://jhighlight.dev.java.net/> | [
0.5296368598937988,
0.18741916120052338,
0.18676482141017914,
0.1450943648815155,
-0.1675540655851364,
-0.20059125125408173,
0.2237928807735443,
0.0028002725448459387,
-0.2256278395652771,
-0.7424917221069336,
0.30348625779151917,
0.4018760621547699,
-0.12616433203220367,
-0.01099266298115... | |
For fun I am trying to see how far I can get at implementing an SVG browser client for a RIA I'm messing around with in my spare time.
But have hit what appears to be a HUGE stumbling block. There is no word wrap!!
Does anyone know of any work around (I'm thinking some kind of JavaScript or special tag I don't know)?... | [
0.6245051026344299,
0.11092957854270935,
0.41003772616386414,
-0.07840252667665482,
-0.15206393599510193,
-0.5018970370292664,
0.36387899518013,
0.3516989052295685,
-0.6360839009284973,
-0.41706734895706177,
0.21895162761211395,
0.48784443736076355,
0.01475166343152523,
0.03381191566586494... | |
**tspan** can give the illusion of word wrap:
> The tspan tag is identical to the text tag but can be nested inside text tags and inside itself. Coupled with the 'dy' attribute this allows the illusion of word wrap in SVG 1.1. Note that 'dy' is relative to the last glyph (character) drawn. | [
0.20811568200588226,
-0.20078596472740173,
0.2917805314064026,
-0.11640606075525284,
-0.4618593752384186,
0.3097972869873047,
0.3729270398616791,
-0.09921618551015854,
-0.06907758861780167,
-0.9016810655593872,
-0.3374030590057373,
-0.010369589552283287,
-0.1645040512084961,
-0.24601003527... | |
I have a single entry output from a paradox table which is imported into Access. Now I have created a report and done the databinding within the report to the dataset from Paradox. When work is done in Paradox the single entry output changes...
How do I open up access and have the values from the report update automati... | [
-0.1342146247625351,
0.3823580741882324,
0.11874714493751526,
0.25345760583877563,
-0.05745101720094681,
0.35568347573280334,
0.38267409801483154,
-0.06668326258659363,
-0.3813266456127167,
-0.6117904782295227,
-0.2270306795835495,
0.43890702724456787,
-0.22904284298419952,
0.4177409410476... | |
Let's say you work 100 days on a project. How many days would each phase of your process (requirements analysis, specification, etc.) take?
I'm interested also in the ratio of specific activities in every phase, such as writing tests, back-end coding, front-end coding, visual design, database design etc.
Many thanks!... | [
0.856995701789856,
0.15056264400482178,
-0.2154344916343689,
0.20787589251995087,
-0.035054534673690796,
0.14793060719966888,
0.234833762049675,
-0.09003154188394547,
-0.38843369483947754,
-0.48883163928985596,
0.1100681722164154,
0.3075903654098511,
0.35067999362945557,
-0.104495055973529... | |
this question is really hard to answer, since projects can be so different and so can be teams. To make it more specific, let's say you have a team of four developers - two of them for back-end work, one for front-end programming and one for design & html/css coding (one member of the team acts as a project manager) an... | [
0.5635098814964294,
-0.006623432505875826,
0.1417398303747177,
0.2743580937385559,
0.1403149515390396,
-0.055759213864803314,
-0.266706645488739,
-0.48171141743659973,
-0.44868403673171997,
-0.09230788797140121,
-0.12847204506397247,
0.39913317561149597,
0.02772020921111107,
-0.15950459241... | |
found to be effective:
4-5 developers can be served by one client side programmer (html/css), one on-team tester and one interaction designer (works with the customer to design wireframes). A team like this typically needs a 50% graphic designer for most applications, but your mileage may vary there. Then there's proj... | [
0.2530592083930969,
0.07414650171995163,
0.058656610548496246,
0.1802845150232315,
-0.07997369766235352,
0.07001692801713943,
0.19754070043563843,
-0.399550199508667,
-0.2022957056760788,
-0.6398235559463501,
-0.30481061339378357,
0.8151659965515137,
0.1882665753364563,
-0.3572605848312378... | |
is an integral part of development as well as the efforts of the on-team tester.
Your local conditions may of course vary, but these numbers are just to give you some idea. | [
0.7944470047950745,
0.14367060363292694,
-0.1370844841003418,
0.10628490149974823,
0.40832680463790894,
-0.03155360743403435,
0.5780301690101624,
-0.09316573292016983,
-0.22889618575572968,
-0.688450038433075,
-0.17585299909114838,
0.0909869521856308,
0.24225254356861115,
-0.21207317709922... | |
My sql server marked one database as suspected , on checking i found my mdf,ldf files are missing, but no errors on chkdsk, what it means some virus ?
Either the files were deleted, or they have been moved and a master database backup restored from before the change in location. In both cases the physical files can onl... | [
0.2715297341346741,
0.20668283104896545,
0.23489704728126526,
0.2757575809955597,
0.1954398900270462,
-0.26286038756370544,
0.17222510278224945,
0.32629355788230896,
-0.43681246042251587,
-0.4256058633327484,
0.25122591853141785,
0.19149811565876007,
-0.2450648844242096,
0.5968248844146729... | |
such would either have to specifically delete the files on startup before SQL Server started (assuming your database starts automatically) or shut down the database then specifically delete the files. Given that chkdsk doesn't report errors either it's unlikely to be a disk issue, so it's a virtual certainty that the c... | [
0.06002030521631241,
0.25944170355796814,
0.14555639028549194,
0.24356989562511444,
0.2872677445411682,
-0.2382008582353592,
0.10311684757471085,
0.29486700892448425,
-0.4706740975379944,
-0.3462315797805786,
-0.3228350281715393,
0.5079963803291321,
-0.15352022647857666,
0.5977890491485596... | |
is running out of space then the database could be moved to that. For some reason a backup of the master database has subsequently been restored from a point before the move.
My first action would be to do a full scan of the system for all mdf/ldf files and (hopefully) locate them. I'd also do a scan of backups and lo... | [
0.3764496147632599,
0.044193167239427567,
0.45824724435806274,
0.28953617811203003,
0.5754170417785645,
-0.12781022489070892,
-0.04867223650217056,
-0.04005724936723709,
-0.4670920670032501,
-0.607304573059082,
-0.07674354314804077,
0.40177103877067566,
-0.07578500360250473,
0.432592004537... | |
missing files.
If you cannot find the mdf/ldf files then your only option is restore from backup. If you don't have a backup then your database is lost. | [
0.06483828276395798,
-0.11438797414302826,
0.2266652137041092,
0.2998270094394684,
0.23216120898723602,
-0.26257166266441345,
0.4971925914287567,
-0.04026666283607483,
-0.45192569494247437,
-0.619635283946991,
-0.4628930985927582,
0.7258643507957458,
-0.29163408279418945,
0.520244061946868... | |
If I understand this correctly:
Current CPU developing companies like AMD and Intel have their own API codes (the assembly language) as what they see as the 2G language on top of the Machine code (1G language)
Would it be possible or desirable (performance or otherwise) to have a CPU that would perform IL handling a... | [
0.3843189775943756,
0.1002223938703537,
-0.1899855136871338,
-0.024648061022162437,
0.03357435762882233,
0.01917002536356449,
0.024434726685285568,
-0.20721571147441864,
0.09825717657804489,
-0.7543811798095703,
-0.173012375831604,
0.4715995192527771,
-0.5748634934425354,
-0.47863808274269... | |
type information held on the stack, not on their own. This is a major difference from Java bytecode, and would make it much more difficult to create sensible hardware to execute IL.
Moreover, IL is intended for compilation to a final target. Most back ends that spit out IL do very little optimisation, aiming instead ... | [
0.15974490344524384,
0.13156934082508087,
0.007938581518828869,
-0.05995577201247215,
-0.42541927099227905,
0.009476535953581333,
0.2071424424648285,
-0.4146765470504761,
0.2170017808675766,
-0.6815322637557983,
-0.02134990319609642,
0.18238042294979095,
-0.5838981866836548,
-0.29573604464... | |
disproportionately hard compared to other architectures, and would achieve little. | [
0.11736936867237091,
0.3558703064918518,
0.24134552478790283,
0.01722530648112297,
0.014810498803853989,
0.5426405072212219,
0.21765780448913574,
-0.12460512667894363,
-0.08153931051492691,
-0.6646272540092468,
0.08475597947835922,
0.37279900908470154,
-0.21814224123954773,
0.3812634646892... | |
**Hi, this is the content of my XML file:**
```
<?xml version="1.0" encoding="ISO-8859-1"?>
<mainNode>
<sub time="08:00">
<status id="2">On</status>
<status id="3">Off</status>
</sub>
<sub time="13:00">
<status id="4">On</status>
<status id="7">On</status>
</sub>
<su... | [
0.03822185471653938,
-0.10566521435976028,
0.90140300989151,
-0.2528283894062042,
-0.11512096971273422,
0.05080454424023628,
0.19388052821159363,
-0.41875332593917847,
0.01402637641876936,
-0.3573703169822693,
-0.14885489642620087,
0.2795006334781647,
0.04459276422858238,
0.252981215715408... | |
<status id="8">On</status>
</sub>
<sub time="20:00">
<status id="4">Off</status>
<status id="7">On</status>
</sub>
<sub time="23:59">
<status id="4">On</status>
<status id="7">On</status>
</sub>
</mainNode>
```
**My program gets the current time:
if I get 15.59, I m... | [
-0.2802213728427887,
-0.33939802646636963,
0.7488963603973389,
-0.10284501314163208,
0.3167221248149872,
0.07472497969865799,
0.5980865955352783,
-0.1279151290655136,
-0.635985791683197,
-0.5986620187759399,
-0.2987159788608551,
0.5176709294319153,
0.13997028768062592,
0.41663825511932373,... | |
<status id="6">On</status>
<status id="7">Off</status>
<status id="8">On</status>
</sub>
```
**With a second XPath query I must get all the status id of the previous sub time (13.00).
How to do it? I know SQL but I'm quite new to XPath. I accept urls to serious XPath resources too, if any. Thanks!... | [
0.05063699930906296,
0.06665276736021042,
0.6467107534408569,
0.15230533480644226,
-0.2647997736930847,
-0.0069284806959331036,
0.2945690155029297,
-0.25310322642326355,
0.23077639937400818,
-0.8359298706054688,
0.0006482831668108702,
0.615453839302063,
-0.242372065782547,
0.06588301062583... | |
][1]
```
**selects the first `sub` node with time later than `15:59`.**
```
/*/*
[translate(@time, ':','')
<
translate('15:59',':','')
][last()]
```
**selects selects the first `sub` node with the previous than `15:59` `sub` time**.
**We can include these in an XSLT transformation** and check t... | [
-0.23191455006599426,
-0.5516448020935059,
0.7137235403060913,
0.006289099808782339,
-0.12576252222061157,
-0.15189966559410095,
0.11053730547428131,
-0.6007415652275085,
-0.04540535807609558,
-0.8654539585113525,
-0.547159731388092,
0.3887740671634674,
-0.27155742049217224,
-0.03539788350... | |
[translate(@time, ':','')
>
translate('15:59',':','')
][1]
"/>
First time before 15:59:
<xsl:copy-of select=
"/*/*
[translate(@time, ':','')
<
translate('15:59',':','') | [
0.11741099506616592,
0.04453665018081665,
0.6736932396888733,
-0.01824064739048481,
0.3140752911567688,
-0.11779122054576874,
0.47752898931503296,
-0.10567726194858551,
0.3078639507293701,
-0.8083887696266174,
-0.4517253637313843,
0.4113994240760803,
-0.4181438684463501,
-0.153261214494705... | |
][last()]
"/>
</xsl:template>
</xsl:stylesheet>
```
**When the above transformation is applied** on the originally provided XML document:
```
<mainNode>
<sub time="08:00">
<status id="2">On</status>
<status id="3">Off</status>
</sub>
<sub time="13:00">
<status id="4">On</s... | [
-0.021314607933163643,
-0.3523208796977997,
0.6574202179908752,
-0.1511581391096115,
0.13399793207645416,
0.03661106526851654,
0.07503128796815872,
-0.7501049637794495,
-0.38682571053504944,
-0.6054782867431641,
-0.5538897514343262,
0.5789826512336731,
-0.1432708501815796,
0.09359840303659... | |
<status id="6">On</status>
<status id="7">Off</status>
<status id="8">On</status>
</sub>
<sub time="20:00">
<status id="4">Off</status>
<status id="7">On</status>
</sub>
<sub time="23:59">
<status id="4">On</status>
<status id="7">On</status>
</sub>
</... | [
-0.27992090582847595,
-0.2780440151691437,
0.5710986852645874,
-0.0005832489696331322,
0.15476202964782715,
0.20604194700717926,
0.21596984565258026,
-0.4608488082885742,
-0.5194400548934937,
-0.5294404029846191,
-0.2557336390018463,
0.5305161476135254,
-0.11680499464273453,
0.300807803869... | |
<status id="5">On</status>
<status id="6">On</status>
<status id="7">Off</status>
<status id="8">On</status>
</sub>
First time before 15:59:
<sub time="13:00">
<status id="4">On</status>
<status id="7">On</status>
</sub>
```
**Do note** the following:
1. **The use of th... | [
-0.04928608611226082,
-0.2810303568840027,
0.5341854691505432,
-0.22442017495632172,
-0.15854650735855103,
0.16165220737457275,
0.17466409504413605,
-0.410814493894577,
0.1099768877029419,
-0.8225978016853333,
-0.24699106812477112,
0.49984776973724365,
-0.06749295443296432,
0.1172290593385... | |
an XML document (such as an XSLT stylesheet, **the `<` operator must be escaped**.
II. XPath 2.0
=============
**In [XPath 2.0](http://www.w3.org/TR/xpath20/) we can use the following two expressions** to produce select the desired nodes:
```
/*/*[xs:time(concat(@time,':00'))
gt
xs:time('15:59:00')
][... | [
-0.3143359422683716,
-0.28472357988357544,
0.7681734561920166,
0.07638952881097794,
0.14244645833969116,
-0.13118094205856323,
-0.046725329011678696,
-0.44054266810417175,
0.06566300988197327,
-0.7802236080169678,
-0.4455312490463257,
0.475614458322525,
-0.3039208650588989,
0.0050691873766... | |
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xsl:output omit-xml-declaration="yes"/>
<xsl:template match="/">
First time after 15:59:
<xsl:copy-of select=
"/*/*[xs:time(concat(@time,':00'))
gt
xs:time('15:59:00'... | [
-0.08580033481121063,
-0.28871238231658936,
0.6742638349533081,
-0.09151645749807358,
-0.5277076959609985,
-0.16291484236717224,
0.24726790189743042,
-0.47961845993995667,
0.0016654039500281215,
-0.7315444946289062,
-0.3066917061805725,
0.6494781374931335,
-0.39503663778305054,
0.259143054... | |
<xsl:copy-of select=
"/*/*[xs:time(concat(@time,':00'))
lt
xs:time('15:59:00')
][last()]
"/>
</xsl:template>
</xsl:stylesheet>
```
**When the above transformation is applied** on the originally provided XML document (the same as in the first solution), the same wan... | [
0.09574557840824127,
-0.2736224830150604,
0.5070638656616211,
-0.06407424807548523,
0.0015118924202397466,
-0.19905903935432434,
0.05055474489927292,
-0.42438051104545593,
0.06812865287065506,
-0.8734951615333557,
-0.34059667587280273,
0.3252088725566864,
-0.318100243806839,
0.115906693041... | |
the values in the xml document, we have to concat to them the missing seconds part.
2. **In XPath 2.0 `xs:time` values can be compared with the "[atomic-value comarison operators](http://www.w3.org/TR/xpath-functions/#comp.duration.datetime)"** such as `lt` or `gt`. | [
0.24378158152103424,
-0.16690336167812347,
0.28984710574150085,
0.04278738424181938,
0.24218519032001495,
-0.06758573651313782,
0.18054792284965515,
-0.20011013746261597,
-0.15463154017925262,
-0.3286968469619751,
-0.20608262717723846,
0.42415565252304077,
-0.17076751589775085,
-0.01404633... | |
How can I specify a multiline commit message for mercurial on the command line?
```
hg commit -m "* add foo\n* fix bar"
```
does not work. The log shows:
```
changeset: 13:f2c6526e5911
tag: tip
date: Fri Jan 23 23:22:36 2009 +0100
files: foobar.cpp
description:
* add foo\n*fix bar
```
> ... | [
-0.16439850628376007,
0.2566503882408142,
0.7595164775848389,
-0.017540279775857925,
0.2256266176700592,
0.0019060263875871897,
0.5940728187561035,
-0.16949820518493652,
-0.3254561126232147,
-0.5744336247444153,
-0.23332741856575012,
0.646599292755127,
-0.4193171560764313,
0.19512069225311... | |
0:d2dc019450a2
tag: tip
user: Aaron Maenpaa <zacherates@gmail.com>
date: Sat Jan 24 07:46:23 2009 -0500
summary: Did some work
```
... but if you fire up "hg view" you can see that the whole message is there.
Edited to add:
... but hg -v log shows the whole message:
```
$ hg -v log
change... | [
-0.002695460105314851,
0.023427074775099754,
0.5360379815101624,
0.10488386452198029,
-0.13198919594287872,
-0.2601918578147888,
0.4759572148323059,
-0.4282713830471039,
-0.39478933811187744,
-0.19020356237888336,
0.12697157263755798,
0.5609830021858215,
-0.2915297746658325,
-0.04386160522... | |
Sat Jan 24 07:46:23 2009 -0500
files: work
description:
Did some work
Now I'm done
``` | [
0.029244359582662582,
0.32947486639022827,
0.35179170966148376,
0.00013899366604164243,
0.07597802579402924,
-0.053517524152994156,
0.7024303078651428,
-0.030447043478488922,
-0.20139004290103912,
-0.6118945479393005,
-0.2063778191804886,
0.1757965087890625,
0.3808436095714569,
-0.27469143... | |
I'm building a dynamic ExtJS form based on JSON data loaded from an ASP.NET web service. The problem I find is that ExtJS expects the JSON in a specific format, ie.
```
{ "metaData": { "title": "Testing" }, "data": [], "success": true }
```
When using an ASP.NET web service to return an object as JSON it returns wi... | [
0.08861974626779556,
-0.19319388270378113,
0.36542433500289917,
-0.125745952129364,
-0.11437322199344635,
0.05500278249382973,
0.42075005173683167,
-0.14684604108333588,
0.11904444545507431,
-0.6065507531166077,
-0.4261271357536316,
0.5560043454170227,
-0.5919551253318787,
0.03143569827079... | |
JSON from my web service but because the response text doesn't have "success": true in the root it is handled by the 'failed' handler. Fortunately this handler accepts the same parameters as the 'success' handler so can be manipulated the same.
Here's an example of my form load handler:
```
this.form.load({
url: "... | [
0.08504631370306015,
-0.1697133630514145,
0.5953724384307861,
-0.25149005651474,
0.029726959764957428,
-0.03585682809352875,
0.3240671753883362,
-0.1687265783548355,
-0.22693753242492676,
-0.5844245553016663,
-0.41605859994888306,
0.6458503007888794,
-0.2944774627685547,
-0.139196082949638... | |
Any advice what has worked for you when dealing with user-entered markup, e.g. wiki or markdown. I have both CPU & database space costs, so I'm not sure which way to go.
1. Store markup in database & render to
html on the server for each pageview. (Less database space but more CPU usage)
2. Store markup in database & ... | [
0.563005805015564,
0.15367895364761353,
0.4568287134170532,
0.01802779734134674,
-0.0123052466660738,
-0.009612971916794777,
0.40400680899620056,
0.21360015869140625,
0.007427677977830172,
-0.7061716318130493,
0.11020377278327942,
0.7315129041671753,
-0.0671604797244072,
-0.627002894878387... | |
else.
(I'm using MFC & Linqtosql).
I would store it in the database as Wiki markup, then hold the transformed HTML output in memory in a cache on the webserver. Whichever web technology you're using, all should support this - a basic tuple (hashtable) keyed on the url, or id, or similar. | [
0.29456961154937744,
0.15190589427947998,
0.3905385136604309,
0.1458704173564911,
-0.15558834373950958,
-0.2411329299211502,
-0.05065407231450081,
0.20739597082138062,
-0.08301139622926712,
-0.7165393829345703,
-0.19972412288188934,
0.3604845702648163,
-0.38466012477874756,
-0.130258917808... | |
I have a class 'Data' that uses a getter to access some array. If the array is null, then I want Data to access the file, fill up the array, and then return the specific value.
Now here's my question:
When creating getters and setters should you also use those same accessor properties as your way of accessing that a... | [
0.1592414379119873,
-0.21923516690731049,
-0.3027391731739044,
0.2831844687461853,
-0.11834362149238586,
0.10952072590589523,
0.0009065525373443961,
-0.04033682867884636,
-0.07261093705892563,
-0.5705357193946838,
0.1195385679602623,
0.3737429678440094,
-0.42633867263793945,
0.416044175624... | |
the array null so goes to get it from the file, and that function ends up calling the getter again from within Data, array is once again null, and we're stuck in an infinite loop.
EDIT:
So is there no official stance on this? I see the wisdom in not using Accessors with file access in them, but some of you are sayin... | [
0.3950486481189728,
-0.02548012137413025,
-0.05459674075245857,
0.07835448533296585,
-0.2756772041320801,
-0.3245234191417694,
0.36179691553115845,
-0.08719638735055923,
-0.3245376944541931,
-0.3529595136642456,
-0.10811223089694977,
0.5264770984649658,
-0.4043414890766144,
0.1851487755775... | |
expensive operations, like reading a file or accessing the network. Use explicit function calls for the expensive operations.
Generally, users of the class will not expect that a simple property retrieval or assignment may take a lot of time.
[This is also recommended in Microsoft's Framework Design Guidelines.](htt... | [
-0.08093833178281784,
-0.09888233989477158,
-0.01774291880428791,
0.4052247405052185,
0.10627254843711853,
-0.2776503264904022,
0.46849220991134644,
-0.2856488525867462,
-0.25623178482055664,
-0.6872658729553223,
-0.30834177136421204,
0.6591720581054688,
-0.07018832117319107,
0.09756834805... | |
likely that the operation is too
> expensive to be a property. In
> particular, operations that access the
> network or the file system (other than
> once for initialization) should most
> likely be methods, not properties. | [
-0.10346044600009918,
0.0071857888251543045,
-0.12540900707244873,
0.25738316774368286,
0.19639308750629425,
-0.2570163905620575,
0.2327176034450531,
-0.03879128769040108,
0.01877831667661667,
-0.8298459649085999,
-0.34283706545829773,
0.42850539088249207,
-0.1046910285949707,
-0.057320963... | |
I'm fairly new to C# but I will **try** to make this quick! ;)
This is just a theoretical situation, but imagine that:
**I)** One have a class 'ClassA' with a 'ClassB' inside it and a 'ClassC' inside of 'ClassB'.
**II)** ClassA have a method which gets called. The method itself is (don't know the name for this) 'con... | [
0.17687813937664032,
-0.013692216016352177,
0.15538069605827332,
-0.12760041654109955,
-0.0022965241223573685,
-0.3254653215408325,
0.22403310239315033,
-0.1414339244365692,
-0.04847108572721481,
-0.6103577017784119,
0.021432846784591675,
0.48036423325538635,
-0.1924828439950943,
0.2794753... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.