If parameter is empty, change where clause

I have an Oracle function that has 3 parameters and uses parameters to set where clause values in multiple select statements that are union'd together. Here is the pseudo code: create or replace function fn_newfunction (IN_1_id in VARCHAR2, IN_2 in ...
more »

2017-01-11 23:01 (2) Answers

JS function parameter outer environment

I have a question regarding the outer environment in JS. Suppose I have the code like this: function callbackTest(callback) { var a = 1; callback(); } callbackTest(function() { console.log(a); }); The brower told me that a is not defined. It...
more »

2017-01-11 19:01 (3) Answers

JavaScript function composition from 3 functions

I'm using Vue and trying to filter an array of results using a JS function composition. My Vue computed values are like so, but can't get filteredByAll to accept a third option getByThing. Right now the filterByAll just filters on the category and k...
more »

2017-01-11 12:01 (1) Answers

Calling Method on Generic Type Java 8

I have a function that accepts a parameter that has some generic type public < T extends SomeA > String foo(T t) {...} Now... SomeA contains a series of methods that can be called, like baz1(), baz2(), baz3(), etc... Now, here's the rub T...
more »

2017-01-10 21:01 (2) Answers

function passing by reference

after I run below codes why myArray is still [2, 3, 4, 5], why it is not changed to []? var myArray = [2, 3, 4, 5]; function doStuff(arr) { arr = []; } doStuff(myArray); However when I do below steps , myArray did change to [2, 3, 4, 5, 6] va...
more »

2017-01-10 21:01 (2) Answers

Function Pointer ambiguity in C++

I have two questions : Q1) Are the function names themselves pointers ?? If they are pointers , then what values are stored in them? Else if they are not pointers ,then, what are they and what values are stored in them? If we consider that functi...
more »

2017-01-10 20:01 (1) Answers

MAX + Left Function Excel

I am trying to get the max value of a column based on the Left function What i am doing is the following : These are the results i get when i write this into Coloumn C : =MAX(LEFT(A:A,2)) But what i truly want is to get in Coloumn C the max Valu...
more »

2017-01-10 14:01 (2) Answers

Callback function doesn't exectute

So, I have two functions and I would like the second one to execute only after the first one has finished. This is the case: $('.link').on('click', function(e){ e.preventDefault(); function myLoopOne () { console.log('first function ...
more »

2017-01-10 13:01 (2) Answers

Creating a data structure in JavaScript

I am currently attempting a JavaScript challenge on FreeCodeCamp. I have been working on this challenge for a few days now and am stumped. I asked for help on the site's forum but the response I got wasn't very helpful or useful. For this particula...
more »

2017-01-09 21:01 (2) Answers

Cannot sort array a second time

I am not able to sort the numbers after second loop, the first group numbers get sorted but after that they just print the given numbers in same order. Ex-input: 2 4 67 90 76 89 3 67 45 1...
more »

2017-01-09 21:01 (0) Answers

[C++]Constructor doesn't detect components

I'm beginner in OOP and I have problem with definition of constructor. headfile.h: #ifndef RACHUNEK_H_INCLUDED #define RACHUNEK_H_INCLUDED #include <string> class Rachunek { std::string surname; std::string nr_account; double balance...
more »

2017-01-09 19:01 (1) Answers

Wordpress apply a filter to a custom post type

I’m using a specific custom post type called “static-block” to create certain HTML blocks which are repeated along posts. That blocks are included via shortcodes, to save time, when I need to update all the pages in which those blocks are inclu...
more »

2017-01-09 18:01 (0) Answers

Static method in Java - Best Practice?

I'm wondering, that using static method, like in example below, is good or bad behavior. Let me know, what you think :) class SomeClass{ static String appendString(String text){ return text + "a"; } } This is pure example, but I'...
more »

2017-01-09 16:01 (3) Answers

Dynamic C++ Function Parameters

This is quite possibly the wrong title, but I don't know how else to describe it. What I'm trying to do is call a C++ function from my scripting language (running in a VM). I've run into some trouble figuring out how to pass in parameters to the func...
more »

2017-01-09 15:01 (1) Answers

PHP Functions - Global Array issue

i'm stuck with my code, i'm trying to do a form validation function, but my array isn't filling up with the errors codes. My code : $errors = array(); function verif($args) { global $errors; $posts = func_get_args(); foreach($posts as ...
more »

2017-01-09 12:01 (1) Answers

What is wrong with my if condition

I found the answer to this question on this site but i just want to understand why my solution wasn't working. The question asked to implement an difference function, which subtracts one list from another. It should remove all values from list a, wh...
more »

2017-01-08 23:01 (3) Answers