Saturday, 24 August 2013

set up javafx scene with multiple nodes

set up javafx scene with multiple nodes

I am trying to set up my javafx scene, but i have failed miserable.
basically what i am trying to do is as per attached photo.

I have tried to set up a gridpane and then position another gridpane
withing it so that I can set up the boxes and labels however this is not
working properly.
I do not want to use JXML.
can you guys recommend how to go about this set up.

Friday, 23 August 2013

Datatables: single column filter for multiple table

Datatables: single column filter for multiple table

I have two tables oTable and aTable using Datatables. I want each table
can do single column filter.
oTable = $("#datalist").dataTable({....});
aTable = $("#tracedata").dataTable({....});
filter code
It just work for oTable only. How to make aTable could filtering it column
but with more efficient code?

php : result of sum array values is wrong

php : result of sum array values is wrong

I have an array:
$test =array('49'=> '-0','51'=> '-0','50'=> '0','53'=> '-1.69','55'=>
'0','57'=> '-2','59'=> '-6','60'=> '-12','65'=> '0','66'=> '0','67'=>
'21.69','69'=> '0','70'=> '0','71'=> '0',);
echo "\n".'===== First Method ========';
echo "\n\n".print_r($test);
echo "\n array_sum: ".array_sum($test);
echo "\n\n".'===== Second Method ========';
$total = 0;foreach($test as $value) $total += $value;
echo "\n foreach:".$total."\n";
the result is

it is wrong, the result should be 0, not 3.5527136788E-15, how to fix it ?

Excel Find column number of a column thru column name and access data of all rows

Excel Find column number of a column thru column name and access data of
all rows

I have created an Excel sheet (xls or xlsx) dynamically who has several
cols 50+. Most of the cols have a single row data. Some have multiple rows
data. Their are few same col names also. My concern is I want to access
cols of multiple rows whose col names are same. For eg : Placement Header
Val1 Val2 Vall3 Header Val1 Val2 Val3
TRUE FIP 1 2 3 SI A 4 5 6 Sheer 7 8 9 SI B 5 2 6 Cont 6 5 4 ----- 1 List
---------- ----------- 2 List -------
1 List & 2List data belongs to same class and is both are added with same
column names.
I am using OLEDB to read data. My class contains properties (Header, Val1,
Val2, Val3). To read data, I iterate thru each property of class and store
data. But with this case, I have multiple tables with same headers.
Is their a way, that I can find column number of col "Placement" and then
seek next 3 cols in and store all 3 rows data in a list.
Or any other alternative method to access the columns of this type and
store them in different Lists object.
Any help is highly appreciative. I am stuck here and am in hurry.

Simple tutorial example (lambda expression) doesn't run

Simple tutorial example (lambda expression) doesn't run

Finally decided to start a bit of experimentation on the new features of
jdk8, namely the lambda expressions following the tutorial. For
convenience, I stripped-down the example, see SSCCE below.
Typing out the predicate just runs fine, refactoring it to a lambda
expression as suggested (and actually done) by Netbeans compiles (?)
without errors, but doesn't run. The laconic console printout is
Fehler: Hauptklasse simple.Simple konnte nicht gefunden oder geladen werden
("Error: main class couldn't be found or loaded")
Environment:
jdk: jdk-8-ea-bin-b102-windows-i586-08_aug_2013.exe
Netbeans 7.4 beta, bundle from 14.7.2013. Not sure if that's the latest,
couldn't download from the Netbeans site (got a "content encoding error"
when clicking on its download link)
BTW, thought of using Netbeans only because it already has support for
jdk8 (if not netbeans, who else ;-) - the eclipse beta preview from
efxclipse has a similar issue (compiling but not running the example). So
being definitely out off my comfort zone, possibly some very stupid
mistake on my part... ?
package simple;
import java.util.ArrayList;
import java.util.List;
import java.util.function.Predicate;
public class Simple {
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
List<Member> members = createMembers();
printMembers(members);
// implement predicate directly, runs fine
// Predicate<Member> predicate = new Predicate<Member>() {
// public boolean test(Member member) {
// return member.getAge() >= 18;
// }
// };
// predicate converted to lambda, fails to run
// "class couldn't be found"
Predicate<Member> predicate = (Member member) -> member.getAge()
>= 18;
for (Member member : members) {
if (predicate.test(member)) {
member.printMember();;
}
}
}
public static class Member {
private String name;
private int age;
public Member(String name, int age) {
this.name = name;
this.age = age;
}
public int getAge() {
return age;
}
public void printMember() {
System.out.println(name + ", " + getAge());
}
}
private static List<Member> createMembers() {
List<Member> members = new ArrayList<>();
members.add(new Member("Mathilda", 45));
members.add(new Member("Clara", 15));
members.add(new Member("Gloria", 18));
return members;
}
}

how to plot graph using ggplot in R

how to plot graph using ggplot in R

