text stringlengths 0 30.5k | title stringclasses 1
value | embeddings listlengths 768 768 |
|---|---|---|
How do I view the history of an individual file with complete details of what has changed?
`git log -- [filename]` shows me the commit history of a file, but how do I see the file content that changed?
For a graphical view, use [`gitk`](https://git-scm.com/docs/gitk/):
```
gitk [filename]
```
To follow the file acr... | [
0.3487705588340759,
0.29440152645111084,
0.27910587191581726,
-0.01638421230018139,
0.1794189065694809,
-0.07100996375083923,
0.0602729506790638,
-0.07484377175569534,
-0.3847408592700958,
-0.6135293245315552,
-0.17121542990207672,
0.48582425713539124,
-0.05221415311098099,
0.2554013431072... | |
I'm working with an existing XML document which has a structure (in part) like so:
```
<Group>
<Entry>
<Name> Bob </Name>
<ID> 1 </ID>
</Entry>
<Entry>
<Name> Larry </Name>
</Entry>
</Group>
```
I'm using LINQ to XML to query the XDocument to retrieve all these entries as foll... | [
0.26968124508857727,
0.2686847746372223,
0.5257860422134399,
0.11363629996776581,
0.0844259038567543,
0.12620121240615845,
-0.271156907081604,
-0.3898559808731079,
-0.3369450569152832,
-0.38773250579833984,
-0.2572476267814636,
0.13713058829307556,
-0.11848245561122894,
0.26955315470695496... | |
(string)g.element("Name").Value,
id = g.Elements("ID").Count() > 0 ? (string)g.Element("ID").Value : "none"
};
```
The "ID" elements aren't always there and so my solution to this was the Count() jazz above. But I'm wondering if someone has a better way to do this. I'm still getting comfortable with this ... | [
0.2543671131134033,
0.3216201961040497,
0.27246156334877014,
-0.16062496602535248,
-0.048765312880277634,
-0.28278082609176636,
0.20255427062511444,
-0.6834977865219116,
-0.12272779643535614,
-0.3792861998081207,
-0.11106830090284348,
0.5154007077217102,
-0.3958893418312073,
-0.14977598190... | |
you rarely actually need to access the `.Value` property.
This is all you need for your projection:
```
var items =
from g in xDocument.Root.Descendants("Group").Elements("Entry")
select new
{
name = (string) g.Element("Name"),
id = (string) g.Element("ID") ?? "none",
};
```
And if y... | [
-0.1582375019788742,
-0.01424858532845974,
0.3810099959373474,
-0.01254970021545887,
0.040446482598781586,
0.052399229258298874,
-0.030048154294490814,
-0.30200013518333435,
-0.3411101996898651,
-0.6100909113883972,
-0.30814555287361145,
0.47519010305404663,
-0.2954818904399872,
0.20946148... | |
name = (string) g.Element("Name"),
id = (int?) g.Element("ID"),
};
``` | [
-0.2230609804391861,
0.14044082164764404,
-0.030075907707214355,
-0.19323717057704926,
0.16303446888923645,
-0.010640513151884079,
0.10448406636714935,
-0.3032759428024292,
0.16933193802833557,
-0.030964870005846024,
-0.4801194667816162,
0.4516845643520355,
-0.5418228507041931,
0.291220963... | |
I realize that this would be COMPLETELY bad practice in normal situations, but this is just for a test app that needs to be taking input from a bar code scanner (emulating a keyboard). The problem is that I need to start up some scripts while scanning, so I need the window to regain focus directly after I click the scr... | [
0.2613929212093353,
-0.2758520543575287,
0.6563166379928589,
-0.24148806929588318,
-0.06729722023010254,
-0.20048457384109497,
0.404010146856308,
-0.09361939132213593,
-0.10176067799329758,
-0.9044701457023621,
-0.10870123654603958,
0.9871722459793091,
-0.22845861315727234,
-0.283501595258... | |
to tell me that it *wants* to have focus, but something is stopping it. BTW, I'm running this on XP SP2 and using .NET 2.0.
Is this possible?
Edit: To clarify, I am running the scripts by double-clicking on them in explorer. So I need it to steal focus back from explorer and to the test app.
Visibility
----------
Ma... | [
0.24517828226089478,
-0.28572747111320496,
0.474287211894989,
0.04415521025657654,
-0.11100523173809052,
-0.444254070520401,
0.33850982785224915,
0.10629094392061234,
-0.11205369234085083,
-0.745442271232605,
-0.20668955147266388,
0.8116638660430908,
-0.12436112016439438,
-0.35629317164421... | |
any of the "Active window" behaviour with the top-most setting.
Focus
-----
I asked a similar question [previously here on StackOverflow](https://stackoverflow.com/questions/91234/multiple-keyboards-and-low-level-hooks) and the answer would solve your problem. You can make the application use a low-level input hook a... | [
-0.12303946167230606,
-0.2031264305114746,
0.6709352731704712,
-0.15567559003829956,
-0.0991855040192604,
-0.18927952647209167,
0.15404094755649567,
0.21635179221630096,
-0.630516767501831,
-0.4254061281681061,
-0.5450031161308289,
0.7303510904312134,
-0.29339614510536194,
-0.1395406126976... | |
the user. Peeking at the input streams through the RawInputDevices hook is the only sensible way to go.
A number of articles may help (C# implementations)
* [RawInput article on CodeProject](http://www.codeproject.com/KB/system/rawinput.aspx)
* [MSDN documentation of RawInput](http://msdn.microsoft.com/en-us/library/... | [
0.34423595666885376,
-0.08034349977970123,
-0.0734538733959198,
0.18877306580543518,
0.0478593111038208,
-0.11781249195337296,
0.3810652494430542,
-0.00012403074651956558,
-0.1075969859957695,
-0.5047129988670349,
-0.20084033906459808,
0.6617674231529236,
-0.020139174535870552,
-0.10043604... | |
I'm trying to write an iterator for results from a PDO statement but I can't find any way of rewinding to the first row. I would like to avoid the overhead of calling fetchAll and storing all the result data.
```
// first loop works fine
foreach($statement as $result) {
// do something with result
}
// but subseq... | [
0.1414632797241211,
-0.040048472583293915,
0.35831040143966675,
-0.22225643694400787,
0.050211381167173386,
0.05631992965936661,
0.28155776858329773,
-0.124173603951931,
-0.4651027321815491,
-0.5388527512550354,
0.018978096544742584,
0.7471257448196411,
-0.3572610020637512,
-0.003204792272... | |
think you can achieve what you want by enabling [buffered queries](http://www.php.net/pdo-mysql#pdo-mysql.constants). If that doesn't work, you can always pull the result into an array with [`fetchAll`](http://www.php.net/manual/en/pdostatement.fetchall.php). Both solutions have implications for your applications perfo... | [
0.127788245677948,
-0.6771189570426941,
0.5247716903686523,
0.08725625276565552,
0.09317497164011002,
0.10482894629240036,
0.040448080748319626,
-0.2384895235300064,
-0.45598024129867554,
-0.5292209386825562,
0.1048092395067215,
0.7881926894187927,
-0.119502492249012,
-0.28053849935531616,... | |
Using C or C++, After I decrypt a file to disk- how can I guarantee it is deleted if the application crashes or the system powers off and can't clean it up properly? Using C or C++, on Windows and Linux?
Don't write the file decrypted to disk at all.
If the system is powerd off the file is still on disk, the disk and ... | [
0.15875600278377533,
0.04586086794734001,
0.13935472071170807,
0.3032551109790802,
-0.08133005350828171,
-0.32899603247642517,
0.1795540302991867,
0.09777774661779404,
-0.36449572443962097,
-0.5578396916389465,
-0.250942200422287,
0.7239735722541809,
-0.25485920906066895,
0.028259640559554... | |
All of the errors are on auto-generated files, not within the files that were created by me. Here are a few of them:
```
'Context' is not a member of 'auth_cookies'
'ProcessRequest' cannot be declared 'Overrides' because it does not override a sub in a base class
'Server' is not a member of 'ASP.auth_cookies_aspx'
Cla... | [
-0.18618039786815643,
0.48553919792175293,
0.48576709628105164,
0.04456916078925133,
-0.03207538649439812,
0.0944342315196991,
0.5663775205612183,
-0.1670895516872406,
-0.2968789041042328,
-0.6047758460044861,
0.020272675901651382,
0.5911248326301575,
-0.4994587302207947,
0.051608972251415... | |
contents of the **`cookies.aspx`** page:
```
<%@ Page Language="VB" MasterPageFile="~/theMaster.master" AutoEventWireup="false" CodeFile="cookies.aspx.vb" Inherits="auth_cookies" title="NOM COOKIES" %>
```
UPDATE: Turns out one of linked files had a link to another .aspx page, causing 2 page directives to be loaded.... | [
0.17874719202518463,
0.021579168736934662,
0.5551252365112305,
0.1310957372188568,
0.007922890596091747,
-0.2686351537704468,
0.3833977282047272,
-0.16065341234207153,
-0.36440539360046387,
-0.6951746940612793,
-0.33577263355255127,
0.3474532961845398,
-0.3013957440853119,
0.24998451769351... | |
Is there some elegant way to add an empty option to a DropDownList bound with a LinqDataSource?
Here's how to add a value at the top of the list. It can be an empty string, or some text.
```
<asp:DropDownList ID="categories" runat="server" AppendDataBoundItems="True" AutoPostBack="True" DataSourceID="categoriesDataSou... | [
-0.1513366848230362,
-0.16385503113269806,
0.6340715885162354,
0.01884688250720501,
0.0316518172621727,
-0.1764923483133316,
0.12565283477306366,
-0.3006661832332611,
-0.2669500410556793,
-0.3870859742164612,
-0.2899250388145447,
0.6271451115608215,
-0.3461790680885315,
-0.3373723030090332... | |
I have a report in SQL Server Reporting Services (SSRS) that I'd like to schedule to run automatically as an email. I'd like the report to be attached as Excel file.
According to the [Microsoft overview](http://www.microsoft.com/Sqlserver/2005/en/us/reporting-services.aspx) this should be possible.
> **Report deliv... | [
0.4267386496067047,
0.13281205296516418,
0.3860637843608856,
0.04080231115221977,
-0.4019845128059387,
-0.4223073720932007,
0.09460373222827911,
0.11792752146720886,
-0.2566307485103607,
-0.43614766001701355,
0.05906958132982254,
0.23663300275802612,
-0.03579459711909294,
-0.00041807405068... | |
your reporting services site you should see a tab for Subscriptions. That's where you'd specify the recipients and delivery methods for automated delivery.
Here's a [page](http://msdn.microsoft.com/en-us/library/ms160334.aspx) that describes the process. | [
0.6450012922286987,
-0.005318240728229284,
0.2563055157661438,
0.3070201873779297,
-0.08861199766397476,
-0.2852393686771393,
0.09974733740091324,
-0.015341658145189285,
-0.346844345331192,
-0.2645356357097626,
-0.022142712026834488,
0.25936490297317505,
-0.029224053025245667,
-0.029299065... | |
What is the best way to stop a user from resizing the top-level window of an application written in WPF?
You will want to use the [`ResizeMode.NoResize`](http://msdn.microsoft.com/en-us/library/system.windows.resizemode.aspx) on the window.
```
<Window x:Class="WpfApplication5.Window1"
xmlns="http://schemas.micros... | [
-0.19750723242759705,
-0.16611315310001373,
0.639422595500946,
-0.022976813837885857,
0.1180822104215622,
-0.16624119877815247,
0.20127789676189423,
-0.2675163745880127,
-0.33189910650253296,
-0.4020622670650482,
-0.340729683637619,
0.4670206308364868,
-0.07759681344032288,
0.0886029601097... | |
I have a public static class in which I would like to have a ToString() method.
I have defined it as public static string ToString(), but get the following warning:
> 'Class.ToString()' hides inherited member 'object.ToString()'. To make the current member override that implementation, add the override keyword. Oth... | [
0.11585325002670288,
-0.25949177145957947,
0.14201082289218903,
0.05159284546971321,
0.003529641544446349,
-0.3649812340736389,
0.49961623549461365,
-0.08707883208990097,
-0.2732742130756378,
-0.4469108283519745,
-0.036707356572151184,
0.5247147083282471,
-0.5154595375061035,
0.48281911015... | |
effectively silence the compiler warning but you are **explicitly hiding** an instance method with a static method. (This is different than overriding the method.) Typically you don't want to hide an instance method except with very good reasons and you really shouldn't hide it with a static method as that really chang... | [
0.43444591760635376,
-0.10319983959197998,
-0.25015538930892944,
-0.07618213444948196,
-0.050418298691511154,
-0.6987219452857971,
0.7752279043197632,
0.0553843155503273,
-0.31280219554901123,
-0.15605886280536652,
-0.40813302993774414,
0.47027677297592163,
-0.4771926701068878,
0.011473259... | |
stringing"? Static classes typically don't hold internal state so there really shouldn't be any internal data to provide as the logical output of a ToString() call. You may want to rethink your class design or provide a different method name that more clearly indicates the purpose of the method without hiding the insta... | [
0.000009474512808083091,
-0.32482412457466125,
0.05248548462986946,
0.1333497315645218,
-0.3764839470386505,
-0.32549789547920227,
0.36456581950187683,
-0.01142593938857317,
-0.32081374526023865,
-0.07779502123594284,
-0.14952826499938965,
0.3460354208946228,
-0.6406852006912231,
0.1317523... | |
> **Duplicate of: [When/Why to use Cascading in SQL Server?](https://stackoverflow.com/q/59297/1288)**
I've always been too scared to use DELETE CASCADE, but as I get more confident (lazy :D), I'm thinking how bad can it be, is it best practise to use it or should I avoid it and clean up my foreign keys etc the old fa... | [
0.28361302614212036,
0.102363720536232,
0.3642089366912842,
-0.17277850210666656,
-0.1528194099664688,
-0.06849459558725357,
0.8718273639678955,
-0.13641652464866638,
-0.3407980799674988,
-0.48483261466026306,
0.27596503496170044,
0.33719921112060547,
-0.49204862117767334,
0.01344651356339... | |
consists of a header and some lines. On the other hand, DELETE CUSTOMER should not delete the associated ORDERS because ORDERS are important in their own right, they are not just attributes of a customer.
One way to think about this is: if I issue DELETE X and it also deletes Y, will I be happy or unhappy? And if I is... | [
0.018117163330316544,
-0.04520031809806824,
0.4212067723274231,
0.18874825537204742,
-0.07219728827476501,
0.29846662282943726,
0.0021491271909326315,
-0.07065457105636597,
-0.05849500373005867,
-0.12242674082517624,
-0.2552368640899658,
0.43352964520454407,
-0.37159985303878784,
-0.033795... | |
I'm starting a project which I think would benefit from bindings (I've got a source list table, several browser views, etc), but I think it would also be quite doable, and perhaps more understandable, without them. From my limited experience I've found bindings to be difficult to troubleshoot and very "magic" (e.g. it'... | [
0.7818053364753723,
0.18796133995056152,
0.06228359788656235,
0.19435879588127136,
0.08411847800016403,
-0.5034506916999817,
0.4526298940181732,
-0.2405599057674408,
-0.36931246519088745,
-0.5393149256706238,
0.17726151645183563,
0.20097005367279053,
-0.09901402145624161,
0.163744941353797... | |
clearer/easier) or would I be better off just writing all the glue code myself in a manner which I was sure I could understand and troubleshoot.
Use Bindings.
Note that you *must* follow the MVC pattern to get the most from bindings. **This is easier than it seems**, as Cocoa does almost everything for you nowadays:
... | [
0.1146930530667305,
-0.2507157325744629,
0.40796977281570435,
0.18443360924720764,
-0.23026400804519653,
-0.21196533739566803,
0.021086659282445908,
-0.1147618517279625,
-0.5801043510437012,
-0.6360998153686523,
-0.18955659866333008,
0.6170162558555603,
-0.3931010663509369,
-0.108559198677... | |
will be simple accessors, which you can just `@synthesize` if you're targeting Leopard.
You usually can't get away with not writing any code, but Bindings can enable you to write very little code.
Recommended reading:
* [Key-Value Coding (KVC) Programming Guide](http://developer.apple.com/documentation/Cocoa/Concept... | [
-0.23057928681373596,
-0.013816498219966888,
0.10093432664871216,
0.038086820393800735,
-0.07616809010505676,
-0.2558533251285553,
0.16862443089485168,
-0.5522511005401611,
-0.23691126704216003,
-0.6570489406585693,
-0.554360032081604,
0.6258487105369568,
-0.14315181970596313,
-0.187722757... | |
At my current job we have a CMS system that is .NET/SQL Server based. While customizing a couple of the modules for some internal use, I was a little surprised to see that instead of having APIs that returned data via your typical result set that was bound to a DataGrid/DataList/Repeater control, that the APIs returned... | [
0.20648303627967834,
0.08065307140350342,
0.29502469301223755,
0.16642747819423676,
0.06353966146707535,
0.15582755208015442,
-0.09987460821866989,
0.036063529551029205,
-0.4535442888736725,
-0.6747177243232727,
0.21644294261932373,
0.5144606828689575,
-0.10075926035642624,
0.1420970261096... | |
end, some of the bits will have a count higher than half the length of the array - those bits determine N. Of course, the count will be higher than the number of times N occurred, but that doesn't matter. The important thing is that any bit which isn't part of N *cannot* occur more than half the times (because N has ov... | [
0.3945409953594208,
0.05419234558939934,
0.12056367844343185,
0.07550013810396194,
0.11887171864509583,
-0.19236841797828674,
0.41167598962783813,
-0.32777640223503113,
-0.315064936876297,
-0.4917873442173004,
-0.1592751443386078,
0.32066336274147034,
0.15726348757743835,
0.157231137156486... | |
net access. Hopefully the above is clear enough though.) | [
0.24987556040287018,
-0.3596847355365753,
0.6323432326316833,
0.416585236787796,
0.3395715653896332,
-0.1319364756345749,
0.3941287100315094,
0.1707339584827423,
-0.299642413854599,
-0.7044357657432556,
0.07482641935348511,
0.2518932819366455,
-0.2390400767326355,
-0.05759957432746887,
-... | |
After some time I wanted to update my git repo, and then something went wrong. What is the proper way out of this situation?
```
mblsha@siruba:~/src/psi/ $ git status
iris: needs merge
# On branch master
# Changes to be committed:
# (use "git reset HEAD <file>..." to unstage)
#
# modified: src/common.cpp
#
# Cha... | [
-0.28919100761413574,
-0.13556523621082306,
0.6864458322525024,
0.1678445041179657,
0.2635751962661743,
0.006996805779635906,
0.2867833971977234,
-0.3535156548023224,
-0.5246809124946594,
-0.34870225191116333,
-0.27334466576576233,
0.32013070583343506,
-0.23719406127929688,
0.2720064520835... | |
(heads/master)
mblsha@siruba:~/src/psi/ $ cd iris
mblsha@siruba:~/src/psi/iris/ $ cat .git/HEAD
cf237ef8f3d9dc058dbde47e6973e6388608ce60
```
When it comes to git submodules, almost any problem you encounter can be solved by:
```
1. deleting the submodule (rm -r iris)
2. recreating it again (git submodule update)
`... | [
-0.19222821295261383,
-0.039702776819467545,
0.7818378806114197,
0.1425805389881134,
0.09760275483131409,
-0.049182355403900146,
0.20984520018100739,
-0.2082144170999527,
-0.4939187467098236,
-0.5902019143104553,
-0.4379623532295227,
0.2877436578273773,
-0.3335399329662323,
0.3180281519889... | |
I'm wondering if there is a quick and easy function to clean get variables in my url, before I work with them.( or $\_POST come to think of it... )
I suppose I could use a regex to replace non-permitted characters, but I'm interested to hear what people use for this sort of thing?
I use the PHP [input filters](http://... | [
0.26694780588150024,
0.0043356819078326225,
0.35363519191741943,
-0.03678818792104721,
-0.23270690441131592,
-0.08689597249031067,
0.06803765892982483,
0.25501108169555664,
-0.09892364591360092,
-0.6550045013427734,
0.09486407041549683,
0.3531014919281006,
-0.05370975285768509,
0.169391602... | |
I'm using the XML data source feature in Reporting Services 2005 but having some issues with missing data. When there is no value for the first column in a row, it appears that the entire column is ignored by SSRS!
The web method request is very simple:
```
<Query>
<Method Name="GetIssues"
Namespace="http://www.m... | [
0.04958295449614525,
0.22810548543930054,
0.7721501588821411,
-0.22448758780956268,
-0.5819748044013977,
0.04177583009004593,
0.3256273567676544,
-0.7418475151062012,
-0.16762520372867584,
-0.6626313924789429,
0.10867869853973389,
0.39083409309387207,
-0.171556755900383,
-0.015520509332418... | |
<Title>ABC</Title>
<RaisedBy />
<Action>Do something</Action>
</Issue>
<Issue>
<Title>ABC</Title>
<RaisedBy>Jeff Smith</RaisedBy>
<Action>Do something</Action>
</Issue>
</GetIssuesResult>
</GetIssuesResponse>
</soap:Body>
</soap:Envel... | [
0.2594355344772339,
-0.012538004666566849,
0.16856364905834198,
-0.02241097390651703,
-0.5896838903427124,
-0.08991756290197372,
0.3187917172908783,
-0.549785852432251,
-0.2895013689994812,
-0.2780996859073639,
-0.3590286076068878,
0.06460629403591156,
-0.46964532136917114,
0.1868420243263... | |
empty. If the 'Issues' are reversed so RaisedBy first has a value, there is no problem. Any ideas?
In the Query itself, try to define your columns explicitly, instead of letting SSRS determine them for you.
In other words, where you have:
```
<ElementPath IgnoreNamespaces="true">*</ElementPath>
```
Replace the \* w... | [
0.1245289221405983,
-0.19065390527248383,
0.605625331401825,
0.00017669495719019324,
-0.1128167137503624,
-0.15217773616313934,
-0.043610118329524994,
-0.11664249002933502,
-0.409598708152771,
-0.5335055589675903,
-0.11731131374835968,
0.4433826804161072,
-0.45512503385543823,
-0.079026520... | |
I need to implement the classic Factory Method pattern in ASP.NET to create server controls dynamically.
The only way I've found to create .ascx controls is to use the LoadControl method of the Page/UserControl classes. I find it messy however to link my factory with a page or to pass a page parameter to the factory.
... | [
0.2645740807056427,
0.05127450078725815,
0.26480066776275635,
-0.01746995560824871,
-0.33369094133377075,
0.17894423007965088,
0.17307259142398834,
0.00032011326402425766,
-0.3614751100540161,
-0.6030978560447693,
0.19800376892089844,
0.35350653529167175,
-0.6104140281677246,
0.35205629467... | |
class from a singleton to a common class, and I passed the page to the constructor:
```
public ControlsFactory
{
private Page _containingPage;
public ControlsFactory(Page containingPage)
{
_containingPage = containingPage;
}
public CustomControlClass GetControl(string type)
{
... | [
-0.35809263586997986,
-0.24934221804141998,
0.6975089311599731,
0.05245903134346008,
0.06203852593898773,
0.3341851830482483,
0.2781113088130951,
-0.6302022933959961,
-0.06240642070770264,
-0.5910800695419312,
-0.17744921147823334,
0.5224679112434387,
-0.4258477985858917,
0.163830146193504... | |
page with the factory, this is probably the most concise and usable way to implement the pattern. | [
0.6221024394035339,
0.19283252954483032,
0.41160574555397034,
-0.1126522496342659,
-0.11738474667072296,
-0.06464450061321259,
0.19452689588069916,
-0.015955066308379173,
-0.3166556656360626,
-0.7310476303100586,
-0.007535836193710566,
0.16750669479370117,
-0.2946893274784088,
-0.083946175... | |
I'm looking for a method to reliably extract the host name from a URL string in Ruby.
e.g.
<http://www.mglenn.com/directory> = www.mglenn.com
OR
<http://www.mglenn.com?param=x> = www.mglenn.com
You could try something like this:
```
require 'uri'
myUri = URI.parse( 'http://www.mglenn.com/directory' )
print myUri.ho... | [
0.1763063222169876,
0.3937815725803375,
0.5440554618835449,
-0.12271532416343689,
-0.07812835276126862,
0.035819217562675476,
0.2769973576068878,
0.0636569932103157,
-0.3138408362865448,
-0.3364587128162384,
-0.18764853477478027,
0.3971754014492035,
-0.3551361560821533,
0.5591961145401001,... | |
When should I put ... at the end of a menu item? I seem to remember reading some rules but can't for the life of me find them.
For context - I'm adding a properties option to a right click menu and am wondering if it is appropriate to add them.
One exception to the first two answers: if the whole **point** of the menu... | [
0.2318858653306961,
-0.26244035363197327,
0.6127483248710632,
-0.03598403185606003,
0.18122175335884094,
-0.14765813946723938,
-0.043288253247737885,
-0.005979208741337061,
-0.364349365234375,
-0.5803899168968201,
-0.08183562755584717,
0.3616017997264862,
0.10977527499198914,
0.18871302902... | |
when the menu command's purpose is to do something else, but it needs a dialog or confirmation in order to do it. | [
0.27924785017967224,
-0.2271880805492401,
0.33319905400276184,
-0.07184881716966629,
0.46007850766181946,
-0.26212552189826965,
0.11946149170398712,
0.2070356011390686,
-0.09594511240720749,
-0.5409221649169922,
-0.7141062021255493,
0.315929114818573,
-0.06491591036319733,
-0.0022621222306... | |
Is it possible to have an ASP.NET MVC route that uses subdomain information to determine its route? For example:
* ***user1**.domain.example* goes to one place
* ***user2**.domain.example* goes to another?
Or, can I make it so both of these go to the same controller/action with a `username` parameter?
You can do it b... | [
0.11126071959733963,
-0.3947305679321289,
0.35753345489501953,
0.14733931422233582,
-0.14052177965641022,
-0.1008458212018013,
0.21397140622138977,
-0.2129954695701599,
-0.3729478120803833,
-0.7824530005455017,
0.031642258167266846,
0.0605633519589901,
-0.430480420589447,
0.346685945987701... | |
= httpContext.Request.Headers["HOST"];
var index = url.IndexOf(".");
if (index < 0)
return null;
var subDomain = url.Substring(0, index);
if (subDomain == "user1")
{
var routeData = new RouteData(this, new MvcRouteHandler());
routeData.Value... | [
0.03603594750165939,
-0.9282689094543457,
0.9461579322814941,
0.14023500680923462,
0.07709401100873947,
-0.2039499133825302,
0.5675557851791382,
-0.15587592124938965,
-0.4690358340740204,
-0.5374454259872437,
-0.33951160311698914,
0.34820955991744995,
-0.42412593960762024,
0.47231113910675... | |
to the User1Controller class
routeData.Values.Add("action", "Index"); //Goes to the Index action on the User1Controller
return routeData;
}
if (subDomain == "user2")
{
var routeData = new RouteData(this, new MvcRouteHandler());
routeData.Values.A... | [
-0.05185640603303909,
-0.7394182085990906,
0.6472829580307007,
0.035475313663482666,
0.13396459817886353,
0.11061721295118332,
0.20916691422462463,
-0.4428410530090332,
-0.3598532974720001,
-0.3730068802833557,
-0.41274502873420715,
0.36781540513038635,
-0.5968443751335144,
0.2154081910848... | |
class
routeData.Values.Add("action", "Index"); //Goes to the Index action on the User2Controller
return routeData;
}
return null;
}
public override VirtualPathData GetVirtualPath(RequestContext requestContext, RouteValueDictionary values)
{
//Implement your... | [
0.11156758666038513,
-0.6662182211875916,
0.46637964248657227,
0.20885281264781952,
0.1481749415397644,
-0.3050483167171478,
0.5433007478713989,
-0.18300767242908478,
-0.045936375856399536,
-0.6076905131340027,
-0.15784502029418945,
0.41297629475593567,
-0.6249729990959167,
0.2366993874311... | |
If I have a comma separated file like the following:
```
foo,bar,n
,a,bc,d
one,two,three
,a,bc,d
```
And I want to join the `\n,` to produce this:
```
foo,bar,n,a,bc,d
one,two,three,a,bc,d
```
What is the regex trick? I thought that an `if (/\n,/)` would catch this.
Also, will I need to do anything special for... | [
0.19512245059013367,
0.15924522280693054,
0.3583891987800598,
0.06677097827196121,
0.20029470324516296,
0.06380526721477509,
0.034248318523168564,
0.049925874918699265,
-0.21406839787960052,
-0.4777536690235138,
-0.2117346227169037,
0.4931115210056305,
-0.40762314200401306,
0.1291532367467... | |
I know the standard way of using the [null coalescing operator](https://en.wikipedia.org/wiki/Null_coalescing_operator) in C# is to set default values.
```
string nobody = null;
string somebody = "Bob Saget";
string anybody = "";
anybody = nobody ?? "Mr. T"; // Returns Mr. T
anybody = somebody ?? "Mr. T"; // Return... | [
0.27555590867996216,
0.33105936646461487,
-0.09630530327558517,
-0.10679126530885696,
0.1438920795917511,
-0.13082346320152283,
0.4231783449649811,
-0.10321133583784103,
-0.22687920928001404,
-0.21090981364250183,
-0.1890057921409607,
0.47186043858528137,
-0.20722520351409912,
0.0303786322... | |
used `??` for something else?
* Is `??` necessary, or should you just use the ternary operator (that
most are familiar with)
Well, first of all, it's much easier to chain than the standard ternary operator:
```
string anybody = parm1 ?? localDefault ?? globalDefault;
```
vs.
```
string anyboby = (parm1 != null) ? p... | [
-0.3781326413154602,
0.16055113077163696,
0.3808194100856781,
-0.15685293078422546,
-0.11001300066709518,
-0.3404957354068756,
0.09815054386854172,
0.3560522198677063,
-0.4141458570957184,
-0.06498759984970093,
-0.21016927063465118,
0.5884538292884827,
-0.4111635982990265,
-0.0506844818592... | |
?? Settings["Name"]
?? GlobalSetting["Name"];
```
vs.
```
string anybody = (Parameters["Name"] != null ? Parameters["Name"]
: (Settings["Name"] != null) ? Settings["Name"]
: GlobalSetting["Name"];
``` | [
-0.46439939737319946,
0.03897429257631302,
0.32134854793548584,
-0.08471878618001938,
0.2727169692516327,
-0.01755889691412449,
-0.002786574885249138,
0.3414250612258911,
-0.2984752357006073,
-0.21574759483337402,
-0.3678381145000458,
0.7155315279960632,
-0.3630317747592926,
-0.23292581737... | |
I have some user generated content I'm trying to render on my site. The rich text box editor I'm using renders font changes using `<font />` tags, which are overridden by CSS on the page.
Does anyone know if there is a way to allow rules defined using the `<font />` tag to show through?
**UPDATE**
Since changing t... | [
0.562676191329956,
0.19565919041633606,
0.3786870241165161,
0.03766530007123947,
-0.0803002417087555,
-0.12917298078536987,
0.07007382810115814,
0.06465641409158707,
-0.13097168505191803,
-0.8097037672996521,
0.16917581856250763,
0.46941104531288147,
-0.31756213307380676,
0.245818689465522... | |
hack to fix my problem. Below is the code I used to solve it. It's a jQuery script that changes all `<font />` tag attributes into inline CSS.
```
(function() {
$('font[size]').each(function() {
var fontSize = this.size;
if (fontSize == 1) {
$(this).css("font-size", 8);
} else ... | [
-0.03130939602851868,
0.02878425270318985,
0.32784003019332886,
-0.18352839350700378,
0.08732626587152481,
0.2126934975385666,
0.36967265605926514,
0.056393127888441086,
0.007411430589854717,
-0.7046027183532715,
0.04699231684207916,
0.8332657814025879,
-0.5910935401916504,
0.0542421340942... | |
} else if (fontSize == 3) {
$(this).css("font-size", 11);
} else if (fontSize == 4) {
$(this).css("font-size", 15);
} else if (fontSize == 5) {
$(this).css("font-size", 20);
} else if (fontSize == 6) { | [
0.06787282228469849,
0.12411605566740036,
0.3100437521934509,
-0.346541166305542,
-0.019903801381587982,
0.5014092922210693,
0.27801987528800964,
-0.40721142292022705,
-0.5382092595100403,
-0.5688463449478149,
-0.5377677083015442,
0.5975728631019592,
-0.22658120095729828,
-0.07446171343326... | |
$(this).css("font-size", 25);
}
});
$('font[face]').each(function() {
$(this).css('font-family', this.face);
});
$('font[color]').each(function() {
$(this).css('color', this.color);
});
})();
```
A year late, but thought I'd share nonetheless.
I was frustrated by this, as w... | [
0.08563276380300522,
0.1729585975408554,
0.33746397495269775,
-0.43289998173713684,
-0.2803969979286194,
0.12299112975597382,
0.3915669918060303,
-0.34144049882888794,
0.012900223955512047,
-0.7522099614143372,
-0.2230149507522583,
0.49072229862213135,
-0.4690397381782532,
0.15456074476242... | |
CSS override problem.
Unfortunately, none of the other solutions worked in my case, so after thinking I came up with this JavaScript solution:
```
var fontEl=document.getElementsByTagName("font");
for(var i=0;i<fontEl.length;i++) {
var f = fontEl[i];
if(f.size)
f.style.fontSize=(Math.round(parseInt(f.... | [
-0.08273069560527802,
0.15454408526420593,
0.7113398909568787,
-0.40679848194122314,
-0.024779072031378746,
0.3289931118488312,
0.3481503427028656,
-0.4805707633495331,
-0.0741044357419014,
-0.6754817962646484,
-0.3816598057746887,
0.3607419431209564,
-0.3339572548866272,
-0.09743271023035... | |
I have some code doing this :
```
var changes = document.getElementsByName(from);
for (var c=0; c<changes.length; c++) {
var ch = changes[c];
var current = new String(ch.innerHTML);
etc.
}
```
This works fine in FF and Chrome but not in IE7. Presumably because getElementsByName isn't working in IE. What'... | [
0.21886099874973297,
0.14688928425312042,
0.6249762177467346,
-0.11832951754331589,
0.10488393902778625,
-0.2543797791004181,
0.21471495926380157,
-0.33760973811149597,
-0.18952856957912445,
-0.7160083055496216,
-0.15470397472381592,
0.6183714270591736,
-0.1734592169523239,
0.1010407209396... | |
support both the NAME attribute and the ID attribute are included in the collection returned by the getElementsByName method, but elements with a NAME expando are not included in the collection; therefore, this method cannot be used to retrieve custom tags by name.
Firefox allows [`getElementsByName()`](http://msdn.mi... | [
0.2455870360136032,
-0.09778694063425064,
0.5710042715072632,
-0.0477827824652195,
0.47830474376678467,
-0.4197288453578949,
0.13540276885032654,
-0.4639291763305664,
-0.30514273047447205,
-0.18245209753513336,
-0.4494546949863434,
0.5590845942497253,
-0.5226499438285828,
-0.24341289699077... | |
if it is what you want, and if so, add it to an array. This would require, however, that you iterate over all of the nodes in the page or at least within a subsection, which wouldn't be the most efficient. You could constrain that list beforehand by using something like [`getElementsByTagName()`](http://msdn.microsoft.... | [
0.09024602174758911,
-0.1600881963968277,
0.5044277906417847,
-0.22011952102184296,
0.019661596044898033,
-0.10843019187450409,
-0.008964376524090767,
-0.5099158883094788,
-0.2025679498910904,
-0.6260531544685364,
-0.2687867283821106,
0.1528361737728119,
-0.38092660903930664,
-0.0668637529... | |
getElementsByModifiedId(baseIdentifier) {
var allWantedElements = [];
var idMod = 0;
while(document.getElementById(baseIdentifier + idMod)) { // will stop when it can't find any more
allWantedElements.push(document.getElementById(baseIdentifier + idMod++));
}
return allWantedElements;
}
// ... | [
0.3773254454135895,
-0.16960731148719788,
0.6073591709136963,
-0.21191203594207764,
0.2913239002227783,
-0.1929788738489151,
0.4081100821495056,
-0.33405473828315735,
-0.1639798879623413,
-0.6161249876022339,
-0.3695997893810272,
0.6715525388717651,
-0.47670552134513855,
0.1350653171539306... | |
to get into those specifics unless you indicate you are using one. Personally, I don't know how people live without one, they save so much time, effort and frustration that you can't afford *not* to use one. | [
0.809597909450531,
0.061274204403162,
-0.39465877413749695,
0.27966365218162537,
0.1046631932258606,
-0.337143212556839,
-0.02005547285079956,
0.03315102308988571,
-0.08029292523860931,
-0.3981878161430359,
0.20187534391880035,
0.3917439877986908,
-0.14543700218200684,
-0.06113307178020477... | |
I really don't understand the fascination with XHTML strict. Inline JavaScript typically requires a rats nest of escapes to make it compatible with XHTML and semi-backwards compatible with MSIE 5 & 6. Then there is the issue of not being OCD enough on user input to make sure you don't miss any illegal characters. It ju... | [
0.45531371235847473,
0.23517003655433655,
0.27509135007858276,
0.1619669497013092,
-0.5452985763549805,
-0.30225950479507446,
0.549159586429596,
0.25273212790489197,
-0.20732860267162323,
-0.3352457880973816,
0.21576900780200958,
0.514814019203186,
-0.4306032359600067,
0.0919465571641922,
... | |
someone else pointed out that a majority of supposedly XHTML compliant websites and open source packages are actually not because of that last issue, forgetting to set the content-type header correctly.
I'm looking to understand why XHTML is useful, or build enough of an arsenal of arguments to prevent it ever being u... | [
0.47111964225769043,
-0.019717413932085037,
0.23719118535518646,
0.22429272532463074,
-0.39067506790161133,
-0.5719956755638123,
0.07251500338315964,
0.1497623473405838,
-0.22206754982471466,
-0.549580991268158,
-0.17765656113624573,
0.40206268429756165,
-0.2155984491109848,
0.086827777326... | |
mess that is old-school-SGML-except-not-really HTML4.
Restricting yourself to [X]HTML Strict doesn't achieve anything in itself, other than simply that it discourages the use of old, less-maintainable techniques you shouldn't be using anyway.
> Inline javascript typically requires a rats nest of escapes to make it co... | [
0.5876845717430115,
0.28726741671562195,
0.2086396962404251,
0.08619800209999084,
-0.12514391541481018,
-0.3093731999397278,
0.30496853590011597,
-0.2147112935781479,
-0.493915855884552,
-0.37163105607032776,
0.11333268135786057,
0.28904327750205994,
-0.6953927874565125,
0.3055578768253326... | |
is the issue of not being OCD enough on user input to make sure you don't miss any illegal characters.
Out-of-band characters are exactly as invalid in HTML4 Transitional as in XHTML1 Strict.
If you're accepting user-submitted HTML and not checking/escaping it with enough of a fine tooth comb to prevent well-formedne... | [
0.10001412034034729,
0.10301599651575089,
0.28636810183525085,
0.12907418608665466,
-0.12041905522346497,
-0.19344326853752136,
0.35433417558670044,
-0.299917995929718,
-0.2741788327693939,
-0.4647097587585449,
-0.045752108097076416,
0.4770568609237671,
-0.31078895926475525,
-0.08568056672... | |
is not really that much point in serving application/xhtml+xml today. To account for IE you have to sniff UA, and then make sure you understand the CSS and JavaScript differences that pop up in both parsing modes... you can do it to prove your technical prowess, but it doesn't really get you anything.
Serving XHTML as... | [
0.4797797203063965,
0.1143246442079544,
0.29633402824401855,
0.19380435347557068,
-0.4061287045478821,
-0.4853082001209259,
0.23144197463989258,
0.0950835645198822,
-0.04945504665374756,
-0.4651985168457031,
-0.19264043867588043,
0.40734466910362244,
-0.3030259609222412,
-0.016509719192981... | |
straight away for you to fix them is way better than leaving them there silently, ready to trip up some future browser. | [
0.6723027229309082,
0.0442047044634819,
-0.16677279770374298,
0.3225928246974945,
0.0024575255811214447,
0.3105132579803467,
0.2712119519710541,
0.4161054491996765,
-0.30811458826065063,
-0.4952281713485718,
0.12678156793117523,
0.23936869204044342,
0.4331987500190735,
-0.02746559493243694... | |
I am doing the following in PHP:
```
exec('java -jar "/opt/flex3/lib/mxmlc.jar" +flexlib "/opt/flex3/frameworks" MyAS3App.as -default-size 360 280 -output MyAS3App.swf');
```
When I run this from the command line, it runs fine and finishes in a second or two.
When I run this command from PHP exec, the java process ... | [
0.30820807814598083,
0.3512100279331207,
0.6280912160873413,
-0.4830581247806549,
-0.12281730026006699,
-0.08880098909139633,
0.7888625264167786,
-0.21542716026306152,
-0.1424272209405899,
-0.6325042843818665,
-0.15043377876281738,
0.6599941253662109,
-0.31427985429763794,
0.13412880897521... | |
command with
```
export DYLD_LIBRARY_PATH="";
```
Also I realized there's no reason to use that method of invoking mxmlc.
So here's the final, working command:
```
exec('export DYLD_LIBRARY_PATH=""; mxmlc MyAS3App.as -default-size 360 280 -output MyAS3App.swf');
``` | [
-0.08829285949468613,
-0.1599833071231842,
0.9216731786727905,
-0.11739172041416168,
0.031229883432388306,
-0.134361132979393,
0.10206171870231628,
-0.1418086439371109,
-0.13033218681812286,
-0.40952372550964355,
-0.5540997385978699,
0.7814269065856934,
-0.3025497794151306,
-0.013770456425... | |
you would think this would be obvious, but searching through documentation, SAP forums, Googling, etc., I've been spectacularly unsuccessful. I'm creating a file in ABAP on a solaris filesystem using the following code:
```
OPEN DATASET p_file FOR OUTPUT IN TEXT MODE ENCODING DEFAULT.
```
the resulting file is owned... | [
0.40671437978744507,
0.3604689836502075,
0.31046730279922485,
-0.06397989392280579,
0.025045644491910934,
0.046043820679187775,
-0.052822526544332504,
-0.16579395532608032,
-0.16465306282043457,
-0.8230437636375427,
-0.4768279790878296,
0.6119606494903564,
-0.33359700441360474,
0.116218477... | |
CONCATENATE 'chmod ugo=rw ' lc_filename
INTO lc_chmod SEPARATED BY space.
CALL 'SYSTEM' ID 'COMMAND' FIELD lc_chmod.
```
Hope this helps.
Cheers,
Heiko | [
-0.10160638391971588,
0.36315715312957764,
0.4746178984642029,
0.23857726156711578,
0.2947195768356323,
-0.09330778568983078,
-0.30921661853790283,
-0.19067223370075226,
-0.07122067362070084,
-0.6980080604553223,
-0.3332987427711487,
0.761276125907898,
0.06171419844031334,
0.25388056039810... | |
I'm building some custom tools to work against a JIRA install, and the exposed SOAP API is great, except that none of the arguments are named.
For example, the prototype for getIssue is:
```
RemoteIssue getIssue (string in0, string in1);
```
All of the SOAP RPC methods follow this convention, so without documentati... | [
0.1158844381570816,
0.1437925547361374,
0.15426179766654968,
-0.08473987132310867,
-0.18679386377334595,
0.0830174908041954,
0.414179265499115,
-0.2541360855102539,
0.18718434870243073,
-0.5511817336082458,
0.023280223831534386,
0.5587292313575745,
-0.4525705873966217,
0.21069636940956116,... | |
How do I set the date/time of the computer in C#?
You can set the date using [Microsoft.VisualBasic.Today](http://msdn.microsoft.com/en-us/library/9z20y6ha(VS.80).aspx) and [Microsoft.VisualBasic.TimeOfDay](http://msdn.microsoft.com/en-us/library/8hhbhw4c(VS.80).aspx), although they're subject to security restrictions.... | [
0.4241924285888672,
0.07825927436351776,
0.6390320062637329,
0.22505781054496765,
0.12959907948970795,
-0.04124898090958595,
0.08178417384624481,
0.24372358620166779,
-0.2737923860549927,
-0.8079343438148499,
-0.00011024023842765018,
0.11178101599216461,
0.3687250316143036,
0.4953273534774... | |
When using a Silverlight-enabled WCF service, where is the best place to instantiate the service and to call the CloseAsync() method?
Should you say, instantiate an instance each time you need to make a call to the service, or is it better to just instantiate an instance as a variable of the UserControl that will be m... | [
-0.05341007560491562,
-0.24998760223388672,
0.2909085750579834,
-0.03434141352772713,
-0.1392453908920288,
-0.1351355016231537,
0.18833027780056,
-0.2645597457885742,
-0.2241087704896927,
-0.6086506843566895,
-0.33607912063598633,
0.1430373340845108,
-0.46213194727897644,
-0.07338699698448... | |
or something equivalent for the UserControl class.
Thanks,
Jeff
You're better off just having an instance variable for the service. Creating and destroying the service for each call creates a lot of unnecessary overhead. Just create the variable and call the methods, no need to open it since this will be [done automa... | [
0.23987042903900146,
0.301502525806427,
0.41847488284111023,
-0.03342617303133011,
-0.253094881772995,
-0.266626238822937,
0.6120221018791199,
-0.02341456525027752,
-0.3694508373737335,
-0.4478229582309723,
-0.10775478184223175,
0.6222436428070068,
-0.4096904695034027,
0.29864099621772766,... | |
explicitly close it since everything will get cleaned up when the Silverlight host closes. However, if you're creating lots of these user control and closing them while keeping the app open then you might want to create some kind of close method on your control that would clean up by calling CloseAsync.
If all the us... | [
0.33354732394218445,
0.22611694037914276,
0.4327954351902008,
0.030956070870161057,
-0.2552487552165985,
-0.22601203620433807,
0.2831294536590576,
-0.19363872706890106,
-0.05015663057565689,
-0.5560039281845093,
-0.22492703795433044,
0.3431326150894165,
-0.5290728211402893,
0.0179229229688... | |
I am working an a search page that allows users to search for houses for sale. Typical search criteria include price/zip code/# bedrooms/etc.
I would like to allow the user to save this criteria in a database and email new homes daily.
I could either:
1) Serialize a "SavedSearch" object into a string and save that t... | [
0.8786577582359314,
0.18212223052978516,
0.5651833415031433,
-0.3080897927284241,
0.25414106249809265,
0.1222524642944336,
0.22544577717781067,
-0.3962312340736389,
-0.2048618346452713,
-0.8127461671829224,
-0.07208066433668137,
0.25289270281791687,
-0.1701149195432663,
0.4470207095146179,... | |
option 2 doesn't feel like an optimal solution either.
How have others solved this problem?
I assume you will need to re-run the search daily in order to find new additions to the results. Maybe it is possible to make sure that you search form specifies a get method so that the search criteria is appended to the url a... | [
0.06018039956688881,
-0.44351547956466675,
0.49762463569641113,
0.16686591506004333,
0.0017131189815700054,
0.050705213099718094,
0.160544753074646,
-0.46730226278305054,
-0.28359392285346985,
-0.6131364703178406,
-0.23185710608959198,
0.6920093894004822,
-0.1862730234861374,
0.11731120198... | |
string onto the url and request the seach page again.
The only caveat is as the search action changes you have to make intelligent defaults to avoid breaking old searches. For example, suppose you start searching by color, none of the old searches will have a color criteria so your search action will have to cater for... | [
-0.09364922344684601,
-0.20044611394405365,
0.2459740936756134,
0.11528481543064117,
0.3540022671222687,
-0.34121590852737427,
0.10234734416007996,
0.057512786239385605,
-0.0952458381652832,
-0.7242769002914429,
-0.3195687234401703,
0.3580906391143799,
-0.4332125782966614,
0.40711864829063... | |
Let's take a very simple example:
* In my window1.xaml, i have a label
control named 'lblProduct'.
* In my window1.xaml.cs, i have a
public method called
CalculateProduct(Int Var1, Int
Var2). CalculateProduct will, as
you may have guessed, calculate the
product of the variables passed in.
I'd like to simply bind the ... | [
0.14670464396476746,
-0.19333843886852264,
0.3642028868198395,
-0.14590121805667877,
-0.33291012048721313,
0.005754663608968258,
-0.043920014053583145,
0.2815384268760681,
-0.20233337581157684,
-0.5730360150337219,
0.2259814292192459,
0.4131145179271698,
-0.29339566826820374,
0.18011875450... | |
While this is well and good, I don't feel the need to create a new class when I've already instantiated the one for my window. In addition, there may be other global variables that I'd like to take advantage of in my Window1 class.
Thanks for your time and help,
Abel.
Yes, there is a way. It's not pretty. You have to... | [
0.508617103099823,
0.009359855204820633,
-0.09911976754665375,
0.27049776911735535,
-0.11729622632265091,
-0.3577894866466522,
0.16892996430397034,
0.04823139309883118,
-0.29969435930252075,
-0.6454951167106628,
-0.07452548295259476,
0.3937511146068573,
-0.2834205627441406,
0.2854497134685... | |
not sure this will help you, but I ran into something similar where I was trying to generate XAML dynamically with XSLT. My solution worked, kind of...well, not really for what I was trying to do. But maybe it will help you.
As I said, you have to declare the xmlns in your page tag, like so:
```
<Page x:Class="WpfBro... | [
0.1922726035118103,
-0.029627790674567223,
0.5382050275802612,
-0.0035712108947336674,
-0.08452858030796051,
-0.3015201687812805,
0.048780057579278946,
-0.23182883858680725,
-0.49032869935035706,
-0.39016109704971313,
-0.09000102430582047,
0.6065645217895508,
-0.3391152024269104,
-0.044230... | |
CommandHandlers
{
private static System.Windows.Input.RoutedUICommand _submitCommand;
static CommandHandlers()
{
_submitCommand = new System.Windows.Input.RoutedUICommand("Submit", "SubmitCommand", typeof(CommandHandlers));
}
public static void BindCommandsToPag... | [
-0.08576586842536926,
-0.24064233899116516,
0.638430655002594,
-0.1373409777879715,
-0.14415422081947327,
0.3185076117515564,
0.18694329261779785,
-0.39171871542930603,
-0.26236245036125183,
-0.5133802890777588,
-0.37696391344070435,
0.49687474966049194,
-0.5938472747802734,
0.278320491313... | |
}
public static System.Windows.Input.RoutedUICommand SubmitCommand
{
get { return _submitCommand; }
}
public static void SubmitContact_Executed(object sender, System.Windows.Input.ExecutedRoutedEventArgs e)
{
...do stuff...
}
public stat... | [
0.2259100079536438,
-0.2260410636663437,
0.3731653094291687,
0.19109340012073517,
-0.02123146876692772,
0.2274063378572464,
0.3701857626438141,
-0.09703779965639114,
-0.20421937108039856,
-0.4773731231689453,
-0.5214359164237976,
0.40772512555122375,
-0.5056250691413879,
0.2152441293001175... | |
e)
{
if (e.Source is System.Windows.Controls.Button)
e.CanExecute = true;
else
e.CanExecute = false;
}
}
}
```
The nasty part is that, so far as I've found, the only way to map things back | [
0.14215849339962006,
0.010335758328437805,
0.5921832323074341,
0.07555267214775085,
0.19849637150764465,
-0.11677896976470947,
0.4415437877178192,
0.09169462323188782,
0.030908526852726936,
-0.7170342803001404,
0.02316659316420555,
0.40562641620635986,
-0.3963925540447235,
0.33350685238838... | |
to Page1.xaml is to cast the sender object and dig through the UI elements of the Page, similar to how you would dig through the DOM on a web page. I had some success with this, but certainly don't pretend to be an expert.
The last thing you have to do is wire up your control in the Page1.xaml.cs. In the XAML, you do ... | [
0.18584845960140228,
0.22993440926074982,
0.36976370215415955,
-0.10842756181955338,
-0.036613401025533676,
-0.27653953433036804,
0.483004093170166,
-0.17380696535110474,
-0.12048335373401642,
-0.6824859976768494,
-0.16385193169116974,
0.3334329426288605,
-0.5107299089431763,
0.10156227648... | |
I have this as Main
```
int[] M ={ 10, 2, 30, 4, 50, 6, 7, 80 };
MyMath.Reverse(M);
for (int i = 0; i < M.Length; i++)
Console.WriteLine(M[i].ToString() + ", ");
```
---
After I created the class MyMath I made the Reverse method
```
public int Reverse(Array M)
{
int len = M.Length;
for (int i ... | [
-0.2392803579568863,
0.03540898859500885,
0.5485698580741882,
-0.6073517799377441,
0.04653593525290489,
0.5791447162628174,
0.4629645347595215,
-0.4371997117996216,
0.03903404623270035,
-0.2720227837562561,
-0.07376590371131897,
0.4032249450683594,
-0.36418551206588745,
0.30350247025489807... | |
M[len - i - 1] = temp;
}
}
```
but I'm sure it's wrong because it's not working :-) so do you have a different code to write in the reverse method?
note: I don't want to use the built in Reverse in the Array class
---
yes guys when i used the built in reverse method i got this error
Process is... | [
-0.2216574251651764,
0.1134529560804367,
0.07200931012630463,
-0.42220476269721985,
-0.0767916589975357,
0.38038456439971924,
0.5225025415420532,
-0.2646530866622925,
-0.2423086166381836,
-0.1641540378332138,
0.2682974338531494,
0.6387166380882263,
-0.4501535892486572,
0.157796248793602,
... | |
own reverse method and there i got stuck
Working from your
```
public static int Reverse(Array M)
{
return Reverse(M);
}
```
You have 2 problems.
1. Reverse(M) looks like the same function that you're in, so you're calling your new function, which calls itself, which calls itself, etc., resulting in the stack ... | [
-0.2928837239742279,
0.045388370752334595,
0.23129159212112427,
-0.3985739052295685,
-0.1970616728067398,
0.40591204166412354,
0.389420747756958,
-0.30804675817489624,
-0.07627629488706589,
-0.5092778205871582,
0.35368266701698303,
0.5073118209838867,
-0.6332579255104065,
0.240132182836532... | |
Does anyone have any experience of developing external tools for SSMS 2005.
Ideally I would like to be able to interact with the query windows directly, for example, taking the query text from the window to perform some processing on it.
Any pointers in the right direction would be great.
Thanks in advance
<http://... | [
-0.2593969404697418,
0.010280421935021877,
0.40385180711746216,
0.12137265503406525,
-0.326299786567688,
-0.17582829296588898,
0.15004141628742218,
-0.2863891124725342,
-0.22064025700092316,
-0.5190579891204834,
0.22092299163341522,
0.5467400550842285,
0.031234916299581528,
-0.267002016305... | |
release of Visual Studio, you
> must have one of the following
> versions of Visual Studio:
>
>
>
> > Visual Studio 2005 Tools for Office (this is a completely separate
> > edition of Visual Studio for purchase;
> > it is not a free download).
> >
> >
> > One of the "Team System" versions of Visual Studio 2005... | [
-0.042325813323259354,
-0.09714656323194504,
0.5306966304779053,
-0.016934748739004135,
-0.2350224256515503,
-0.056106239557266235,
0.17799919843673706,
0.007268574088811874,
-0.13153985142707825,
-0.5838913321495056,
-0.21250511705875397,
0.5731002688407898,
-0.2064216285943985,
-0.173126... | |
2008 Professional, as well as
> the "Team System" versions. This
> includes add-in and document-level
> projects for both Office 2003 and the
> 2007 Microsoft Office system. | [
-0.5323904752731323,
0.14658035337924957,
0.13092917203903198,
0.09993503987789154,
-0.16732516884803772,
0.07198260724544525,
0.3336912989616394,
-0.199270099401474,
0.11225131899118423,
-0.26367586851119995,
-0.06334992498159409,
0.7877358198165894,
0.04188578203320503,
-0.42883107066154... | |
I'm trying to read the contents of a text file, in this case a list of computer names (Computer1, computer2 etc,) and I thought that StreamReader would be what you would use but when I do the following:
```
StreamReader arrComputer = new StreamReader(FileDialog.filename)();
```
I got this exception:
```
The type or... | [
0.20540983974933624,
0.09946926683187485,
0.18497490882873535,
-0.038168542087078094,
-0.033648621290922165,
-0.13596518337726593,
0.10172981768846512,
0.1991650015115738,
-0.07537848502397537,
-0.5731149315834045,
-0.055865563452243805,
0.5446389317512512,
-0.5138155817985535,
0.111785672... | |
name:
```
System.IO.StreamReader arrComputer = new System.IO.StreamReader(FileDialog.filename);
``` | [
-0.06791466474533081,
-0.26912280917167664,
0.5352850556373596,
0.019003700464963913,
0.12548840045928955,
0.2580340504646301,
-0.07670016586780548,
0.1715223789215088,
-0.15612594783306122,
-0.7481846213340759,
-0.3103247284889221,
0.41363221406936646,
-0.3851913511753082,
0.6459080576896... | |
What is the most elegant way of bubble-sorting in F#?
**UPDATE**
As pointed out in one of the answers, bubble sorting isn't efficient in a functional language to begin with. A humourously-cynical commenter also pointed out that bubble sorting is only appropriate when the list is small and it's almost sorted anyway.
... | [
-0.1405138224363327,
-0.029565313830971718,
0.4389355778694153,
0.04096149280667305,
0.004657465033233166,
0.04030429571866989,
-0.1425461620092392,
-0.07987308502197266,
0.0072638532146811485,
-0.7121123671531677,
-0.03416810557246208,
0.3605925440788269,
-0.3601045608520508,
-0.489780187... | |
list many times (and this can't be really implemented very efficiently for immutable lists).
Anyway, the example from Erlang can be rewritten to F# like this:
```
let sort l =
let rec sortUtil acc rev l =
match l, rev with
| [], true -> acc |> List.rev
| [], false -> acc |> List.rev |> sortUtil [] true... | [
-0.2150801718235016,
-0.2899898886680603,
1.0034204721450806,
-0.1355804055929184,
-0.2739547789096832,
-0.134232759475708,
-0.02321625128388405,
-0.3707449734210968,
-0.4859330952167511,
-0.6211995482444763,
-0.16153983771800995,
0.5831316113471985,
-0.5214880108833313,
-0.022268364205956... | |
other side, you can implement the same algorithm using mutable arrays. This will be more efficient and in F# you can work with arrays too if you want. The following function creates a copy of the array and sorts it.
```
let sort (arr:'a[]) =
let arr = arr |> Array.copy
let swap i j = let tmp = arr.[i] in arr.[i]... | [
-0.03944585099816322,
-0.1587819904088974,
0.30119165778160095,
-0.32565221190452576,
-0.07631416618824005,
0.1593548208475113,
0.010459532029926777,
-0.5772269368171692,
-0.3702232837677002,
-0.5218048691749573,
0.06896200776100159,
0.4356246590614319,
-0.42440715432167053,
0.022464776411... | |
then swap (j-1) j
arr
```
Tomas | [
-0.10604427009820938,
0.139308363199234,
-0.09911952912807465,
-0.18207190930843353,
-0.08106682449579239,
0.0921243280172348,
0.20155128836631775,
-0.3592795133590698,
-0.285226047039032,
0.06598580628633499,
-0.6240829229354858,
0.45642325282096863,
-0.4833649694919586,
0.015679940581321... | |
Is it possible to deploy a website using `git push`? I have a hunch it has something to do with using [git hooks](http://www.git-scm.com/book/en/v2/Customizing-Git-Git-Hooks) to perform a `git reset --hard` on the server side, but how would I go about accomplishing this?
I found [this script](https://stackoverflow.com/... | [
0.15831361711025238,
0.015536155551671982,
0.4769938290119171,
-0.1357114315032959,
0.003200710518285632,
-0.09080140292644501,
0.22529731690883636,
-0.3465048372745514,
-0.32609474658966064,
-0.5311044454574585,
-0.01128237135708332,
0.5016623139381409,
-0.1869649887084961,
-0.24592165648... | |
access to the file (again, on the server):
```
chmod +x .git/hooks/post-update
```
5. Now, just locally push to your web server and it should automatically update the working copy:
```
git push production
``` | [
0.2612832188606262,
-0.028180893510580063,
0.74922114610672,
-0.10390795767307281,
0.06653114408254623,
-0.20636804401874542,
0.03907713294029236,
0.1108751893043518,
-0.18562519550323486,
-0.8806043267250061,
-0.4987773597240448,
0.3513335883617401,
-0.14658521115779877,
0.096330374479293... | |
How can I extract the list of colors in the System.Drawing.Color struct into a collection or array?
Is there a more efficient way of getting a collection of colors than using this struct as a base?
So you'd do:
```
string[] colors = Enum.GetNames(typeof(System.Drawing.KnownColor));
```
... to get an array of all th... | [
0.08293870091438293,
-0.1678323894739151,
0.45613983273506165,
0.1398405283689499,
-0.11074187606573105,
0.02751828357577324,
-0.0015064984327182174,
-0.5424596071243286,
-0.1597045511007309,
-0.5864217281341553,
0.2370787262916565,
0.4242769479751587,
-0.2726472318172455,
0.05532714724540... | |
BindingFlags.Public);
foreach (System.Reflection.PropertyInfo c in propInfoList) {
Console.WriteLine(c.Name);
}
```
This writes out all the colors, but you could easily tailor it to add the color names to a list.
Check out this Code Project project on [building a color chart](http://www.codeproject.com/KB/cs/ref... | [
0.4202578067779541,
-0.028491083532571793,
0.5762963891029358,
-0.3174894154071808,
-0.11373144388198853,
-0.254177987575531,
0.3710225224494934,
-0.6509169340133667,
-0.15473014116287231,
-0.6246826648712158,
-0.13767750561237335,
0.44476377964019775,
-0.4818056523799896,
0.13021825253963... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.