Author Archives: hungndv

About hungndv

A developer's worked since 2012. I outsource, fix bugs for web, desktop apps. Skills: html, css, javascript, json, jquery, php, wordpress, mysql, bootstrap, angularjs, web services, restful, git, svn, c#, linq, EF, asp.net mvc & webforms, winforms, wpf, sql server, wcf, architect, principles...

Python with .NET

  • Python for .NET (pythonnet)
    • work with Python 2+, Python 3+ for Unicode
    • Only Python interactive window in Visual Studio support intellisense.
  • IronPython
    • only work with Python 2
    • Python Tools for Visual Studio supports intellisense in code editor.

Both use the same machnism to read .NET code

import sys
import clr
 
sys.path.append("path/to/dll-or-exe-file")
 
clr.AddReference("ClassLibrary1")
 
from ClassLibrary1 import Class1
 
c = Class1()

To print Unicode string, set font of console windows:

 

 

Advertisements

Jenkins, Windows 7 x64, Git, MSBuild

Admin password: “C:\Program Files (x86)\Jenkins\secrets\initialAdminPassword”

Refer link https://wiki.jenkins.io/display/JENKINS/Git+Plugin

  • Use another account to run jenkins service
  • SSH enter directly:

  • SSH from file:

Plugin Multiple SCMs Plugin https://wiki.jenkins.io/display/JENKINS/Multiple+SCMs+Plugin to checkout many repos into many sub directories.

Nuget: download from https://www.nuget.org/downloads

MSBuild from C:\Program Files (x86)\MSBuild\

Config build section

Capture_Build_Section

Email:

Let jenkins open web browser, jenkin.war is in C:\Program Files (x86)\Jenkins:

java -jar jenkins.war --httpPort=...

New jenkins password “C:\Users\<user_name>\.jenkins\secrets\initialAdminPassword”

Copy job to new jenkins: https://stackoverflow.com/questions/9038748/how-do-i-copy-a-job-from-one-instance-to-another

 

The foreach statement.

The following example illustrates low-level use of IEnumerable and IEnumerator:

string s = "Hello";
// Because string implements IEnumerable, we can call GetEnumerator():
IEnumerator rator = s.GetEnumerator();
while (rator.MoveNext())
{
    char c = (char) rator.Current;
    Console.Write (c + ".");
}
// Output: H.e.l.l.o.

However, it’s rare to call methods on enumerators directly in this manner, because C# provides a syntactic shortcut: the foreach statement. Here’s the same example rewritten using foreach:

string s = "Hello"; // The String class implements IEnumerable
foreach (char c in s)
    Console.Write (c + ".");

From “C# 5.0 in a Nutshell”.