This week's giveaway is in the Cloud/Virtualization forum.
We're giving away four copies of Production-Ready Serverless (Operational Best Practices) and have Yan Cui on-line!
See this thread for details.
Win a copy of Production-Ready Serverless (Operational Best Practices) this week in the Cloud/Virtualization forum!

Giovanni Montano

Ranch Hand
+ Follow
since Apr 29, 2014
Giovanni likes ...
Android Open BSD Slackware
Based in the Netherlands, I am Italian, this is not my real name, but similar.
Like Running, Bach, Plato, History, Football, Green tea, Statistics.

Android/Java/Python/Machine Learning
at the moment as an hobby
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 Giovanni Montano

Winston Gutkowski wrote:

Giovanni Montano wrote:...a good way to understand this kind of things is a Digi Comp I made in 1963

Blimey. Someone who's been around longer than me. Kudos.

Like your quote, BTW. Very Zen. :-)


just read, I am quite junior instead, but love retrocomputing
3 weeks ago
yesterday I could hear without attending the second part of the conference, and he mentioned a good way to understand this kind of things is a Digi Comp I made in 1963
2 months ago
As suggested by Campbell Richie I am going to play with javap, or better as I use Kotlin, I use the intelliJ function that shows bytecode directy, this opened me a word
I am going to study this. We live in an era of frameworks that do a lot of magic, I really want to know  this kind of  assembly(?) thing

So far so good, I need to study it a bit before to express any opinion, thank you very much, hopefully will come back in this thread, nice to see all your reactions. Even if Campbell Richie noticed that I am doing an high level language, is beautiful because
1) is kinda of sexy, fascinating experience, feel a kind of god
2) Who was a child that was breaking the toys to see what was inside, want to do it for curiosity
3) You become a better programmer. Do not agree? As never ending junior, I spent a lot of time to try to understand frameworks that were doing a lot of magic, making really difficult to debug third party libraries, to understand why something is happening, once one understand how the machine process things, it looks much easier doing some coding

2 months ago

Winston Gutkowski wrote:Simple answer: No.

An "if" statement in Java is equivalent to a 'if' or 'branch' statement in the lower-level language that Java has been compiled into. If you're really interested, there are probably specifications for how the JVM expects it to behave, but basically an "IF" is an"IF".
It's about the simplest computer instruction there is.



Will come back after 20ish hours from now, so that can manage to do my javap thing. . Is a magic thing that gives me anguish  to execute commands without even know what the machine is really doing, I want to go in an homeopathic way, with really small steps at the root of how all this happens

you say is the simplest instruction an if, but I guess is the one that is behind everything. I guess also in a sequence you need an "if" to execute a sequence so that machine says something :if instruction is finished, execute next line.
And also how can I do a "for"or "while" iteration if not using : do iteration x, if iteration ends, execute iteration y
2 months ago
Uncle Bob today came to the  Netherlands and we had an astonishing conference. He said that behind every language there is a sequence, a selection and an iteration.
A selection is an If statement.
Now I am wondering: is possible to write in Java a code that simulates an if selection without using an if? In other words I would love to know what happens when I give an if command to the machine.
I would love to know if there is a source where I can dive into also for other things. I am wondering what there is behind a Boolean declaration for instance and so on.
2 months ago

