"One voice can change a room, and if one voice can change a room, then it can change a city, and if it can change a city, it can change a state, and if it change a state, it can change a nation, and if it can change a nation, it can change the world. Your voice can change the world." -Barack Obama (source)
Can anyone help me understand this? Java 6 docs for ConcurrentHashMap reads : Retrieval operations (including get) generally do not block, so may overlap with update operations (including put and remove). Does that mean it is not thread safe? link : docs.oracle.com/javase/6/docs/api/java/util/concurrent/…
> However, even though all operations are thread-safe, retrieval operations do not entail locking, and there is not any support for locking the entire table in a way that prevents all access. This class is fully interoperable with Hashtable in programs that rely on its thread safety but not on its synchronization details.
Ok I think if I used java 6 I will keep running into issues. Should I back port it from java 8? Has anyone done this before? Is there any basic tutorial to do so?
@TBag what they mean by "block" here is that the thread making the call doesn't have to generally wait in order to read a value
generally you'll use a read lock for reading and a write lock for writing. A read lock, contrary to a write block, is compatible with other read locks, so nothing is blocked if they're all reads
once a write happens, then even the read locks get blocked, but that doesn't happen often also because the write operation is probably fairly quick about it
@geisterfurz007 wow, haven't seen that. hahaha, i am just gonna leave this here inverse.com/article/… and if you dare say i read this article, then consider yourself cancelled.
if you could do that, than even if it is deterministic, you're potentially processing what would be the equivalent of that human brain wondering where he is what he's doing
@SameerPradhan Welcome to the Java Chat, the room for Java enthusiasts! Please use a code snippet tool when posting code snippets. If you have an Android question, you're in the wrong place! And remember: this is not tech support! Thanks for visiting and have fun! :D
Please don't use chat as fastlane for your questions. Instead, wait a few days before asking here to give the people on the main site some time. If we want to answer questions there, we will look for them on our own.
Suppose I have a table of msg_notif_logsand msgs. The link between the two is msg_id. msg_notif_logs has customer_id, msg_id and view_date. msgs has msg_id, msg_body. If I want to view those msg_bodys that have the same msg_id between these 2 tables, I should use INNER JOIN. But the question is, is there a querry to first INSERT records into msg_notif_logs if msg_id is not found in it? Should I use two queries, first INSERT, then INNER JOIN ?
Youtube: Will you look at THAT! This PilotsEYE.tv video that you already watched 3 times that has 3 parts and takes an hour to watch. I just found that! Wanna watch?
I'm writing a server-side app using JAX-RS. How do you test the functionaloty of your REST-ful API? Do people use postman manually or automate it using scripts? I'm thinking should I write a python client for regression test of my API?
My API does not have Create and Delete (of CRUD) for some REST requests. If I were to write an independent python client, I should also implement them for data-stubbing
The Ranger is one of the standard playable character classes in most editions of the Dungeons & Dragons fantasy role-playing game. Rangers were hunters and skilled woodsmen, and often lived reclusive lives as hermits.
== Publication history ==
=== Creative origins ===
The ranger was primarily based on the character Aragorn, and the Rangers of the North of J. R. R. Tolkien's Middle-earth mythos, as warriors who use tracking and other wilderness skills to hunt down their enemies. The AD&D second edition handbook mentions several other inspirations from myth and legend, such as Robin Hood, Jack the...
If you suspect for a moment that the ring you're seeing is the endgame, world ending, nuclear weapon, if you suspect there's less than 1% that it's true, but it might still be true, he should have taken Frodo to the elves immediately before investigating further
what I don't understand is that they basically did a suicide march against Sauron's army in the fleeting hope that Sam and Frodo were making it to Mt Doom
were they that sure that all was lost if they couldn't complete their mission?
@Neil But they have also stated that read write overlap may occur. Which means it says more than 2 threads can access it at the same time (that too read-write!). And hence it is not synchronized. idk the docs seem a bit vague to me.
Hello, I am trying to understand how JSP and Servlets work. In my JSP i have the following <td><a href="/delete?id=<c:out value='${contact.id}' />">Delete</a></td>, meant to delete a row in a table. Now I am now sure how I can invoke my Delete Servlet. I have tried @WebServlet(name = "Delete", urlPatterns = {"/Delete"}) but the Servlet is not being invoked. How do I invoke my servlet?
Grover Cleveland was the only president in history to hold the job of a hangman. He was once the sheriff of Erie County, New York, and twice had to spring the trap at a hanging. (source)
archive - contact - sexy exciting merchandise - search - about ← previousFebruary 11th, 2019nextFebruary 11th, 2019: Thank you to everyone who came out to the SF-adjacent events on Saturday! I had a great time, even if one of them was SLIGHTLY chilling.– Ryan
@Neil Using /delete I am able to execute the Servlet, but when I append ?id=<c:out value='${contact.id}' /> it s throwing an error. Is not there a way of "making" it know that I am passing parameters?
@Neil I am getting this error The origin server did not find a current representation for the target resource or is not willing to disclose that one exists.
@Neil I get you, I have seen some example but they are using xml configurations, me I want to use annotations. It's okay, I know what it is like at work when you are busy ;D
@MadaraUchiha What bothers me more is that Gandalf for so long ignored Sauron when he was known as the Necromancer (even after they knew it was Sauron).
velocity Hashmap question: I want to create two hashmaps of background colors, the colors in $hashmapA will use black as the foreground color, and the colors in $hashmapB will use white as the foreground color.
Could I loop through $hashmapA and compare each entry to designated background color, if there's a match, include a CSS class that makes the text color black, then loop through $hashmapB and do the same thing? or is there a better way to do this?
I'm trying to determine which would be the most efficient way to determine if the foreground color should be black or white. This may be a better question for another chatroom, so I'm going ot post it there.
I'll be using a few different colors, gray, blue, green, red, with varied shades. They all have names specific to them which are CSS classes. I have two written lists of background colors that should have white foreground, and background colors that should have black foreground
I thought about trying to do something like that, but I'm too lazy to try and figure out the number values in the rgb scale to determine the limits on whether the foreground should be black or white. I have a few CSS class names and already went through a color contrast site comparing each. I just need to figure out how to do the control structure.