text stringlengths 0 30.5k | title stringclasses 1
value | embeddings listlengths 768 768 |
|---|---|---|
/// <param name="hive"></param>
/// <param name="key"></param>
static void ParseKey(string keyWithHive, out string hive, out string key)
{
if (keyWithHive == null)
{
throw new ArgumentNullException("keyWithHive");
} | [
-0.0651652067899704,
-0.13898342847824097,
0.18243899941444397,
-0.1430537849664688,
0.037480276077985764,
0.41092219948768616,
0.5379540920257568,
-0.7811510562896729,
-0.09425746649503708,
-0.3066565990447998,
-0.3037899136543274,
0.2821396291255951,
-0.5341655611991882,
0.24597114324569... | |
if (keyWithHive.StartsWith("HKEY_LOCAL_MACHINE\\"))
{
hive = "HKLM";
key = keyWithHive.Substring(19);
}
else if (keyWithHive.StartsWith("HKEY_CLASSES_ROOT\\"))
{ | [
-0.026442132890224457,
-0.3310976028442383,
0.11184686422348022,
0.03801395744085312,
0.49317699670791626,
-0.2396697849035263,
0.5222085118293762,
0.044969040900468826,
-0.27995339035987854,
-0.5713136792182922,
-0.3716919720172882,
0.46242719888687134,
-0.3483661115169525,
0.232846304774... | |
hive = "HKCR";
key = keyWithHive.Substring(18);
}
else if (keyWithHive.StartsWith("HKEY_USERS\\"))
{
hive = "HKU"; | [
0.24001619219779968,
-0.0806756541132927,
0.23455087840557098,
-0.2100629061460495,
0.3937017321586609,
0.003295942908152938,
0.26731905341148376,
0.03537508472800255,
-0.15176993608474731,
-0.5842388272285461,
-0.2687651515007019,
0.32818758487701416,
-0.4346970021724701,
0.26861196756362... | |
key = keyWithHive.Substring(11);
}
else if (keyWithHive.StartsWith("HKEY_CURRENT_USER\\"))
{
hive = "HKCU";
key = keyWithHive.Substring(18);
} | [
0.14487868547439575,
-0.1598716527223587,
0.4083283245563507,
-0.18009525537490845,
0.5014250874519348,
-0.14862693846225739,
0.2914603054523468,
-0.016985582187771797,
-0.20259693264961243,
-0.36946141719818115,
-0.10643794387578964,
0.5092848539352417,
-0.3300000727176666,
0.225259080529... | |
else
{
throw new ArgumentException();
}
}
/// <summary>
/// Write a WiX RegistryValue element for the specified key, name, and value
/// </summary> | [
0.03866838663816452,
-0.09336570650339127,
0.0753936618566513,
-0.09969063848257065,
0.2596755623817444,
0.06388208270072937,
0.22513273358345032,
-0.20581355690956116,
0.210829496383667,
-0.6620041728019714,
-0.06275171786546707,
0.506844162940979,
-0.1458418071269989,
0.07881016284227371... | |
/// <param name="writer"></param>
/// <param name="key"></param>
/// <param name="name"></param>
/// <param name="value"></param>
static void WriteRegistryValue(XmlWriter writer, string key, string name, string value)
{
if (writer == null)
{ | [
-0.13542653620243073,
0.027512837201356888,
0.40626591444015503,
-0.034921761602163315,
-0.11691294610500336,
0.39876583218574524,
0.30001699924468994,
-0.6377385854721069,
0.048584502190351486,
-0.2570526897907257,
-0.10512298345565796,
0.33990684151649475,
-0.4267588257789612,
0.20255188... | |
throw new ArgumentNullException("writer");
}
if (key == null)
{
throw new ArgumentNullException("key");
}
if (value == null) | [
-0.37646350264549255,
-0.17358970642089844,
0.16582544147968292,
-0.3496393859386444,
0.06676651537418365,
0.1645471453666687,
0.38136520981788635,
-0.28931862115859985,
0.09634007513523102,
-0.43661004304885864,
-0.31105101108551025,
0.7332858443260193,
-0.24306458234786987,
0.27435052394... | |
{
throw new ArgumentNullException("value");
}
string hive;
string keyPart;
ParseKey(key, out hive, out keyPart);
writer.WriteStartElement("RegistryValue"); | [
-0.19360937178134918,
-0.026217849925160408,
-0.019666370004415512,
-0.3845936059951782,
0.3354015648365021,
0.11325713992118835,
0.5810651779174805,
-0.17434820532798767,
0.18863217532634735,
-0.5893784761428833,
-0.2791067063808441,
0.6652054786682129,
-0.4974139928817749,
0.444048762321... | |
writer.WriteAttributeString("Root", hive);
writer.WriteAttributeString("Key", keyPart);
if (!String.IsNullOrEmpty(name))
{
writer.WriteAttributeString("Name", name);
}
writer.WriteAttributeString("Value", value);
writer.WriteAttribu... | [
-0.3539298176765442,
-0.012440684251487255,
0.31053629517555237,
-0.35258302092552185,
0.3467943072319031,
-0.0962221771478653,
0.7298240065574646,
-0.06233322620391846,
0.13798265159130096,
-0.47994086146354675,
-0.2682921886444092,
0.5431585907936096,
-0.5079576373100281,
0.3131650984287... | |
writer.WriteAttributeString("Action", "write");
writer.WriteEndElement();
}
/// <summary>
/// Convert a .reg file into an XML document
/// </summary>
/// <param name="inputReader"></param>
/// <param name="xml"></param>
static void RegistryFileToWix(... | [
-0.001968132331967354,
0.05177747830748558,
0.5935232639312744,
0.11066515743732452,
-0.04149121418595314,
0.35871586203575134,
0.1323307752609253,
-0.5826612710952759,
-0.1000845655798912,
-0.645319402217865,
-0.149593785405159,
0.3979843556880951,
-0.3769349753856659,
0.02728980965912342... | |
{
Regex regexKey = new Regex("^\\[([^\\]]+)\\]$");
Regex regexValue = new Regex("^\"([^\"]+)\"=\"([^\"]*)\"$");
Regex regexDefaultValue = new Regex("@=\"([^\"]+)\"$");
string currentKey = null;
string line;
while ((line = inputReader.ReadLine()) ... | [
-0.625952959060669,
-0.5663995146751404,
0.6934843063354492,
-0.18746203184127808,
0.2306804656982422,
0.43333014845848083,
0.20937521755695343,
-0.3228735625743866,
0.14369069039821625,
-0.21533828973770142,
-0.48874133825302124,
0.5459733605384827,
-0.44477394223213196,
0.336089491844177... | |
{
line = line.Trim();
Match match = regexKey.Match(line);
if (match.Success)
{ | [
-0.4665217697620392,
-0.7530703544616699,
0.6373339295387268,
-0.25935378670692444,
0.6319631338119507,
0.15558840334415436,
0.32586416602134705,
-0.32165777683258057,
0.3145695626735687,
-0.2576480507850647,
-0.6087477803230286,
0.5196371674537659,
-0.19559834897518158,
0.0401848517358303... | |
//key track of the current key
currentKey = match.Groups[1].Value;
}
else
{ | [
-0.08837362378835678,
-0.1580595225095749,
0.09087973088026047,
-0.21850374341011047,
0.42827343940734863,
-0.21011008322238922,
0.01060145627707243,
-0.24111458659172058,
0.08114989846944809,
-0.06884214282035828,
-0.17137466371059418,
0.751617431640625,
-0.20994974672794342,
-0.006632469... | |
//if we have a current key
if (currentKey != null)
{
//see if this is an acceptable name=value pair | [
-0.039185211062431335,
-0.09592121839523315,
0.14314380288124084,
-0.1494191735982895,
0.25278982520103455,
-0.16833090782165527,
0.2374672293663025,
-0.21542368829250336,
0.09363806247711182,
-0.18551155924797058,
-0.15965288877487183,
0.3313959240913391,
-0.09018366783857346,
0.303723156... | |
match = regexValue.Match(line);
if (match.Success)
{
WriteRegistryValue(xml, currentKey, match.Groups[1].Value, match.Groups[2].Value); | [
-0.36828139424324036,
-0.44014132022857666,
0.5697265267372131,
-0.27098482847213745,
0.19413979351520538,
-0.012324213050305843,
0.34153544902801514,
-0.2755903899669647,
0.3033654987812042,
-0.4666002094745636,
-0.43654441833496094,
0.5320262312889099,
-0.335735559463501,
0.1399346292018... | |
}
else
{
//see if this is an acceptable | [
0.2823663651943207,
0.1213047057390213,
0.04147474467754364,
0.004560787696391344,
0.3068627715110779,
-0.2147463858127594,
0.31084883213043213,
0.21956615149974823,
0.10904239118099213,
-0.34992149472236633,
-0.0546494759619236,
0.5242580771446228,
0.04221007600426674,
-0.1649076193571090... | |
default value (starts with @)
match = regexDefaultValue.Match(line);
if (match.Success)
{ | [
-0.33544012904167175,
-0.5806623697280884,
0.5814782977104187,
-0.2298707365989685,
0.40246495604515076,
-0.03895749896764755,
0.4132581055164337,
-0.12927627563476562,
0.23019248247146606,
-0.2420244663953781,
-0.3337765634059906,
0.6993792057037354,
-0.32546988129615784,
0.18146765232086... | |
WriteRegistryValue(xml, currentKey, (string)null, match.Groups[1].Value);
}
}
} | [
-0.21529550850391388,
-0.18074582517147064,
0.24732837080955505,
-0.03768733888864517,
0.03664601221680641,
0.1433381289243698,
0.4887707233428955,
-0.03731629252433777,
0.18591031432151794,
-0.7709090113639832,
-0.1671893447637558,
0.6217818260192871,
-0.3514843285083771,
0.30671510100364... | |
}
}
}
/// <summary>
/// Convert a .reg file into a .wsx file
/// </summary>
/// <param name="inputPath"></param>
/// <param name="outputPath"></param>
static void RegistryFileToWix(string inputPath, | [
0.13338154554367065,
-0.13824880123138428,
0.48818936944007874,
0.0021172473207116127,
0.07735523581504822,
0.4092835485935211,
0.1449493169784546,
-0.5594450831413269,
-0.2416013926267624,
-0.6066210269927979,
0.07236560434103012,
0.32102730870246887,
-0.7180071473121643,
0.09063815325498... | |
string outputPath)
{
using (StreamReader reader = new StreamReader(inputPath))
{
using (XmlTextWriter writer = new XmlTextWriter(outputPath, Encoding.UTF8))
{
writer.Formatting = Formatting.Indented; | [
-0.1745203584432602,
-0.35339707136154175,
0.6998302340507507,
-0.24179910123348236,
0.16062632203102112,
0.21418997645378113,
0.14448855817317963,
-0.25120148062705994,
0.08949626237154007,
-0.6129115223884583,
-0.3484653830528259,
0.6183019280433655,
-0.5044324994087219,
0.19003577530384... | |
writer.Indentation = 3;
writer.IndentChar = ' ';
writer.WriteStartDocument();
writer.WriteStartElement("Component"); | [
-0.26270240545272827,
0.20674173533916473,
0.23481301963329315,
-0.2067689150571823,
0.26593151688575745,
0.30342525243759155,
0.3638934791088104,
-0.3280981481075287,
-0.08284714072942734,
-0.4706622362136841,
-0.3894914388656616,
0.2904531955718994,
-0.13977041840553284,
0.19541597366333... | |
RegistryFileToWix(reader, writer);
writer.WriteEndElement();
writer.WriteEndDocument();
}
}
}
static void Main(string[] args)
{ | [
-0.12892404198646545,
0.06876006722450256,
0.6299514770507812,
-0.1524723619222641,
0.500702440738678,
0.1565445214509964,
0.29381293058395386,
0.053587839007377625,
0.0871838629245758,
-0.5836865305900574,
-0.1455296277999878,
0.47546693682670593,
-0.5113999247550964,
0.5579610466957092,
... | |
if (args.Length != 2)
{
PrintUsage();
return;
}
RegistryFileToWix(args[0], args[1]);
}
}
}
``` | [
0.042138662189245224,
-0.12717761099338531,
0.5889954566955566,
-0.3790900707244873,
0.26538780331611633,
0.022201456129550934,
0.3106301426887512,
-0.305324524641037,
-0.18458107113838196,
-0.4269055128097534,
-0.19444651901721954,
0.6843498945236206,
-0.43198496103286743,
0.2955603003501... | |
I'm trying to change default firstDayOfWeek for java.util.Calendar from SUNDAY to MONDAY. Is it possible to achieve this through JVM configuration instead of adding this piece of code?
```
cal.setFirstDayOfWeek(Calendar.MONDAY);
```
The first day of the week is derived from the current locale. If you don't set the lo... | [
0.2274518758058548,
-0.07377681136131287,
0.716667652130127,
-0.2722263038158417,
0.05405489727854729,
0.09939398616552353,
0.39903080463409424,
0.0737742930650711,
-0.32857781648635864,
-0.6458510160446167,
-0.1486063301563263,
0.5253002047538757,
-0.3763170540332794,
0.22215688228607178,... | |
language/country:
* *`-Duser.language=en -Duser.country=US`* -> **`en_US: 1`** *(Sunday)*
* *`-Duser.language=en -Duser.country=GB`* -> **`en_GB: 2`** *(Monday)*
Don't forget that this could change other behavio(u)r too. | [
0.10735947638750076,
0.33483371138572693,
0.21143196523189545,
-0.5478043556213379,
-0.08143921196460724,
0.3801288604736328,
0.8461403846740723,
0.3808642327785492,
-0.14128562808036804,
-0.663364827632904,
-0.281926691532135,
0.8014048933982849,
-0.14656394720077515,
0.08312161266803741,... | |
There are two schools of thought on how to best extend, enhance, and reuse code in an object-oriented system:
1. Inheritance: extend the functionality of a class by creating a subclass. Override superclass members in the subclasses to provide new functionality. Make methods abstract/virtual to force subclasses to "fil... | [
0.13241207599639893,
-0.20203332602977753,
-0.3797466456890106,
0.36376774311065674,
-0.19762054085731506,
0.07245124131441116,
0.17999334633350372,
-0.4084172546863556,
-0.1406417042016983,
-0.4681604206562042,
-0.04032040759921074,
0.2341592013835907,
-0.4222135841846466,
0.2334289848804... | |
alternatives?
I see this debate come up on a regular basis, but I don't think it's been asked on
Stack Overflow yet (though there is some related discussion). There's also a surprising lack of good Google results for it.
It's not a matter of which is the best, but of when to use what.
In the 'normal' cases a simple ... | [
0.028709828853607178,
-0.20496217906475067,
0.007436314597725868,
0.286918967962265,
-0.1525794267654419,
0.4870259463787079,
0.16540899872779846,
-0.4572727084159851,
-0.46576476097106934,
-0.6465513706207275,
0.2079317718744278,
0.6210682988166809,
-0.2417551875114441,
-0.069141879677772... | |
the original class. Use aggregation. The new class has now the original class as a member.
However, there is a big gray area. So we need several other tricks.
* If we have used inheritance (or we plan to use it) but we only use part of the interface, or we are forced to override a lot of functionality to keep the cor... | [
0.3650960326194763,
-0.12744826078414917,
-0.04501837491989136,
0.40235280990600586,
-0.39708593487739563,
-0.3523646891117096,
0.26910436153411865,
-0.0806150883436203,
-0.20975911617279053,
-0.5875272154808044,
0.14237166941165924,
0.20826581120491028,
-0.4958057403564453,
0.369069486856... | |
functionality. Then we have a smell that points in the direction of inheritance.
To cut it short. We should use aggregation if part of the interface is not used or has to be changed to avoid an illogical situation. We only need to use inheritance, if we need almost all of the functionality without major changes. And w... | [
0.2256084382534027,
-0.04594062268733978,
-0.014562917873263359,
0.2692176103591919,
-0.13857004046440125,
-0.25869444012641907,
0.22950884699821472,
-0.5017340183258057,
-0.41345617175102234,
-0.5764702558517456,
-0.12140127271413803,
0.5552235245704651,
-0.547648012638092,
0.066107414662... | |
inherit from the root class. But you should take care with this, not to create an illogical separation.
Lets add an example. We have a class 'Dog' with methods: 'Eat', 'Walk', 'Bark', 'Play'.
```
class Dog
Eat;
Walk;
Bark;
Play;
end;
```
We now need a class 'Cat', that needs 'Eat', 'Walk', 'Purr', and 'Pla... | [
0.2762432098388672,
-0.10752315819263458,
-0.138412207365036,
0.04002297669649124,
-0.08909064531326294,
-0.2147628515958786,
0.3681491017341614,
-0.2453308254480362,
-0.09200236201286316,
-0.6442285776138306,
-0.27910730242729187,
0.41007623076438904,
-0.3542444109916687,
0.26267713308334... | |
method so that it does nothing.
```
class Cat is Dog
Purr;
Bark = null;
end;
```
Ok, this works, but it smells bad. So lets try an aggregation:
```
class Cat
has Dog;
Eat = Dog.Eat;
Walk = Dog.Walk;
Play = Dog.Play;
Purr;
end;
```
Ok, this is nice. This cat does not bark anymore, not even silent. B... | [
-0.29139816761016846,
-0.10589828342199326,
0.12120302021503448,
-0.011270279064774513,
-0.2367541790008545,
0.23125147819519043,
0.5527872443199158,
-0.4362083375453949,
-0.32050901651382446,
-0.6670053601264954,
-0.031091364100575447,
0.14161384105682373,
-0.8058130145072937,
0.288397282... | |
are at the same level. We can even introduce other pets to extend the model. Unless it is a fish, or something that does not walk. In that case we again need to refactor. But that is something for an other time. | [
0.605604350566864,
-0.23569029569625854,
0.2896193861961365,
0.5133278369903564,
0.33419138193130493,
0.0036665836814790964,
0.20692114531993866,
-0.06445995718240738,
-0.21707329154014587,
-0.7414038777351379,
0.1842290461063385,
0.5903713703155518,
-0.2971760332584381,
0.0421147421002388... | |
I've got a Page class in my .edmx ADO.NET Entity Data Model file with with Parent and Children properties. It's for a hierarchy of Pages.
*removed dead ImageShack link - ADO.NET Entity Framework Hierarchical Page Class*
This is handled in my SQL database with a ParentId foreign key in the Page table bound to the Id p... | [
-0.056768566370010376,
0.5002551078796387,
0.5341407656669617,
-0.00008604254981037229,
-0.3670025169849396,
-0.11797298491001129,
0.11475817114114761,
-0.11131352186203003,
-0.18152929842472076,
-0.7052291035652161,
0.10401371866464615,
0.14136400818824768,
-0.22994394600391388,
0.3280503... | |
Title="Window1" Height="300" Width="300" Name="Window1">
<Grid>
<TreeView Margin="12" Name="TreeViewPages" ItemsSource="{Binding}" TreeViewItem.Expanded="TreeViewPages_Expanded">
<TreeView.Resources>
<HierarchicalDataTemplate DataType="{x:Type local:Page}" ItemsSource="{Binding C... | [
-0.08869437873363495,
-0.2311067283153534,
0.5352205038070679,
0.24508987367153168,
-0.25206616520881653,
-0.016013389453291893,
0.06907148659229279,
-0.26249104738235474,
-0.2228878289461136,
-0.6362767219543457,
-0.2357921153306961,
0.2087107002735138,
0.150920569896698,
0.09134291112422... | |
</TreeView.Resources>
</TreeView>
</Grid>
</Window>
```
Here's my Visual Basic code...
```vb
Class Window1
Private Sub Window1_Loaded(ByVal sender As System.Object, ByVal e As System.Windows.RoutedEventArgs) Handles MyBase.Loaded
Dim db As New PageEntities
Dim RootPage = From p In db... | [
-0.0015459980349987745,
0.1216195747256279,
0.6448510885238647,
-0.14765961468219757,
-0.06591769307851791,
0.3802298605442047,
0.3505537807941437,
-0.17735721170902252,
-0.018554024398326874,
-0.861022412776947,
-0.19922000169754028,
0.25240397453308105,
-0.08147422969341278,
0.2407787442... | |
Select p
TreeViewPages.ItemsSource = RootPage
End Sub
Private Sub TreeViewPages_Expanded(ByVal sender As System.Object, ByVal e As System.Windows.RoutedEventArgs)
Dim ExpandedTreeViewItem As TreeViewItem = DirectCast(e.OriginalSource, TreeViewItem)
Dim PageId As Guid = DirectCast(Expand... | [
-0.07884815335273743,
-0.31901466846466064,
0.7632664442062378,
0.021217597648501396,
-0.2036299705505371,
0.3260253965854645,
0.3478671908378601,
-0.5266939401626587,
-0.20371688902378082,
-0.6396011114120483,
-0.6271213293075562,
0.2346741408109665,
-0.2773532271385193,
0.456553161144256... | |
Where p.Parent.Id = PageId _
Select p
ExpandedTreeViewItem.ItemsSource = ChildPages
End Sub
End Class
```
When the window loads, the root node and its children are queried from the database and inserted into the tree.
Each time a node is expanded, that node's children and grandch... | [
-0.15924887359142303,
-0.19213880598545074,
0.4659194350242615,
0.059144482016563416,
0.2922743558883667,
0.3565972149372101,
-0.054427795112133026,
0.001241933205164969,
-0.22432956099510193,
-0.8095057010650635,
-0.4670262038707733,
-0.1492987424135208,
-0.04807228967547417,
0.5350670814... | |
database and inserted into the tree. | [
0.016512559726834297,
-0.004994487389922142,
0.00023490840976592153,
0.2578720152378082,
0.3598741292953491,
-0.04797692969441414,
-0.1491674929857254,
-0.10057094693183899,
-0.15666818618774414,
-0.5520095229148865,
-0.2117779701948166,
-0.06095125526189804,
-0.1301582008600235,
0.2764343... | |
I'm trying to build a HQL that can left join values from a collection, in order to give me the chance of checking "is null" on it.
Taken from the example from hibernate manual:
```
from Cat as cat
left join cat.kittens as kitten
with kitten.bodyWeight > 10.0
```
doesn't seem to work in NHibernate, sinc... | [
0.2645798325538635,
-0.08029793202877045,
0.11719368398189545,
-0.3229221701622009,
-0.49873438477516174,
-0.08713363856077194,
0.32394006848335266,
-0.26911452412605286,
-0.205803781747818,
-0.5645515322685242,
0.06528861075639725,
0.06116810441017151,
-0.3419109284877777,
0.1420454233884... | |
not supported in NHibernate. It was [first requested in 2005](http://jira.nhibernate.org/browse/NH-514) and is by far the most popular requested feature. | [
-0.05577158182859421,
-0.20465576648712158,
0.7230157256126404,
-0.08168230950832367,
-0.08592229336500168,
-0.08256422728300095,
0.1965741515159607,
0.25678831338882446,
-0.22702544927597046,
-0.3748304843902588,
-0.2837982475757599,
0.5022683143615723,
-0.32176968455314636,
0.44483473896... | |
In Python map() works on any data that follows the sequence protocol. It does The Right Thing^TM whether I feed it a string or a list or even a tuple.
Can't I have my cake in OCaml too? Do I really have no other choice but to look at the collection type I'm using and find a corresponding List.map or an Array.map or a ... | [
0.30525490641593933,
0.12594394385814667,
-0.04959602281451225,
-0.2928731143474579,
-0.2309999167919159,
-0.11402635276317596,
0.14127115905284882,
-0.13741737604141235,
-0.5960723757743835,
-0.5737180709838867,
-0.154998779296875,
0.40528184175491333,
-0.38387060165405273,
-0.22449959814... | |
[Extlib](http://ocaml-extlib.googlecode.com/)). `Enum` defines maps and folds over `Enum.t`; you just have to use a conversion to/from `Enum.t` for your datatype. The conversions can be fairly light-weight, because `Enum.t` is lazy.
What you really want is Haskell-style [type classes](http://en.wikipedia.org/wiki/Type... | [
0.1518588662147522,
-0.11435555666685104,
0.195465549826622,
0.047619640827178955,
-0.2001325637102127,
-0.28639233112335205,
0.030733667314052582,
-0.008674138225615025,
-0.20462551712989807,
-0.9665321111679077,
-0.3401950001716614,
0.2117844521999359,
-0.66227787733078,
-0.0486334301531... | |
I have two html pages, when you click on something on the first html, it will go to the second one. What I want to do is to show text according to what you clicked on the first html. different texts are wrapped with different ids. Here's how I wrote:
```
<a href="secondpage.html#one"></a>
<a href="secondpage.html#two"... | [
0.1796686053276062,
0.04127101972699165,
0.33787068724632263,
-0.3151645064353943,
-0.6489566564559937,
0.19632187485694885,
0.24447394907474518,
-0.2640841603279114,
-0.08978412300348282,
-0.9868618249893188,
0.27968353033065796,
0.42310547828674316,
-0.4473114609718323,
0.069459021091461... | |
I have a JS file to modify each id:
```
$("one").observe('click', function() {
$('Pic').writeAttribute('src',"picone.jpg");
$('Bio').update("texthere!");
});
```
Same for two and three.
Right now if I click on a button on the first page, it will always show
the text and pic for "one", no matter which button... | [
0.326340913772583,
-0.040181007236242294,
0.6157782673835754,
-0.22990797460079193,
0.037568364292383194,
0.06150960922241211,
0.11534100025892258,
-0.2695375382900238,
-0.14860965311527252,
-0.6887615323066711,
-0.04113731533288956,
0.5921050906181335,
-0.3361322581768036,
-0.051655687391... | |
$(location.hash).click();
});
```
attach ondomready-event to window. Fetch element with id=one (with jQuery this would be '#one', same as your location.hash would be, very handy in this case), trigger a click on it.
You might need to replace $(location.hash).click(); with $(location.hash).get(0).click() since jQuery... | [
-0.14806494116783142,
-0.36697113513946533,
0.441772997379303,
-0.0006718990625813603,
-0.06371016055345535,
-0.1963236778974533,
-0.0027544491458684206,
-0.15602312982082367,
-0.2527073919773102,
-0.6089473962783813,
-0.17772814631462097,
0.47226423025131226,
-0.39538779854774475,
0.03442... | |
show/hide content dynamically? Do it on the same page... | [
0.7038644552230835,
-0.13072702288627625,
-0.4070037305355072,
0.23820734024047852,
-0.05514077842235565,
-0.4579681158065796,
0.17946289479732513,
0.06608143448829651,
0.1267993152141571,
-0.5865923762321472,
-0.31610268354415894,
0.4203764498233795,
-0.25610876083374023,
0.05776666849851... | |
What combination of CSS or attributes are needed?
* Hide the actual control
* Made a DIV with the controls and styling you want on top of it
The button is not a standard HTML control.
See: <http://www.quirksmode.org/dom/inputfile.html> | [
0.08838491141796112,
-0.4316638112068176,
0.35969817638397217,
0.42178037762641907,
0.05768369883298874,
-0.06886305660009384,
0.15174302458763123,
-0.18394975364208221,
-0.2777026295661926,
-0.26112452149391174,
0.060000840574502945,
0.33552059531211853,
-0.3469056487083435,
-0.1817660033... | |
I have a website built using Asp.net and LinqToSql for Data Access. In a certain section of the site, LinqToSql produces a query that looks like this (from my dev machine):
```
select ...
from table1
left outer join table2 on table1 where ...
left outer join table3 on table2 where ...
```
Since the connection betwee... | [
0.1945333331823349,
0.23561903834342957,
0.5732126832008362,
0.0595075860619545,
-0.028923163190484047,
-0.14193524420261383,
0.1784188151359558,
-0.22043024003505707,
-0.18872421979904175,
-0.6904815435409546,
0.21673941612243652,
0.2538612484931946,
-0.08556824177503586,
0.25408124923706... | |
identical code in the same scenario, LinqToSql produces the following query:
```
select ...
from table1
left outer join table2 on table1 where ...
join table3 on table2 where ...
```
For some reason, it renders the join between table2 and table3 as an inner join, instead of an outer join. This results in zero record... | [
-0.06861420720815659,
0.022784098982810974,
0.4561936557292938,
-0.0427221842110157,
-0.27481698989868164,
-0.1485939621925354,
0.3508681356906891,
-0.5228113532066345,
-0.40835249423980713,
-0.5990641713142395,
0.2811923623085022,
0.6767309904098511,
-0.4316137135028839,
0.151127427816391... | |
would create different sql? How can I fix this? It seems to be something tied into the way that Linq and .Net is running on the server. However, I can't think of any way to confirm and fix this.
---
Linq Code (I am only including the parts that are relevant to the section where the sql changed):
```
from Import_Tabl... | [
0.13672392070293427,
0.14151562750339508,
0.41208070516586304,
-0.11773919314146042,
-0.13368310034275055,
-0.0826243981719017,
0.17962968349456787,
-0.3491784632205963,
-0.2260107845067978,
-0.7557364106178284,
0.06069327890872955,
0.5267361402511597,
-0.49177783727645874,
0.4039774239063... | |
If I comment out the line here that begins with "CheckedOutUser = ..." then it works on the server - so this is definitely the culprit.
Actual sql returned:
```
SELECT
(CASE WHEN NOT ([t0].[IsCheckedOut] = 1) THEN CONVERT(NVarChar(401),'--') ELSE ([t2].[FirstName] + ' ') + [t2].[LastName] END) AS [CheckedOutUser],... | [
-0.1294347494840622,
-0.1267727166414261,
0.5385812520980835,
-0.05127546191215515,
-0.1430552452802658,
0.07188877463340759,
0.5043856501579285,
-0.09290862828493118,
-0.1283106654882431,
-0.759191632270813,
-0.2889201045036316,
0.707929253578186,
-0.27824756503105164,
0.1530391424894333,... | |
the last line begins with "Inner"
**Update:** My solution is [below](https://stackoverflow.com/questions/269594/linqtosql-producing-different-sql-queries-on-different-machines-for-identical-c#275751)
I have checked the following:
1. Both use the same database
2. Both have the identical code
3. Both have the identical... | [
-0.014115420170128345,
0.05067654326558113,
0.67471843957901,
-0.22067536413669586,
-0.16539570689201355,
0.09679249674081802,
0.4368351399898529,
-0.15274280309677124,
-0.14396700263023376,
-0.5905753970146179,
0.05267791077494621,
0.5107570290565491,
-0.200984925031662,
0.105899915099143... | |
I've got an MS access database and I would need to create an SQL query that allows me to select all the not distinct entries in one column while still keeping all the values.
In this case more than ever an example is worth thousands of words:
Table:
```
A B C
1 x q
2 y w
3 y e
4 z r
5 z t
6 z y
```
*SQL magic*
Re... | [
0.09744241833686829,
0.34928858280181885,
0.4965703785419464,
-0.08425011485815048,
-0.17558439075946808,
0.06253606826066971,
0.2496107965707779,
-0.35990050435066223,
-0.3153610825538635,
-0.4663011431694031,
0.1306985318660736,
0.25842612981796265,
-0.2434420883655548,
0.404829025268554... | |
only list one row of B not the 2 or more that I need.
Any help?
Thanks.
```
Select B, C
From Table
Where B In
(Select B From Table
Group By B
Having Count(*) > 1)
``` | [
0.15876245498657227,
0.3971318006515503,
0.12573431432247162,
0.0045332154259085655,
0.03746414557099342,
0.22224202752113342,
-0.07784081250429153,
-0.0685933381319046,
-0.5256698727607727,
-0.6186370253562927,
-0.17654015123844147,
0.6829166412353516,
-0.40880757570266724,
-0.05555489659... | |
Does anybody know if there is a way to make autocompletion work in MySQL Command Line Client under Windows? It's working nicely under Linux for me, but simply moves the cursor under Windows instead.
It ought to work this way:
```
C:\> mysql --auto-rehash
```
Or configure your my.cnf:
```
[mysql]
auto-rehash
```
*... | [
-0.1372794806957245,
0.42159199714660645,
0.37060362100601196,
-0.03851828724145889,
-0.16273701190948486,
-0.08289006352424622,
0.6367481350898743,
-0.012663756497204304,
-0.6167635917663574,
-0.4547520577907562,
-0.19084489345550537,
0.6444114446640015,
-0.6119634509086609,
0.14157460629... | |
working, as expected. It was never
> working in mysql.exe because we were
> not able to make readline to compile
> with VC++.
>
>
> mysqlc.exe is a cygwin build, and it is linked with readline.
Explanation: [GNU readline](http://en.wikipedia.org/wiki/GNU_readline) is a standard open-source library for handling u... | [
0.21117326617240906,
-0.05864564701914787,
0.25699424743652344,
-0.06135515496134758,
-0.23157423734664917,
-0.28530701994895935,
0.0319586805999279,
-0.01925598457455635,
-0.04977856203913689,
-0.7665138840675354,
-0.19450999796390533,
0.45086246728897095,
-0.37593406438827515,
-0.2111370... | |
fully compatible with the Microsoft Windows environment.
At one time in the past, the MySQL product provided an alternative client they called `mysqlc.exe`, which they compiled with the [cygwin](http://www.cygwin.com/) toolset on Windows, but they don't provide this anymore. The cygwin toolset includes the readline li... | [
-0.24561026692390442,
-0.31140923500061035,
0.5257298350334167,
0.27609965205192566,
-0.30465397238731384,
0.21048468351364136,
0.19632303714752197,
0.26484745740890503,
-0.03183586895465851,
-0.6118851900100708,
0.09535571187734604,
0.7250238060951233,
-0.33879008889198303,
0.188163369894... | |
like a lot of work even for someone who is familiar with building MySQL from source. | [
0.3503706753253937,
0.06139311566948891,
-0.08076432347297668,
0.2586231529712677,
0.0016967060510069132,
-0.2970678210258484,
-0.014797625131905079,
0.20371659100055695,
-0.017870839685201645,
-0.17930786311626434,
0.2800199091434479,
0.453035831451416,
0.2546154260635376,
-0.078429445624... | |
Does anyone know how to iterate over a generic list if the type of that list isn't known until runtime?
For example, assume `obj1` is passed into a function as an `Object`:
```
Dim t As Type = obj1.GetType
If t.IsGenericType Then
Dim typeParameters() As Type = t.GetGenericArguments()
Dim typeParam As Type = t... | [
-0.021473072469234467,
-0.12032008171081543,
0.3831852972507477,
-0.05789819359779358,
-0.10921494662761688,
-0.14078691601753235,
0.4185127317905426,
-0.19185882806777954,
-0.14976486563682556,
-0.639102041721344,
0.002442976925522089,
0.5471630692481995,
-0.3304648697376251,
0.1163806617... | |
but that's fine for this simple example.
What I'd like to know is, based on the above, how do I do something like this:
```
For Each item As typeParam In obj1
'do something with it here
Next
```
Or even something as simple as getting `obj1.Count()`.
If you know that obj is a [Generic List](http://msdn.microsoft... | [
0.24548663198947906,
-0.10195064544677734,
0.21976101398468018,
0.018663765862584114,
-0.35472729802131653,
0.04112245887517929,
0.34716081619262695,
-0.14386224746704102,
-0.12014035880565643,
-0.9366661310195923,
0.11766315251588821,
0.125044047832489,
-0.3084777593612671,
0.222542881965... | |
object. This will give you an IEnumerable(Of object) that you can then start using Linq against. | [
0.19650810956954956,
-0.056006673723459244,
0.4845637381076813,
0.1733565330505371,
-0.07321185618638992,
-0.33095142245292664,
0.08540311455726624,
-0.17381836473941803,
-0.03288552910089493,
-0.6479895710945129,
-0.060646940022706985,
0.38596877455711365,
-0.14690200984477997,
-0.2124133... | |
I have a clock feature in a VB.NET program that displays the time including the seconds. I currently have a timer constantly polling using NOW. I have to poll the system clock quite often because I need to have the second update in sync with the system clock.
Is there a more direct to access the time only when the sec... | [
0.6342968344688416,
-0.07086188346147537,
0.4905104637145996,
0.14595754444599152,
0.07691137492656708,
0.075269915163517,
0.2796059548854828,
0.0035156733356416225,
-0.12894688546657562,
-0.8199941515922546,
0.5214398503303528,
0.717984139919281,
-0.148922860622406,
0.09618692100048065,
... | |
that performed the polling to get the timer very close to the seconds changing, then delegate to the timer. You could call the sync routine once a minute or so to make sure that you aren't getting any OS drift.
That being said, I'm sure there is a way to detect the seconds changing event, I just don't know how to do i... | [
0.2301287204027176,
-0.26698005199432373,
0.27053987979888916,
0.3468359708786011,
-0.05770845711231232,
-0.3572174906730652,
0.10578563064336777,
-0.024683812633156776,
-0.46250882744789124,
-0.5660898089408875,
0.10410713404417038,
0.308488130569458,
-0.10916829109191895,
-0.195147067308... | |
might be a better approach than polling:
```
Public Class Form1
Private WithEvents clockTimer As New Timer
Private currentTime As DateTime = DateTime.MinValue
Private Sub ClockTick(ByVal sender As Object, _
ByVal e As System.EventArgs) Handles clockTimer.Tick
UpdateTimer()
DisplayTimer()
... | [
-0.16358597576618195,
-0.24525490403175354,
0.4778865873813629,
0.13676977157592773,
0.10476140677928925,
0.20519590377807617,
0.07509348541498184,
-0.20247377455234528,
-0.20266911387443542,
-0.38282695412635803,
-0.22282350063323975,
0.5093188285827637,
-0.17076504230499268,
0.4685290455... | |
Private Sub DisplayTimer()
lblTime.Text = currentTime.ToString("T")
End Sub
Private Sub Form1_Load(ByVal sender As System.Object, _
ByVal e As System.EventArgs) Handles MyBase.Load
UpdateTimer()
DisplayTimer()
End Sub
End Class
```
Now, based on my preliminary tests, there is some s... | [
0.1259409785270691,
-0.06027406454086304,
0.6953527331352234,
-0.060961656272411346,
-0.10922398418188095,
0.1343059241771698,
0.19823461771011353,
-0.02185738831758499,
-0.13331864774227142,
-0.37617993354797363,
0.17601490020751953,
0.29666587710380554,
-0.14196862280368805,
0.4446182250... | |
We have a current application where user login credentials are stored in a SQL Server DB. These are, basically, stored as a plain text username, a password hash, and an associated salt for this hash.
These were all created by built in functions in ASP.NET's membership/role system. Here's a row for a user named 'joe' a... | [
0.37373867630958557,
0.40619853138923645,
0.09378543496131897,
0.058638304471969604,
-0.006664003245532513,
-0.242121621966362,
0.06137507036328316,
-0.05466194450855255,
-0.12165652215480804,
-0.6719274520874023,
0.18612538278102875,
0.13105788826942444,
-0.20186223089694977,
0.1770870685... | |
an SHA1 hash.
So far I've been able to ascertain that ASP is storing these hashes and salts in a base64 format. Those values above decode into binary strings.
We've used reflector to glean how ASP authenticates against these values:
```
internal string EncodePassword(string pass, int passwordFormat, string salt)
{
... | [
-0.284085750579834,
-0.08668726682662964,
0.273090124130249,
-0.3709656000137329,
-0.429989755153656,
-0.0016082260990515351,
0.5709497928619385,
-0.592886745929718,
-0.10886719822883606,
-0.5708340406417847,
-0.13130980730056763,
0.12867529690265656,
-0.11864399164915085,
0.28268349170684... | |
Buffer.BlockCopy(src, 0, dst, 0, src.Length);
Buffer.BlockCopy(bytes, 0, dst, src.Length, bytes.Length);
if (passwordFormat == 1)
{
HashAlgorithm algorithm = HashAlgorithm.Create(Membership.HashAlgorithmType);
if ((algorithm == null) && Membership.IsHashAlgorithmFromMembershipConfig)
... | [
-0.4452263414859772,
-0.3046744763851166,
0.22240670025348663,
-0.0465010441839695,
0.32328203320503235,
-0.008080526255071163,
0.30164867639541626,
-0.3777916133403778,
-0.33529457449913025,
-0.7047290802001953,
-0.2645148038864136,
0.3105570077896118,
-0.23017650842666626,
0.406742662191... | |
{
inArray = this.EncryptPassword(dst);
}
return Convert.ToBase64String(inArray);
}
```
Eseentially, pulls in the salt from the DB and b64 decodes it into a binary representation. It does a "GetBytes" on the raw password and then it concatinates them, salt first.
It then runs the SHA1 algorithm on thi... | [
-0.21520155668258667,
0.11940454691648483,
-0.09433047473430634,
-0.28958651423454285,
-0.07452842593193054,
-0.16635018587112427,
0.3950526714324951,
-0.16670650243759155,
0.030222851783037186,
-0.7020613551139832,
0.048028215765953064,
0.5165680646896362,
-0.36365053057670593,
0.48737800... | |
figure out how this translates over. Here's how I'm testing:
```
import hashlib
from base64 import b64decode, b64encode
b64salt = "kDP0Py2QwEdJYtUX9cJABg=="
b64hash = "OJF6H4KdxFLgLu+oTDNFodCEfMA="
binsalt = b64decode(b64salt)
password_string = 'password'
m1 = hashlib.sha1()
# Pass in salt
m1.update(binsalt)
# Pass ... | [
-0.04537302628159523,
0.15639764070510864,
0.18848052620887756,
-0.20075489580631256,
-0.2042361944913864,
-0.13526509702205658,
0.3956093490123749,
-0.1848227083683014,
-0.198836088180542,
-0.7395747900009155,
-0.04005104675889015,
0.49266135692596436,
-0.36570531129837036,
0.066935949027... | |
is inserting a byte order marker when you convert a UTF16 string to binary. The .NET byte array contains no BOM, so I did some ghetto python that turns the UTF16 into hex, removes the first 4 characters, then decodes it to binary.
There may be a better way to rip out the BOM, but this works for me!
Here's one that pa... | [
-0.06206517294049263,
0.24488578736782074,
-0.00516086770221591,
-0.3212071359157562,
-0.2341688722372055,
0.10414183139801025,
0.4311901926994324,
-0.34461289644241333,
-0.17315974831581116,
-0.5222357511520386,
-0.1843249648809433,
0.22164775431156158,
-0.5405154824256897,
0.114683836698... | |
print "Logged in!"
else:
print "Didn't match"
print b64hash
print b64encode(m1.digest())
``` | [
0.33286476135253906,
0.33343368768692017,
0.05341993272304535,
0.024377787485718727,
0.44001564383506775,
-0.2665848731994629,
0.37448829412460327,
-0.13369561731815338,
-0.2718800902366638,
-0.3697260320186615,
-0.1254924237728119,
0.5007696151733398,
-0.5726046562194824,
-0.0872443914413... | |
We are using feature branches in Subversion for our development which is a very convenient way of keeping code within version control that is not yet ready for the mainline. However, whenever I go to merge the feature branch revision into the mainline it is a pain. Right now I go through the following steps:
1. Check ... | [
0.45691296458244324,
-0.09312346577644348,
0.3855504095554352,
0.0003037078131455928,
0.06429165601730347,
-0.19345416128635406,
0.46512046456336975,
-0.10172922909259796,
-0.11422478407621384,
-0.685031533241272,
-0.06954409182071686,
0.5856351852416992,
-0.3112035393714905,
0.19687156379... | |
the current mainline directory.
5. Perform a difference using my IDE to ensure all of the files are properly checked out/added to subversion
6. Compile and test
7. Commit
It seems to me that there is a lot of room for errors in this process and it makes me nervous every time I walk through the steps. Granted, everythi... | [
0.5350335240364075,
-0.05400616303086281,
0.40303051471710205,
-0.16060380637645721,
-0.07006125897169113,
-0.39728930592536926,
0.6466058492660522,
-0.3380327820777893,
-0.45970964431762695,
-0.5147567987442017,
0.053041260689496994,
0.7014146447181702,
-0.3127458691596985,
-0.02200238220... | |
the steps of merging a feature branch in Subversion into their mainline development? Are you using different tools? Are you utilizing the merging feature in Subversion 1.5?
I am using the new --reintegrate feature of Subversion 1.5 at the moment and I think it's amazing. It's much easier and much less error-prone than ... | [
0.5959399938583374,
-0.28723177313804626,
0.0837581604719162,
-0.03049669787287712,
0.06860856711864471,
-0.3255377411842346,
0.2504330277442932,
-0.003926117438822985,
-0.0835728868842125,
-0.6535754799842834,
0.025728454813361168,
0.6917721629142761,
-0.2735172212123871,
-0.0779587700963... | |
scenario.
As to your original questions, you just need to keep very rigorous track of which main branch revisions you've merged into your working branch during development. Even with the --reintegrate feature of 1.5, however, it's still important to ensure that the reintegrated working copy of the main branch looks co... | [
0.26853886246681213,
-0.3919030725955963,
-0.01917668618261814,
0.1402105838060379,
0.43588581681251526,
-0.144076406955719,
0.2922154366970062,
-0.015042198821902275,
-0.4364358186721802,
-0.6981476545333862,
-0.2881276309490204,
0.4797988831996918,
-0.22136633098125458,
0.202895835041999... | |
well written and I would recommend looking it over briefly to see all the changes between 1.4 and 1.5 and for a good description on the new merging facilities. | [
0.1966921091079712,
0.11439438164234161,
0.4126723110675812,
-0.10531642287969589,
0.08242064714431763,
-0.20835918188095093,
0.007252193056046963,
0.20915795862674713,
0.23457546532154083,
-0.7189672589302063,
-0.013109886087477207,
0.2684587836265564,
0.14091366529464722,
-0.222343757748... | |
I've got a solution which I setup / cleanup using batch files ...
- there are a pair of MSMQ ports, send and receive, with another application on the end of the queues
I'm finding I can't properly stop the orchestration in the batch file ... the error is the send port is unenlisted
- I'm using the StopOrch.vbs script... | [
0.2899627387523651,
-0.17403972148895264,
0.40589454770088196,
-0.010977276600897312,
-0.05164973437786102,
-0.07051632553339005,
0.5325008630752563,
-0.18729975819587708,
-0.4756353795528412,
-0.46123212575912476,
-0.10180109739303589,
0.49680331349372864,
-0.5872420072555542,
0.181678861... | |
if you extend ComboBox you can add this functionality easily. Here is a quick example, it is a rough version and probably needs testing / tweaking but it shows how you could accomplish this.
```
package
{
import mx.controls.ComboBox;
import mx.core.UIComponent;
public class ComboBox2 extends ComboBox
... | [
0.3676466941833496,
-0.4687744975090027,
0.47299808263778687,
-0.08679083734750748,
0.23918965458869934,
-0.20131169259548187,
0.3218306303024292,
-0.6073907613754272,
-0.04177192971110344,
-0.770459771156311,
-0.37473437190055847,
0.5229878425598145,
-0.5725852251052856,
-0.01832069270312... | |
protected var textInputReplacement:UIComponent;
override protected function createChildren():void {
super.createChildren();
if ( !textInputReplacement ) {
if ( itemRenderer != null ) {
//remove the default textInput | [
-0.07147365808486938,
-0.17567078769207,
0.4948752820491791,
-0.08978647738695145,
0.24140824377536774,
0.12563453614711761,
0.6672345399856567,
-0.18914785981178284,
-0.08176028728485107,
-0.5185236930847168,
-0.5389821529388428,
0.525865375995636,
-0.19757211208343506,
0.3632075190544128... | |
removeChild(textInput);
//create a new itemRenderer to use in place of the text input
textInputReplacement = itemRenderer.newInstance();
addChild(textInputReplacement);
} | [
-0.2159980982542038,
-0.06626152992248535,
0.21769745647907257,
-0.15736106038093567,
-0.08806934207677841,
0.3809957206249237,
0.4557032585144043,
-0.3522283732891083,
-0.08206398040056229,
-0.5868716835975647,
-0.321042537689209,
0.39441004395484924,
-0.4558255672454834,
0.35550445318222... | |
}
}
override protected function updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void {
super.updateDisplayList(unscaledWidth, unscaledHeight);
if ( textInputReplacement ) {
textInputReplacement.width = unscaledWidth;
textInputRepla... | [
-0.055026862770318985,
-0.4180203974246979,
0.6769388318061829,
-0.10317781567573547,
0.5449299216270447,
-0.2439146786928177,
0.33569490909576416,
-0.13670386373996735,
-0.07681257277727127,
-0.5407155156135559,
-0.4746299684047699,
0.9389589428901672,
-0.2695772647857666,
0.0374855585396... | |
}
}
}
}
``` | [
-0.016344990581274033,
0.4495171308517456,
0.23163163661956787,
-0.18499617278575897,
0.39558660984039307,
-0.21481190621852875,
0.08800963312387466,
0.4133334159851074,
0.23730628192424774,
-0.5074179768562317,
-0.3644443452358246,
0.5587084293365479,
-0.3209930658340454,
0.33781036734580... | |
How can I deploy a custom authentication provider in MOSS 2007?
Is there any provided functionality to do this (like a Sharepoint feature)?
Or do I have to install it in the GAC on each box in the farm manually?
The usual approach for installing extensions like this is to use a feature, yes. However, you won't be usi... | [
0.42718565464019775,
-0.0636783316731453,
0.37947577238082886,
-0.012923373840749264,
-0.1541471779346466,
-0.18410062789916992,
0.3310227394104004,
-0.4225771725177765,
-0.3960830271244049,
-0.33652329444885254,
0.20182619988918304,
0.5856499671936035,
-0.13684886693954468,
-0.06019037961... | |
events: install, uninstall, activate and deactivate. I suggest you hook the install and uninstall events to deploy your provider.
<http://msdn.microsoft.com/en-us/library/bb862634.aspx>
Make sense?
-Oisin | [
0.06492847204208374,
-0.2361735999584198,
0.19696833193302155,
0.03223977982997894,
0.27366897463798523,
0.01618003658950329,
0.1396171897649765,
0.08335120975971222,
-0.2014264166355133,
-0.5760363936424255,
-0.7009080052375793,
0.6247890591621399,
-0.3432345390319824,
-0.2879179418087005... | |
Is there an easy way to convert a string that contains this:
```
Date: Wed, 5 Nov 2008 13:12:12 -0500 (EST)
```
into a string that contains this:
```
20081105_131212
```
**UPDATE:**
I ended up using date.tryparse which is similar to tryParseExact except you don't have to specify the format string. I did have t... | [
-0.20586828887462616,
0.07751099020242691,
0.7180426120758057,
-0.25357306003570557,
0.10216931998729706,
-0.059395670890808105,
0.18108592927455902,
-0.2754829525947571,
-0.0161813385784626,
-0.5784327387809753,
-0.12128262221813202,
0.517425537109375,
-0.2397618293762207,
0.4251029491424... | |
Nov 2008 13:12:12 -0500
```
Then I can format appropriately to generate my filename date using this:
```
If Date.TryParse(buff1, dateValue) Then
MsgBox(Format(dateValue, "yyyyMMdd_HHmmss"))
Else
MsgBox("nope")
End If
```
Even better than `Date.Parse` in this case would be `Date.TryParseExact()`. That would... | [
0.01792438142001629,
0.151719331741333,
0.6130059361457825,
-0.09036129713058472,
0.02512807957828045,
-0.05433027818799019,
0.27824464440345764,
-0.0972985178232193,
-0.04151685908436775,
-0.41301587224006653,
-0.1827079802751541,
0.40701767802238464,
0.04702060669660568,
0.25959354639053... | |
the same time zone? | [
0.32483816146850586,
0.09528779238462448,
-0.04038242995738983,
0.11801357567310333,
0.09687632322311401,
-0.23406372964382172,
0.22327539324760437,
0.23177839815616608,
-0.24194669723510742,
-0.1190851703286171,
0.39476001262664795,
-0.1555514931678772,
-0.21813498437404633,
0.15747787058... | |
Is there a way to run a project inside a solution that has more one project (read: web applications) and avoid the autostart feature of the integrated asp.net webserver in Visual Studio?
I have a big solution that has Windows forms projects, Windows Services projects, Web applications, Windows Libraries etc., sometime... | [
0.37597036361694336,
0.24546107649803162,
-0.1607988476753235,
0.15236708521842957,
-0.01768188364803791,
-0.30335450172424316,
0.16149774193763733,
-0.02807953953742981,
-0.3391910791397095,
-0.4646947979927063,
-0.0937037542462349,
0.47462350130081177,
-0.2714090049266815,
0.134451806545... | |
team are.
Thanks.
Select the project you don't want to start up automatically in solution explorer and in the properties pane set "Always Start When Debugging" to false | [
0.40995797514915466,
-0.23089279234409332,
-0.022251354530453682,
0.4596482217311859,
0.29885783791542053,
-0.40374165773391724,
0.3953396677970886,
-0.2817451059818268,
0.07429303228855133,
-0.9434743523597717,
-0.3228563666343689,
0.42466163635253906,
0.19682811200618744,
-0.290418356657... | |
I have a class derived from `CTreeCtrl`. In `OnCreate()` I replace the default `CToolTipCtrl` object with a custom one:
```
int CMyTreeCtrl::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
if (CTreeCtrl::OnCreate(lpCreateStruct) == -1)
return -1;
// Replace tool tip with our own which will
// ask us for... | [
0.025702184066176414,
-0.015638072043657303,
0.9190254807472229,
-0.1934434175491333,
0.1405661553144455,
0.03775344789028168,
0.14582155644893646,
-0.40820226073265076,
0.13097743690013885,
-0.7248159050941467,
-0.2534037232398987,
0.9251476526260376,
-0.38094547390937805,
-0.287670046091... | |
return 0;
}
```
My message handler looks like this:
```
ON_NOTIFY_EX(TTN_NEEDTEXT, 0, &CMyTreeCtrl::OnTtnNeedText)
```
However I never receive a `TTN_NEEDTEXT` message. I had a look with Spy++ and it also looks like this message never gets sent.
What could be the problem here?
Update
------
I'm not sure whether... | [
0.0971822440624237,
0.22492586076259613,
0.4044398069381714,
-0.16880036890506744,
-0.08002909272909164,
-0.09259387105703354,
0.6138024926185608,
-0.17878708243370056,
0.04867565259337425,
-0.6966218948364258,
-0.21346871554851532,
0.7375179529190063,
-0.276887446641922,
0.026342261582612... | |
window's `OnCreate()` method:
```
int CMyPane::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
if (CDockablePane::OnCreate(lpCreateStruct) == -1)
return -1;
const DWORD dwStyle = WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS | WS_CLIPCHILDREN |
TVS_CHECKBOXES | TVS_DISABLEDRAGDROP | TVS_HASBUTTONS | TVS_HASLINES ... | [
-0.1098753958940506,
-0.3626672923564911,
0.9149130582809448,
-0.16775186359882355,
0.20612820982933044,
0.21567761898040771,
0.11870162934064865,
-0.13845664262771606,
-0.10572117567062378,
-0.8176119327545166,
-0.5892592668533325,
0.3706507086753845,
-0.3025374412536621,
0.05760363116860... | |
parameters because the base class will complain in the form of an `ASSERT` about a `uFlag` member if there is no tool ID set.
And since we need to set the ID, we also need to set a rectangle. I created a `CRect` member and set it to `(0, 0, 10000, 10000)` in the CTor. I have not yet found a working way to change the to... | [
0.03091799095273018,
-0.09971323609352112,
0.4313438832759857,
0.18727606534957886,
-0.023415913805365562,
-0.025136673822999,
0.2546471655368805,
-0.1408442258834839,
-0.125817209482193,
-0.5082023739814758,
-0.0025943154469132423,
0.7498894333839417,
-0.3004908561706543,
0.33769717812538... | |
Message map entry
ON_NOTIFY(TVN_GETINFOTIP, TREECTRL_ID, &CMobileCatalogPane::OnTvnGetInfoTip)
// Handler
void CMyPane::OnTvnGetInfoTip(NMHDR *pNMHDR, LRESULT *pResult)
{
LPNMTVGETINFOTIP pGetInfoTip = reinterpret_cast<LPNMTVGETINFOTIP>(pNMHDR);
// This is a CString member
m_toolTipText.ReleaseBuffer();
... | [
-0.20868055522441864,
-0.28486743569374084,
0.9295346140861511,
-0.06697162240743637,
-0.00567404692992568,
0.026859214529395103,
0.3765992522239685,
-0.1856636106967926,
-0.5232177972793579,
-0.671276330947876,
-0.3562313914299011,
0.5119361877441406,
-0.5290318131446838,
-0.0348141603171... | |
I have a collection of unmanaged dlls with a C# wrapper around them that I'm calling from a C# project. I've added a build event line that looks like:
```
mkdir ..\Release
mkdir ..\Debug
copy ..\..\Includes\*.dll ..\Release\*.dll
copy ..\..\Includes\*.dll ..\Debug\*.dll
```
Problem is, when I go to publish the appli... | [
0.3822057247161865,
0.33770453929901123,
0.23604154586791992,
-0.040579963475465775,
0.06341581791639328,
-0.37925979495048523,
0.30295437574386597,
-0.08705314993858337,
-0.17142440378665924,
-0.6995463967323303,
-0.3293820917606354,
0.5984413623809814,
-0.33666619658470154,
0.17990690469... | |
I wrote a managed C++ class that has the following function:
```
void EndPointsMappingWrapper::GetLastError(char* strErrorMessage)
{
strErrorMessage = (char*) Marshal::StringToHGlobalAnsi(_managedObject->GetLastError()).ToPointer();
}
```
As you can see, this is a simple method to copy the managed string of the ... | [
-0.16551059484481812,
0.2265850156545639,
0.3660585880279541,
-0.010511374101042747,
0.2259477972984314,
-0.0026343949139118195,
0.4264990985393524,
-0.2372758835554123,
-0.08999722450971603,
-0.5175487995147705,
-0.17375405132770538,
0.7032821178436279,
-0.2808423638343811,
0.194141417741... | |
that address the content of the buffer returned by Marshal::StringToHGlobalAnsi.
A correct implementation should be:
```
void EndPointsMappingWrapper::GetLastError(char* strErrorMessage, int len)
{ char *str = (char*) Marshal::StringToHGlobalAnsi(_managedObject->GetLastError()).ToPointer();
strncpy(strErrorMessage... | [
-0.05121229216456413,
0.058563657104969025,
0.5946247577667236,
0.04877316951751709,
0.2119825929403305,
-0.0350518524646759,
0.282480388879776,
-0.50103360414505,
-0.21005460619926453,
-0.4621800184249878,
-0.5456829071044922,
0.45458826422691345,
-0.17522172629833221,
0.11722329258918762... | |
Is there a way to run a one-liner in sas, or do I have to create a file? I'm looking for something like the -e flag in perl.
My favourite is using the -stdio option
Either:
```
sas -stdio
```
Then start typing. Or ...
```
echo "proc options; run;" | sas -stdio
``` | [
0.22107721865177155,
0.03914852440357208,
0.06647531688213348,
-0.24295952916145325,
-0.1265362799167633,
-0.25033071637153625,
0.3838217556476593,
0.18436653912067413,
0.008378260768949986,
-0.6472262144088745,
-0.5067522525787354,
0.4171704053878784,
-0.24066787958145142,
-0.149047359824... | |
I'm constructing a simple form in ERB but the HTML produced by the text\_field tag makes the *for* attribute in the label tag invalid.
```
<div>
<p><%= label_tag "email[name]", "Name" %></p>
<%= text_field :email, :name, :class => "text_field" %>
</div>
```
Produces the HTML
```
<div>
<p><label for="email[nam... | [
-0.04004485532641411,
0.24199128150939941,
0.6911956071853638,
-0.36516934633255005,
-0.481103777885437,
0.14008000493049622,
0.2313586175441742,
-0.6066866517066956,
-0.02503134496510029,
-0.9123470187187195,
-0.08686757832765579,
0.5092840194702148,
-0.2861427366733551,
-0.17371132969856... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.