var copyOfArray = originalArray.slice();Apparently
Array.slice, if called with no parameters, returns a copy of the entire array. Kinda cool!
This is just a spot to keep miscellaneous links. It also shows you what a geek I am.
var copyOfArray = originalArray.slice();Apparently
Array.slice, if called with no parameters, returns a copy of the entire array. Kinda cool!
var patient = new Patient { AccountNumber = accountNumber };
And the same code using ReSharper formatting (Ctrl-K Ctrl-F): var patient = new Patient {AccountNumber = accountNumber};
I would have thought that ReSharper would take over the Ctrl-K Ctrl-D and Ctrl-K Ctrl-F keyboard shortcuts, but it does not.
"Turns out environment variables for ASP.NET Core projects can be set without having to set environment variables for user or having to create multiple commands entries....
"This way you do not have to create special users for your pool or create extra commands entries inproject.json. Also, adding special commands for each environment breaks build once, deploy many times' as you will have to calldnu publishseparately for each environment, instead of publish once and deploying resulting artifact many times."
$ git tfs clone https://tfsserver/tfs/DefaultProjectCollection/ "$/path/to/tfs/project"
TFS repository can not be root and must start with "$/".
You may be able to resolve this problem.
The solution? Prepend MSYS_NO_PATHCONV=1 to the command, e.g.:$ MSYS_NO_PATHCONV=1 git tfs clone https://tfsserver/tfs/DefaultProjectCollection/ "$/path/to/tfs/project"
Initialized empty Git repository in C:/Projects/path/to/tfs/project/.git/
Fetching from TFS remote 'default'...
C6782 = 81584efc08348f7dc4c81297e4e82115789a1e3d
C6784 = 6a6a8bd55111286b24c7acd4825e4ef79030d693
C6863 = 60e8369f34b16a6123d7ed22bf60e59db46ee2e9
etc.
$ echo "* text=auto" >>.gitattributes $ rm .git/index # Remove the index to force Git to $ git reset # re-scan the working directory $ git status # Show files that will be normalized $ git add -u $ git add .gitattributes $ git commit -m "Introduce end-of-line normalization"Source: http://git-scm.com/docs/gitattributes#_end_of_line_conversion
rm .git/index followed by git reset is the same as git rm --cached -r.) [EDIT: I realize upon studying this that this version will touch all files in the source tree, whereas the version above does not.]$ echo "* text=auto" >>.gitattributes $ git rm --cached -r . $ git reset --hard $ git add . $ git commit -m "Normalize all the line endings"Source: Refreshing a repository after changing line endings (Github)
$ git rm --cached -r . $ git add .gitignore $ git add . $ git commit -m "Remove ignored files."
git reset vs git reset --hardgit reset and git reset --hard in the Github approach. I'll have to think about that another time. :)
git merge-file, which redoes the merge -- looks particularly interesting and powerful and helps out in the classic newlines style situations I often find myself in.Do
Set WSHShell = WScript.CreateObject("WScript.Shell")
WSHShell.SendKeys ("{SCROLLLOCK}")
Set WSHShell = Nothing
WScript.Sleep (2*1000)
Loop
Save as a VBS and run on whatever machine you want to stay open.Do
Set WSHShell = WScript.CreateObject("WScript.Shell")
WSHShell.SendKeys ("{SCROLLLOCK}{SCROLLLOCK}")
Set WSHShell = Nothing
WScript.Sleep (60*1000)
Loop
$ git rm --cached -r .Step 2 (optional): if it wasn't already present, add the .gitignore folder obtained from, e.g. the gitignore project:
$ git add .gitignoreStep 3: add back the folder
$ git add .
$ git commit -m "Remove ignored files."Voila! The resulting commit status (or diff) will show all undesired files being removed.
Processor performance object not found on PC01 Try running Exctrlst from microsoft.com to repair the performance counters.The
Exctrlst in question is from the Windows Resource Kit. After installing and running the Exctrlst utility, it still didn’t work. Luckily, more Googling led me to running this command:lodctr /rWhich of course didn’t work either. First I got an
error code 5, which I recognized as the old “Access denied” error code, so I ran it again as Administrator. No dice. That just gave me an error code 2.C:\> cd C:\Windows\SysWOW64 C:\Windows\SysWOW64> lodctr /r Info: Successfully rebuilt performance counter setting from system backup storeYay! And finally:
C:\Windows\SysWOW64> winmgmt.exe /RESYNCPERF C:\Windows\SysWOW64>A subsequence
pslist worked perfectly.
<div class="row"> <div class=”col-md-12”>This is some content inside the column</div> </div>
<div class=”container”> <div class="row"> <div class=”col-md-12”>This is some content inside the column</div> </div> </div>
$ git tfs clone https://me.visualstudio.com/DefaultCollection/_versionControl $/MyProject TFS repository can not be root and must start with "$/". You may be able to resolve this problem. - Try using $/C:/Program Files/Git/MyProject
$ MSYS_NO_PATHCONV=1 git tfs clone https://me.visualstudio.com/DefaultCollection/ $/MyProject Initialized empty Git repository in C:/Projects/MyProject/.git/
$ git tfs clone https://me.visualstudio.com/DefaultCollection/ $//MyProject Initialized empty Git repository in C:/Projects/MyProject/.git/
ML Dialects and Haskell: SML, OCaml, F#, Haskell - Hyperpolyglot
99 Bottles of Beer | Language F#
99 Bottles of Beer | Language Haskell
git diff -w | git apply --cached --ignore-whitespaceappcmd set config /section:staticContent /+[fileExtension=’svg’,mimeType=’image/svg+xml’].gitattributes, which is automatically created when you use Visual Studio to create a project that uses git as its version control system..gitattributes file that contains (among other things) this line at the top:.gitattributes file to comment out the "text=auto" line and save this file:
Then issue this command to un-stage all the files. It doesn't matter whether some of the files have meaningful changes. You're not resetting or undoing any file edits, you're merely removing them from the index:
Finally, restore the "text=auto" line in your .gitattributes file and save that file:
You should be all set. If you issue a git status command again you should see only the files that have meaningful changes, if any.
Last post I explained why I don't teach the SOLID design principles. Read the post for more detail, but the primary reason is that SOLID encourages heavy use of dependencies. Applying SOLID to a codebase for even a short time will yield dependencies on abstractions everywhere -- quickly producing a codebase that is unintelligible.
In TypeScript I can declare a parameter of a function as a type Function. Is there a "type-safe" way of doing this that I am missing?My favorite answer: http://stackoverflow.com/a/24034429/53107 from Drew Noakes:
Here are TypeScript equivalents of some common .NET delegates:interface Action<T> { (item: T): void; } interface Func<T,TResult> { (item: T): TResult; }
git push <remote> <remote>/<old_name>:refs/heads/<new_name> :<old_name>
git push origin origin/hotfix/Cant-load-assembly.0:refs/heads/feature/Fix-cant-load-assembly :hotfix/Cant-load-assembly.0
angular.element($0).scope()
Refreshing a repository after changing line endingsHere's the StackOverflow post from which GitHub gets their answer. There's also something interesting about removing the index, which I never knew about.
Trying to fix line-endings with git filter-branch, but having no luck
Add this to the .gitconfig file in your home directory to add rebase commands to the Tools menu:
[guitool "Rebase onto..."] cmd = git rebase $REVISION revprompt = yes [guitool "Rebase/Continue"] cmd = git rebase --continue [guitool "Rebase/Skip"] cmd = git rebase --skip [guitool "Rebase/Abort"] cmd = git rebase --abort [guitool "Pull with Rebase"] cmd = git pull --rebase
http://www.mydigitallife.info/keyboard-shortcuts-in-remote-desktop-connection-rdc-for-navigation/
- CTRL+ALT+END: Open the Microsoft Windows NT Security dialog box (CTRL+ALT+DEL)
- ALT+PAGE UP: Switch between programs from left to right (CTRL+PAGE UP)
- ALT+PAGE DOWN: Switch between programs from right to left (CTRL+PAGE DOWN)
- ALT+INSERT: Cycle through the programs in most recently used order (ALT+TAB)
- ALT+HOME: Display the Start menu (CTRL+ESC)
- CTRL+ALT+BREAK: Switch the client computer between a window and a full screen
- ALT+DELETE: Display the Windows menu
- CTRL+ALT+Minus sign (-): Place a snapshot of the entire client window area on the Terminal serverclipboard and provide the same functionality as pressing ALT+PRINT SCREEN on a local computer (ALT+PRT SC)
- CTRL+ALT+Plus sign (+): Place a snapshot of the active window in the client on the Terminal server clipboard and provide the same functionality as pressing PRINT SCREEN on a local computer (PRT SC)
I just found out from K. Scott Allen’s MVC3 training video on Pluralsight that the app_code directory in MVC3 is alive and well. Basically the Razor helpers here are pre-compiled and can be accessed globally in the application.
Apparently the usage in a Razor page is as follows:
@Common.Script(“myscript.js”, Url)
Note to self: compare and contrast with shared “editor” partial views.
Note: I composed this post with Windows Live Writer 2011 but it doesn’t seem to play well with Blogger’s own editor. ¡Qué pena!
<script src="../../Scripts/jquery-ui-1.8.11.min.js" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery-ui-1.8.11.min.js")" type="text/javascript"></script>
| Find what: | "\.\./\.\.{/[^"]*}" |
| Replace with: | "@Url.Content("~\1")" |
To discover WCF services, make sure that https is turned off. This is done in two places, apparently:
When you’re done, turn those things back on again.
[HttpPost] public ActionResult Edit(SomeEditModel form) { if (IsNotValid) { return ShowAView(form); } DoActualWork(); return RedirectToSuccessPage(); }
listControl.Text = "4 Year College";Well, unfortunately, no! The "Text" property is named that way for consistency across all ASP.NET controls and refers to the form value that is passed to the server when the page is submitted. So unfortunately for me, the "Text" property silently rejected my attempt to set it and the page did not work.Scott Hanselman and Rick Anderson collaboration and Mike Pope (Editor)
Both C# and VB versions:
<img src="//domain.com/img/logo.png">If the browser is viewing that current page in through HTTPS, then it'll request that asset with the HTTPS protocol, otherwise it'll typically* request it with HTTP. This prevents that awful "This Page Contains Both Secure and Non-Secure Items" error message in IE, keeping all your asset requests within the same protocol."