Win a copy of Head First Android this week in the Android forum!

Josh Abraham

Ranch Hand
+ Follow
since Dec 17, 2014
Cows and Likes
Cows
Total received
1
In last 30 days
0
Total given
0
Likes
Total received
1
Received in last 30 days
0
Total given
2
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Josh Abraham

Hi Guys,

I'm using Intellij and I saw it's pretty easy to add jar files to a project classpath.
I just have to go to File -> Project Structure -> Libraries -> click the '+' button -> choose the jar and that's it.

However, any IDE is a nice and graphic way to present data. Basically, all configurations of a code project are declared in files.
What I want to ask is where is the file that defined the classpath of my project ?  
[size=12]Hi,

I looked at this tutorial: https://spring.io/guides/gs/accessing-data-jpa/

and I wrote a class with the statement:


I don't know why, but I get an Error that "Entity" doesn't exist in javax.persistence package.

I also added the following dependencies to Maven:



and it still didn't help.

By the way, I also asked this question on Stack Overflow:
http://stackoverflow.com/questions/43832705/spring-boot-does-entity-annotation-exist
http://stackoverflow.com/questions/43833662/javax-persistence-entity-doesnt-exist?noredirect=1#comment74705247_43833662

and I haven't got a satisfying answer so far.

I'll be grateful for your help.

[/size]
4 years ago
When I removed the line "package...", it worked properly.
4 years ago
Now, it's:

$ javac ChainOfResponsibilityEverydayDemo.java
$ java ChainOfResponsibilityEverydayDemo
Error: Could not find or load main class ChainOfResponsibilityEverydayDemo
4 years ago
I changed the file name to 'ChainOfResponsibilityDemo', and I still get the same error.
4 years ago
Hi Guys,

I have the following code:



I saved this file in the name "file.java".

In order to run it, I opened my terminal in the containing folder of this file and typed:
> javac file.java
> java ChainOfResponsibilityEverydayDemo

I got the error:

Error: Could not find or load main class com.pluralsight.chain.ChainOfResponsibilityEverydayDemo



Do you know what I'm doing wrong?
4 years ago
Thanks. Actually the correct lines are:
5 years ago
Hi Guys,

I opened the following post in StackOverflow and didn't get an answer yet:
http://stackoverflow...gerbinder-error
I appreciate if someone can help me.


I opened a Maven project in IntelliJ and got the following error after choosing the option 'redeploy' in tomcat7 plugin:

SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org...ticLoggerBinder for further details.



also have the following dependencies in pom.xml file:

 


Can you please help me finding the error?
5 years ago
Hi Guys,

I'm using tomcat8 and I want its maven plug in.
Do you know what is the correct version?

I tried to add this to my pom.xml:


But I didn't know what version number to give.

Thanks,
5 years ago
Hi,

This is my ppom.xml file:



As you can understand, I'm trying to import the package org.apache.tomcat.maven.
However, I get an error:  "Plugin org.apache.tomcat.maven:tomcat7-maven-plugin:2.3-SNAPSHOT not found"

BTW, I also opened a post in stackoverflow:
http://stackoverflow.com/questions/39962624/intellij-adding-a-tomcat-plugin-in-maven-menu
5 years ago
Hi,

First, I want to mention that I already posted it on StackOverflow, and didn't get an answer yet.

I have a linked list that I want to write to a file. For this purpose, I wrote the following code:


Now, I want to take the file I extracted while using the last code and read the linked list. For this purpose, I wrote the code:

When I look at 'temp', I see a corrupted data structure. 'temp' points to a node that doesn't have the same fields as the original head of the linked list, and the 'next' field in temp points to NULL.

Can you try to tell me what I'm doing wrong here?
5 years ago
Hi Guys,

Suppose I have a method which prototype is
.
As you probably, understand, the method gets two integers and returns an int.

If I want to make this method work on two floats (and returns a float), I understand that I'll have to copy paste the implementation of the previous method and change 'int' to 'float'.
My question is: "Is there a way to write only one method that can be valid for both integeres and floats?".

5 years ago
I think I found the answer by myself.

The functions I supplies are only a part of my program. Somewhere in the program, I used the function sleep().

According to the documentation of sleep (http://linux.die.net/man/3/sleep):

sleep() may be implemented using SIGALRM; mixing calls to alarm(2) and sleep() is a bad idea.Using longjmp(3) from a signal handler or modifying the handling of SIGALRM while sleeping will cause undefined results.



When I removed the sleep() function, everything was OK.
6 years ago
I think I have an idea.
I saw that once I remove the last line "swapcontext" and write (instead of it) "while(1);", it works as expected.
Do you have any idea why the swapcontext disables the timer?
6 years ago
I wrote the following code:




My purpose was to write a program that responds to both SIGVTALRM signal and SIGALRM. However, when I run the program, it seems that the program only react to SIGALRM signals.

In the function ut_start() I started a timer that resets every 100 usec. I don't see any evidence that it works.

One more thing, how can debug this program so I can actually see the the timer has started? Is there any variable that I can see in debug mode that tells me something about the status of the timer?
6 years ago