Posts

Creating a jar file in Android -

i want create jar file own classes. can give me sample code creating simple jar file in android? check creating jar file .class file in bin folder

c# 4.0 - How is the long method way of doing below code in "Lambda Expressions" in the past? -

public static ienumerable<t> get<t>(this ienumerable<t> source, func<t, bool> predicate) { foreach (t item in source) { if (predicate(item)) yield return item; } } like this: public static ienumerable<t> get<t> (ienumerable<t> source, func<t, bool> predicate) { var list = new list<t>(); foreach (t item in source) { if (predicate(item)) { list.add(item); } } return list; }

Java Swing - Problem in disabling JCheckbox -

i disabling jcheckbox , enabling of setenabled(...) method. but problem if disable unselected checkbox, becomes selected after enable it. i want of them have same state after being enabled had before being disabled. are enabling/disabling jcheckbox using actionlistener? if so, normal because when click on checkbox, isselected() status changes. what can add checks using isselected() , setselected() methods.

Problem passing json into jquery graph(flot) -

i trying retrieve json pass flot graph. know json right because hard coded check, i'm pretty sure i'm not passing right because it's not showing up. here's javascript: var total = $.ajax({ type: "post", async: false, url: "../api/?key=xxx&api=report&crud=return_months&format=json" }).responsetext; //var total = $.evaljson(total); var plot = $.plot($("#placeholder"),total); here's json: [ { data: [[1,12], [2,43], [3,10], [4,17], ], label: "e-file"}, { data: [[1,25], [2,35], [3,3], [4,5], ], label: "bank products" }, { data: [[1,41], [2,87], [3,30], [4,29], ], label: "all returns" } ], {series: {lines: { show: true },points: { show: true }}, grid: { hoverable: true, clickable: true }, yaxis: { min: 0, max: 100 }, xaxis: { ticks: [[1,"january"],[2,"february"],[3,"march"],[4,"april"],[5,"may"],[6,"june"],[7,"july"]...

ruby on rails - Why is my new ID always "1" -

i have parent-child relationship between 2 objects. parent :has_many :children child :belongs_to :parent when creating new parent, in same controller, i'm creating child. @mom = parent.new @child = child.new @mom.children << @child that seems go okay, parent has 1 more attribute - parent has favorite child @mom.favorite_child = @child seems should work, except let's 61st child in database, gets id of 61 (and know happening, because when check database, child record has id of 61). reason, when assign @child parent's "favorite_child" attribute, "favorite_child" gets set "1" - when need set "61". clues? seems parent needs like class parent has_many :children has_one :favorite_child, :foreign_key=>'favorite_child_id', :class_name => 'child' otherwise, doesn't know it's foreign key relationship, , you're trying assign object integer.

c# - VS2005: Found conflicts between different version of the same dependent assembly -

what mean if receive warning? mean project referencing same assembly different files? this can commonly occur if "project reference" has somehow reverted file reference. if have project referencing other projects, try removing references , re-adding them. can occur if 2 dependent projects each reference different version of third assembly.

How to use LINQ in Mono? -

i can't make system.linq (aka linq objects) work. running monodevelop 2.2.1 in ubuntu 10 lucid lynx mono 2.4.4. they advertise in site implemented linq, can't find enumerable.range or toarray() . what's wrong? i guess need is: in project options set "runtime version" "mono/.net 3.5" add reference system.core package (right click references in solution explorer) add "using system.linq" module after code should compile , execute hope helps, regards