Win a copy of Rust Web Development this week in the Other Languages forum!

yoel fisher

+ Follow
since Jun 19, 2018
Cows and Likes
Total received
In last 30 days
Total given
Total received
Received in last 30 days
Total given
Given in last 30 days
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by yoel fisher

fixed I changed this code:

changed add to setContentPane

it's quite a mess. in my opinion, you need to separate logic and view. this can also be done with one panel.

I never did this in java swing so I gave it a go:

import it to eclipse and see if you like this style better (i used gridbag layout).

2 years ago

Jan Rad wrote:I have a CSV file containing 3 entities, how do I create a scatterplot without JCharts??

comment: if this does not help you personally I write it as a future reference for anyone needing to write a graph from scratch in java from a csv.

I did something like that a month ago.

for charts from scratch I used the normalization equation described here:

using the knowledge I got from this article I learned how to create charts from scratch( and minimaps, sliders etc).

how do you put a dot with the value of 5000 on a chart of 100px? you need to normalize it and find the relative position within the 100 px graph.

let's say the max val of the 5000 is 10000. then:
graphx = (5000/10000)*100 = 50

you can do the same for y val or even z if it's a 3d graph.

for the csv file.

all csv files have a line separator (for each row) and each line have separators (for columns).
the first row is the column names usually (this is important to remember as these are not values.

for example (csv file):


so to get data from the file (after you get it using file io), you need to split it by new line (.split("\n") ).
now you have all the csv file rows in an array.

to get the rows columns split it by comma "," ( .split(",").

let's say we want bens age we will write something like:

String row  = csv[1];

String[] cols = row.split(",")

System.out.print(cols[2]);//prints 33

this can also be done the same way in: c++,php,js,python etc. you can use regex instead\with split too.

in your case, you will need a class to do this with loops and methods that return all the colls.

I can't give you my code as its a clients paid work and he asked me not to give it to anyone.

if it's beyond your level, don't give up, learn java anyway you can until you master the basics.

also, swing was not easy to master but once you do its great.

if you have a specific question I'll try to help.

I'm a java private tutor, I help people learn the java programming language from the ground up.

I'm giving a free trial lesson to remove any doubts potential students may have about this service.

my curriculum/syllabus is the java core and alot of basic projects and assignments I have gathered to teach people java and programming.

I have taught people from around the world (using skype and screen sharing software like teamviewer) from total beginners to people that got stuck somewhere along the way and needed personal help.

beyond basic syntax, I have gathered/developed assignments that help develop logic, from when I started learning programming, to these days where I give them to my students to develop their "machine logic" for programming. that way I build the students logic from the ground up instead of just teaching confusing syntax they don't understand how to use, or throwing them into deep water with complex tasks\assingments while they don't have basic knowledge and practice (like alot of schools and other sources often do).

I also have other assignments for the student to practice on their own outside of lessons.

programming takes practice my service is for serious people only.

the lessons hourly rates and packages are listed on this page (i cant edit here and prices may change so I don't write them here):

to contact me you can use this contact form:

my website has alot of articles about programming for those who want to study the basics on their own.

some people who contacted me asked similar questions so I will clarify them for all (faq if you like):

*"do you teach other programming languages other than java"

yes i can also teach web development: html,css,javascript,jade,sass,jqury,bootstrap,php, WordPress development (plugins and themes).

i can also teach python,c++,c# (monodevlop).

for mobile dev I use corona sdk it uses lua scripting language.

I can also teach game programming, I have a framework I created for game dev in java and js. from time to time I join game jams(like ludom dare) for fun.

if you're a total beginner I suggest you start with java.

*"can you show me your github or stuff you did"

sure 50+ github repos enjoy:

*"can you solve my academic assignment":

I can but it will be a waste of time and money and you won't learn anything, learning programming probably will help you more, with assignments and anything else. its a prestige and very profitable profession and worth learning properly, even without a diploma or degree.

for anything else, you can contact me.

3 years ago

Liutauras Vilda wrote:Welcome to the Ranch.

I'm looking to your github repository you advertised, and in particular looking to some Java project.

What kind of coding style convention(s) you are following building Java applications?

for the swing gui softwere. first i separate the logic and gui as much as i can, i try to separate concerns as much as i can in general.
i create a child class for each jframe and jpanel, this way its easier to control everything.  in the panel class i also implemented action listener interface. in that case its becuse i didnt have much user input to handle, otherwise i would of done it in a separate class. not much of an mvc pattern but something on those lines.

in general in all my programming i use refactoring principles, out of the 70+ i use 10 of them. consciously i use extract alot and search my code where i can extract a method or class. unconsciously i noticed i chack for class intimacy (class calling another class attributes and methods too much), it became part of the way i think. thers alot of things i do without realizing.

i have a few comments conventions, after a closing curly brackets i write what it ends. for methods i write a long comment for the method description, input and output(i do this for code i give other people).
sometimes i add example use of class and methods in comments. i use my own documentation i created using jquery (inspired by some other website that dose the same).

almost in every framework api i used i end up simplifying it , separating the complex stuff to a class or functions doing simple common stuff with 1 line (usually a function i created) instead of 10. probably extract method again(it became an instinct).

in game dev its different mvc dont work that good (its better for db based apps) factory pattern is great for creating stuff . my game framework is based on somthing called world entity, basicly the world is a scene with alot of entities ("actors").

i studied database design a few years ago, so i know how to create and use a rational database(mostly sql), i have a framework for crud with sql i port (also ported to java).
for user based apps i use rbac user system also ported to java from php.

my php crud class:

refrences to the holy refactoring bible:

inappropriate-intimacy(will not be tolerated!):

flashpunk, a game framework i know inside out (thats how i started learning gamedev):

factory pattren (example with shapes but works great with enemies bullets etc for games, its like a middelmen):

rbac wiki:

i learned a lot of things over the years too much to cover, basically i do: database based  apps, gui , game programing (and sometimes just graphics for graphs) and tools (frameworks, code generators,web bots).
3 years ago
some people who contacted me asked similar questions so i will clarify them for all (faq if you like):

*"do you teach other programming languages other then java"

yes i can also teach web development: html,css,javascript,jade,sass,jqury,bootstrap,php, WordPress development (plugins and themes).

i can also teach python,c++,c# (monodevlop).

for mobile dev i use corona sdk it uses lua scripting language.

i can also teach game programming, i have a framework i created for game dev in java and js. from time to time i join game jams(like ludom dare) for fun.

if your a total beginner i suggest you start with java.

*"can you show me your github or stuff you did"

sure 45 github repos enjoy:
some of them are also things i did with a team (1 or two shared repos). also i didnt post all of my open source projects yet so its not all i have.

lately i have been using java to create tools:

i had a static tut website project, one page app , each tutorial had its own html file, it became a real drag writing it by hand so i created a tool to generate the html code.
it creates swing forms dynamically depending on your tut structure. i dont know if its the latest. but in the latest you can save projects which is realy helpfull.
took me less then a day to create (i created this sort of gui code makers before), im planning on adding an export as pdf option.

another not so simple webdev project solved with java. we needed to use a free crud table framework with a commercial license. jtable.js was the best option, but it had a js nested object within nested object
for each table which made creating more then 5 tables really long and frustrating.
again gui code generation to the rescue , my software made that process much faster. i also made a jtable.js helper functions to make it easier to use the api. and a php class to handle most common server database actions (crud).

i was told java dosnt have something like windows console (like in c++ console programs etc) so i implemented one using swing. i made a few test programs.
also i made a book library management system to test if it will work with bigger projects .

in game dev im used to a particular design pattern called world entity. most game engines dont have this, so i create a framework that dose what im used to.
i dont know any other way to create games with the same efficiency and order. and i will not compromise for less. i have one like it for phaser.js too.
it helped me trough alot of 48 hour game making marathons (game jams).

other then that i have created a whole java course for beginners on my pc.

as i mentioned my usual rates are 15$ for a lesson, it will rise in the future.
i decided to continue giving the first lesson for free just to remove any risk from the client/student. you can try me as a teacher for 1 free lesson.

to contact me you can use this forum pm or this google form:

3 years ago
after a 100 views and paid advertising not a single person contacted me from this forum. i know there are people here that learn java and would benefit from my services.
sure one lesson wont be enough i want to make a living off tutoring , but im reasonable. my normal rates are 15$ which is very cheap.

but im giving you a chance to test my services without any risk, i see that one lesson might not be enough for you to even contact me.

so now im giving 2 free lessons for the first 5 people to contact me through here .

(in your message please write that your from the code ranch so i will know that i need to give you two free lessons).

first person to contact me will get his 3rd lesson for 10$ instead of 15$. you wont find a better deal for a java private teacher services anywhere and its for a limited time and in limited quantity.
if i was a beginner and was offerd two free lessons i would at least be interested.

the lessons will be via teamviewer so it dosnt matter where you are from. i worked with students from all around the world using my computer. if your a student in a university i can help you with your assignments i solved alot of java computer science assignments from alot of places. if you want to learn java better and your not a total beginner, i can help you learn how to use swing for gui based programs, i can also teach how to use a database and create database based applications, i can also teach you how to use design patterns like mvc and how to write better code using refactoring. i have alot to teach no matter what level you are in java. and i offer two lessons for free ther is no risk for you.

contact me for more details.

3 years ago
Tim Holloway is right.

i will say it simpler. if somone wants to use your softwere thy will install python and lua or what ever. they may even go throgh complex installations.
if your target users are programmers they wont be shay using cli with tools like grunt node.js etc etc.

now your judging a programming language on if it can create exe or not?

in the end of the day all programming languages have the same logic (machine logic). in the end its only tools and you use the one you need or like.
or whatever makes you money or brings results.
3 years ago
simple use the fat jar maker:

you can create executable for linux and mac with the same java code.

the simplest sulution
3 years ago
im a private tutor teaching programming in java. im giving away a free lesson to the first 10 students that contact me.

most tutors on the internet if they give a trail lesson it usually costs a little. with me you have no risk.
you get 1 free lesson.

here is the google form:
3 years ago
ok cool, here it is:

i also have tuts on other swing components. use hd quality to watch it.
its part of my old videos , i was not used to reading text to a mic back then.
thers also the transcript of the vid and the source code on github.
3 years ago