Java: Complete code examples of thread-per-connection blocking IO versus NIO?

Ok, I'm going crazy here. I have been rewriting the NIO code for my server, and running into some real headaches. The bottom line is that getting NIO "right" is very hard. Some people pointed...

Reference types live on the heap, value types live on the stack

While reading "C# in Depth" I was going through the section titled "Reference types live on the heap, value types live on the stack." Now what I could understand is (mainly for ref type): class...

Is std::vector so much slower than plain arrays?

I've always thought it's the general wisdom that std::vector is "implemented as an array," blah blah blah. Today I went down and tested it, and it seems to be not so: Here's some test...

SQLite Optimization for Android application

We have about 7-8 tables in our Android application each having about 8 columns on an average. Both read and write operations are performed on the database and I am experimenting and trying to...

Should OLAP databases be denormalized for read performance?

I always thought that databases should be denormalized for read performance, as it is done for OLAP database design, and not exaggerated much further 3NF for OLTP design. PerformanceDBA in various...

To use or not to use SSL? Why use SSL always?

The argument for using SSL is to prevent some malicious user who has gone through the pains of snooping your traffic being able to read your traffic. So while it may make sense if you are using an...

javascript functions and arguments object, is there a cost involved

It is common place to see code like that around the web and in frameworks: var args = Array.prototype.slice.call(arguments); In doing so, you convert the arguments Object into a real Array (as...

return large data by reference or as return in function?

On the job today I had an arguement with a collage about passing large data between scopes. The myth was that reference uses less memory/CPU usage when passing between 2 scopes. We build a proof...

When will infinite loops, and recursive functions with no stop conditions, eventually stop?

I heard a myth saying that infinite loop or a recursive function with no stop condition will stop when "the stack overflows". Is it right? For example : void call() { call(); }...

Why is jython slow?

Jython performance is generally critized as slow --- is there a particular reason for this? Or is this just a modern myth? And most importantly, what is the future of Jython and how aggressively...

Hyphen, underscore, or camelCase as word delimiter in URIs?

I'm designing an HTTP-based API for an intranet app. I realize it's a pretty small concern in the grand scheme of things, but: should I use hyphens, underscores, or camelCase to delimit words in...

Is LinkedList really faster than ArrayList in the case of insertion in the middle of list?

- What is the difference between LinkedList and ArrayList? When is it preferable to use a LinkedList? I think every Java developer has heard this question at interview at least once. - Linked list...

Myth of Soma MMO game Bot - Memory Address for Items on floor contains garbage and constantly changing info

I've been coding a bot for a relatively small MMO, mainly as a hobby to challenge my own skills and learn something new. I've overcome many challenges and have successfully built a bot which hunts...

Is CallableStatement really immune to SQL injection?

We have a Java application that communicates with multiple SQL Server databases on the same box. The number of and names of these databases vary. By and large, we use almost exclusively stored...

SecureRandom.getInstance("SHA1PRNG", "SUN") always blocking while new SecureRandom() is not?

I'd like to consult some question on the common myth of SecureRandom in Java, on security vs. performance tradeoff. I've been researching on the Internet for a while and I've put the following...

Don't make functions within loops Javascript

I get that there are possibly three hundred of these questions, and I understand why not to. If we were looping saying a regular for loop, each iteration we are creating an anonymous function...

How to sort an Iterable

I have a custom List (not a Collection!!) that implements Iterable. I don't implement List because that would bring way too much methods that I don't want, and that I don't need. Some more...

CQRS: Command Return Values

There seems to be endless confusion about whether commands should or should not have return values. I would like to know if the confusion is simply because the participants have not stated their...

Firebase Database Secrets on Google Apps Script

So, first of all, I'm asking this question because I want that someone admits or denies -whats for me is a myth- about to use or not to use the deprecated firebase database secrets. Why this?...

Pass Veracode CWE 117 (Improper Output Neutralization for Logs) only with replaceAll("\r", "_").replaceAll("\n", "_")

I read on some forums the myth that it is enough to pass the Veracode CWE 117 (Improper Output Neutralization for Logs) issue by doing something like this. Can somebody confirm if this is the case...

Split string to array of strings with 1-3 words depends on length

I have following input string Lorem ipsum dolor sit amet consectetur adipiscing elit sed doeiusmod tempor incididunt ut Duis aute irure dolor in reprehenderit in esse cillum dolor eu fugia...

How does Poetry work regarding binary dependencies? (esp. numpy)

Until now I have been using conda as virtual environment and dependency management. However, some stuff does not work as expected when transfering my environment.yml file from my development...

YouTube embed video player size still too small

A really simple but irritating problem. I am trying to embed a YouTube video in a simple HTML page with Dreamweaver, defining the player window to be larger. But no matter what I do, the player...

TypeScript can't infer promise type

I'm trying to make the response from an axios request type-safe, but am having problems making the TypeScript compiler infer the type correctly. Consider the following function which simply...

CodeIgniter 4 plus Myth/Auth throws error when running Migrations via php spark migrate -all

I have discovered some wired behavior, I have that one CI4 project i am working on since a couple of weeks. everything is working just fine, but until now i have just been working with the project...

Ill-formed goto jump in C++ with compile-time known-to-be-false condition: is it actually illegal?

I am learning about some dark corners of C++ and, in particular, about the "forbidden" goto and some restrictions on its usage. This question is partially inspired by Patrice Roy's talk at CppCon...

NPM missing script build

{ "homepage": "https://github.com/neqts/RWeb.git", "name": "react-website", "version": "0.1.0", "private": true, "dependencies": { "@testing-library/jest-dom": "^5.11.5", ...

myth-auth bug when integrated with codeigniter

So, it seems like there is a bug in myth-auth when integrated with codeigniter. It tries to authenticate the $password even when the $email is null.Therefore throwing the Undefined offset: 1...

ErrorException in myth auth login

I'm using myth auth library to my login form. When I ran the login it said: ErrorException Undefined variable: config here are the code for my view l <?= $this->extend($config->viewLayout);...

Is there an equivalent NotNullWhen C# pattern for async tuple return?

In C# with nullable types it is possible to implement a 'TryGet' that is smart about null checking, e.g., bool TryGetById(int id, [NotNullWhen(returnValue: true)] out MyThing? myThing) which...