Since the Magento REST API for applying websites to products is currently bugged, use this workaround: string websiteIds = @”{“”0″”:{“”website_id””:””3″”},””1″”:{“”website_id””:””4″”}}”;
Category: .Net
NLog.config using NuGET
Most tutorials online teaches you to add the NLog configuration using the “Project > Add > New Item” method and […]
Databinding Collections in WPF: IList required
If your data is in an IEnumerable (such as data returned by a yield function), IList< T >, or Dictionary< […]
A Better Enumerable.Range
Personally, I don’t enjoy this all that much: Enumerable.Range(0, GetTotalEmployees()), at least when compared to doing something more like this: […]
Disable DevExpress Wizard Finish Button with code behind
因為 UI 的流暢,所以在所有動作完成前 Finish Button 應該要被隱藏,不過 DevExpress 似乎沒提供,而找到的這篇 Disable Wizard Finish Button with code behind 提供的解法是 You can accomplish this […]
Add New Relic To Elastic Beanstalk for .NET
Add New Relic To Elastic Beanstalk for .NET The instructions and files in this post can be used to configure […]
Manual Dependency Injection
If you don’t like any of the plenty IoC out there you gonna love this fancy way to inject your […]
Routing Basics in ASP.NET MVC
When getting started with ASP.NET MVC and/or the ASP.NET Web API, it can be overwhelming trying to figure out how […]
Icons on SyndicationItem
First we create the SyndicationFeed object and read XML data from a feed at the address FeedUri: Dim SyndFeed As […]
Search for a Gameobject by name, inside a Transform hierarchy
Usage Transform tTrans = anotherTransform.Search(“desiredName”); Extension public static Transform Search(this Transform target, string name) { if (target.name == name) return […]
Compose bytes to UTF-8 string
先稍微記一下 UTF-8。 大於 ASCII 碼的,就會由上面的第一位元組的前幾位表示該 unicode 字元的長度,比如 110xxxxxx 前三位的二進位表示告訴我們這是個 2BYTE 的 UNICODE 字元;1110xxxx 是個三位的 UNICODE 字元,依此類推;xxx 的位置由字元編碼數的二進製表示的位填入。越靠右的 x 具有越少的特殊意義。只用最短的那個足夠表達一個字元編碼數的多位元組串。注意在多位元組串中,第一個位元組的開頭 “1” […]
Streamtastic – Own3d and Twich.tv C# API library.
So I made this during the weekend, it’s a simple to use C# library that developers can use to list […]
Thoughts on being a programmer.
Thoughts on being a programmer Don’t be an asshole. Simple code is hard to write. Exquisitely simple code is exquisitely […]
Visual Studio 2013/2012 enhanced scroll bar and code preview
Magna Carta of code Do you ever lose context debugging a 1,000 lines code in Visual Studio? Tired of cursing […]
Quick DropDownList of days/range with LINQ
@{ var days = Enumerable.Range(1, 31).Select(i => new SelectListItem { Text = i.ToString(), Value = i.ToString() }); SelectList source= new […]
Write a program to find the longest word made of other words
using System; using System.Collections.Generic; using System.Linq; namespace LongestWordFromWords { internal class Program { public static string FindLongestWords(IEnumerable<string> listOfWords) { if […]
Routing Basics in ASP.NET Web API
As noted in Routing Basics in ASP.NET MVC, routing in ASP.NET Web API is functionally very similar to the standard […]
IDisposable in Java
Java 7 introduces an equivalent pattern to C#’s IDisposable pattern, AutoClosable, or try-with-resources. For example: try (BufferedReader br = new […]
The road map to develop indie games
An epic link, made of epic resources: http://lioninngames.com/the-roadmap-to-develop-indie-games/ via @david_bonilla on Twitter I really want to develop a game, but […]
Disable control while EditForm is active
Use CellEditorInitialize method. protected void GridView_CellEditorInitialize (object sender, ASPxGridViewEditorEventArgs e) { if (!GridView.IsNewRowEditing) { if (e.Column.FieldName == FIELD_NAME) { e.Editor.ReadOnly […]