Campbell Ritchie wrote:Not sure I understand the exact problem, but have you come across Stream.collect(Collectors.partitioningBy()?

Campbell Ritchie wrote:Not sure I understand the exact problem, but have you come across Stream.collect(Collectors.partitioningBy()?

Thank you very much.

The internals of the method are quite simple:

public static <T> Collector<T, ?, Map<Boolean, List<T>>> partitioningBy(Predicate<? super T> predicate) {
       return partitioningBy(predicate, toList());

(I mean as it is a beginner forum, for the readers that know of course concepts as  parametrization with generics, Map, Covariance, and functional paradigms)

The problem is that
1) I cannot use java 8 Streams in android, and also I do everything in Kotlin, but this is not a problem because I am speaking about business logic and I could use RXJava that has houndreads of operators to transform Observables, much more than streams
so the real problem is number 2:
2) I am just doing an intellectual exercise, so I want to know the algorithm behind, and not a method, and not partitioningBy unfortunately does not resolve my case, because you need to pass a logic to sort the variablesW
let's say as use case, I have a server which I get from the Webservice API some consecutive ArrayList<ServerObject> responses.

I have a class that manages in the UI(user interface) this array in this way:

class DoMarvellousThingsWithTheServerList{

ServerObject serverObject;

//here come the consecutive ArrayList ItemsToCompare from another class
//and I need to separate  the first  ItemToCompare object with the second ItemToCompare in two different variables,
//and then a third ItemToCompare array should be compared with the second one, then the fourth with the third,
//there is an Utility class called DiffUtil that runs this comparation if I furnish two Array variables oldItem and NewItem

public void InjectFromServer(ArrayList<ServerObject> itemToCompare){

//here should happen the magic
//and every new instance should be loaded also as List in the user interface
//I thought to something like  the operator %2, or to take the Hash of everyObject is coming, or to Serialize the object
// but I do not have any idea what is the most elegant, efficient way to proceed



ps Is not that I need a solution, as you may know after 5 years in the forum, I finally found a job as developer:) but this is not an assignment I need to solve, so there is any hassle to solve it, is just to sharp my abilities because mimicks a real case I went through some time ago and I could not solve so easy
5 months ago
Are several days, I am thinking just as an intellectual challenge that I have a method that passes a whatever parameter, and I want to catch its stream in two separate variables depending if is odd or even.
This is the use case, I thought was not so easy to realize.
I receive from an API some data, and I need to sort these data alternatively in one variable oldItem, and the next one in a variable newItem so that I can compare oldItem with newItem to spot if the items(  some arrays that go in a list) are the same( using a kind of DiffUtil library

I would anyway assign every  new Array that is "injected" from an external class to an instance variable inside the class

6 months ago

tony narloch wrote:

(off topic)
I confess  was really akin to write curse words when I started my first experiments.
but i guess was sublimated frustration more than real adverse feelings
6 months ago

Pete Letkeman wrote:Interesting for many reasons including, many of the Effective Java concepts have already been implemented in Kotlin.
Now/soon you can read about effective Kotlin programming see

Thanks so far I found really informative the book "Kotlin in Action" i won in Java ranch
7 months ago

Pete Letkeman wrote:The same people (Jet Brains) who made Kotlin have also created Anko which is marketed as "Pleasant Android application development".
With the official release of Android Studio 3 Kotlin is baked in, however it does not appear as though Anko is. You can read about Anko on it's GitHub site

From what I gather Anko can help streamline your layouts, SQL, intents, dialogs, fragments and more. There appears to be many different tutorials regarding Anko.
I was wondering:

  • Have you started using Anko?
  • If you have started using Anko that is?

  • I bumped into a course with Anko, but the Android community does not like for layouts, because xml looks as a really efficient way to manage them when are not needed programmatical interventions
    7 months ago

    Jeanne Boyarsky wrote:

    Giovanni Montano wrote:I will work in Dutch and I have been hired for a position where I do not have seniors.

    A mentor doesn't have to be senior to you...

    Good point Jeanne!
    7 months ago
    Thanks all of you, and for the delicious pies.
    I will work in Dutch and I have been hired for a position where I do not have seniors.
    I will do Android/Ios and possibly Machine Learning,Artificial Intelligence based on my skills.

    I am prioritizing what to do to be prepared, really excited
    7 months ago

    Pete Letkeman wrote:

  • As far as I know (I could be wrong) you can only compile an Objective C application for iOS using a Mac/Apple computer.
      - You can create Android programs using Mac/Apple systems.

  • yes, is needed Apple. also I guess there are some workarounds if one cannot afford mac
    7 months ago
    Dear  friends,
    after 5 years of self study yesterday i become a developer

    will start in one month
    want to thank this fanstastic forum that togheter with stackoverflow allowed me to realize this dream.

    I want to thank all the senior that have been really supportive to me, in particular I have to make a special mention to three of you: Campbell Ritchie, Junilu Lacar and Liutaras Vilda

    Focusing allow to get objectives done, even when the external circumstances are not optimal

    Do you have  an ArrayList  of [b]generic [/b<]Suggestions> on how to survive the first month in an agile environment speaking in a language that is not English and I am moderately fluent? The company is based in Haarlem in the Netherlands, people are really nice.
    Looking forward, just resigned from my previous job, I do not need to study always all the weekends and nights anymore after a no coding work, because as most of the developer i will have also 1680+ hours per year to dedicate myself from the morning at this fantastic activity

    7 months ago