text stringlengths 0 30.5k | title stringclasses 1
value | embeddings listlengths 768 768 |
|---|---|---|
I need to write a little ruby function that does word wrapping. I have got the following function :
```
def word_wrap(text, line_width)
if line_width.nil? || line_width < 2
line_width = 40
end
text.split("\n").collect do |line|
line.length > line_width ? line.gsub(/.{1,#{line_width}})(\s+|$)/, "\\1\n").st... | [
0.14076614379882812,
-0.017276756465435028,
0.5267620086669922,
-0.16664017736911774,
-0.26129159331321716,
-0.13035593926906586,
0.2679934501647949,
-0.4252161383628845,
-0.12491754442453384,
-0.6330127716064453,
-0.1092572882771492,
0.6324684619903564,
-0.3209851086139679,
0.071391455829... | |
Praesent"
```
At the moment, word\_wrap(s, 20) gives something like this:
```
Lorem <span>ipsum
dolor</span>
si<span>t</span>
amet,
conse<span>ctetur
adipiscing
elit</span> Praesent
```
It should be:
```
Lorem <span>ipsum dolor</span> si
<span>t</span> amet, conse<span>ctetur
adipiscing elit</span>
Praesent
``... | [
-0.06488808244466782,
-0.08061046153306961,
1.235459804534912,
0.05477602407336235,
-0.12351123243570328,
0.23541930317878723,
0.1526077836751938,
-0.7725454568862915,
-0.01670859195291996,
-0.5593124628067017,
-0.3090968430042267,
0.5110539197921753,
-0.22881735861301422,
-0.1123584061861... | |
Lorem <span>ipsum
dolor</span>
si<span>t</span>
amet,
conse<span>ctetur
adipiscing
elit</span> Praesent
TEXT
#=> "Lorem <span>ipsum\ndolor</span>\nsi<span>t</span>\namet,\nconse<span>ctetur\nadipiscing\nelit</span> Praesent\n"
irb> puts word_wrap(text,20)
Lorem <span>ipsum dolor</span... | [
-0.29212307929992676,
0.047688473016023636,
0.6733473539352417,
0.35057520866394043,
-0.1587771773338318,
0.1530962735414505,
0.10837112367153168,
-0.7620976567268372,
0.013734598644077778,
-0.26264744997024536,
-0.1883816123008728,
0.20415936410427094,
-0.14634451270103455,
-0.04641614481... | |
down how the regex works:
`SPAN_RE` matches one span tag (either `<span>` or `</span>` or or ...)
```
(?i: - Start of a non-capturing parenthesis (useful for grouping patterns)
The i flag means the inner pattern is case-insensitive
< - a literal '<' character
\/? - 0 or 1 a forward slashes
sp... | [
-0.06915038079023361,
-0.04840778559446335,
0.9259511828422546,
-0.04257991537451744,
0.014444385655224323,
0.12199504673480988,
0.09257172793149948,
-0.37463247776031494,
-0.40535178780555725,
-0.4733487069606781,
-0.36035993695259094,
0.45864248275756836,
-0.051216237246990204,
-0.253864... | |
character
) - end of the non-capturing parenthesis
```
`ALL_SPAN_RE` matches all the spans at a given position - guaranteeing that the next character
matched is *not* the start of a span tag.
```
(?: - Start of a non-capturing parenthesis (useful for grouping patterns)
#{SPAN_RE}* - 0 or more s... | [
0.15124571323394775,
-0.0035248587373644114,
0.9858229160308838,
-0.3184443414211273,
-0.3222430944442749,
0.4386752247810364,
0.08617857843637466,
-0.6131686568260193,
-0.3907667100429535,
-0.32713034749031067,
-0.47308018803596497,
0.38400959968566895,
-0.3296271860599518,
-0.21580748260... | |
Since this is inside a negative lookahead, it means that the next
character in the string is not allowed to start a span
) - end of the negative lookahead
) - end of the non-capturing parenthesis
```
This means that we can match one character after the | [
-0.020295141264796257,
0.00889592245221138,
0.5564275979995728,
-0.2916785180568695,
-0.17275141179561615,
0.06682518124580383,
0.06889981031417847,
-0.20455427467823029,
-0.055873941630125046,
-0.36797723174095154,
-0.21482159197330475,
0.36629369854927063,
-0.42363235354423523,
-0.075043... | |
`ALL_SPAN_RE` and be sure that we're not
grabbing part of a span.
The `full_re` then just greedily matches as many characters as it can,
up to the desired width (ignoring spans), making sure that it ends on a
non-space character that is either the end of a word or followed by a span.
```
( - start... | [
0.06448454409837723,
0.1002325639128685,
1.1083132028579712,
-0.13990779221057892,
-0.2032073736190796,
0.098012775182724,
0.15828774869441986,
-0.2351493090391159,
-0.29702648520469666,
-0.29625049233436584,
-0.7193002700805664,
0.47162163257598877,
-0.22038009762763977,
-0.22048501670360... | |
#{ALL_SPANS_RE} - any and all spans
. - one character (which can't be the start of a span)
) - end of non-capturing parenthesis
{0,#{width-1}} - match preceding pattern up to width-1 times | [
0.26199978590011597,
-0.16845449805259705,
1.004410743713379,
-0.2126530557870865,
-0.2636285126209259,
0.31834959983825684,
0.20851868391036987,
-0.5008581280708313,
-0.47347235679626465,
-0.4312646985054016,
-0.2922947406768799,
0.2842499017715454,
-0.24775859713554382,
-0.14258816838264... | |
so this matches width-1 characters (ignoring spans)
#{ALL_SPANS_RE} - any and all spans
\S - a non-whitespace character
we don't want to insert a "\n" after whitespace
(?: - a non-capturing parenthesis | [
0.034711625427007675,
0.09613823145627975,
0.6507875323295593,
-0.3098476231098175,
0.07540898025035858,
0.28400179743766785,
0.06150040403008461,
-0.40819063782691956,
-0.46067771315574646,
-0.5127038955688477,
-0.1945849359035492,
0.4333956241607666,
-0.33307939767837524,
-0.055454012006... | |
#{SPAN_RE}+ - 1 or more spans
| - OR
\b - the end of a word
these alternatives makes sure we aren't breaking in the middle of a word
) | [
0.2947939336299896,
0.13441134989261627,
0.9063991904258728,
-0.1693340688943863,
-0.1659112572669983,
-0.002907752525061369,
0.640143871307373,
-0.5983337163925171,
-0.33647415041923523,
-0.34087809920310974,
-0.5582994818687439,
0.6040362119674683,
-0.06481444090604782,
-0.00635800557211... | |
- end of non-capturing parentheis
) - end of capturing parenthesis
\s* - any whitespace
since we're wrapping, we can just toss this when | [
-0.017433591187000275,
-0.16017471253871918,
0.21554946899414062,
-0.13417454063892365,
-0.160537987947464,
-0.01727035455405712,
0.08737361431121826,
-0.06367722153663635,
-0.1509578377008438,
-0.44865331053733826,
-0.21752174198627472,
-0.026298481971025467,
-0.2936968207359314,
-0.02262... | |
we insert the newline
``` | [
0.5394964218139648,
0.38733986020088196,
0.49378061294555664,
-0.08468133211135864,
0.3206213414669037,
-0.13564293086528778,
-0.026309724897146225,
0.10939314216375351,
0.10037205368280411,
-0.628612756729126,
-0.26000168919563293,
0.4829118251800537,
-0.10683546215295792,
0.0410391688346... | |
I need to save some classes and data structures to a file. My first reflex was to use XML or Binary serialization but this is turning into a nightmare. I have a set of classes that were not meant to be serialize (private setters, no parameterless constructors, no Serialization attribute, dictionaries, etc.). Considerin... | [
0.005806141532957554,
0.03482464328408241,
0.1403357833623886,
0.1530752032995224,
-0.10546346008777618,
-0.09281425923109055,
0.32383114099502563,
0.0546676330268383,
-0.05555759742856026,
-1.0613206624984741,
-0.0324656143784523,
0.36108696460723877,
-0.3297979235649109,
0.16073200106620... | |
framework in the System.Web.Extensions.dll assembly.
With this class, you can serialize any POCO whether it's marked as [Serializable] or not. Your program does not have to be a web application to use JSON serialization. Here's an example:
```
public class Unserializable
{
public int Age { get; set; }
public int ... | [
0.23132166266441345,
-0.12718802690505981,
0.3569963276386261,
-0.0507468543946743,
0.052465856075286865,
-0.11240584403276443,
0.20607377588748932,
-0.3668179512023926,
-0.3317180871963501,
-0.7758153080940247,
-0.12362789362668991,
0.2879801094532013,
-0.3486218750476837,
0.4246630370616... | |
Age = 40,
ID = 2,
Name = "Betty"
};
var jser = new JavaScriptSerializer();
var jsonText = jser.Serialize( u );
// next line outputs {"Age":40,"ID":2,"Name":"Betty"}
Console.WriteLine( jsonText );
}
}
``` | [
-0.11359082907438278,
0.0658521056175232,
0.6084471940994263,
-0.5068305730819702,
0.5143173336982727,
0.4789092540740967,
0.17252491414546967,
-0.22687187790870667,
-0.04366312175989151,
-0.7724531292915344,
-0.4300265908241272,
0.4343641698360443,
0.0055216457694768906,
0.243271991610527... | |
I got a job offer today for a position as a SharePoint developer. One of my friends is telling me that sharepoint is a big mess and not something I would want to be doing.
What are some of your experiences/thoughts in working with SharePoint?
I'm going to buck the trend here a bit. I see SharePoint as a development pl... | [
0.7133938670158386,
0.4088250994682312,
-0.1344296932220459,
0.08170581609010696,
0.08630453050136566,
-0.14003999531269073,
0.18432149291038513,
0.33363988995552063,
-0.3366173207759857,
-0.8349112868309021,
0.3663131296634674,
0.48301148414611816,
0.0386783666908741,
0.34634870290756226,... | |
get me wrong, SharePoint does come with baggage, but if you like to solve real-world business problems and not just sling code, it has a lot to offer. I am continuously amazed at how rich the platform is with WSSv3 - which is free.
If you like to align yourself with Microsoft technology, then you need to realize that ... | [
0.03721357882022858,
0.2551097869873047,
0.5056425333023071,
-0.040165748447179794,
-0.31737020611763,
-0.35300570726394653,
0.05211090296506882,
0.26195016503334045,
-0.08147311210632324,
-0.3501443862915039,
0.2072761505842209,
0.6815022230148315,
-0.19445478916168213,
-0.269882142543792... | |
is bound to improve in these areas.
In regards to some of the negatives I have read in this thread:
* I have written web parts that live in SharePoint that utilize the AJAX toolkit and so have co-workers of mine. One co-worker is very active with Silverlight web parts.
* Yes, you do tend to develop on Windows Server ... | [
0.25229963660240173,
0.5165544748306274,
-0.1660260409116745,
0.17284268140792847,
-0.03738309070467949,
-0.1989026665687561,
0.3898749351501465,
0.37362951040267944,
-0.2693328261375427,
-0.8056947588920593,
0.2948669493198395,
0.6182542443275452,
0.026870721951127052,
-0.1059264615178108... | |
things instead of develop. Authorization, done; provisioning, done; row-level security, done; basic UI CRUD, done; deployment to multiple front ends, done; search, done. Now I have time to focus on solving the business problem.
If you are going to do SharePoint development, you need to get started on the right foot. I... | [
0.6502758860588074,
0.059171855449676514,
0.09822114557027817,
-0.20448386669158936,
0.13723424077033997,
-0.09423454850912094,
0.29697877168655396,
0.002705300459638238,
-0.22118690609931946,
-0.6159909963607788,
-0.059501077979803085,
0.7345212697982788,
0.16813917458057404,
0.1923029422... | |
since it's beta days and am happy with the direction I have chosen. | [
0.2581779658794403,
0.21915414929389954,
0.056499067693948746,
-0.4012291133403778,
0.10239898413419724,
-0.5778933167457581,
0.45113077759742737,
0.8067904114723206,
-0.0024112071841955185,
-0.34685462713241577,
-0.060196634382009506,
-0.09717831760644913,
0.4137972593307495,
0.4564389586... | |
I'm writing a WPF app and the font that I am using *only* has problems running in WPF - it works fine using it in anything else (notepad, wordpad, etc.). The problem with WPF is that it falls back to another font *sometimes*. By "sometimes" I mean that only characters [a-zA-Z] appear to render correctly - everything el... | [
0.33215630054473877,
0.2220328450202942,
0.5066400766372681,
-0.025883391499519348,
-0.23890548944473267,
0.04844510555267334,
0.4470977783203125,
0.03903474286198616,
0.0261627659201622,
-0.9782219529151917,
0.015363696031272411,
0.4674239158630371,
-0.25977689027786255,
-0.15046961605548... | |
I'm trying to use is the "Scramble" TTF font (<http://famousfonts.smackbomb.com/fonts/scrabble.php>).
Numbers and spaces should be seen as a blank Scrabble/Scramble tile, but instead the number itself appears in the textbox I'm using.
The code I'm using:
```
<TextBox Text="Testing testing testing" FontFamily="Fonts/... | [
0.3042658865451813,
0.14584800601005554,
0.29083991050720215,
-0.10230367630720139,
-0.0047386325895786285,
0.018879415467381477,
0.11258861422538757,
-0.014212976209819317,
0.0629655197262764,
-0.7033290863037109,
-0.15575218200683594,
0.5415199995040894,
-0.19848282635211945,
-0.10113924... | |
not exist
> on the system.
> * The font that is specified by the client application does not
> contain the glyphs that are required
> to render text.
>
>
> In WPF, the font fallback mechanism
> uses the default fallback font family,
> "Global User Interface", as the
> substitute font. This font is defined
> as... | [
-0.2960784137248993,
0.03882553055882454,
0.428862988948822,
-0.133707657456398,
-0.00658443896099925,
0.29468852281570435,
0.07171399146318436,
-0.07378781586885452,
-0.23119986057281494,
-0.7145806550979614,
-0.3154796063899994,
0.21873842179775238,
-0.5319921970367432,
0.042922843247652... | |
technologies.
My guess would be that the font doesn't support Unicode - the font itself was created in 1996, and since it's intended to emulate Scrabble pieces, I'm not sure that the font author even considered localization.
***EDIT***
According to the font documentation, the font supports the letters, and any number... | [
0.04775802791118622,
0.2477339208126068,
0.46352118253707886,
0.16966105997562408,
-0.0696156919002533,
0.3138681948184967,
-0.07823535799980164,
0.0580398291349411,
-0.1295633763074875,
-0.590140700340271,
-0.05425403267145157,
0.16187265515327454,
-0.01902715303003788,
0.0429052188992500... | |
I'm looking to create a fairly large-scale ASP.NET MVC project and I want to break it out so that it's not all in one project and one assembly.
I looked at how Oxite does their organization (<http://oxite.codeplex.com/Wiki/View.aspx?title=architecture>) but I was wondering how other people do it too. Any suggestions?
... | [
0.49227795004844666,
-0.028207020834088326,
0.09004432708024979,
0.25751689076423645,
-0.14689166843891144,
-0.013821415603160858,
-0.14296597242355347,
-0.1756051629781723,
-0.29861629009246826,
-0.7544224858283997,
0.02923976257443428,
-0.0007310145883820951,
-0.3657205104827881,
0.16318... | |
included in here is ViewData model.
Project.Site - This project contains the Views, images, javascript and all other static non-code files. There should be minimal C# code here, the majority should live in Project.Core
You may want to check out how [S#arp Architecture](http://code.google.com/p/sharp-architecture/) has... | [
0.257636159658432,
-0.17887626588344574,
0.34974029660224915,
0.41012436151504517,
-0.07774212956428528,
-0.05209379270672798,
-0.14789192378520966,
-0.048280324786901474,
-0.13375641405582428,
-0.4929121136665344,
-0.08616986125707626,
0.10301150381565094,
0.023469027131795883,
0.06883323... | |
What are Vertex and Pixel shaders?
What is the difference between them? Which one is the best?
A [Pixel Shader](http://en.wikipedia.org/wiki/Pixel_shader) is a GPU (Graphic Processing Unit) component that can be programmed to operate on a per pixel basis and take care of stuff like lighting and bump mapping.
A [Verte... | [
0.24073591828346252,
0.014680066145956516,
0.5607361197471619,
0.3311317265033722,
-0.35975438356399536,
0.0542072132229805,
-0.45007649064064026,
-0.20859523117542267,
-0.016324780881404877,
-0.7709223031997681,
-0.011153853498399258,
0.2855454087257385,
-0.3164815902709961,
-0.0946733653... | |
9 or better include these capabilities.
There are multiple resources on the web for gaining a better understand of how to use these things. NVidia and ATI especially are good resources for documents on this topic. | [
0.2256445288658142,
-0.12800917029380798,
0.4105834662914276,
0.2950597405433655,
0.075980544090271,
-0.05125780031085014,
-0.0951257273554802,
0.43249014019966125,
-0.35492363572120667,
-0.6197353005409241,
-0.3135868310928345,
0.47110414505004883,
0.001464226865209639,
0.1131369471549987... | |
My site provides a javascript that shows the rate of the Dutch equivalent of the Dow Jones index. Users can embed this script in their website.
It looks like this:
```
<script type="text/javascript" src="http://www.aexscript.nl/r/gratis"></script>
```
The corresponding controller action looks like this:
```
def sh... | [
0.2219753861427307,
0.08175365626811981,
0.42412668466567993,
0.03912893310189247,
-0.01742033287882805,
-0.3125750422477722,
0.14537130296230316,
-0.14825014770030975,
-0.32526642084121704,
-0.5193620324134827,
0.205460324883461,
0.282090425491333,
-0.3182014226913452,
0.2518666684627533,... | |
$ before numresults on the second line. | [
-0.003146306611597538,
-0.13327249884605408,
0.4989244043827057,
0.06546737253665924,
0.14478996396064758,
0.23904897272586823,
0.19700616598129272,
0.3646570146083832,
0.057334840297698975,
-0.45061007142066956,
-0.06280200183391571,
0.3948059678077698,
0.0702868327498436,
0.5750308632850... | |
I'm working on an windows mobile application built using c#/dotNet in visual studio. There is a form with a DateTimePicker control. I can use the popup keypad to edit the day and month but it doesn't work for the year.
Has anyone else had this problem? Any way to fix it?
1. Go [here](http://www.microsoft.com/download/... | [
0.7159521579742432,
0.06485771387815475,
0.46972566843032837,
-0.1892320066690445,
0.251954585313797,
0.051553212106227875,
0.3584253191947937,
0.07213051617145538,
-0.24354064464569092,
-0.6883021593093872,
0.03977103903889656,
0.3393929600715637,
-0.2548624575138092,
0.0643724724650383,
... | |
to run "mono fsi.exe" and compiled F# apps as "mono myApp.exe".
Usefull tips:
1. It makes sense to create scripts for the compiler and F# interactive. i.e.:
/usr/local/bin/fsc
#!/bin/sh
exec /usr/bin/mono /usr/local/src/FSharp-1.9.9.9/bin/fsc.exe $@
/usr/local/bin/fsi
#!/bin/sh
exec /usr/bin/mono /usr/local/src... | [
0.3516726493835449,
0.06531522423028946,
0.30355867743492126,
-0.11934355646371841,
-0.23474806547164917,
-0.306598037481308,
0.5976448655128479,
-0.2297024428844452,
-0.1577327996492386,
-0.5404084324836731,
-0.2915259301662445,
0.688452959060669,
-0.4546736180782318,
-0.2803516983985901,... | |
Sometimes I still get stuck trying to translate procedural code into functional code.
Is there a list of functional idioms/snippets that are mapped to procedural idioms/snippets?
**Edit**
Since there doesn't seem to be a centralized website of these snippets, I am turning this into a community wiki. Please paste any... | [
0.1965881884098053,
0.043971575796604156,
0.128030925989151,
0.0984211191534996,
-0.08441422134637833,
-0.2020070105791092,
0.5726335048675537,
0.355148583650589,
-0.6107106804847717,
-0.7216612100601196,
-0.09222982078790665,
0.11980857700109482,
-0.2543700635433197,
-0.09284093976020813,... | |
F# (in .NET) the overhead is quite high and not useful for "normal" flow control.
This came up when playing with sort algorithms a while back (to kill some time), which make heavy use of repeat/until and break. It hit me that recursive tail call functions can achieve exactly the same result, with only a slight ding to... | [
0.028461888432502747,
-0.2489945888519287,
0.34535419940948486,
-0.08770345896482468,
-0.2602156698703766,
-0.14334695041179657,
0.2302110493183136,
-0.005259030498564243,
-0.05724427103996277,
-0.3147633373737335,
-0.18684221804141998,
0.6119533777236938,
-0.3291160464286804,
-0.268187999... | |
These all appear to run at exactly the same speed as a traditional F# 'while' statement, but your mileage may vary (some platforms may not properly implement tailcall and therefore may stack fault until they are patched). At the end is a (bad) sort algorithm written in both styles, for comparison.
Let's start with a '... | [
0.38226279616355896,
-0.23642075061798096,
0.2198212593793869,
0.06049489602446556,
-0.054722584784030914,
0.06498938053846359,
0.25083670020103455,
-0.1889948546886444,
-0.054818570613861084,
-0.46682631969451904,
-0.35432183742523193,
0.44849586486816406,
-0.16597217321395874,
-0.2586323... | |
= ref 0
let f() = incr v;
let g() = !v;
let N = 100000000
let imperDoWhile() =
let mutable x = 0
let mutable bDone = false
while not bDone do
f()
x <- x + 1
if x >= N then bDone <- true
```
Ok, that's easy enough. Keep in mind that f() is always called at least once (do/while).
H... | [
0.22680555284023285,
-0.15699879825115204,
0.5586981773376465,
-0.4607495069503784,
0.07424751669168472,
-0.024005087092518806,
0.29486703872680664,
-0.5678580403327942,
-0.1839991956949234,
-0.3411543369293213,
-0.18355534970760345,
1.0636683702468872,
-0.30386167764663696,
0.235018536448... | |
don't need to declare a mutable here.
```
let funDoWhile() =
let rec loop x =
f() (*Do*)
if x < N then (*While*)
loop (x+1)
loop 0
```
We can spin that to a traditional do/while by putting the function call inside the if block.
```
let funWhileDo() =
let rec loo... | [
0.09006469696760178,
-0.39335545897483826,
0.10972005128860474,
-0.10426773875951767,
0.2350848764181137,
-0.30514124035835266,
0.16274680197238922,
-0.2782011032104492,
0.00863465666770935,
-0.09354643523693085,
-0.24050617218017578,
0.6579611897468567,
-0.3239998519420624,
0.141504719853... | |
if x < N then (*While*)
f() (*Do*)
loop (x+1)
loop 0
```
How about repeating a block until some condition is true (repeat/until)? Easy enough...
```
let funRepeatUntil() =
let rec loop x =
f() (*Repeat*) | [
0.28851598501205444,
-0.40225857496261597,
0.4568403661251068,
-0.020176442340016365,
0.09200820326805115,
-0.3304446339607239,
0.5257773995399475,
-0.1976134479045868,
-0.42781883478164673,
-0.006243161391466856,
-0.38840487599372864,
0.6401512622833252,
-0.3378511369228363,
-0.0227109286... | |
if x >= N then () (*Until*)
else loop (x+1)
loop 0
```
What was that about a monad-less break? Well, just introduce a conditional expression which returns 'unit', as in:
```
let funBreak() =
let rec loop() =
let x = g()
if x > N then () (*break*)
else | [
0.37089085578918457,
-0.4459323287010193,
-0.08562330901622772,
0.02105635777115822,
0.045817092061042786,
-0.31458985805511475,
0.4157940745353699,
-0.34793621301651,
-0.37107834219932556,
-0.10747717320919037,
-0.517831563949585,
0.49914586544036865,
-0.5792129039764404,
0.06026972085237... | |
f()
loop()
loop()
```
How about continue? Well, that's just another call to loop! First, with a syntax crutch:
```
let funBreakContinue() =
let break' () = ()
let rec continue' () =
let x = g()
if x > N then break'()
elif x % 2 = 0 then | [
0.22010023891925812,
-0.25824421644210815,
0.18153589963912964,
-0.22401632368564606,
0.11742182821035385,
-0.28826650977134705,
0.4908638000488281,
-0.2781182527542114,
-0.34862712025642395,
-0.04709972068667412,
-0.5586842894554138,
1.0085057020187378,
-0.7006333470344543,
-0.15576209127... | |
f(); f(); f();
continue'()
else
f()
continue'()
continue'()
```
And then again without the (ugly) syntax crutch:
```
let funBreakContinue'() =
let rec loop () =
let x = g()
if x > N then () | [
0.39258965849876404,
-0.4002225995063782,
0.315121591091156,
-0.24914343655109406,
0.0024920846335589886,
-0.2831266522407532,
0.5945309400558472,
-0.3308781087398529,
-0.5082562565803528,
-0.11547486484050751,
-0.7541147470474243,
0.9293172359466553,
-0.6615358591079712,
0.107005164027214... | |
elif x % 2 = 0 then
f(); f(); f();
loop()
else
f()
loop ()
loop()
```
Easy as pie!
One nice result of these loop forms is that it makes it easier to spot and implement states in your loops. For example, a bubble sort | [
0.41898152232170105,
-0.22136279940605164,
0.04823054373264313,
-0.03389829397201538,
0.12396769970655441,
-0.22342370450496674,
0.39014068245887756,
-0.20176006853580475,
0.05197487026453018,
-0.7028060555458069,
-0.09612002968788147,
0.382320374250412,
-0.5842365026473999,
-0.03893807157... | |
continually loops over an entire array, swapping values that are out of place as it finds them. It keeps track of whether a pass over the array produced any exchanges. If not, then every value must be in the right place, so the sort can terminate. As an optimization, on every pass thru the array, the last value in the ... | [
0.5006706118583679,
-0.41266655921936035,
0.059222299605607986,
-0.06112981587648392,
0.13566270470619202,
-0.07738769799470901,
0.45844531059265137,
-0.11976566165685654,
-0.46378931403160095,
-0.11750993132591248,
-0.13729168474674225,
0.07526417821645737,
-0.647708535194397,
0.202719926... | |
is done, there is no need for that assignment; it's already set to true!
Here is F# code which implements a bubble sort (yes, bubble sort is terrible algorithm; quicksort rocks). At the end is an imperative implementation which does not change state; it updates the bModified flag for every exchange. Interestingly, the... | [
-0.043659988790750504,
-0.12645015120506287,
0.3509277403354645,
-0.13966615498065948,
-0.032914627343416214,
-0.0029057429637759924,
0.45752763748168945,
-0.15472930669784546,
-0.1901862919330597,
-0.5371485352516174,
-0.21671640872955322,
0.45155593752861023,
-0.47019368410110474,
-0.246... | |
]
if f i' j' > 0 then
a.[ i ] <- j'
a.[ j ] <- i'
let bubble f (xs:'a array) =
if xs.Length = 0
then ()
let rec modified i endix =
if i = endix then
unmodified 0 (endix-1)
else | [
0.13611601293087006,
-0.42369505763053894,
0.7013336420059204,
-0.42367270588874817,
0.14042682945728302,
-0.053619060665369034,
0.16030386090278625,
-0.3048562705516815,
0.0867839828133583,
-0.22264449298381805,
-0.26372867822647095,
0.6158797144889832,
-0.5947540998458862,
0.058549400418... | |
let j = i+1
sort2 f i j xs
modified j endix
and unmodified i endix =
if i = endix then
()
else
let j = i+1 | [
-0.23436638712882996,
-0.19768472015857697,
0.29200199246406555,
-0.4152236878871918,
-0.22467041015625,
0.2685553729534149,
0.37803858518600464,
-0.3548840880393982,
0.3310041129589081,
-0.35058435797691345,
-0.33401161432266235,
0.1668582260608673,
-0.5146519541740417,
-0.060621999204158... | |
let i' = xs.[ i ]
let j' = xs.[ j ]
if f i' j' > 0 then
xs.[ i ] <- j'
xs.[ j ] <- i' | [
-0.02962872013449669,
0.09463522583246231,
0.34341225028038025,
-0.4025862216949463,
-0.24157045781612396,
0.18448208272457123,
0.4585707485675812,
-0.25579461455345154,
0.284280925989151,
-0.41690346598625183,
-0.5542308688163757,
0.41311606764793396,
-0.34487128257751465,
0.1070914119482... | |
modified j endix
else
unmodified j endix
in unmodified 0 (xs.Length-1)
let bubble_imperitive f (xs:'a array) =
let mutable bModified = true
let mutable endix = xs.Length - 1
while bModified do
bModified <- false
endix <- endix - 1 | [
0.15008960664272308,
-0.32824599742889404,
0.4804302752017975,
-0.24177226424217224,
0.10607141256332397,
-0.0026065134443342686,
0.19595125317573547,
-0.2430838793516159,
0.21011100709438324,
-0.25370970368385315,
-0.2687666714191437,
0.5973833799362183,
-0.7116091251373291,
0.04792021960... | |
for i in 0..endix do
let j = i+1
let i' = xs.[ i ]
let j' = xs.[ j ]
if f i' j' > 0 then
xs.[ i ] <- j' | [
-0.03371210768818855,
-0.01721978187561035,
0.426248699426651,
-0.49784427881240845,
-0.1003645807504654,
0.06254811584949493,
0.5508973598480225,
-0.28916704654693604,
0.41388678550720215,
-0.3926614224910736,
-0.27517399191856384,
0.30427953600883484,
-0.35875630378723145,
0.035170786082... | |
xs.[ j ] <- i'
bModified <- true
done
done
``` | [
0.36669278144836426,
0.40137508511543274,
0.18855445086956024,
-0.24070748686790466,
0.04267854616045952,
-0.07133210450410843,
0.6378845572471619,
-0.07727343589067459,
0.09870665520429611,
-0.3979622423648834,
-0.5231488943099976,
0.5074889063835144,
-0.18730266392230988,
-0.006733865477... | |
I'm searching for a robust lightweight grid for ASP.NET MVC. I'd rather not write a grid, if someone else has done it,but I have yet to find a decent grid. It should be 508 compliant and for the most part, 508 compliance eliminates all the JavaScript grids.
* It has to be easy to use.
* Not too expensive ( a couple hu... | [
0.35628071427345276,
-0.038657404482364655,
0.4012095034122467,
0.05759497359395027,
-0.21808694303035736,
-0.11760015040636063,
0.1493738293647766,
-0.3753296136856079,
-0.34955593943595886,
-0.6771799921989441,
0.0368458554148674,
0.45290902256965637,
0.06238352134823799,
0.0017876109341... | |
and gives it sortablity and search features. Other grids would either render the table themselves or make ajax requests to the server.
I like this one:
<http://www.codeproject.com/KB/aspnet/MVCFlexigrid.aspx>
there are also
<http://blog.maartenballiauw.be/post/2008/06/Code-based-ASPNET-MVC-GridView.aspx>
<http://www.... | [
-0.06913583725690842,
-0.41501742601394653,
0.4713693857192993,
-0.13571497797966003,
-0.19945991039276123,
0.06693209707736969,
-0.04570009559392929,
-0.15460216999053955,
-0.5063058733940125,
-0.700449526309967,
0.10201136022806168,
0.3739108145236969,
0.14164380729198456,
-0.00661122472... | |
I am trying to use the following code, to display $formcode, which is the html code for a form, in a popup windows. I understand that it is not an ideal method, but I want to understand why it is not working.
```
<?php
$blah = "Well"; $test = "Done";
echo '<script type="text/javascript" src="fetchlayers.js"></script>'... | [
0.2596249282360077,
0.29654067754745483,
0.6272557973861694,
-0.4515301287174225,
0.08453460782766342,
-0.21930624544620514,
0.6057420372962952,
-0.6872974038124084,
0.062126755714416504,
-0.7610337734222412,
-0.25382933020591736,
0.45979660749435425,
-0.26370713114738464,
-0.0222107730805... | |
there.
I'm not sure if it's this or not, because I can't test it, but check the alert('$blah')
it should be with \' I think
```
alert(\'$blah\')
``` | [
0.30781009793281555,
0.37929463386535645,
0.49706846475601196,
-0.19080355763435364,
0.3661045730113983,
-0.31332340836524963,
0.054221898317337036,
0.3514609932899475,
-0.23134610056877136,
-0.5116547346115112,
-0.06085139140486717,
0.4800334870815277,
-0.2177758514881134,
-0.021346623077... | |
I'm binding a gridview dynamically from a table in my database I have called "Sessions". I get the information from a method using a linq query that is something like this:
```
var s = from sessions in datacontext.Sessions
where sessions.test == id
orderby sessions.ID ascending | [
0.627902626991272,
0.11245666444301605,
0.45829176902770996,
0.00013078136544208974,
-0.1287226378917694,
0.016170559450984,
-0.07314019650220871,
-0.4806685447692871,
-0.22418250143527985,
-0.677975594997406,
0.062360674142837524,
0.20910842716693878,
-0.1374046951532364,
0.23949643969535... | |
select sessions;
gridView.DataSource = qsessions;
gridView.DataBind();
```
Sessions contains a dateTime field that I want to minimize to just display the date (month/day/year). From what I've read through google searches, the solution is to specify the formatting in the aspx markup of the gridview using something lik... | [
0.31158798933029175,
-0.04734797775745392,
0.5433016419410706,
-0.13509349524974823,
-0.03752744942903519,
-0.04261089861392975,
0.35034069418907166,
-0.24833638966083527,
-0.4128934442996979,
-0.6152288317680359,
-0.11143815517425537,
0.372885525226593,
-0.04422933980822563,
0.12668849527... | |
Lately I've been favoring using named pipes (option --enable-named-pipes) in MySQL running on windows, and connect via the .NET connector driver. It's often recommended for security purposes, but one thing it allows me to do is connect with "." as the connection string and develop on my PC and deploy to the server with... | [
0.37334299087524414,
-0.07379089295864105,
0.323196142911911,
-0.04153098911046982,
-0.11000636219978333,
-0.2052135467529297,
0.1757952719926834,
0.0821695402264595,
0.10485585778951645,
-1.1466529369354248,
-0.11663650721311569,
0.41955262422561646,
-0.07298250496387482,
0.42598274350166... | |
testing successfuly MySQL 5.0 using named pipe, and what an
> increase in speed! 50% in the case of this big project First it may be
> a good idea to use the latest JConnector driver from MySQL
>
> <http://www.waltercedric.com/component/content/article/1217.html>
> In simple performance tests, it appears that na... | [
0.21019326150417328,
-0.3138580024242401,
0.49477633833885193,
0.10923083126544952,
0.04253757372498512,
-0.10080007463693619,
0.3604511320590973,
-0.3308417797088623,
-0.08668902516365051,
-0.9111620783805847,
0.18732251226902008,
0.5648064613342285,
0.26167988777160645,
0.045874137431383... | |
it's faster for localhost access vs TCP, however, I haven't been able to find anything definitive. Perhaps it's more specific to the particular driver being used too.
Try looking at <http://msdn.microsoft.com/en-us/library/aa178138(SQL.80).aspx>
Even though it speaks about MS SQL Server, the Local named pipes running ... | [
-0.09561092406511307,
-0.2549966871738434,
0.2628103196620941,
0.28903529047966003,
-0.1601191908121109,
-0.03165970742702484,
0.04511808231472969,
0.0710238516330719,
-0.18290814757347107,
-0.8724486827850342,
0.007532874587923288,
0.5162541270256042,
-0.0652381181716919,
0.28908112645149... | |
Local named pipes runs in kernel mode
> and is extremely fast. | [
-0.15129496157169342,
-0.24872609972953796,
0.23006992042064667,
0.05553930997848511,
-0.2768116891384125,
-0.039340462535619736,
0.27548590302467346,
0.3051563799381256,
0.25317713618278503,
-1.0183334350585938,
-0.013680679723620415,
0.1477711945772171,
-0.28260159492492676,
0.3943725228... | |
I have a blog that has a redirect loop, and I can't understand htaccess too well right now (late, and needs to be done by the AM) so am hoping for a quick fix. The site is throwing 301s from xxxxx.org to xxxxx.org/index.php, and back to the beginning. The htaccess file is as follows:
```
# BEGIN WordPress
<IfModule mo... | [
0.1681380718946457,
0.31452393531799316,
0.5958325266838074,
-0.2566864788532257,
-0.03726183995604515,
-0.17010731995105743,
0.43195605278015137,
-0.3781245946884155,
0.20376451313495636,
-0.6482779383659363,
0.16784074902534485,
0.6610506772994995,
-0.2669442296028137,
-0.000886879861354... | |
are combined with a logical OR so they will apply in all cases. If the file is a plain file it will not be a directory and vice versa.
Your rule is also odd. Are you trying to match all cases? in that case it should presumable be .\* (any string of characters) rather than . (any single character) | [
0.30324724316596985,
0.21233351528644562,
0.1596330851316452,
0.08390495926141739,
0.16707579791545868,
-0.1687615066766739,
-0.04869018867611885,
0.08288941532373428,
-0.3424471318721771,
-0.38909345865249634,
-0.17211787402629852,
0.26578113436698914,
-0.5323478579521179,
0.1027600541710... | |
How can I use semi-transparent png images in IE6?
In fact you can using [IE6 PNG Fix.](http://www.twinhelix.com/css/iepngfix/) There are some limitations, but overall, it works just fine. | [
0.5100764632225037,
-0.3217627704143524,
0.4168844223022461,
0.2224460244178772,
-0.3264150321483612,
-0.29201412200927734,
0.2771213948726654,
0.09121102839708328,
-0.03954219073057175,
-0.892494261264801,
0.1808764636516571,
0.5238757133483887,
-0.17052121460437775,
0.09247023612260818,
... | |
I Have a library which has custom domain logic. Some of the stuff is heavy hitting and depend on the core runtime outside silverlight runtime.
Is it possible to compile the same code for 2 different runtimes and reference different flavours from different consumers? How
There are several ways to achieve what you want.... | [
0.9593825936317444,
0.04340185597538948,
-0.16016630828380585,
-0.027309035882353783,
-0.3549045920372009,
-0.21868444979190826,
0.11265088617801666,
-0.25020357966423035,
-0.1508457064628601,
-0.6023162603378296,
0.31648653745651245,
0.374430388212204,
-0.287281334400177,
0.23260444402694... | |
instead of referencing assemblies
3. Even better, you can use Prism v2 and Project Linker addin that comes with it to let Visual Studio manage files linking between projects. You can read more about multi-platform targeting [here](http://mokosh.co.uk/post/2009/04/19/prism-2-wpf-and-silverlight-multi-platform-targeting/... | [
0.48419418931007385,
-0.1390216201543808,
0.19910810887813568,
0.07724075764417648,
-0.36150476336479187,
-0.341325581073761,
0.19650599360466003,
-0.3616939187049866,
-0.4538504481315613,
-0.39783409237861633,
-0.10839532315731049,
0.4231708347797394,
-0.3481072783470154,
-0.3645746409893... | |
I have a javascript function that accepts a number and performs a mathematical operation on the number. However, the number I'm passing in could have a comma in it, and from my limited experience with Javascript I am having problems working with that value. It doesn't seem to treat that as a numeric type.
What's the e... | [
0.23297235369682312,
0.17843709886074066,
0.43689295649528503,
0.1452471911907196,
-0.13847796618938446,
0.591488778591156,
-0.05533405765891075,
-0.09464506804943085,
-0.17555834352970123,
-0.5264844298362732,
0.3828190863132477,
0.2750399112701416,
-0.019442252814769745,
0.18753980100154... | |
by using the javascript **replace** function
**example**:
```
function checkNumeric(objName)
{
var lstLetters = objName;
var lstReplace = lstLetters.replace(/\,/g,'');
}
```
With input tag here:
```
<input type="text" onblur="checkNumeric(this);" name="nocomma" size="10" maxlength="10"/>
``` | [
-0.3670845627784729,
-0.11005714535713196,
0.7071259617805481,
-0.29339489340782166,
0.3016968071460724,
0.20140662789344788,
0.11446090787649155,
-0.25826650857925415,
-0.2246403992176056,
-0.7955077886581421,
-0.5415433645248413,
0.5922633409500122,
-0.40106892585754395,
-0.3139099180698... | |
Something in here is incompatible with PHP5, but I am totally lost as to what. I have an .htaccess file on my web server that has the line "AddHandler x-mapp-php5 .php", as it is required by just about everything else on the server and it defaults to PHP4...however; I need this one script to work, but it *only* works o... | [
0.13431212306022644,
0.1829797476530075,
0.27502816915512085,
-0.019319569692015648,
-0.03605379909276962,
-0.3702491223812103,
0.3578420579433441,
0.14975737035274506,
-0.24677996337413788,
-0.7914095520973206,
0.17449349164962769,
0.3869074881076813,
-0.27585485577583313,
0.1194411441683... | |
for the array */
/* start the script... no more editing from here on... */
/* get a list of the files + dirs and turn the list into an array */
function file_list($dir) {
global $sort;
global $file_file_count;
if (is_dir($dir)) {
$fd = @opendir($dir);
while (($part = @readdir($fd)) == tr... | [
-0.4560503363609314,
-0.21600840985774994,
0.6757773160934448,
-0.25498858094215393,
0.09182538092136383,
0.07262285053730011,
0.2592587172985077,
-0.2171381115913391,
-0.23629584908485413,
-0.5406188368797302,
-0.3217252492904663,
0.6532065272331238,
-0.36376020312309265,
0.08204027265310... | |
$file_array[] = $part;
}
}
if ($fd == true) {
closedir($fd);
}
if (is_array($file_array)) {
$sort($file_array);
$file_file_count = count($file_array);
return $file_array;
} else {
return false;
}
} else {
return false; | [
-0.2014068216085434,
-0.19515761733055115,
0.47973936796188354,
-0.5492337942123413,
-0.10340007394552231,
0.1592961549758911,
0.2804505527019501,
-0.5991824269294739,
-0.0467371828854084,
-0.35401788353919983,
-0.5904169678688049,
0.4567852318286896,
-0.4228023588657379,
0.213485613465309... | |
}
}
/* function to convert to Mb, Kb and bytes */
function file_size($size) {
$megabyte = 1024 * 1024;
if ($size > $megabyte) { /* literal.float */
$re_sized = sprintf("%01.2f", $size / $megabyte) . " Mb";
} elseif ($size > 1024) {
$re_sized = sprintf("%01.2f", $size / 1024) . " K... | [
-0.189427450299263,
0.04253543168306351,
0.5418245196342468,
-0.28803542256355286,
0.26610589027404785,
0.5612632036209106,
0.23909911513328552,
-0.2913852035999298,
-0.4201044738292694,
-0.552869975566864,
-0.5707873106002808,
0.5782080292701721,
-0.21438321471214294,
0.1076500415802002,
... | |
= $size . " bytes";
}
return $re_sized;
}
/* get a list of the files/dirs, put them into a table. */
function generate_file_list($path) {
global $download_path;
global $PHP_SELF;
$final_path = str_replace("//","/",str_replace("..","",urldecode($path)));
$file_array = file_list("$downloa... | [
-0.22762472927570343,
-0.25372570753097534,
0.7684832215309143,
-0.5108999609947205,
0.01828650012612343,
0.1275199055671692,
0.2622275650501251,
-0.44791316986083984,
-0.24924452602863312,
-0.32821667194366455,
-0.24870331585407257,
0.7738730311393738,
-0.38901248574256897,
0.099411614239... | |
} else {
echo "<table width=\"75%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">\n";
echo "<tr><td><b>file</b></td><td><b>size</b></td></tr>\n";
foreach ($file_array as $file_name) {
$is_file = "$download_path/$final_path/$file_name";
$final_dir_name = urlencode($final_path); /* u... | [
-0.1945301592350006,
-0.13097016513347626,
0.5900596380233765,
-0.4732585549354553,
0.22127366065979004,
0.06253879517316818,
0.1828715056180954,
-0.6701375246047974,
-0.002426153514534235,
-0.2921217679977417,
-0.5347367525100708,
0.6690053939819336,
-0.2923070788383484,
0.256587743759155... | |
if (is_file($is_file)) {
print "<tr><td><a href=\"$PHP_SELF?go=download&path=$final_dir_name&file=$final_file_name\">$file_name</a></td><td>$final_file_size</td></tr>\n";
} elseif (is_dir($is_file)) {
print "<tr><td><a href=\"$PHP_SELF?go=list&path=$final_dir_name/$final_file_name\">$file_na... | [
-0.571772038936615,
-0.31048786640167236,
0.9535257816314697,
-0.22786816954612732,
0.29103413224220276,
0.029937801882624626,
-0.1365499049425125,
-0.2535818815231323,
-0.17554688453674316,
-0.7000224590301514,
-0.4365900754928589,
0.728659987449646,
-0.17619982361793518,
-0.1066315248608... | |
= str_replace("//","/",str_replace("..","",stripslashes(urldecode($path)))); /* fopen adds \ to ' - so we strip 'em. */
$get_file = str_replace("//","/",str_replace("..","",stripslashes(urldecode($file))));
header("Content-Disposition: atachment; filename=$get_file");
header("Content-Type: application/o... | [
-0.09078654646873474,
-0.21762661635875702,
0.913368821144104,
-0.13909968733787537,
0.1824112981557846,
0.13101139664649963,
0.3137364387512207,
-0.3001570701599121,
-0.18887315690517426,
-0.46596601605415344,
-0.7419279217720032,
0.8706985712051392,
-0.4793972074985504,
0.084545060992240... | |
"dirlist") {
generate_file_list(""); /* null, so we get a list for the root directory */
} elseif ($go == "list" && isset($path)) {
if (isset($path)) { /* if the path is null - it returns a list for the root directory */
generate_file_list($path); /* get a list for the path specified */
} ... | [
-0.2689954340457916,
-0.3528614044189453,
0.36842790246009827,
-0.2535971999168396,
0.1140526607632637,
0.11406976729631424,
0.1790115237236023,
-0.4839058518409729,
-0.051865722984075546,
-0.433193564414978,
-0.23355728387832642,
0.9251537919044495,
-0.602879524230957,
-0.0329195819795131... | |
== "download") {
if (isset($path) && isset($file)) {
do_download($path,$file); /* download the file... */
} else {
echo "no file selected to download :)\n";
}
}
?>
```
The code is assuming that the ***$go***, ***$file***, and ***$path*** variables are being magically set. To get... | [
0.06661420315504074,
-0.3427375853061676,
0.4953809380531311,
-0.05577358230948448,
0.3202337622642517,
0.003156268736347556,
0.3276482820510864,
-0.09665115177631378,
-0.23751309514045715,
-0.6259227991104126,
-0.3533792197704315,
0.6198621988296509,
-0.2700870931148529,
0.007373685948550... | |
*/
$download_path = 'content'; /*path to your files, NB: no slash at the end*/
$sort = 'asort'; /* array sorting - alphabetical sorting for the array */
/* start the script... no more editing from here on... */
$go = $_REQUEST['go'];
$file = $_REQUEST['file'];
$path = $_REQUEST['path'];
// ...
```
This us... | [
-0.06788697838783264,
-0.19577820599079132,
0.5497006773948669,
0.09126890450716019,
0.13496626913547516,
-0.27024728059768677,
0.48013079166412354,
0.13327595591545105,
-0.5065103769302368,
-0.7921967506408691,
-0.37861090898513794,
0.42560896277427673,
-0.2023032009601593,
0.049298327416... | |
Where can I find the windows certificate store location on the hard drive for server 2003. I am coding a c# utility for managing few certificates we use to notify when they are expiring. So, I choose to store them in the windows certificate store. Instead of using any existing location(Personal...) that I see in MMC I ... | [
0.053337212651968,
0.6054548621177673,
0.38124334812164307,
0.15439175069332123,
0.07776618748903275,
-0.2008713185787201,
0.07301577925682068,
0.27855104207992554,
-0.44469016790390015,
-0.4658401310443878,
0.25192388892173767,
0.39894556999206543,
-0.11850807815790176,
0.3398338258266449... | |
Windows has APIs to manage certificates, and I would suggest looking into those. I am pretty sure you can do all reasonable things though the public API. If you use the APIs with the system store, you will likely have to write less code, and your resulting solution will be more secure, better integrated with the OS (an... | [
0.19361494481563568,
0.3948850631713867,
0.29865318536758423,
0.23019811511039734,
0.08488266170024872,
-0.2463817298412323,
0.33927851915359497,
0.026083718985319138,
-0.16502726078033447,
-0.6839584112167358,
-0.1784781664609909,
0.6933785080909729,
-0.10907381027936935,
-0.0225455984473... | |
I know Internet Explorer has always been hopeless with styling html `<select>` with inconsistent or non-existent font sizes, colours, borders, background colours etc so what are some alternatives for creating your own flexible field that is cross-browser compatible?
It's fine to require any JavaScript framework such a... | [
0.4030267298221588,
0.10403917729854584,
0.16468584537506104,
0.14248427748680115,
-0.2268873155117035,
-0.2194627970457077,
0.1491963267326355,
0.3092791438102722,
-0.059612125158309937,
-0.6913230419158936,
-0.025432704016566277,
0.45079073309898376,
-0.44815146923065186,
0.1331157237291... | |
Javascript turned off or screen readers? If 99.9% of websites can manage to make their select boxes blend in, you should really just suck it up and style it as much as you can.
You could however look into [this jQuery plugin](http://www.headcircus.com/uiguy/selectboxfactory/selectboxfactory.html) which enhances select... | [
0.4429109990596771,
-0.3088550865650177,
0.037826165556907654,
0.11930619925260544,
-0.2296978235244751,
-0.2922004759311676,
0.20565958321094513,
0.19438937306404114,
-0.008832152932882309,
-0.8092568516731262,
-0.12819577753543854,
0.30184024572372437,
-0.4874732792377472,
-0.07093093544... | |
I've got a web setup project with a custom screen in it that asks for a machine name. Is there anyway to prepopulate this field with the current machines name?
For the case that I need it for just including "Localhost" does not meet my requirements.
"Environment.MachineName" will return the machine name within a cod... | [
0.5637271404266357,
0.31988173723220825,
0.1977354735136032,
-0.011938787996768951,
0.18778203427791595,
-0.19211915135383606,
0.5030377507209778,
0.13394910097122192,
-0.15161095559597015,
-0.758986234664917,
0.32152679562568665,
0.6925361156463623,
-0.03492200747132301,
-0.01891737431287... | |
doesn't look like the simple Web Setup Project will be enough for you to do what you want. I would suggest any of the following, depending on how important this is to your project:
* Just use a default of LOCALHOST
* Leave the default blank and use the dialog text to tell the user how to retrieve the machine name
* Do... | [
0.3695489764213562,
-0.0210984218865633,
0.1299344301223755,
0.06592483073472977,
0.2281474620103836,
-0.28611135482788086,
0.5229597687721252,
0.05334312468767166,
-0.18607035279273987,
-0.9775662422180176,
0.03180552273988724,
0.9528053998947144,
-0.2559971809387207,
-0.14701908826828003... | |
feature that bad, go with one of the other options that is acceptable enough in your situation. | [
0.12622851133346558,
-0.11462830752134323,
-0.07670234888792038,
0.16710439324378967,
-0.16461443901062012,
-0.11025846004486084,
0.39066576957702637,
0.5028550028800964,
-0.01651177369058132,
-0.6633326411247253,
-0.132721945643425,
0.8677858114242554,
-0.11946124583482742,
-0.11289478093... | |
I have the following method which is used to populate a DAO from the database. It performs 3 reads - one for the primary object, and 2 for some translations.
```
public bool read(string id, MySqlConnection c)
{
MySqlCommand m = new MySqlCommand(readCommand);
m.Parameters.Add(new MySqlParameter("@param1", id));... | [
-0.0975729376077652,
0.023724285885691643,
0.8692367076873779,
-0.046870432794094086,
0.019593151286244392,
0.2919197678565979,
0.5206310749053955,
-0.6415131688117981,
-0.03654158115386963,
-0.49282601475715637,
-0.2037380188703537,
0.43835440278053284,
-0.36420542001724243,
0.37885880470... | |
m.Connection = c;
r = m.ExecuteReader();
r.Read();
account1Name = r.GetValue(0).ToString();
r.Close();
m = new MySqlCommand(getAccountName);
m.Parameters.Add(new MySqlParameter("@param1", secondAccountID));
m.Connection = c;
r = m.ExecuteReader();
r.Read();
account2Name = r.GetVa... | [
-0.0031108988914638758,
0.09683655202388763,
0.7606567144393921,
-0.2824289798736572,
0.16655299067497253,
0.16032634675502777,
0.8557605743408203,
-0.5090141892433167,
-0.37802526354789734,
-0.2202083319425583,
-0.47191038727760315,
0.8492583632469177,
-0.4268513321876526,
0.3238855302333... | |
to be working earlier in your code. Are you sure there is a value to read there (i.e. is your query returning 0 rows or null or something else that can't be converted to a string?) | [
0.0209910087287426,
-0.07182268053293228,
0.0743439570069313,
0.14519618451595306,
0.11114737391471863,
0.10177464783191681,
0.24991421401500702,
-0.0032032253220677376,
-0.3893841803073883,
-0.4566192328929901,
0.09387307614088058,
0.3538129925727844,
-0.22790101170539856,
-0.108464241027... | |
I'm used to using TFS, and my company is now switching to SVN for a new project (the main reason is to better incorporate our java & .Net codebase under the same source control).
I am given to understand merges in subversion are hard (Jeff [mentioned this](https://blog.stackoverflow.com/2009/05/podcast-52/) in his lat... | [
0.22176167368888855,
-0.2387484759092331,
-0.03211238235235214,
-0.11416314542293549,
-0.4180372953414917,
-0.3661315143108368,
0.28112101554870605,
-0.1817759871482849,
-0.26571759581565857,
-0.720770001411438,
0.00041976498323492706,
0.40127483010292053,
-0.4893982410430908,
-0.147235989... | |
the user. Is that the same in subversion?
**Update** - an accepted answer here can only come from someone who has experienced big merges in both **TFS** and **subversion**, and can actually compare & contrast the two. Knowing that "merge in subversion is good" or "TFS is crap" doesn't really help me decide, because it... | [
0.41530004143714905,
-0.24321967363357544,
0.15370388329029083,
0.12192585319280624,
-0.463230162858963,
0.03937524929642677,
0.22202607989311218,
0.030806617811322212,
-0.3752042353153229,
-0.828263521194458,
0.0037544858641922474,
0.6097949743270874,
-0.1891254484653473,
-0.0041881659999... | |
fact easier than in TFS (taking tooling into consideration)?
I have done big merges in both TFS and Subversion. The TFS codebase was a 1.5->2.0 branch of a SharePoint application with production changes merged into the 2.0 codebase. The SVN merge was a merge of new features from a fork into the baseline source.
You ar... | [
0.10784698277711868,
-0.2238924503326416,
0.22006021440029144,
-0.055071376264095306,
0.014125806279480457,
-0.19973789155483246,
0.29153141379356384,
-0.27757441997528076,
-0.19969500601291656,
-0.7072187662124634,
0.019315389916300774,
0.6082618236541748,
-0.3135455548763275,
-0.03241505... | |
a bit more manual because we had to target specific versions of the files in SVN, and SVN did a diffmerge on files which did not allow us the flexibility we experienced with changesets in TFS (cases such as "not all changes in ChangesetA but all changes in ChangesetB"). We didn't have merge tracking at the time, nor wa... | [
0.21487167477607727,
-0.2636469900608063,
0.32833191752433777,
0.0657266154885292,
0.028885135427117348,
-0.33578363060951233,
0.13594016432762146,
-0.2791514992713928,
-0.18718242645263672,
-0.6541456580162048,
-0.02913249097764492,
0.8217617869377136,
-0.35046154260635376,
-0.12349177896... | |
mind that TFS is a big product with really great GUI tools for managing your source, while SVN depends more heavily on the command-line, so this complicates things if you're used to working with the GUI. | [
0.45808175206184387,
0.016793791204690933,
0.018095754086971283,
0.15183722972869873,
-0.17383131384849548,
-0.2405203878879547,
0.03344174101948738,
0.2813127040863037,
-0.16320064663887024,
-0.5792237520217896,
0.011131687089800835,
0.8189429640769958,
-0.16214290261268616,
-0.1054214313... | |
Tortoise SVN will not let me access an svn repository that has a self signed **and** expired ssl certificate.
Is there a config somewhere to tell it that I want to trust that certificate anyway?
I had a similar problem with SCPlugin on mac - the workaround was to use the command line version of svn, which does give yo... | [
0.018941303715109825,
0.09981757402420044,
0.35566073656082153,
-0.03361484408378601,
-0.03844182938337326,
-0.23560845851898193,
0.6257084608078003,
0.1620810329914093,
-0.2846411168575287,
-0.36422401666641235,
-0.1124735027551651,
0.9751347899436951,
-0.05946221575140953,
0.116847410798... | |
Why does this not work in ff/chrome?
```
javascript: document.execCommand('SaveAs','true','http://www.google.com');
```
(used as a bookmarklet)
execCommand is not completely standardized across browsers. Indeed, execCommand('SaveAs', ...) only seems to be supported on IE. The recommended way to force a save-as would... | [
0.25918957591056824,
-0.14715030789375305,
0.5955579280853271,
-0.03331495448946953,
-0.1321137696504593,
-0.19135034084320068,
-0.029307425022125244,
-0.2795763313770294,
0.008809352293610573,
-0.7985955476760864,
-0.33183062076568604,
0.5957406163215637,
-0.25490689277648926,
-0.05110124... | |
I have been called in to "clean up" and get started again in a .NET environment where the developers left quite a tangled mess. The developer is still available to me and he is/was able to pull up the solution on his machine, but when I attempt to use this is on my machine it creates a mess.
What I would like to do is... | [
0.4294086694717407,
0.298285573720932,
0.10803645104169846,
-0.08319143950939178,
0.27394962310791016,
-0.2949221432209015,
0.2779809832572937,
-0.09737059473991394,
-0.2070385068655014,
-0.7344598770141602,
-0.17445944249629974,
0.19060754776000977,
-0.24298706650733948,
0.234483540058136... | |
items in the GAC) is there any utility or way to get a full report of where everything actually is, the physical and virtual paths for both Debug and Release configurations. Also post-build tasks, etc. With a ton of projects of different types and various config screens, just manually trying to document it is possible,... | [
0.2593296766281128,
0.11973518133163452,
0.2952839136123657,
0.3533111810684204,
-0.06663352251052856,
-0.18072563409805298,
0.08006644248962402,
0.03656106814742088,
-0.6024758219718933,
-0.2227175086736679,
-0.13418903946876526,
0.40923964977264404,
0.08236122131347656,
0.212510257959365... | |
I have been able to pull together a working solution, VSS "corrects" me by randomly bring files in that then reference non-existing locations. It's been a treat and VSS is a virus.
Any suggestions for extracting this from the only machine on the planet that will build this (and only in Release) so someone else could w... | [
0.5434201955795288,
0.1285431683063507,
0.1259886622428894,
0.10218053311109543,
0.14081107079982758,
-0.37521693110466003,
0.4274354875087738,
0.5426689982414246,
-0.14832639694213867,
-0.6824935078620911,
0.046748269349336624,
0.21272103488445282,
-0.4031633734703064,
0.2547030448913574,... | |
be supported on IE. The recommended way to force a save-as would be to use a content-disposition: attachment header, as described in <http://www.jtricks.com/bits/content_disposition.html>
Since this is part of the HTTP header, you can use it on any file type. If you're using apache, you can add headers using the .htac... | [
0.4011581838130951,
-0.27804985642433167,
0.4590945541858673,
0.037551168352365494,
-0.018469881266355515,
-0.23487238585948944,
0.08324681967496872,
-0.0255693718791008,
0.046259164810180664,
-0.7606728076934814,
-0.3580850064754486,
0.5031470060348511,
-0.29086458683013916,
-0.0959951207... | |
Can anyone tell me what is going wrong with this code? I tried to submit a form with JavaScript, but an error ".submit is not a function" shown. See below for more details of the code:
```
<form action="product.php" method="get" name="frmProduct" id="frmProduct" enctype="multipart/form-data">
<input onclick="submitAc... | [
0.11715870350599289,
0.31843921542167664,
0.46054911613464355,
0.07269939035177231,
-0.19283486902713776,
-0.120335653424263,
0.5122408866882324,
-0.620034396648407,
-0.045984867960214615,
-0.6520705223083496,
0.06717608124017715,
0.7062758207321167,
-0.15394586324691772,
-0.02452409639954... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.