i have data frame which contains Quarter and Unique Customer ID columns
what i want is plot a graph which will count the Unique customers by
Quarter.
what i tried is
uniquegraph<-data.frame(uniqueCustomerdf)
> uniqueCustomer<-c(uniquegraph$Customer.Id)
> Quarter<-c(uniquegraph$Quarter)
> uniquegraphplot<-data.frame(uniqueCustomer=uniqueCustomer,Quarter=Quarter)
> ggplot(mygraphdf,aes(x=myquarter,y=totalunitprice)) +
geom_bar(stat="identity")
and also i tried hist
hist(uniqueCustomer, plot=TRUE)
but here how to assign Quarter i am not getting

Thursday, 22 August 2013

((((((((((((( __ READ __ BEFORE ___ DELETED ___ BY ___ MODS ___ ))))))))))))))

((((((((((((( __ READ __ BEFORE ___ DELETED ___ BY ___ MODS ___
))))))))))))))

You are about to be provided with information to
start your own Google.
Some people posted comments and said this can not
be done because google has 1 million servers and we do not.
The truth is, google has those many servers for trolling
purposes (e.g. google +, google finance, youtube the bandwidth consuming
no-profit making web site, etc ).
all for trolling purposes.
if you wanted to start your own search engine...
you need to know few things.
1 : you need to know how beautiful mysql is.
2: you need to not listen to people that tell you to use a framework
with python, and simply use mod-wsgi.
3: you need to cache popular searches when your search engine is running.
3: you need to connect numbers to words. maybe even something like..
numbers to numbers to words.
in other words let's say in the past 24 hours people searched for
some phrases over and over again.. you cache those and assign numbers
to them, this way you are matching numbers with numbers in mysql.
not words with words.
in other words let's say google uses 1/2 their servers for trolling
and 1/2 for search engine.
we need technology and ideas so that you can run a search engine
on 1 or 2 dedicated servers that cost no more than $100/month each.
once you make money, you can begin buying more and more servers.
after you make lots of money.. you probably gonna turn into a troll
too like google inc.
because god is brutal.
god is void-state
it keeps singing you songs when you are sleeping and says
"nothing matters, there is simply no meaning"
but of course to start this search engine, you need a jump start.
if you notice google constantly links to other web sites with a
trackable way when people click on search results.
this means google knows which web sites are becoming popular
are popular, etc. they can see what is rising before it rises.
it's like being able to see the future.
the computer tells them " you better get in touch with this guy
before he becomes rich and becomes un-stopable "
sometimes they send cops onto people. etc.
AMAZON INC however..

will provide you with the top 1 million web sites in the world.
updated daily in a cvs file.
downloadable at alexa.com
simply click on 'top sites' and then you will see the downloadable
file on the right side.
everyday they update it. and it is being given away for free.
google would never do this.
amazon does this.
this list you can use to ensure you show the top sites first in your
search engine .
this makes your search engine look 'credible'
in other words as you start making money, you first display things
in a "Generic" way but at the same time not in a "questionable" way
by displaying them based on "rank"
of course amazon only gives you URLS of the web sites.
you need to grab the title and etc from the web sites.
the truth is, to get started you do not need everything from web sites.
a title and some tags is all you need.
simple.
basic.
functional
will get peoples attention.
i always ask questions on SO but most questions get deleted. here's
something that did not get deleted..
How do I ensure that re.findall() stops at the right place?
use python, skrew php, php is no good.
do not use python frameworks, it's all lies and b.s. use mod-wsgi
use memcache to cache the templates and thus no need for a template engine.

always look at russian dedicated servers, and so on.
do not put your trust in america.
it has all turned into a mafia.

google can file a report, fbi can send cops onto you, and next thing you know
they frame you as a criminal, thug, mentally ill, bipolar, peadophile, and
so on.
all you can do is bleed to death behind bars.
do not give into the lies of AMERICA.
find russian dedicated servers.
i tried signing up with pw-service.com but i couldn't do it due to
restrictions with their russian payment systems and so on..
again, amazon's web site alexa.com provides you with downloadable
top 1 mil web sites in the form of a cvs file.
use it.
again, do not give into python programmers suggesting frameworks for python.
it's all b.s. use mod_wsgi with memcache.
again, american corporations can ruin you with lies and all you can do is
bleed to death behind bars
again, a basic search engine needs : url, title, tags, and popular searches
can be "cached" and words can be connected to "numbers" within the mysql.
mysql has capabilities to cache things as well.
cache once, cache twice, and you will not need 1 million servers in order
to troll.
if you need some xdotool commands to deal with people calling you a troll
here it is;
xdotool key ctrl+c
xdotool key Tab Tab Tab Return
xdotool type '@'
xdotool key ctrl+v
xdotool type --clearmodifiers ', there can not be such thing as a `troll`
unless compared to a stationary point, if you are complaining, you are not
stationary. which means you are the one that is trolling.'
xdotool key Tab Return
create an application launcher on your gnome-panel, and then select the
username in the comments section that called you a 'troll' and click the
shortcut on the gnome-panel.
it will copy the selected username to the clipboard and then hit TAB TAB
TAB RETURN
which opens the comment typing box. and then it will type @ + username +
comma, and then the rest.
...........................................................................................................................................................