Win a copy of Svelte and Sapper in Action this week in the JavaScript forum!

Itamar Levi

Greenhorn
+ Follow
since Oct 27, 2012
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Itamar Levi

Hello,

I am working on Ubuntu

I have an executable jar Try.exe

I run it by the command : java -jar Try.exe

Type : JPS and gets

530 SecondaryNameNode
32713 NameNode
2558 Jps
11566 Master
2341 jar


I would like to get :
530 SecondaryNameNode
32713 NameNode
2558 Jps
11566 Master
2341 MyJarName

how to i give a name to the process ?

thanks
Itamar





3 years ago
Hello,

I am using Spring-BOOT
I am trying to execute some task in the same time.

1. I defined a scheduler
2. set pool-size to 10.
3. schedule some tasks (for loop ) with crone expression for every 1 second.

I expected the scheduler to execute 10 task with different threads asynchronously.
But  it executes each time with only one thread.










the output is :
jobScheduler-1
jobScheduler-1
jobScheduler-1
jobScheduler-1
jobScheduler-1
jobScheduler-1

It is like using only one thread, but it has 10 threads in the pool.


i expected to be asyncronically :
jobScheduler-1
jobScheduler-2
jobScheduler-3
jobScheduler-4
jobScheduler-1
jobScheduler-3
jobScheduler-1
...

What is wrong?

Thanks
Itamar.
4 years ago
Hello,

currently in my project i am importing an application.properties file by using @PropertySource



as i build the war the application.properties builds into the war file. (myWar.war contains the application.properties file inside)

i would like to have the application properties outside the war (next to the war in the same directory level)
can i define in @PropertySource path which is 3 folders up from the current location ? (something like @PropertySource("file:../../../application.properties") ?

Itamar.
4 years ago
hello,

i am using spring security with angularJS.
i submit login form with username and password on post request to the spring security on the server.

the problem is that the authentication fail.
in spring security its fail on UsernamePasswordAuthenticationFilter.java filter
because request.getParameter(usernameParameter); returns null for my post request.


in class UsernamePasswordAuthenticationFilter.java method attemptAuthentication(HttpServletRequest request, HttpServletResponse response)
the attemp is valid only for post request request.getMethod().equals("POST")
but next it try to retrieve username parameter from the post request ( request.getParameter(usernameParameter); ) which return null.

my login post request is :


spring filter code :


1. why do i get username null? how can i fix it?
2. it is POST request can we get parameter from the request by request.getParameter()?

Itamar.
4 years ago
Hello,

Client code :



Server code:



I am getting

POST http://localhost:8080/Architect/admin/popp.htm 415 (Unsupported Media Type)

What is the problem?

Thank's
Itamar levi.
5 years ago

"Resources placed under the WEB-INF folder cannot be accessed directly by the browser."
That is true. but I didn't access fragment1.html directly by the browser. i access it by including it in another jsp (index2.jsp)

And why does access the resource with <%@ include file="WEB-INF/view/fragment1.html" %> is working?

Hello,

I created a web project on tomcat apache 8

I am trying to include a jsp loacted in the WEB-INF directory.
I fail to include it with angular.

directory webapp contains : index2.jsp
directory webapp/WEB-INF contains : fragment1.html

index2.jsp code :

Why i fail to include fragment1.html with angularJS?

Itamar.
Hello,

I have a workspace/project which contains the next modules
1. WebModule
2. BusinessModule1
2. BusinessModule2
2. BusinessModule3

What is the right location for the @Controller and @Service?

1. All the @controllers and @ services have to be located in the WebModule.
2. Each module(including the business) have to contains its @controllers and @ services
3. The WebModule contains all the @Controllers and the business modules contains the @Service
4. Is there better option?

What is the right way?

Itamar.
5 years ago
Yes, I think you are right
I'll keep looking for
but i guess i have to write it by myself.

Thanks Winston.

Itamar.
5 years ago
Hi,

The utility has to be able to unroll every loop (for or while loop).

It is not important to me how it is done by the utility.
It can be parsing the text or even do it by analyse the byte code (for example by using soot framework).

The input is a valid java file and the out put is a transformed java file.

I am looking if there is a utility with the capability of unrolling for a given number.

Thanks
Itamar.


5 years ago
Hello,

Is there any function/utility/tool that unroles a loop (of n iterations) for a given number.


For example:
the utilityhas to unroll 3 times the next loop:



The tansformed code has to be:




Thanks
Itamar.



5 years ago
If we take a look about android applications which receive notification (like mail araivel on gmail or message from WhatsUp chat)
does It means that necessarily the client (android phone) has to initiate the first connection to the server? (in order to register in the NAT tables in the router)?

If it's true. so every time the client(android phone) change to different WIFI network it has to perform a process of register all its application (which get notifications)
to their servers?

Itamar?
6 years ago
Hello,

I am trying establish a server (my android phone) client(my computer at home) connection.
My computer is in Lan network. so i could overcome the issue of starting a connection within the Lan network.

Because of the NAT mechanism i tried to create the android mobile as a server and my computer as a client, my computer will start the connection to the android mobile.

I created the server in my mobile with ServerSocket
I found my android ip address in web like www.whatsismyip.com

It is not working. the client(my computer) can't find the server(my phone).
(I know this not recomended architecture)
What is wrong? why is it not working? why the client can't connect to the server?

Thank's
Itamar.
6 years ago