Yosuf Ibrahim

Ranch Hand
+ Follow
since Apr 27, 2017
Yosuf likes ...
Eclipse IDE Java Windows
Cows and Likes
Cows
Total received
4
In last 30 days
0
Total given
0
Likes
Total received
9
Received in last 30 days
0
Total given
21
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Yosuf Ibrahim

Hello,

I have an android app idea I would like to create, I have minimum experience in java and none in android studio. I have been looking around for sometime now for a detailed free tutorial in vain. I am a bit lost on where to start from.

What I have managed to do up til now successfully is:

  • Download Android Studio
  • Setup my android phone to test the app on it, works like a charm
  • Test out the default activities like the nav drawer\ empty activity and such
  • Understand the drag and drop features for compnents


  • What I need to understand currently:
  • Everything  else seems like it
  • 1 month ago

    salvin francis wrote:... That's sounds good too. I hope OP has learnt a few good things from this post. I know I have !



    I have Just need to practice this since I still am unable to benefit from it
    10 months ago

    Tim Cooke wrote:The application I work on at work has a very large static data set that is read into memory on startup and never modified at run time. That data set lives in a single file and is modified as and when new items are required, which is rarely. The new data is then loaded the next time the application is started up.



    Isn't that bad programming, having all the data read on startup using up maybe a GB of ram if not more that is not required??
    10 months ago

    Carey Brown wrote:

    Yosuf Ibrahim wrote:

    Carey Brown wrote:So, you can only have one gun?


    Of every type yeah, for example:

    Name: RPG-42 Alamut
    ClassName: launch_RPG32_F


    It sound like the name itself is unique if you can only have one, so why would you also need a unique id?



    It is the way the game has been made, the name is displayed for the players the classname is used by developers\modders to communicate with the engine. This is why I need them all
    10 months ago

    Carey Brown wrote:

    Yosuf Ibrahim wrote:The unique ID aka classname is how the game engine knows the weapon the developer is trying to equip a soldier, crate etc.


    So, you can only have one gun?



    Of every type yeah, for example:

    Name: RPG-42 Alamut
    ClassName: launch_RPG32_F
    10 months ago

    Carey Brown wrote:

    Yosuf Ibrahim wrote:
    What is the "unique id" used for? Can you have multiple weapons of the same type?



    The unique ID aka classname is how the game engine knows the weapon the developer is trying to equip a soldier, crate etc.

    10 months ago
    I do not think databases would fit my needs because think of the objects I am saving as a words in a dictionary, user will be only reading that data will not modify it or add more to it, all the data will be added during the development of the application
    10 months ago

    Campbell Ritchie wrote:Go back to the Manning link I gave you and read that chapter. The principal idea of FP is probably that you are not allowed any side‑effects.

    You can reduce the λs in JB's code with method references. I shall leave that to YI as an exercise.



    Will do cheers
    10 months ago
    Hello everyone

    So I am working on a project which requires a lot of data to be stored on the disk now I have to ways (but feel free to recommend other ways) to store that data and extract them. Please keep in mind there will be no less than 2000 Objects to be saved

    Method 1:
    Save each object in its own .dat file and organize them into folders based on their type like in the pic below. The .dat files names will be set in the following format "[Name]_[Unique ID].dat"



    This way the computer when displaying a list will just display the following format "[Name] [Unique ID]" saving precious memory and when a user needs to see the details of the object the method readFromFile(String fileName) would be called.

    Me personally I prefer this method over the other one I am about to mention for the following reasons:
    If one Objects is corrupted it will not corrupt the rest along with it since each item is independant from the other.
    Easier to extract and filter them because they are all split up in folders accordingly.
    Would be easy to modify an object since all i need to do is simply delete the folder and create a new one in its place.


    Method 2:
    Just the whole list of the objects saved in .dat file of the super type so I would have the following .dat files only.

    Attachments
    Weapons
    Cloths
    Soldiers
    Vehicles
    Mags

    Now this method is a million times easier to setup but if one file gets corrupted I will have hundreds or more objects that would need to be re-created.

    If there are other ways I am all eyes and hopefully brains to understand them

    Cheers
    10 months ago
    Thank you Jason, I have the basic idea I will attempt the methods i was recommended to do using FP and will ask again if I have any questions
    10 months ago
    Hello,

    I have lately asked advice on a class I have created and got a lot and amazing advice which I have applied mostly. I have reached the part in which Predicates was advised and to read on Functional Programming to understand them. I have been reading the following articles on it but I literally understood nothing. Can someone please explain to a noob here what if I am missing?

    Thank you

    Links:
    https://flyingbytes.github.io/programming/java8/functional/part0/2017/01/16/Java8-Part0.html
    https://flyingbytes.github.io/programming/java8/functional/part1/2017/01/23/Java8-Part1.html
    https://flyingbytes.github.io/programming/java8/functional/part2/2017/02/04/Java8-Part2.html
    10 months ago
    The code won't compile either way if your method does not end with a return statement, therefore I would say the one return statement is the best solution since it is neater and you need the last one either way but not all the others.

    However in only one situation so far do I prefer multiple return statements and that is if I am using if else statement where is the condition is met I am ready to exit and do not require the computer to go over the rest of my code. For example:

    10 months ago

    Junilu Lacar wrote:



    Am I not always glad when you give me an answer, you and Campbell especially.

    Cheers man, Builders it is
    10 months ago