Questions

Among $_REQUEST, $_GET and $_POST which one is the fastest?

Which of these code will be faster? ``` $temp = $_REQUEST['s']; ``` or ``` if (isset($_GET['s'])) { $temp = $_GET['s']; } else { $temp = $_POST['s']; } ```

10 Jan at 17:41

How to find the lowest common ancestor of two nodes in any binary tree?

The Binary Tree here is may not necessarily be a Binary Search Tree. The structure could be taken as - ``` struct node { int data; struct node *left; struct node *right; }; ``` The maxi...

How can I scan barcodes on iOS?

How can I simply scan barcodes on iPhone and/or iPad?

6 Jun at 10:21

What is the Java ?: operator called and what does it do?

I have been working with Java a couple of years, but up until recently I haven't run across this construct: ``` int count = isHere ? getHereCount(index) : getAwayCount(index); ``` This is probably ...

Sql Server equivalent of a COUNTIF aggregate function

I'm building a query with a `GROUP BY` clause that needs the ability to count records based only on a certain condition (e.g. count only records where a certain column value is equal to 1). ``` SELEC...

24 Apr at 01:10

Big-O summary for Java Collections Framework implementations?

I may be teaching a "Java crash-course" soon. While it is probably safe to assume that the audience members will know Big-O notation, it is probably not safe to assume that they will know what the or...

20 Feb at 05:1

Compiling with g++ using multiple cores

Quick question: what is the compiler flag to allow g++ to spawn multiple instances of itself in order to compile large projects quicker (for example 4 source files at a time for a multi-core CPU)?

How to customize the background color of a UITableViewCell?

I would like to customize the background (and maybe the border too) of all of the UITableViewCells within my UITableView. So far I have not been able to customize this stuff, so I have a bunch of whit...

How do you reverse a string in place in C or C++?

How do you reverse a string in C or C++ without requiring a separate buffer to hold the reversed string?

24 Nov at 03:35

Possible to perform cross-database queries with PostgreSQL?

I'm going to guess that the answer is "no" based on the below error message (and [this Google result](http://archives.postgresql.org/pgsql-sql/2004-08/msg00076.php)), but is there anyway to perform a ...

15 Mar at 19:14

Error: write EPROTO 34557064:error:100000f7:SSL routines:OPENSSL_internal:WRONG_VERSION_NUMBER

``` Error: write EPROTO 34557064:error:100000f7:SSL routines:OPENSSL_internal:WRONG_VERSION_NUMBER:../../third_party/boringssl/src/ssl/tls_record.cc:242: ``` The issue was that I was trying to POST t...

18 Jul at 13:49

Array and string offset access syntax with curly braces is deprecated

I've just updated my php version to 7.4, and i noticed this error pops up: > Array and string offset access syntax with curly braces is deprecated here is part of my code which is triggering the above...

9 Dec at 13:49

TypeScript: Object.keys return string[]

When using `Object.keys(obj)`, the return value is a `string[]`, whereas I want a `(keyof obj)[]`. ``` const v = { a: 1, b: 2 } Object.keys(v).reduce((accumulator, current) => { accumula...

17 Oct at 13:48

How to assign more memory to docker container

As the title reads, I'm trying to assign more memory to my container. I'm using an image from docker hub called "aallam/tomcat-mysql" in case that's relevant. When I start it normally without any spe...

4 Oct at 03:58

UICollectionView, full width cells, allow autolayout dynamic height?

For 2021! See @Ely answer regarding `UICollectionLayoutListConfiguration` !!!! --- In a vertical `UICollectionView` , Is it possible to have , but, allow the to be controlled by ? This strikes m...

3 Jun at 12:30

How to solve InaccessibleObjectException ("Unable to make {member} accessible: module {A} does not 'opens {package}' to {B}") on Java 9?

This exception occurs in a wide variety of scenarios when running an application on Java 9. Certain libraries and frameworks (Spring, Hibernate, JAXB) are particularly prone to it. Here's an example f...

<ng-container> vs <template>

`ng-container` is mentioned in the [official documentation](https://angular.io/guide/structural-directives#ng-container) but I'm still trying to understand how it works and what are use cases. It is p...

How can I limit ngFor repeat to some number of items in Angular?

My Code: ``` <li *ngFor="let item of list; let i=index" class="dropdown-item" (click)="onClick(item)"> <template [ngIf]="i<11">{{item.text}}</template> </li> ``` I am trying to have only 10 list ...

7 May at 04:17

Get SQL code from an Entity Framework Core IQueryable<T>

I am using Entity Framework Core and I need to see which SQL code is being generated. In previous versions of Entity Framework I could use the following: ``` string sql = ((System.Data.Objects.Object...

3 Feb at 09:16

How to list indexes created for table in postgres

Could you tell me how to check what indexes are created for some table in postgresql ?

2 Jul at 17:7

How can one tell the version of React running at runtime in the browser?

Is there a way to know the runtime version of React in the browser?

3 May at 02:22

Android 6.0 multiple permissions

I know that Android 6.0 has new permissions and I know I can call them with something like this ``` if (ContextCompat.checkSelfPermission(this, Manifest.permission.WRITE_EXTERNAL_STORAGE) != Pac...

How to show the run command of a docker container

I use a third party GUI (Synology Docker package) to setup a docker container. However, it's limitation makes me need to run the container from the command line. (I want to map another host ip to bind...

24 Sep at 13:25

How to run vi on docker container?

I have installed docker on my host virtual machine. And now want to create a file using `vi`. But it's showing me an error: ``` bash: vi: command not found ```

30 Oct at 00:45

Dart How to get the name of an enum as a String

Before enums were available in Dart I wrote some cumbersome and hard to maintain code to simulate enums and now want to simplify it. I need to get the name of the enum as a string such as can be done...

6 Mar at 17:23