This week's book giveaway is in the Cloud/Virtualization forum.
We're giving away four copies of Learning OpenStack Networking: Build a solid foundation in virtual networking technologies for OpenStack-based clouds and have James Denton on-line!
See this thread for details.
Win a copy of Learning OpenStack Networking: Build a solid foundation in virtual networking technologies for OpenStack-based clouds 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

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
2 weeks 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
1 month 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
    1 month 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!
    1 month 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
    1 month 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
    1 month 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

    1 month ago

    Stephan van Hulst wrote:Well, while this is really interesting stuff, I don't think you really need to know that much about it to be a good Java programmer. Every little bit helps though.

    I was the guy that was breaking all the toys. Cannot stay away from breaking complexity patterns
    1 month ago

    Stephan van Hulst wrote:I don't think they forgot to take out the assert. Remember that this is open source that can be compiled in debug mode and isn't necessarily a reflection of a particular 'build'. Before compilation the asserts might still be removed, or more likely, they're left in because they don't do any harm.

    It's important to distinguish the compiler from the standard libraries. While some classes of the standard libraries might be written in C/C++ and compiled to machine code, I believe the compiler itself can be written in pure Java (ignoring for a minute that it has to use classes from the standard library that might call native code) because it translates Java to Java Bytecode, which by its very nature is platform independent.

    The code for the JVM will likely make heavy use of native code though.

    I see thank you Stephan, still have to learn a lot
    1 month ago
    OK, I eliminate offset, makes semantically sense what you say, names are really important, good code have to tell a story, a novel, and definetly is better to leave at the parameter the expression of the meaning, otherwise looks as an abstract baseline.

    I hate static methods but they make sense when one want to use a static class, if the view get too busy, and you do not use the presenter. by the way I suggest the books of Martin Fowler, I am starting to like them a lot, this nice cheatsheet is fantastic at this purpose
    EDIT: @Junilu for future reference if somebody looks into this post to find solutions.

    I was risking to overarchitecting everything, even easier for my use case, i could resolve like that, eventually adding a static Utility class if want to separate. No need to create a POJO or iterate collections.

    Karl Beecher wrote:Hi,

    In terms of architecture, the book covers general principles of modular programming and object-oriented programming. You'll learn how to build components which have high cohesion, low coupling, clean and reusable interfaces and you'll learn how to build classes which allow for flexible designs.

    Designing good interfaces is a critical element of building large-scale software. Dependency injection is one way--and a fine one, at that--to avoid brittle designs (i.e. designs that tend to break and demand rework when you attempt to change things). Specifically, it is a solution to the problem of a client being responsible for constructing a concrete service object in order to use it. That's not necessarily something a client should do. The server instance should instead be instantiated elsewhere and 'injected' into the client.

    Design patterns do not have their own section in the book, but a few examples of them feature throughout.

    I hope that answers you questions.

    Fantastic looks as a really beautiful book, thanks
    2 months ago

    Tim Holloway wrote:Actually, there's usually a core set of services that are written in C (and/or assembly) because they need to do things that either cannot be done in the target language, cannot be done well in the target language, or have prohibitive costs when done in the target language. The exception is when the target language is generating native code. So, for example, C/C++ compilers are likely to be written entirely in C or C++. And as far as it goes, you could probably do Java in 100% java if there was a native-hardware JVM (Oracle's BEA/jRockit was something like that).

    Java also has a small set of classes that are partially or wholly implemented in native code, but they are kept to a minimum. Java is a complete enough language in its own right that I haven't looked at the JNI stuff in many long years.

    And, of course "real world" Java includes not only the vendor-distributed base kit, but also tons of add-ons such as the Apache, JBoss, Spring and codehaus class libraries.

    I guess you are referring to JNI
    2 months ago

    Stephan van Hulst wrote:It is as I expected. I took a look at the source code for OpenJDK, lo and behold:

    That's beautiful, on the Internet is almost impossible to find information for the internals, because the people that look into them, have enough knowledge to understand them.

                Assert.check(code.state.stacksize == 0);

    this line has been forgotten I guess, production code should not have `Assert` as far as I know          
    2 months ago

    Junilu Lacar wrote:

    Giovanni Montano wrote:so I want one class that does one thing, so want to get rid of the calendar business logic away from the view, and building a class `MyCalendar` looks nice to me as you suggest.As consequence I do not need to copy the event but just pass a reference to make my view class semantically clearer because more short and with one only responsibility, namely showing the user interface (1).

    So I am going to build a class `MyCalendar` with all the needed android imports
    and this class will have a method called insert( Event event, LocalDataTime moment){} (2)

    The statement marked (1) is contradictory to (2) -- If the responsibility is to simply show the user interface, then why do you have method that changes the internal state of the Calendar? Managing state seems like it's the responsibility of a Model layer class, not a View/Presentation layer class. The view/presentation simply handles the visual representation of the model.  I would imagine you'd have at least two classes: Calendar and CalendarView.

    Anyway yes we are on the same page, Managing state it's the responsibility of the Model layer. I have a small god class at the moment with the smallest use case (passing the event to the calendar,) because I started in the MainClass the first implementation, now I am going to refactor in other classes. I definitely want the view to make only the view

    I got another solution by another great dev, and was based on my suggestion to create a POJO, a Collection subclass (List/Map) and Iterate:
    (please consider that Events is a class of the Android library

    A)Create a MyEvent class for representing the subset of events you want to create (e.g. year, month, day, starthr, startmin, endhr, endmin, title, etc.).
    B)Change your InsertCalendarEvent() to take a MyEvent as argument: so this function becomes general purpose.
    C)reate an InsertCalendarEvents() method with a Collection of MyEvents as argument. This method would just iterate through the collection (using an iterator) and call InsertCalendarEvent().
    D)When you need to insert the events, you would just have to generate a collection of MyEvents (for example an ArrayList) and invoke  InsertCalendarEvents().
    (Here, MyEvent plays a passive DTO role. But you could also opt for an active record approach and let MyEvent save itself to the calendar (in this case you should sore the ID returned in the URI in case the event should be modified later on).)

    It looks really immediate and easy to decouple, and is quite a recurrent way to use Android( I do not know why I always found Android has really complex architectural patterns, while backend  friends usually use only "simple" MVC)

    Well case solved, and thank you for your help, I liked the questions to ask,  and your solution to implement a Parameter Object Pattern.