When Refectring the current statmement

By saeed ahmed

When I try to refecter commented into the static method, its return null. Other wise its ok. why ?

    public static  function Table($input) {
      $name = 'gazett_'.$input['ExamYear'].'_'.$input['gender'].'_'.$input['Examtype'];
      //        $obj = new static;
      //        $obj->setTable($name);
      //        return $obj; if i return insetance its ok, but in given below its return null why ?

      return (new static)->setTable($name);

Here how return current instance from static method ?

Source: Stack Overflow


how to exit upon entering negative number

By Robbie

This program asks for 100 inputs and sorts inputs in ascending order also calculates the average of all the inputs. I am wondering how do i make it to exit upon entering negative number instead of asking for 100 inputs, and show average .

#include <iostream>
#include <iomanip>
using namespace std;

bool sortArray(double* anArray, int size);
double averageArray(double* anyArray, int size);

int main()

double* anArray;
double total = 0.0;
double average;
signed scores=100;
int count;

cout << "Enter a series of positive numbers Entering a negative number will stop input ";

anArray = new double[scores];

cout << "Enter test scores: ";
for (count = 0; count < scores; count++)

    cout << "Test Score " << count + 1 << ": ";
    cin >> anArray[count];


sortArray(anArray, scores);

for (count = 0; count < scores; count++)
    cout << anArray[count] << "n";

cout << averageArray(anArray, scores);

return 0;

bool sortArray(double* anArray, int size)
bool sort = false;

for (int i = 0; i < size; i++)
    for (int j = 0; j < size - 1; j++)
        if (anArray[j] > anArray[j + 1])
            sort = true;
            double temp = anArray[j];
            anArray[j] = anArray[j + 1];
            anArray[j + 1] = temp;
return sort;

double averageArray(double* anyArray, int size)
double count = 0.0;

for (int i = 0; i < size; i++)
    count += anyArray[i];

return (count / (double) size);

Source: Stack Overflow


How to display Vertical Label inside chart for Horizontal Bar chart

By user3289230

enter image description here

I am trying to generate a horizontal bar chart with c#. I am looking for a solution for displaying vertical label inside chart.
This is horizontal bar chart, so vertical axis is x-axis. I can display y-axis (horizontal axis) inside chart but I can’t do for vertical axis.
Any idea? I am looking for third party chart too if it is possible.

Source: Stack Overflow


Why Social Business is Way Bigger than Social Media Marketing [Podcast]

By Bernie Borges “While social selling best practices certainly do produce results, the practitioners who are most successful are those who truly understand social business”. In a new Social Business Engine podcast, Bernie Borges explains some of the current issues in the social media industry, and how we need to re-focus.

Source: Social Media Today


Rainmaker Rewind: 12 Tips for Creating Calls to Action that Work on LinkedIn Pulse

By Caroline Early

This week’s edition of Rainmaker Rewind features our own Sean Jackson and Mica Gadhia on The Missing Link.

The dynamic duo welcomed John Nemo, bestselling LinkedIn author and trainer, to discuss calls to action on LinkedIn Pulse.

John Nemo is not only personable and an absolute pleasure to listen to, he also knows LinkedIn inside and out.

John is a bestselling LinkedIn author and trainer who helps small business owners, coaches, consultants, trainers, and sales and business development executives use LinkedIn to generate more sales leads, clients, and revenue for themselves.

He takes Sean and Mica through the step-by-step process of giving readers everything they need to take the action you want them to take.

Click here to listen and learn from The Missing Link.

Have time for a couple more? Check out these great episodes …


In this episode of Youpreneur, Chris and Brian talk about what it takes to be a digital entrepreneur and what that means for brand-building business owners.


The New Future of the Digital Entrepreneur, with Brian Clark


In this episode of Hit Publish, Amy asks the question: “When it comes to marketing, what’s in a name? Does it really matter what you call your products and services?” Well … yes it does. And Hit Publish is here to help.

Hit Publish:

How to Generate Powerful Product Names That Don’t Sound Gimmicky

And one more thing …

If you want to get my Rainmaker Rewind pick of the week sent straight to your favorite podcast player, subscribe right here on Rainmaker.FM.

See you next week.

The post Rainmaker Rewind: 12 Tips for Creating Calls to Action that Work on LinkedIn Pulse appeared first on Copyblogger.

Source: Copy Blogger


AppActivate working inconsistently in Powershell

By karun10

I have the following two line code which will bring the respective window to the front that will help me take screenshots automatically. But the problem is that, sometimes, it works like a charm and sometimes it doesn’t. And when I say it doesn’t work, I don’t mean that it is failing with any error message or warnings. Nothing happens. Just the code runs and the windows doesn’t come to the front.

I would like to know if there is any hidden prerequisites for this snippet to run successfully? Should the window in question should be in any state before I run this code to bring that window upfront?

Here is the code:


Source: Stack Overflow


validatorJS- not validating password confirm

By Chandan Purohit

I was developing a simple app with sign up and login facility using python Flask. I have used validator.js for client side validation. The problem i am facing is the the confirm password validation works when the html file is opened on its own but when i render it from flask it always shows that passwords dont match. Here is the project link github link to my project

Other validations are working as expected.

The html for the fields looks like this:

  <div class="form-group ">
    <label for="inputPassword" class="control-label">Password</label>
    <div class="form-group">
      <input type="password" data-minlength="6" name="inputPassword" class="form-control" id="inputPassword" placeholder="Password" required>
      <span class="help-block">Minimum of 6 characters</span>

    <div class="form-group">
      <input type="password" class="form-control" name="inputPasswordConfirm" id="inputPasswordConfirm" data-match="#inputPassword" data-match-error="Whoops, these don't match" placeholder="Confirm" required>
      <div class="help-block with-errors"></div>

Source: Stack Overflow