Naziru Gelajo

Ranch Hand
+ Follow
since Dec 21, 2015
Naziru likes ...
Java Netbeans IDE Ubuntu
Cows and Likes
Cows
Total received
1
In last 30 days
0
Total given
0
Likes
Total received
7
Received in last 30 days
0
Total given
25
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Naziru Gelajo

You need to use what is known as Encapsulation in your Object-Oriented Programming design. You need to set your instance variables to private and then use what is known as getters and setters to invoke your variables in another class. Please let me know if you need further clarification.
2 months ago

Akshayyha Krishnamurthy wrote: I learned that whenever there is an instantiation of a subclass, then implicitly compiler will add super() in the subclass's default constructor which in turn invokes the parent class constructor. So in this case too why didn't it produce a runtime error even?
Also, there's a compile-time error when I declare a constructor for the interface.
Could anyone help me understand this ?



It is because you are calling from Object (the Parent or Superclass to call classes).

Moderator edit: please quote only relevant parts, not the entire post.
3 months ago

Al Hobbs wrote:Have you looked at the logs to see what's happening? Also, are you using NetBeans? Looks like NetBeans.



Yep, I am using Netbeans. This is the only thing I find in the logs:

4 months ago

Al Hobbs wrote:Is your code throwing an exception or what?



No exception is being thrown. It just does not save object data to the table. It successfully creates the table with the proper columns however.
4 months ago
Hello, I am having a problem in which my Spring Hibernate Application is not storing created objects into a Database Table via the Hibernate template. Here is my code

Hibernate Mapping File:


Application Context:


POJO/Bean Class:


DAO class:


Main class (Instantiation of Objects to be stored in DB Table):
4 months ago
Hello everyone,

I am able to successfully create and insert entries in a table via Hibernate, however for some reason I am unable to update records within my database created by Hibernate. I created an individual method for update and delete as seen below (NOTE: I have also included the POJO class I created):



As aforementioned, the table is successfully created in a MySQL database. However, I am unable to update an objects Marks (grade) via my HQL query:



The purpose of the update method is to effectively take one of the records in the table via the id column and updates the element in the marks column.
Hello, I am attempting to find the cyclomatic complexity for a method in code. I have numbered the lines to represent nodes, although I'm not sure if it's 100% correct:



Here is a flow graph, again, I would like to get some feedback about whether I am correct or incorrect. Thanks!



if the img html tag does not work, here is my flow graph: https://1drv.ms/u/s!AvALpeZvjVx7geByBUjQVgZEZs2Lag
9 months ago
To find if an element exists within an array, you can do it a couple of simple ways on top of my head.

One is doing a linear search on a small array like the one provided, it won't take too long. However, assuming you had a dataset or an array millions of numbers. I would use a binary search. However, for a binary search to be effective, all numbers in the array must be sorted.
1 year ago
Hello, I'm trying to figure out how to fling an ImageView within a RelativeLayout in a direction that won't go off the screen. If you view my YouTube video for my project, the ball is not travelling very far in this penalty shootout mini-game.



Are there any good tutorials on what to do with the soccerball? or any hints on how to make sure it goes towards the goal and no where else? Thanks!
1 year ago
Hello, a couple of things please use the [code][/code] html built-in tags when posting code. They are located within the code posting interface. Also, I can attribute the reason why the code ends is due to the Scanner class and the way it handles input.
1 year ago
I don't seem to get why it's not working. It is checking the EditText (TextBoxes) to check and see if the input is empty (empty string literal is defined as ""). When I leave all text boxes empty in the app, and click the button, it is supposed to display this AlertDialog. Instead, the app crashes. Any suggestions on what I am doing wrong? Thanks!

1 year ago
So, I have made some modifications, but my cosineSimliarity computation is not working properly based on some values given to me for this exercise...I am not sure what I'm doing wrong, Is my formula somehow wrong?



I know that some people mentioned remove the comments so I attempted to do so. Where I'm not too sure of where I'm succeeding is in the math. The Cosine similarity computation is not working properly.
1 year ago

Liutauras Vilda wrote:parseMovieFile() and parseRatingFile() methods look almost identical. Consider adding parameter for file path and removing one duplicated method.



Noted, however one data set is far larger than the other, hence, there are separate methods for movie file parsing and rating file parsing.
1 year ago

Fred Kleinschmidt wrote:You should never use Math.pow() to compute the square of a number.  Just use x*x instead.
In your computeCosineSimilarity() method, what do you think will happen if movieA is longer than movieB?



Well that could be a problem if movieA is longer than movieB so I'm thinking about using a HashMap instead of an array.
1 year ago