Category "function"

Creating a powershell function that will take on ONE parameter and outputs a concatenated string value (fname+lname)

I'm looking for some guidance or tips for how to revise the function below. My goal is create a function that accepts one parameter and then returns a string. I

Rewriting strlen() in C [closed]

if anyone has ever wanted to try and rewrite a string function in C, would this code work to replace the standard strlen() function? I have no

Why is my rock/paper/scissors game getting the same random number for multiple function calls?

I have made a functioning (if possibly extremely verbose) game of rock/paper/scissors. If I run the game by calling the function once over and over the 'compute

Dynamic function names in JavaScript

This may seem a bit weird, but can come in handy when creating dynamic event listeners and I'll do my best to explain what I'm trying to achieve. I have a var

SQL Working Days between two Dates

Hi I have the following function to work out WD between two dates. my query is...i have two dates with the same date eg. 06/07/2016 and i want WD to show as 0 b

$scope value not updating in view when $scope value is changed in controller

I have a function which uses papaparse.js to immediately get the content of a .csv file selected via a file input as a JSON object list, I then pass this list t

Can we pass setState as props from one component to other and change parent state from child component in React?

class App extends Component { constructor() { super(); this.state = { name: 'React' }; this.setState=this.setState.bind(this) } re

Postgres function to update old data and insert new data

I am trying to write a function that when my script pulls information from AD that it inserts new entries that don't exist and then update the ones that do exis

Trouble with output for Fantasy Game Inventory

I'm a beginner working on the Automate the boring stuff with Python book. I'm stuck on this practice problem. The instructions are as follows: List to Dictiona

view parameters passed to JavaScript function in Chrome

I'm using Timeline in Chrome Developer Tools to help write a userscript. The timeline shows which functions are called, but not what values are actually passed

Explain how this array transposing and flattening function works

Here this function in PHP that allows to merge any N amount of different length arrays in a fashion that output array will be in next order: Array1[0],Array2[0]

Does a constructor has a "type" in C++ since it is a special member function

I recently learnt that constructors do not have names in C++ and some other things about them. I am also aware that a function has a type in C++ called a functi

Generate a two-digit positive random number in JavaScript [closed]

How can I implement a simple function in JavaScript that generates a random positive number that consists of only two digits?

Using :: (scope resolution operator) in C++

I am learning C++ and I can never tell when I need to use :: . I do know that I need to use std:: in front of cout and cin. Does this mean that inside of the io

Javascript call() & apply() vs bind()?

I already know that apply and call are similar functions which set this (context of a function). The difference is with the way we send the arguments (manual vs

How compare CodeFunction.Access value?

I'm generating methods of partial classes. Using T4 Text Template At first, I'm looking for extra implemented methods in the interface. After that, reading acc

str_word_count() function doesn't display Arabic language properly

I've made the next function to return a specific number of words from a text: function brief_text($text, $num_words = 50) { $words = str_word_count($text,

anchor jumping by using javascript

I have a question that will be found very often. The problem is that nowhere can be found an explicit solution. I have two problems regarding anchors. The mai

Accessing private fields and function from main

I've programmed only in Java in my career and started using C++ since 10 days, so this question may seem strange to many of you. I have defined the structure of

Is it possible to program your own kbhit() in C?

I took a class of programming at my university and I am working on some program. I want to know if it is possible to program my own kbhit() function. And if it