Thursday, December 18, 2014
Creating Jar file from the command line
The Java Development Kit includes a command-line program named jar that can be used to create jar files. If all your classes are in the default package (like most of the examples in this book), then the jar command is easy to use. To create a non-executable jar file on the command line, change to the directory that contains the class files that you want to include in the jar. Then give the command
jar cf JarFileName.jar *.class
jar file with class that has a main method:
Main-Class: ClassName
where ClassName should be replaced by the name of the class that contains the main() routine.
jar cmf ManifestFileName JarFileName.jar *.class
to create the jar file. (The jar command is capable of performing a variety of different operations. The first parameter to the command, such as "cf" or "cmf", tells it which operation to perform.)
By the way, if you have successfully created an executable jar file, you can run it on the command line using the command "java -jar". For example:
java -jar JarFileName.jar
Saturday, December 13, 2014
UNIX command - How can I extract a range of lines from a text file on unix?
sed -n 1,3000p filename > newfile
SQL Forcing the current identity value to a new value
USE AdventureWorks2012;
GO
DBCC CHECKIDENT ('Person.AddressType', RESEED, 10);
GO
http://msdn.microsoft.com/en-ca/library/ms176057.aspx
Thursday, December 11, 2014
Installing Incredible PBX for CentOS 6.5 or 7
Installing Incredible PBX for CentOS 6.5 or 7
cd /root
wget http://incrediblepbx.com/incrediblepbx11.4.centos.tar.gz
tar zxvf incrediblepbx*
./IncrediblePBX*
Reset the FreePBX Administration Interface Password (http://localhost/admin)
/root/admin-pw-change
Sunday, November 9, 2014
Easily locate iOS Simulator files for Mobile Development
During mobile development when using the iOS Simulator you need to review local files that you may be saving to the file system or sqlite db files.
Apple previously located the iOS Simulator files at
/Library/Application Support/iPhone Simulator/[OS version]/Applications
In the new version of xcode 6 the above location is no longer present. A bunch of googling turned up nothing until I found a program called SimPholders that provides a program that locates your simulator files for you along with providing a menu that lists the different simulator versions. Amaze balls!
http://simpholders.com/
Monday, November 3, 2014
List of UI Components (Datagrid, etc.)
Here is a ongoing list of client side Javacript UI components:
jQWidgets - jQuery based UI Widgets.
SmartClient/Isomorphic http://www.smartclient.com
SmartClient with Column grouping example: http://smartclient.com/smartgwtee/showcase/#cube_analytics
SmartClient Enterprise Edition Demo: http://smartclient.com/smartgwtee/showcase
Extjs.com
Ext.net
Jqgrid
Aspose
KendoUI
Telerik
DevExpress
ComponentArt
Wijmo
Wijmo Knockout Grid - Loading Remote Data sample
Wijmo Knockout Grid - Loading Remote Blog Post
Sunday, October 26, 2014
duoco.de - Compile C# code to JavaScript in Visual Studio
DuoCode is an alternative compiler, powered by Microsoft® Roslyn, and integrated in Visual Studio.
It magically cross-compiles your C# 6.0 code into high-quality readable JavaScript code, enabling rapid development of web applications utilizing the extensive features of the C# language, the Visual Studio IDE, and the .NET Framework base class libraries.
Here is a code sample:
// Original C# code
using System;
using DuoCode.Dom;
using DuoCode.Dom.Global;
using System;
using DuoCode.Dom;
using DuoCode.Dom.Global;
namespace HelloDuoCode
{
static class Program
{
public class Greeter
{
private readonly HTMLElement element;
private readonly HTMLElement span;
private int timerToken;
{
static class Program
{
public class Greeter
{
private readonly HTMLElement element;
private readonly HTMLElement span;
private int timerToken;
public Greeter(HTMLElement el)
{
element = el;
span = document.createElement("span");
element.appendChild(span);
Tick();
}
{
element = el;
span = document.createElement("span");
element.appendChild(span);
Tick();
}
public void Start()
{
timerToken = window.setInterval((Action)Tick, 500);
}
{
timerToken = window.setInterval((Action)Tick, 500);
}
public void Stop()
{
window.clearTimeout(timerToken);
}
{
window.clearTimeout(timerToken);
}
private void Tick()
{
span.innerHTML = string.Format("The time is: {0}", DateTime.Now); // try to put a breakpoint here
}
}
{
span.innerHTML = string.Format("The time is: {0}", DateTime.Now); // try to put a breakpoint here
}
}
static void Run()
{
System.Console.WriteLine("Hello DuoCode");
{
System.Console.WriteLine("Hello DuoCode");
var el = document.getElementById("content");
var greeter = new Greeter(el);
greeter.Start();
}
}
}
var greeter = new Greeter(el);
greeter.Start();
}
}
}
// JavaScript code generated by DuoCode
HelloDuoCode.Program = $declare("HelloDuoCode.Program", System.Object, 0, $HelloDuoCode$Assembly, function($t, $p) {
$t.Run = function Program_Run() {
System.Console.WriteLine$10("Hello DuoCode");
HelloDuoCode.Program = $declare("HelloDuoCode.Program", System.Object, 0, $HelloDuoCode$Assembly, function($t, $p) {
$t.Run = function Program_Run() {
System.Console.WriteLine$10("Hello DuoCode");
var el = document.getElementById("content");
var greeter = new HelloDuoCode.Program.Greeter.ctor(el);
greeter.Start();
};
});
HelloDuoCode.Program.Greeter = $declare("Greeter", System.Object, 0, HelloDuoCode.Program, function($t, $p) {
$t.$ator = function() {
this.element = null;
this.span = null;
this.timerToken = 0;
};
$t.ctor = function Greeter(el) {
$t.$baseType.ctor.call(this);
this.element = el;
this.span = document.createElement("span");
this.element.appendChild(this.span);
this.Tick();
};
$t.ctor.prototype = $p;
$p.Start = function Greeter_Start() {
this.timerToken = window.setInterval($delegate(this.Tick, System.Action, this), 500);
};
$p.Stop = function Greeter_Stop() {
window.clearTimeout(this.timerToken);
};
$p.Tick = function Greeter_Tick() {
this.span.innerHTML = String.Format("The time is: {0}", $array(System.Object, [System.DateTime().get_Now()])); // try to put a breakpoint here
};
});
var greeter = new HelloDuoCode.Program.Greeter.ctor(el);
greeter.Start();
};
});
HelloDuoCode.Program.Greeter = $declare("Greeter", System.Object, 0, HelloDuoCode.Program, function($t, $p) {
$t.$ator = function() {
this.element = null;
this.span = null;
this.timerToken = 0;
};
$t.ctor = function Greeter(el) {
$t.$baseType.ctor.call(this);
this.element = el;
this.span = document.createElement("span");
this.element.appendChild(this.span);
this.Tick();
};
$t.ctor.prototype = $p;
$p.Start = function Greeter_Start() {
this.timerToken = window.setInterval($delegate(this.Tick, System.Action, this), 500);
};
$p.Stop = function Greeter_Stop() {
window.clearTimeout(this.timerToken);
};
$p.Tick = function Greeter_Tick() {
this.span.innerHTML = String.Format("The time is: {0}", $array(System.Object, [System.DateTime().get_Now()])); // try to put a breakpoint here
};
});
Subscribe to:
Posts (Atom)