T H Lim

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

Recent posts by T H Lim

There are many Scala collections like List, Set, Priority Queue, etc. They are in immutable and mutable forms and they are "functional". However, they do not support the effect F[_] out of the box. Fortunately, Cats Effect provide some of the commonly used collection like queue, dequeue, etc. For the developers, what are the options they have to get an effect-ful collection like Map and List, without writing overly complicated collections that support the effect F[_]? How do other pure FP languages developers manage in general?

iuliana cosmina wrote:Most microservices nowadays are reactive. Spring Boot is one of the most used tools to write and deploy microservices quickly. Spring Webflux provides a lot of components to build reactive microservices quite easily.
...
As for Spring Webflux and MVC, they integrate together nicely, because in the same application  you might have bits that hsould n ott be reactive. For example, when logging into an application using a login form, there's no point having a reactive controller to handle the user logging in, since giving him access to something is dependent on him bbeing logged in.  But after logging in, you might have a page depicting some data that gets updated in real time, and that data should be handled by a reactive component - either a reactive controller of handler function.
...

I hope this answers your question.
Cheers!



I am confused why a login controller should not be a reactive controller. My understanding for reactive is to reuse the same thread for something else while waiting for the database or auth server response. Yes, the user cannot proceed without authorization, but while waiting for the request to be authenticated, the server thread can be used to serve other requests. There are other processes similar to the login process where some steps must be performed before it can proceed further. Does that mean these processes should not use a reactive controller? Thanks
3 months ago
I am glad I asked. Your replies strengthen my understanding on Swing. Thanks guys
9 years ago
Thanks for the prompt reply.

What I want to find is the reason why I don't see the error with my example, is because my example is trivia or because the Swing framework has changed? Now I have the answer.

What I don't get is why should I wrap the initial code lines 8 through 26 in invokeLater()? These codes formed the initial components for this UI application.
9 years ago
I was writing an example to showcase the usage of SwingUtilities.invokeLater(). I came to realize this simple example (code included) I have written didn't warranty the use of invokeLater(). I do encounter there were times I needed to use invokeLater() but I forgotten where and when I used. I also understand that in a non EDP thread I should use invokeLater() but in my case I don't seem to need that and it worked fine. I was hoping anyone advise me why I don't need to use invokeLater() in this piece of code. I hope there is no bug in my showcase code.

Btw, I am using JDK 1.6 / 1.7 in Linux and Windows.

Thanks.

9 years ago
Finally, I nailed the problem with this. Thank you for your advise.

10 years ago
I have read the document but it didn't cross my mind there is an "extension" in addition to plugins. I read the article and it was meant to deploy to the repository via SSH. how do I copy an assembled JAR file (not include pom.xml & sources) to another host via SSH? Meanwhile I will reread the docs.

Thanks

/lim/
10 years ago
I modified my pom.xml to include extension but it still didn't work

10 years ago
I am guilty of including it as a plugin. How do i I make it as extension? Here is part of my pom.xml. Thanks

10 years ago
Hi,

I want to use wagon-ssh (1.0-beta-7) plugin to deploy my assembled (via assembly:assembly) application to another server using SSH. It failed with a fatal error,

[INFO] ------------------------------------------------------------------------
[ERROR] FATAL ERROR
[INFO] ------------------------------------------------------------------------
[INFO] The plugin descriptor for the plugin Plugin [org.apache.maven.wagon:wagon-ssh] was not found. Please verify that the plugin JAR /Users/sshark/.m2/repository/org/apache/maven/wagon/wagon-ssh/1.0-beta-7/wagon-ssh-1.0-beta-7.jar is intact.
[INFO] ------------------------------------------------------------------------
[INFO] Trace
java.lang.IllegalStateException: The plugin descriptor for the plugin Plugin [org.apache.maven.wagon:wagon-ssh] was not found. Please verify that the plugin JAR /Users/sshark/.m2/repository/org/apache/maven/wagon/wagon-ssh/1.0-beta-7/wagon-ssh-1.0-beta-7.jar is intact.

My maven and OS versions are stated below. Can anyone help me as of why the wagon plug in is not intact? Does it require maven 3? Thanks

Apache Maven 2.2.1 (r801777; 2009-08-07 03:16:01+0800)
Java version: 1.6.0_24
Java home: /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home
Default locale: en_US, platform encoding: MacRoman
OS name: "mac os x" version: "10.6.8" arch: "x86_64" Family: "mac"


/lim/
10 years ago
I relooked my code with SwingWorker. Now it works as with my custom Thread handling. Thanks
10 years ago
As far as the cursor concerned, I used the system cursor.
10 years ago
Hi,

I solved my problem the work in progress flag. What I did was, I spawn a new Thread. Within this Thread, I made a remote request. Once it has completed, I updated the Swing components using SwingUtilities.invokeLater(...) within the same Thread. Finally, reset the work in progress flag to false. DropTargetAdapter's dragEnter(...) and drop(...) will check work in progress flag and reject any further drop-in outright until the 1st task is completed.

I tried using SwingWorker but it didn't seem to solve my problem. It seems to me, SwingWorker still works within the single AWT thread. This means that when a drop in event happened and the AWT thread is busy, the event will be queued. Once the AWT thread is freed, it will pick up whatever in the queue. It will add those files which i dragged into drop-in area during the "drop-in disabled" period. As compared to the earlier solution where the AWT thread is free-ed, accepted the drop-in event and rejected it.

I don't understand SwingWorker well and I could have probably made a mistake. Any advise would be a great help.

Thank you guys for chipping in.
10 years ago
the mouse cursor changed doesn't stop the user from dragging more files into the drop zone.
10 years ago
Hi,

I am writing a drop zone application where I will load the information of the file dropped in. The information will be extracted from the file and stored across the network so there will be a couple of seconds between each drop. What I want is to disable the drop zone and show a message "Sending..." during that period of time. So far what I managed to do is prevent the application from accepting new drop-ins but the mouse cursor icon doesn't reflect that and it basically hung my application interface because I was sitting on the AWT-thread during the upload and processing. I am using glass pane to show the message "Sending..." Any idea how I can improve this?

Thanks

/lim/

10 years ago