Error
  • JHTMLicon not supported. File not found.
  • JHTMLicon not supported. File not found.
  • JHTMLicon not supported. File not found.
  • JHTMLicon not supported. File not found.
  • JHTMLicon not supported. File not found.
  • JHTMLicon not supported. File not found.
  • JHTMLicon not supported. File not found.
  • JHTMLicon not supported. File not found.
  • JHTMLicon not supported. File not found.
  • JHTMLicon not supported. File not found.
  • JHTMLicon not supported. File not found.
  • JHTMLicon not supported. File not found.
  • JHTMLicon not supported. File not found.
  • JHTMLicon not supported. File not found.
  • JHTMLicon not supported. File not found.

code

Select state name code
Tuesday, 21 February 2012 14:08
// Thanks for the code!


// insert code here..

Read more: http://feeds.dzone.com/~r/dzone/snippets/~3/i_RlIR1ReCE/14737

 
DirectX
Tuesday, 21 February 2012 12:39
Download newest version of DirectX 2012 for free


// insert code here..

Read more: http://feeds.dzone.com/~r/dzone/snippets/~3/MsbSfpjlW-Y/14735

 
Use base64 for embedding raster data in source file
Wednesday, 08 February 2012 12:25
When we create a simple script with gui, it should be nice to puts the icons in the source script,
so whe can diffuse the code without any packaging.

This code create a ruby source which declare some file-content coded in ASCII/.base64
In the source, he put get_icon_filename(name) which put content to a temporary file and return
the filename created :


# usage: ruby gene.rb ../angel.png face_crying.png face_smile_big.png > icons64.rb
require 'base64'
require 'tmpdir'

str=<require 'base64'
require 'tmpdir'
$icons={}
EEND

lvar=[]
ARGV.each { |fn|
varname=File.basename(fn).split('.')[0].gsub(/[^a-zA-Z0-9]+/,"_").downcase
File.open(fn,"rb") { |f|
str+= "\n$icons['#{varname}']=< lvar << varname
}
str+=<<'EEND'

def get_icon_filename(name)
raise("icon '#{name}' unknown in #{$icons.keys}") unless $icons[name]
fname=File.join(Dir.tmpdir,name+".png")
puts "#{name} ==> #{fname} / #{$icons[name].size}" if $DEBUG
File.open(fname,"wb") { |f| f.write($icons[name].unpack('m')) } unless File.exists?(fname)
fname
end
EEND

puts str

STDERR.puts "#{lvar.join(", ")} done size=#{str.size}."


This generate a code like :

require 'base64'
require 'tmpdir'
$icons={}

$icons['angel']=<iVBORw0KGgoAAAANSUhEUgAAAFAAAAB9CAYAAAA1I+RFAAAABHNCSVQICAgI
....
Hc7GYuTuE23+EVbG/wE7dk77N6cYpQAAAABJRU5ErkJggg==
EEND

$icons['face_crying']=<iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAABHNCSVQICAgI
fAhkiAAAAAlwSFlzAAAN1wAADdcBQiibeAAAABl0RVh0U29mdHdhcmUAd3d3
...
31Ubdjyxtik75Th+55rrWLbzbO1ULTcJrJnruL1TMiGArs18rf0vPLcG1l08
LtAAAAAASUVORK5CYII=
EEND

$icons['face_smile_big']=<iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAABHNCSVQICAgI
.....
IQlXZwKuzrjtNLc0aDs1ABcd0k6ypVidf+6Owx6Eu22ZAAAAAElFTkSuQmCC
EEND

def get_icon_filename(name)
raise("icon '#{name}' unknown in #{$icons.keys}") unless $icons[name]
fname=File.join(Dir.tmpdir,name+".png")
puts "#{name} ==> #{fname} / #{$icons[name].size}" if $DEBUG
File.open(fname,"wb") { |f| f.write($icons[name].unpack('m')) } unless File.exists?(fname)
fname
end


Here a little Shoes app for use raster content

require 'green_shoes'

<< "contents of 'icons64.rb' here" >>

Shoes.app do
stack {
background "#A0A0B0".."#A0A0FF"
$icons.keys.each { |name|
para name
image get_icon_filename(name)
}
}
end



Or a Ruiby app (see https://github.com/raubarede/Ruiby):


require_relative 'Ruiby/lib/ruiby.rb'
<< "contents of 'icons64.rb' here" >>

class X < Ruiby_gtk
def component()
stack do
$icons.keys.each do |n|
flow {
slot(label(n))
slot(label("#"+get_icon_filename(n) ))
}
end
end
end
end
Ruiby.start { X.new("test",100,100) }


Read more: http://feeds.dzone.com/~r/dzone/snippets/~3/Kb-W7vdtXW0/14645

 
Add column clone to data table in c#
Tuesday, 31 January 2012 09:36
Add following line to your code to clone a column


dt.Columns.Add("StudentID", System.Type.GetType("System.String"),"GNRNumber");

Read more: http://feeds.dzone.com/~r/dzone/snippets/~3/WAV35DpR5rI/14583

 
Server side evaluation of Grid View row.
Monday, 30 January 2012 07:31
Following is grid view code for aspx page.



Width="100%" OnRowDataBound="gv_RowDataBound">


































































Following code evaluates each row of grid:

protected void gv_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{

Label lblStudentName = ((Label)e.Row.FindControl("lblStudentName"));
Image imgControl = ((Image)e.Row.FindControl("imgControl"));

lblStudentName.Text = Convert.ToString(DataBinder.Eval(e.Row.DataItem, "StudentName"));
imgControl.ImageUrl = (Convert.ToBoolean(DataBinder.Eval(e.Row.DataItem, "Present")) ? "Images/Checkmark.png" : "Images/Cross.png");
}
}

Read more: http://feeds.dzone.com/~r/dzone/snippets/~3/P3QQaXrJRl8/14541

 
Start
Prev
1


Page 1 of 7
Taxonomy by Zaragoza Online