text:
Q: Doubly LinkedList nodes [Circular] in Javascript class LinkedList{
  constructor(value){
    this.head = {
      data: value,
      next: null,
      prev: null
    }
    this.tail = this.head
    this.length = 1

  }
  append(val){
    const node = {
      data: val,
      next: null,
      prev: this.tail
    }
    this.tail.next = node
    this.tail = node
    this.length++
    return this
  }
  prepend(val){
    const node = {
      data: val,
      next: null,
      prev: null
    }
    node.next = this.head
    this.head.prev = node
    this.head = node
    this.length++
    return this
  }
  insert(value, pos){
    let i = 1
    let target = this.head
    while (i!=pos){
      target = target.next
      i++
    }
    const node = {
      data: value,
      next: null,
      prev: null
    }
    node.next = target.next
    let nextNode = target.next
    nextNode.prev = node
    node.prev = target
    target.next = node
    this.length++
  }
  remove(i){
    let counter = 1
    let currentNode = this.head
    while (counter!= i){
      currentNode = currentNode.next
      counter++
    }

    let temp = currentNode.next
    currentNode.next = temp.next
    let nextNode = temp.next
    nextNode.prev = currentNode
    temp.next = null
    temp.prev = null
    this.length--
  }
  printNodes(){
    const nodeArray = []
    let currentNode = this.head;
    while (currentNode){
      nodeArray.push(currentNode.data.toString())
      currentNode = currentNode.next
    }
    console.log(nodeArray.join("-->"))
  }
}
const lili = new LinkedList(5)
lili.append(12)
lili.append(18)
lili.append(15)
lili.insert(14,2)
lili.printNodes()
lili.remove(2)
console.log(lili)

I made this incomplete implementation of a doubly LinkedList in Javascript. The 2nd node's prev property and the 2nd to last node's next property are both showing [Circular] instead of [Object]. Could someone explain what Circular is and why this is happening? Thanks.

A: You should never print the underlying data structure since all other nodes point to their neighbors. I also flipped the arguments for your insert method, because position is usually the first argument in many standard libraries.
Instead, you need to devise an iterator that allows you to traverse your list from head to tail once. In the example below, I adapted the folowing class iterator within your LinkedList class. You can find out more about iterators here: MDN: Iterators and generators.
You can quickly traverse the list by simply spreading.
printNodes() {
  console.log(`List nodes: ${[...this].join("-->")}`);
}

class Node {
  constructor(data) {
    this.data = data;
    this.next = null;
    this.prev = null;
  }
}

class LinkedList {
  constructor(value) {
    this.head = this.tail = null;
    this.length = 1
  }
  append(data) {
    const node = new Node(data);
    if (this.head == null) {
      this.head = this.tail = node;
      this.head.prev = null;
      this.tail.next = null;
    } else {
      this.tail.next = node;
      node.prev = this.tail;
      this.tail = node;
      this.tail.next = null;
    }
    this.length++;
    return this;
  }
  prepend(data) {
    const node = new Node(data);
    if (this.head == null) {
      this.head = this.tail = node;
      this.head.prev = null;
      this.tail.next = null;
    } else {
      this.tail.prev = node;
      node.next = this.head;
      this.head = node;
      this.tail.prev = null;
    }
    this.length++;
    return this;
  }
  get(pos) {
    let i = 0, currentNode = this.head;
    while (currentNode) {
      if (i === pos) return currentNode;
      currentNode = currentNode.next;
      i++;
    }
    return null;
  }
  insert(pos, value) {
    const target = this.get(pos), node = new Node(value);
    node.next = target.next;
    const nextNode = target.next;
    nextNode.prev = node;
    node.prev = target;
    target.next = node;
    this.length++;
    return this;
  }
  remove(pos) {
    let counter = 1, currentNode = this.head;
    while (counter != pos) {
      currentNode = currentNode.next;
      counter++;
    }
    const temp = currentNode.next;
    currentNode.next = temp.next;
    const nextNode = temp.next;
    nextNode.prev = currentNode;
    temp.next = null;
    temp.prev = null;
    this.length--;
  }
  // See: https://stackoverflow.com/a/45849918/1762224
  *iterator() {
    let currentNode = this.head;
    while (currentNode) {
      const { data } = currentNode;
      currentNode = currentNode.next;
      yield data;
    }
  }
  [Symbol.iterator]() {
    return this.iterator();
  }
  printNodes() {
    if (this.head == null) {
      console.log('List is empty');
      return;
    }
    console.log(`List nodes: ${[...this].join("-->")}`);
  }
}

const list = new LinkedList()
  .append(5)
  .prepend(12)
  .append(18)
  .append(15)
  .insert(2, 14);
list.printNodes();

list.remove(2);
list.printNodes();
.as-console-wrapper { top: 0; max-height: 100% !important; }


text:
Q: how to format html table im trying to select data from the database and populate a html table with the data, one of the columns is of type Varchar(max) so the string is large and the readability is bad.
the current result is below:

the desired outcome is below:

the only column that needs formatted is the description column.
ive tried several different things including, inserting data into the database with Char(13) etc. as seen below:

Thrusters (95#)'+ CHAR(13)+ char(10)+ 'Pull-ups'

ive also tried adding style to the  tags like so:
  html.Append("");
  html.Append(column.ColumnName);
  html.Append("	");

this just gave duplicates of the columns. im not sure how this should be done.
below is the code used:
    protected void Page_Load(object sender, EventArgs e)
       {
        if (!this.IsPostBack)
        {
            //Populating a DataTable from database.
            DataTable dt = this.GetData();

            //Building an HTML string.
            StringBuilder html = new StringBuilder();

            //Table start.
            html.Append("
");

            //Building the Header row.
            html.Append("
");
            foreach (DataColumn column in dt.Columns)
            {

                html.Append("");
                html.Append(column.ColumnName);
                html.Append("	");
            }
            html.Append("
");

            //Building the Data rows.
            foreach (DataRow row in dt.Rows)
            {
                html.Append("
");

                foreach (DataColumn column in dt.Columns)
                {

                    html.Append("");
                    html.Append(row[column.ColumnName]);
                    html.Append("	");
                }
                html.Append("
");
            }

            //Table end.
            html.Append("
");

            //Append the HTML string to Placeholder.

            FindControl("PlaceHolder1").Controls.Add(new Literal { Text = html.ToString() });
        }

    }

A: Try this, border-collapse: table borders are collapsed into a single border

table {
  border-collapse: collapse;
  width:100%;
}

table, th, td {
  border: 1px solid black;
}

table td:nth-child(2){ text-align:center; }

table td{ padding:5px; }

 Name
 Length
 Description

  Fran
  21-15-9 Reps
  Thruster (95#)
Pull-ups

  Garrett
  3 Rounds
  75 Squats
25 Ring Handstand Push-ups
25 L Pull-ups

redpajama_set_name: RedPajamaStackExchange


text:
Q: BackgroundDownloader 4GB Limit I'm using a BackgroundDownloader in a C# UWP app and it appears that on Windows 10 Mobile it has a 4GB limit (binary GB, so about 4.2 decimal GB).  Files in the same directory work as long as they are not bigger than 4GB, tried a 3.99 and it was fine, a 4.04GB did not download.  BackgroundDownloader is not returning any errors (which work on other files) nor is it provisioning the temp download file.
I do have plenty of space on the SD card, it's a 32GB card that was empty, and after not being able to download the 4.04 I was able to download 2 files totaling over 7GB, so not a space issue.
Is there a way to change that limit, or at least some documentation that the limit exists?  I've dug through MSDN looking for confirmation of the limit without success.

A: The maximum size of a file depends on the filesystem.
As pointed out in the comments, the root of the problem is the FAT32 filesystem, which has a maximum filesize of 4 GiB - 1 Byte.
Consider using the NTFS filesystem.
File System |       Max Size
____________________________
FAT32       | 4 GiB − 1 Byte
NTFS        |         16 TiB


text:
Q: Exposing the current state name with ui router I'm trying to implement a language switcher where if a user clicks on "de" from any given page on an "en" side - it takes them to that page of the "de" side. If I console.dir the $state parameter, it exposes the values I'd want with the "current" property of the given $state. If I try to console.dir the $state.current to focus on the values I want, it only gives the parent state property (my current views are nested).
My current thinking is, I'm on url/en/content, and dynamically I can then have my lang navigation dynamically load the appropriate destination points into some kind of data attribute, pick those up with a custom directive where I'd initiate a "go to" and set my preferedLanguage value per angular-translate.
The key issue at the moment is exposing that $state name - again, when simply browsing $state the current object gives the values I'd want, but $current.state directly only gives the parent state.
If anyone has a better suggestion of how to do this (in a angular way - no custom cookie junk) I'm happy to take suggestions.
Thanks!
Update! CODE SAMPLES:
Object reference of my states:
var urlStates = {
        en: {
            home: {
                name: 'home',
                url: '/en',
                templateUrl: 'templates/'+lang+'/home.html',
                abstract: 'true'
            },
            home_highlights: {
                name:'home.highlights',
                url: '',
                templateUrl: 'templates/'+lang+'/home.highlights.html'
            },
            home_social:
            {
                name: 'home.social',
                url: '/social',
                templateUrl: 'templates/'+lang+'/home.social.html'
            },
            home_map:
            {
                name: 'home.map',
                url: '/map',
                templateUrl: 'templates/'+lang+'/home.map.html'
            }

        };

My States:
$stateProvider
        .state(urlStates.en.home)
        .state(urlStates.en.home_highlights)
        .state(urlStates.en.home_social)
        .state(urlStates.en.home_map);

        $locationProvider.html5Mode(true);

})

Controller:
.controller('LandingPage', function($translate, $state){
    this.state = $state;
    this.greeting = "Hello";
});

And Lastly, the output I see in the dom:
With this.state = $state;
{
    "params": {},
    "current": {
        "name": "home.highlights",
        "url": "",
        "templateUrl": "templates/en/home.highlights.html" },
        "transition": null
}

With this.state = $state.current
{
    "name": "",
    "url": "^",
    "views": null,
    "abstract": true
}

A: Answering your question in this format is quite challenging.
On the other hand you ask about navigation and then about current $state acting all weird.
For the first I'd say it's too broad question and for the second I'd say... well, you are doing something wrong or missing the obvious :)

Take the following controller:
app.controller('MainCtrl', function($scope, $state) {
  $scope.state = $state;
});

Where app is configured as:
app.config(function($stateProvider) {
  $stateProvider
    .state('main', {
        url: '/main',
        templateUrl: 'main.html',
        controller: 'MainCtrl'
    })
    .state('main.thiscontent', {
        url: '/thiscontent',
        templateUrl: 'this.html',
        controller: 'ThisCtrl'
    })
    .state('main.thatcontent', {
        url: '/thatcontent',
        templateUrl: 'that.html'
    });
});

Then simple HTML template having

  {{ state | json }}

Would "print out" e.g. the following
{
  "params": {},
  "current": {
    "url": "/thatcontent",
    "templateUrl": "that.html",
    "name": "main.thatcontent"
  },
  "transition": null
}

I put up a small example showing this, using ui.router and pascalprecht.translate for the menus. I hope you find it useful and figure out what is it you are doing wrong.
Plunker here http://plnkr.co/edit/XIW4ZE

Screencap

A: this is how I do it
JAVASCRIPT:
var module = angular.module('yourModuleName', ['ui.router']);

module.run( ['$rootScope', '$state', '$stateParams',
                      function ($rootScope,   $state,   $stateParams) {
    $rootScope.$state = $state;
    $rootScope.$stateParams = $stateParams;
}
]);

HTML:

      $state = {{$state.current.name}}
      $stateParams = {{$stateParams}}
      $state full url = {{ $state.$current.url.source }}

EXAMPLE
http://plnkr.co/edit/LGMZnj?p=preview

A: In my current project the solution looks like this:
I created an abstract Language State
$stateProvider.state('language', {
    abstract: true,
    url: '/:language',
    template: '

'
});

Every state in the project has to depend on this state
$stateProvider.state('language.dashboard', {
    url: '/dashboard'
    //....
});

The language switch buttons calls a custom function:
de

And the corresponding function looks like this (inside a controller of course):
this.setLanguage = function(lang) {
    FooterLog.log('switch to language', lang);
    $state.go($state.current, { language: lang }, {
        location: true,
        reload: true,
        inherit: true
    }).then(function() {
        FooterLog.log('transition successfull');
    });
};

This works, but there is a nicer solution just changing a value in the state params from html:
de

Unfortunately this does not work, see https://github.com/angular-ui/ui-router/issues/1031

A: Use Timeout
$timeout(function () { console.log($state.current, 'this is working fine'); }, 100);

See - https://github.com/angular-ui/ui-router/issues/1627

A: I wrapped around $state around $timeout and it worked for me.
For example,
(function() {
  'use strict';

  angular
    .module('app')
    .controller('BodyController', BodyController);

  BodyController.$inject = ['$state', '$timeout'];

  /* @ngInject */
  function BodyController($state, $timeout) {
    $timeout(function(){
      console.log($state.current);
    });

  }
})();

A: Its just because of the load time angular takes to give you the current state.
If you try to get the current state by using $timeout function then it will give you correct result in $state.current.name
$timeout(function(){
    $rootScope.currState = $state.current.name;
})


text:
Q: Simple question about the definition of Brownian motion I have a question concerning the definiton of Brownian motion. Usually (e.g. on Wikipdia) one demands a brownian motion $\lbrace B_t\rbrace_{t\in[0,\infty)}$ to satisfy the following condition:
$\forall 0\leq t_0<t_1<...<t_m: B_{t_1}-B_{t_0},...,B_{t_m}-B_{t_{m-1}}$ are independent random variables.
But today I come across with formally another definition of Brownian motion! Instead of the above condition the book demands the following property:
$\forall t,h\geq 0$, $B_{t+h}-B_t$ is independent of $\lbrace B_u : 0\leq u\leq t \rbrace$.
Now I'm wondering whether both properties are indeed equivalent or not?! Hopefully someone can help me.

A: Yes, they are indeed equivalent.
Proof: Let $X_1,\ldots,X_n$ arbitrary random variables and denote by
$$S_j := \sum_{k=1}^j X_k$$
the $j$-th partial sum. Since $$X_j = S_j - S_{j-1} \qquad \quad S_j = \sum_{k=1}^j X_k$$
it is not difficult to see that
$$\sigma(X_1,\ldots,X_n) = \sigma(S_1,\ldots,S_n).$$
If we set $X_j := B_{t_j}-B_{t_{j-1}}$ for a Brownian motion $(B_t)_{t \geq 0}$, then this shows
$$\sigma(B_{t_1},\ldots,B_{t_n}) = \sigma(B_{t_1}-B_{t_0},\ldots,B_{t_n}-B_{t_{n-1}}). \tag{1}$$
Consequently,
$$\begin{align*} \sigma\{B_u; u \leq t\} &\stackrel{\text{Def}}{=} \sigma \left( \bigcup_{\substack{t_1<\ldots<t_n \leq t \\n \in \mathbb{N}}} \sigma(B_{t_1},\ldots,B_{t_n}) \right) \\ &\stackrel{(1)}{=} \sigma \bigg( \underbrace{\bigcup_{\substack{t_1<\ldots<t_n \leq t \\n \in \mathbb{N}}} \sigma(B_{t_1}-B_{t_0},\ldots,B_{t_n}-B_{t_{n-1}})}_{=:\mathcal{G}} \bigg). \end{align*}$$
Since $\mathcal{G}$ is a $\cap$-stable generator of $\sigma(B_u; u \leq t)$, we conclude that $B_{t+u}-B_t$ is independent from $\sigma(B_u; u \leq t)$ if, and only if, $B_{t+h} -B_t$ is independent from $\mathcal{G}$. And this is equivalent to $B_{t+h}-B_t$ being independent from $B_{t_n}-B_{t_{n-1}},\ldots,B_{t_1}-B_{t_0}$ for all $t_1 < \ldots < t_n \leq t$.
Literature: See e.g. René L. Schilling/Lothar Partzsch: Brownian Motion - An Introduction to Stochastic Processes (Lemma 2.14).


text:
Q: TFS - Filter Specific File Types from Changeset Details We use Team Foundation Server (TFS) for source control.
In our solution we use TypeScript and SASS to create JavaScript and CSS files respectively.  Although .js and .css files are included in our source control (since they are ultimately the files put into production), any 'changes' occur to the corresponding .ts and .scss files.
However, when reviewing a changeset in TFS, all of the .js and .css files are included along with the .ts and .scss files.  Often times a simple change in a few .ts/.scss files can lead to a large number of changes in .js/.css files - crowding the changeset details.
Is there any way to filter which file types are displayed in a changeset so that it is easier to review what has 'actually' changed?

A: Those JavaScript and CSS files are build artifacts. You shouldn't put them into source control -- let your build system build them as necessary, the same way your developers do.
You can ignore files or folders via .tfignore files for TFVC or via .gitignore files for Git.


text:
Q: Drawing a circle within a circle and divide into pieces? please help.
I need to draw the next circle in a circle.
And depending on the the given number draw a part of the inner circle.
I would be grateful for any hints.
Thanks.

A: Creating a custom View (a Circle!)
First our custom styleable attributes.
values/attrs.xml
<resources>
    <declare-styleable name="circleview">
        <attr name="cRadius" format="integer" />
        <attr name="cFillColor" format="color" />
        <attr name="cStrokeColor" format="color" />
        <attr name="cAngleStart" format="integer" />
        <attr name="cAngleEnd" format="integer" />
    </declare-styleable>
</resources>

Lets look at the main layout that incorparate my CircleView class.
layout/main.xml
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
              xmlns:circleview="http://schemas.android.com/apk/res/se.adanware.canvasplaying"
              android:orientation="vertical"
              android:layout_width="fill_parent"
              android:layout_height="fill_parent">
    <TextView
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:text="Hello World, CanvasActivity"
            />
    <se.adanware.canvasplaying.CircleView
            android:id="@+id/pieCircle"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            circleview:cFillColor="#DDaa99"
            circleview:cStrokeColor="@android:color/white"
            circleview:cRadius="80"
            circleview:cAngleStart="30"
            circleview:cAngleEnd="290"
            />
    <TextView
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:text="Hello World, CanvasActivity"
            />
</LinearLayout>

src/CircleView.java
package se.adanware.canvasplaying;

import android.content.Context;
import android.content.res.TypedArray;
import android.graphics.Canvas;
import android.graphics.Paint;
import android.graphics.RectF;
import android.util.AttributeSet;
import android.util.Log;
import android.view.View;

public class CircleView extends View {

        private Paint circlePaint;
        private Paint circleStrokePaint;
        private RectF circleArc;

        // Attrs
        private int circleRadius;
        private int circleFillColor;
        private int circleStrokeColor;
        private int circleStartAngle;
        private int circleEndAngle;

    public CircleView(Context context, AttributeSet attrs) {

        super(context, attrs);
        init(attrs); // Read all attributes

        circlePaint = new Paint(Paint.ANTI_ALIAS_FLAG);
        circlePaint.setStyle(Paint.Style.FILL);
        circleStrokePaint = new Paint(Paint.ANTI_ALIAS_FLAG);
        circleStrokePaint.setStyle(Paint.Style.STROKE);
        circleStrokePaint.setStrokeWidth(2);
        circleStrokePaint.setColor(circleStrokeColor);
    }

    public void init(AttributeSet attrs)
    {
        // Go through all custom attrs.
        TypedArray attrsArray = getContext().obtainStyledAttributes(attrs, R.styleable.circleview);
        circleRadius = attrsArray.getInteger(R.styleable.circleview_cRadius, 0);
        circleFillColor = attrsArray.getColor(R.styleable.circleview_cFillColor, 16777215);
        circleStrokeColor = attrsArray.getColor(R.styleable.circleview_cStrokeColor, -1);
        circleStartAngle = attrsArray.getInteger(R.styleable.circleview_cAngleStart, 0);
        circleEndAngle = attrsArray.getInteger(R.styleable.circleview_cAngleEnd, 360);
        // Google tells us to call recycle.
        attrsArray.recycle();
    }

    @Override
    protected void onDraw(Canvas canvas) {
        // Move canvas down and right 1 pixel.
        // Otherwise the stroke gets cut off.
        canvas.translate(1,1);
        circlePaint.setColor(circleFillColor);
        canvas.drawArc(circleArc, circleStartAngle, circleEndAngle, true, circlePaint);
        canvas.drawArc(circleArc, circleStartAngle, circleEndAngle, true, circleStrokePaint);
    }

    @Override protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec)
    {

        int measuredWidth = measureWidth(widthMeasureSpec);
        if(circleRadius == 0) // No radius specified.
        {                     // Lets see what we can make.
            // Check width size. Make radius half of available.
            circleRadius = measuredWidth / 2;
            int tempRadiusHeight = measureHeight(heightMeasureSpec) / 2;
            if(tempRadiusHeight < circleRadius)
                // Check height, if height is smaller than
                // width, then go half height as radius.
                circleRadius = tempRadiusHeight;
        }
        // Remove 2 pixels for the stroke.
        int circleDiameter = circleRadius * 2 - 2;
        // RectF(float left, float top, float right, float bottom)
        circleArc = new RectF(0, 0, circleDiameter, circleDiameter);
        int measuredHeight = measureHeight(heightMeasureSpec);
        setMeasuredDimension(measuredWidth, measuredHeight);
        Log.d("onMeasure() ::", "measuredHeight =>" + String.valueOf(measuredHeight) + "px measuredWidth => " + String.valueOf(measuredWidth) + "px");
    }

    private int measureHeight(int measureSpec) {
        int specMode = MeasureSpec.getMode(measureSpec);
        int specSize = MeasureSpec.getSize(measureSpec);
        int result = 0;
        if (specMode == MeasureSpec.AT_MOST) {
            result = circleRadius * 2;
        } else if (specMode == MeasureSpec.EXACTLY) {
            result = specSize;
        }
        return result;
    }

    private int measureWidth(int measureSpec) {
        int specMode = MeasureSpec.getMode(measureSpec);
        int specSize = MeasureSpec.getSize(measureSpec);
        int result = 0;
        if (specMode == MeasureSpec.AT_MOST) {
            result = specSize;
        } else if (specMode == MeasureSpec.EXACTLY) {
            result = specSize;
        }
         return result;
    }
}

src/CanvasActivity.java
package se.adanware.canvasplaying;

import android.app.Activity;
import android.os.Bundle;

    public class CanvasActivity extends Activity {
        /**
         * Called when the activity is first created.
         */
        @Override
        public void onCreate(Bundle savedInstanceState) {
            super.onCreate(savedInstanceState);
            setContentView(R.layout.main);
        }
    }


text:
Q: How did the words "petting" and "necking" come to mean kissing with passion? I'm sure most of you have heard "necking" to mean kissing with passion; however, before "necking" the popular word among American youth was "petting". From Flappers to Rappers: The Study of American Youth Slang by Dr. Thomas Dalzell states that by the middle of the 1920s folks overwhelmingly were using the word necking instead of petting. The book doesn't state when petting was first used. Nevertheless, I'm most interested as to why folks used petting and necking to describe one who is kissing with passion. Any thoughts?

A: The verb 'neck' meaning "to kiss, embrace, caress" is first recorded 1825 (implied in necking) in northern England dial., from the noun.
I would imagine the implication is that the activity took place from the neck upwards.
The sense of 'petting' meaning "to stroke" is first found 1818. Slang sense of "kiss and caress" is from 1920 (implied in petting, in F. Scott Fitzgerald).
The common-sense trajectory seems to be the use of the word in relation to domestic animals, then children, then adults affectionately, then romantically.
See 'petting parties' here.
All very tame compared to bussing, it would seem. :)

A: I am by no means an expert. However, I do observe and like to make a hypothesis based on the observations. I think it may be possible that the term "necking" may have come the observed actions of many birds' mating rituals. The observation that I made was the mating ritual of the common dove. I noticed that two doves that are established mates occasionally go through an intricate dance that seemed to terminate with both birds pecking and grooming each others neck. Just a thought from a common man.

A: Here is the actual sentence from the "College Slang" sidebar in chapter 2 ("The 1920s: The Flapper") of Tom Dalzell, Flappers 2 Rappers: American Youth Slang (1996) in which necking and petting are discussed:

Necking replaced "petting" to mean kissing, while a party referred either to a girl who necked or necking itself.

In the book's glossary of 1920s slang, Dalzell includes this entry for necker:

necker A petter who puts her arms around a boy's neck

And this one for petting pantry:

petting pantry A movie theater

Dalzell revisits necking and petting in chapter 4 ("The 1940s: The Jive Generation"), though with very little explanation of what it meant:

What was in the past known as petting or necking was known by the sub-deb as boodling, gooing it, hacking, monking, mousing, mugging, or smooching.

I have detailed elsewhere at some length my unsuccessful attempts to corroborate another of Dalzell's assertions about 1920s slang—namely, that grungy meant "envious"—and in a comment above, FumbleFingers alludes to another dubious claim about 1920s slang in the same work: that pine feathers period referred to "The period in a Flapper's life when she blossoms out."
It is certainly possible that some young people in the 1920s used petting in the narrow sense of "kissing passionately" (perhaps further distinguished by the girl's having her arms around the boy's neck), but I wouldn't reach that conclusion on the strength of Dalzell's assertions alone. I also recommend being extremely cautious about using contemporary online sources to corroborate Dalzell, since many such sources base their information on Flappers 2 Rappers, and therefore do not provide independent confirmation of its conclusions.
Fortunately, unlike Dalzell, we have the authoritative insight of Time magazine to set us straight. From Time (January 17, 1927) [combined snippets]:

"What do you Americans mean by 'petting' or 'necking'?  queried, last week at Chicago, Canon William Thompson Elliott, of Leeds, England. There to show himself a clergyman of the world, he hastily added: "Those words don't exist in England. The things which I imagine are referred to don't happen over there. I'm sure they don't."
To oblige the Canon, reporters ventured definitions:—
"'Petting' and 'necking' arc about the same; but girls prefer to describe it by the former word and youths by the latter."
"'Necking' is apt, strictly speaking, to be more violent but more innocent than 'petting.'"
"Either 'petting' or 'necking' may describe any series of caresses which stop short of copulation."
Prudent, Canon Elliott expressed no opinion on these definitions. When persistent newsgatherers asked: "Isn't it true that in Australia 'Do you smooge?' is equivalent to 'How about a petting party?'" the Canon was again silent.

Writing for the Federal Council of the Churches of Christ in America, Sidney Weston, Young People's Relationships (1931) [combined snippets] also offers a much more nuanced account of the different possible meanings of petting at the end of flapper era than Dalzell does 65 years later:

"Light Petting" and "Heavy Petting"
Students sometimes distinguish between "light petting" and "heavy petting," meaning, by the former term, the milder and more restricted forms of endearment, and by the latter the more intimate, unrestricted and agitating kinds of physical-emotional relations. What happens in "heavy petting" is that young people, without the intention of going further, embrace and fondle each other in ways similar to those of married lovers who are preparing for physical union.

It thus appears that during the 1920s and shortly thereafter, petting was understood not to be exclusively (or indeed primarily) a matter of kissing—but activities along a continuum ranging from touching to embracing to fondling to pawing to groping—with kissing included for good measure.
Presumably petting arose from the term for gently touching a pet animal. Necking, meanwhile, is associated in discussions from 1922 and 1923 with the phenomenon of dancing cheek to cheek (and hence neck to neck). Here is the relevant portion of J.E. Lighter, The Random House Historical Dictionary of American Slang (1994) for the verb neck:

neck v. 1. Orig. Stu[dent] to engage in amorous embracing and kissing; pet. —Also used trans. Now colloq. Hence necker, necking, n. [Relevant examples:} 1922 D[ialect] N[otes] V 148: Necking, dancing with cheeks together. 1923 H.L. Mencken Amer[ican] Lang[uage] (ed. 3) 272: Necker; one given to cheek-to-cheek dancing. ... 1925 Lit[erary] Digest (Mar. 15) 65: "Petting" now exists only in the college novels, the more forceful, if more obscure "necking" having taken its place to describe amorous adventures.

This last-cited reference from 1925 may be the source of Dalzell's information that "necking" replaced "petting" as a standard slang term during the 1920s, though where Dalzell got the idea that it was confined to kissing I have no idea. Robert Chapman, New Dictionary of American Slang (1986) has this amusing entry for petting:

petting n The activity of those who pet [defined elsewhere in the dictionary as "To kiss and caress]: Petting is necking with territorial concessions.—Frederick Morton

The quotation is from Frederick Morton, "The Art of Courtship," in Holiday magazine, volume 21 (1957) [combined snippets]:

Practice varies with the individual, but I've compiled a roughly representative rate chart: The casual dater is accorded a goodnight kiss, a mere romantic token; the steady may neck (a generic term for kisses and caresses qualifying for the motion-picture seal); the fiancé holds petting privileges (petting is necking with territorial concessions); the husband, finally, as the holder of a life contract, is under no restraints.

Presumably this description reflects a mid-twentieth-century understanding of the terms' nuances.


text:
Q: MySQL How do I update rows based on existing values I'm normalizing an existing database. I currently have two columns in Table1, domain and container, with limited distinct combinations (currently ~30 combinations of these two from ~1000 records). I've built a new Table2 that holds all combinations, with a primary key (container_id) auto-generated when a new record is installed. I've added a container_id column to Table1, and want to fill in the values based on the Table1.container column.
At this point, all of the container names in table 2 are distinct, but that could change in the future, hence the need for a unique number as the PK.
i.e.
UPDATE Table1
SET container_id = (SELECT Table2.container_id
    FROM Table2
    WHERE Table2.container = Table1.container)
WHERE EXISTS
  ( SELECT Table2.container_id
    FROM Table2
    WHERE Table2.container = Table1.container)

This query return error 1242: subquery returns more than one row.
Am I barking up the totally wrong tree? Table2 should have zero duplicate values.

A: I should have used a join to update the table1
UPDATE Table1
LEFT JOIN Table2 USING (container)
SET Table1.contanier_id = Table2.contanier_id
WHERE Table1.contanier_id IS NULL AND Table2.contanier_id IS NOT NULL;

A: Table2.container is not unique, hence can get repeated. Due to this both sub queries return more than one row.


text:
Q: Multiple Regression: Variation Explained I'm stuck on a homework problem and I'm hoping you all might be able to help me out. I'd be very appreciative!
We were given this data set: Data. I ran a regression in Minitab with GPA as the response and IQ and Self-Concept as the predictors. I've answered a number of questions correctly with this regression, but I can't figure out how to interpret the data to answer the following two questions:

*

*What percent of the variation in GPA is explained by IQ?

*Additional amount of variation explained due to the addition of Self-Concept to the model?

This is what I got from Minitab:

Is this enough information to discern the answer to these questions? If so, how do I interpret this information to find the percent of variation explained by each predictor?

A: You will want to calculate the Coefficient of Determination (wiki link: http://en.wikipedia.org/wiki/Coefficient_of_determination) which is the fraction of variance explained by your regression divided by the total variance in the data. So if you have r^2 = 1 then 100% of the variance is explained by your model.
To calculate this value you will want to take the Sum of Squares for your regression (in your case 221.58) and then divide it by the Total Sum of Squares (in your case this is 339.43).
So to address your first question you should run a regression using only the IQ variable and get the Sum of Squares for the regression and from that you can calculate the fraction of variance you've explained with your model. I have not used Minitab before but I suspect that this will be equivalent to the Seq SS for the IQ variable (or 143.7)
For your second question you just need to figure out (from your output) what the explained variation is (i.e., 221.58/339.43 or ~65.3%).
I hope that helps.


text:
Q: Generic class with multiple types generates errors I am trying to create the following class using generics:
public class IndexSet<T> extends HashMap<T, D extends Duet<T>>

But the compiler generates two errors with text "error: > expected", pointing here: D extends Duet<T>
I tried to make it another way:
public class IndexSet<T> extends HashMap<T, D extends Duet<? extends T>>

And even more errors come. I've searched through all the internet, but I see that people are using the exact same syntax. I have no idea, what am I doing wrong?

A: You need to declare the type parameters on the type you are declaring.
public class IndexSet<T, D extends Duet<T>> extends HashMap<T, D> {


text:
Q: Manipulating of a larger matrix to increase search time of a smaller matrix So given a larger image and a smaller image that is located within the larger image.  What can be done to the larger image in a separate function to help decrease search time.  The small image is a pixel to pixel similar to the large.  Trying to find the small one's exact location.
Given:
function [x] = generate_value(big_image)

function [row, col] = searchImages(big_image, small_image, x)

where x is generated in the other function. To be more specific the x vale can by anything. A structure, hash mapping, anything isnt not super reliant on built in matlab functions.
Unfortunately, I do need to use the two function signatures given.
Any ideas of what i could to the larger image to speed up the search.  Time is important.


text:
Q: Why is it called a ratio scale? Can you provide a simple example that clearly explains- why ratio scale is called ratio scale?

A: In an interval scale, the intervals are equal.
The increase in temperature from 10 degrees to 20 degrees is the same increase from 20 degrees to 30 degrees. The intervals are equal. That's not true for a scale of, say math ability. Is the difference in math ability between someone who scores 10 and someone who scores 20 the same as the difference in math ability between someone who scores 20 and someone who scores 30? What does 10 more points of math ability even mean?
But in a scale that's not ratio, the ratios don't make sense. You can't double 10 degrees and get 20 degrees, and call that twice as hot.
In a ratio scale, ratios make sense. 20lbs is twice as much mass as 10lbs. 1 minute is half of 2 minutes. (And if you're using temperature, you can use the Kelvin scale, which does have a true zero, and is ratio).


text:
Q: Colorbox cboxOverlay position IE I have a problem with Colorbox .
When you click cboxOverlay position is at the bottom,,, But only in IE .
Loook link: cboxOverlay position IE problem
How to solve this problem?

A: You have to fix your css.
#cboxOverlay {
    position: absolute !important;
}


text:
Q: Understanding CPU fan ref design I'm currently designing a carrier board for the Jetson Orin NX 16GB SoM (system on module).
I'm having trouble understanding the ref design of the fan management part. The part about fan management is page 74-75 of the design guide. There don't seem to be much useful information excepted the bellow schematics:

For the fan header, pin 1 is ground, pin 2 is Vcc (5V), pin 2 is tachometer (I suppose open drain, but not sure), pin 4 is PWM.
The bottom part (between pin 230 of Jetson to fan header pin 4) is, if I'm not mistaken, simply a level shifter from 1.8 V (Jetson GPIO voltage) to 5 V. Correct? Is there any reason to use 5 discrete components rather than an all integrated level shifter?
For the middle part (between pin 208 of Jetson and pin 3 of fan header (tachymeter signal from fan), it seems to be shifting down from 5 to 1.8 V, maybe with pulling up if the tachymeter is open drain. Is there a reason why not just to use a voltage divider for the down shifting?
And my main interrogation is the supply part (between VDD_5V_IN at the top and pin 2 of fan header):

*

*I think there is an error on the MOSFET with reference SM2309 (ie the top most). I couldn't find a decent datasheet. I have one for the SM2309PSA from some obscure manufacturer, and one for the TSM2309 that seems to be a decent part (referenced on Mouser). In both cases, it's a P-MOS (but they are not the same). I would also guess a P-MOS would make more sense than the N-MOS drawn (there seems to be no easy way to get a V_GS>0)

*If indeed this MOSFET should be a PMOS, how should it be wired? And what function (protection) does it provide?

*Any idea why they add the 100 µH inductor? (the diodes are for free wheeling)

So my main question is if SM2309 should be a P-MOS instead, and if so how it should be wired and why?
For the other parts, I have a feeling it might be over-complicated, but not wrong.

A:
So my main question is if SM2309 should be a P-MOS instead, and if so
how it should be wired and why?

It certainly looks like it should be a p-channel MOSFET because an n-channel MOSFET will just behave like a forward-biased diode as it is shown in your question. I strongly suspect it is an attempt to produce a reverse voltage polarity protection circuit like this: -

Image from Reverse polarity protection with a P-MOSFET.

Any idea why they add the 100µH inductor? (the diodes are for free
wheeling)

It looks like it will keep fan electrical noise from appearing on the main 5 volt supply i.e. it's a filter and, as you say, the diodes are there to catch the flyback energy from the inductor to prevent excessive back emf.

A: The fan becomes like a 2 watt generator on power down so the FET acts an isolation switch and the transient energy is dumped inside the fan.
The other circuits are level shifters to protect a low voltage CPU or uC.
Added
Yes you are correct or at least I agree, the 5Vin uses a PMOS switch shown incorrectly as an NMOS. Send a note to NVidia for the correction if they do not already know. At least the base part number is good enough to confirm.  It's a common oversight and why we have revisions to documents.


text:
Q: How to inject network drivers into Ubuntu Iso? how to inject network drivers into the ubuntu OS iso? I went through the Cubic to create a custom Ubuntu live CD.
But it doesn't say anything about injecting the drivers, only to install packages. What if I get kernel modules to put into the iso image?
Here, suppose I need to inject intel driver into the iso, then I can make a directory inside the kernel tree directory:
/lib/modules/$Kernel_version/kernel/drivers/net/ethernet/intel/
What if I have a custom driver, what needs to be done for it?


text:
Q: "Headers already sent" error from output in one file, and not another I know this question has been posted many times before, but I've been unable to find a good answer anyway, since the error doesn't exactly behave as it should.
You see, I have code similar to this:
<?php
    include("banner.php");
    include("menu.php");
    print "
";
        if(true) header("Location:index.php");
        else print "Hello World";
    print "
";
    include("footer.php");
?>

banner.php looks like this:

and menu.php looks like this:

Menu

            <a href="test1.php?id=<?php print $id; ?>">
Item 1

Item

Item 3

            <a href="test4.php?id=<?php print $id; ?>">
Item 4

Note that there are a few PHP elements in menu.php.
If I run the first piece of code, I get the error Warning: Cannot modify header information - headers already sent by (output started at /var/www/menu.php:10) in /var/www/test.php on line 5. Line 10 in menu.php is the last line. If I remove the menu completely from the code, and leave banner.php, the code works fine. I find this confusing, since banner.php does too provide output, as does the print "
"; line right after the inclusion of the menu.
My question is simply this: Why does menu.php trigger the error, while banner.php doesn't?

A: This would happen if the output is being buffered, and the last line of menu.php filled up the buffer and flushed it down the wire.

A: Any PHP that modifies a header need to be before any other page data, unless you have output buffering on. The header gets sent right when you output ANYTHING. HTML code, PHP, ect..
Think of the PHP code as a facet, and the web server is a glass. Lets imagine that we're going to fill up the glass with the output of the HTML. As soon as it gets the first drop the headers are already established for what it's going to send.
You can turn on output buffering in your PHP.ini.
Output buffering basically like a measuring cup where you have the PHP code fill the measuring cup and when it gets to a certain point it gets poured into the glass cup (Web server). While it's being built up, it's still in PHP we have access to it which is why we're able to modify the headers we haven't given anything to the web server. However, take note that this has a performance impact on the server. You probably won't notice it though.

A: HTTPHeader must be the first thing to send. And any output from the script (even if it is a single character or error message) is proceeded by HTTP Headers. and once the content send is started additional header cannot be sent. This is HTTP Protocol basics. I will explain it WRT your code.
<?php
    include("banner.php");
    //The above line the banner output is sent.So does the HTTP Headers
    include("menu.php");
    print "
";
        if(true) header("Location:index.php");
        //Because the Output is started in bannrd you cannot send additional headers.
        else print "Hello World";
    print "
";
    include("footer.php");
?>

If you have output buffering turned on in php.ini then unpredictable results can happen, as headers are never buffered and the content is only buffered. In your case it looks like you send the header before php flushes the banner code.


text:
Q: RAID 6 >80% Highest Active Time with small I/O I have a RAID 6 with 18 disks. It is used as a storage for small images(5-500Kb). It is about 6TB full of data. I have an utility that reads that images to the ram and then send it over network. I noticed that with about 10Mb/s I/O I have about 100% active time. qlen is about 18-25, iops is about 500-700. is it because of a lot small requests? Can I improve that? I noticed that it could affect other applications that use that storage for their needs. Also, response time for some files can grow till 700-1000ms.

A: Can't directly answer your question, because drive performance has a whole lot of 'it depends'. It depends a lot on IO types, IO sizing, cache, controllers etc.
Most especially, you need to understand the difference in 'cost' of read vs. write IO.
Write IO is expensive on a RAID 6 - each IO requires 6 disk operations. That means you can just divide your number of spindles by 6 for sustained transfer. There are a few tricks you can do to hide this problem - you can cache aggressively, because if you're able to stripe coalesce, you massively reduce that problem. If you write one block, you need to do 6 operations each. However if you can write a full stripe, you have to just write an extra 2 blocks, making it more efficient than RAID 1 would be. You can also defer a write, and just send it down to disk later - causing the write to complete at 'cache speed' until you fill your cache.
Read IO on the other hand - takes one operation to service, but it must be done real time - you can't defer it like you can writes. That means your reads are generally slower - but again, you can partially mitigate this by caching - but you do have to exploit likely patterns of reads (e.g. large sequentials, re-read of common files).
That means there's practically speaking a very large difference between theoretical and optimal performance based on workload, which is why this sort of question is so difficult to answer.
In your case - you say you have small IOPs. 500-700 IOPs for 10MB/sec means you've got small IOs. So you could quite easily - if they're a random pattern - running at the worst case speed of your disks. Either because your read IOs are random and can't be cached, or your write IOs are random and thus can't be coalesced and full-striped to disk - as soon as your write cache fills, you'll slow down to 'disk' speed, and that can be abominably slow. (18 disks gives you effective 3 spindles in that scenario - you're getting more than that though)
I think you'll probably be ok on controller to disk ratios, but it's hard to say. It's usually the case that the limiting factor is the spinning rust, as that's generally the slowest part of the system. But we get distorted expectations thanks to huge caches and effective caching algorithm.
So I would suggest that what you need to check - what sort of ratio of IO you get. (Ignore MB/sec, it's clear you're not even getting close to theoretical levels there). Check cache hit ratios and cache sizing - if you can, look at how full your caches are and what rate of full stripe write you're getting (if you're doing much write IO).
Also check disk seek rate - see how often your heads are moving around on the disks -  again, one of the downsides of intensive random read patterns is your disks will be thrashing.


text:
Q: Sony experia z3 with bootloader bad I have problem with my experia z3 and i can't fix it! I looking for help now. I try to unlock my bootloader but fastboot give me message FAILED (remote: Command not allowed) someone who know how to fix this problem ?
Cheers

A: It seems driver problem.
try these:
Connect to flashtool (beta2 or beta4) with device power-on debug off, to see if flashtool can recognize it, and how much it can recognize.
Connect to flashtool with device power-on debug on , to see if flashtool can recognize it.
Connect to flashtool with device in fastboot mode, to see if flashtool can recognize it.
Connect to flashtool with device in flashmode, to see if flashtool can recognize it.
Flashtool may fix some driver error. I just succeeded after hours of bungling like that.


text:
Q: Proof that this is a complete metric space How do I prove that a metric space defined by ($A,d$), where $A$ is any set and $d$ is the distance defined by
$\displaystyle d(x,y) = \left\{ 1, \ \text{if} \ x \neq y \atop
0, \ \text{if} \ x = y \right.$
is complete? I know I have to prove that any Cauchy sequence is convergent to a limit, and that the limit must be inside the set, but I don't know how to begin the proof.


text:
Q: Iterator object for a 2-3 Tree I needed help with the iterator for a 2-3 Tree. The way I am implementing right now is a recursive approach which is almost similar to DFS. I initialize the traversal from the root, visit it's left branch until I hit a leaf node, and then add it to the Linked-List. Step by step, as the recursion backtracks, all the nodes in the left branch gets added and then the 1st key of the root to preserve the order. I do the same thing with middle and right branch. Once the linked list is built, I simply return it's iterator. What I wanted to know that is this is the best way to build an iterator for the 2-3 Tree? What can I change to make it efficient? I am worried that if the tree gets huge, the recursive calls might hit a StackOverFlowError (lol, the irony.)
private class Traversal
{
    LinkedList<Node> ordered;

    void traverseTree()
    {
        ordered = new LinkedList<>();                   // Reset the ordered list. traverseTree will be only called in case of modification
        traverse(root);                                 // Initialize traversal from the root.
    }

    void traverse(Node n)
    {
        if (n.children.size() == 0)                     // If it's a leaf node, add it to the linked list.
            ordered.add(n);
        else
        {
            traverse(n.children.get(0));                // Otherwise, first traverse the left branch
            ordered.add(new Node(n.keys.get(0)));       // When it is done, create a new node containing key 1 of the node n to keep it ordered.
            traverse(n.children.get(1));                // Then traverse the middle/right branch of n.
            if (n.children.size() == 3)                 // If there are 3 branches, then we still need to traverse it.
            {
                ordered.add(new Node(n.keys.get(1)));   // Before we traverse, create a new node containing the 2nd key of n to the list since everything is going to be greater than it in the right branch.
                traverse(n.children.get(2));            // Then traverse the last branch and add all encountered nodes in order.
            }
        }
    }
}

A: First off, it is important to mention that neither the way I am going to describe nor your way allows for a "proper" tree traversal. You will always only get a single key, wrapped in a Node object. If you want to actually iterate through the tree and get a Node at position x, and not its value you can modify both your and my version to not return the keys of the non-leaf nodes but the nodes themselves.
There could also be a different option by writing your own iterator based around stacks of parents. This option is not necessarily better when it comes to time constraints but you would be operating without recursion so no stack overflows are an issue. If you think about it for a little bit you will see though, that this is just a very manual way to do things "recursively". Here is the gist of it:
Assume the left-bottom-most element (in a graphic illustration) to be your first elemtent. Let's call it A. Now to get you A you will have to traverse through your tree, passing all "the parents" of A (obviously it has only one direct parent but I am referring to the parent of the parent...). Now we can push every parent of A onto a Stack<Node>-type object. Let's call it S. Now once we reach A we will have the path of A in S (like a directory path). This is good enough for us to do our slow recursion. This method of traversal will manually perform what your recursive method performed "automatically" did. Here we actually move around in the tree opposed to working with an extra List.
class TreeIterator implements Iterator
{
Node current, recentChild;
Stack<Node> parentsOfCurrentNode; //our S

TreeIterator(Node root)
{
    current = root;
    while(current.children.size() != 0)
    {
        parentsOfCurrentNode.push(current);
        current = current.children.get(0); //getting our initial A
    }
}
public Node next()
{
    if(current.children.size() == 0)
    {
        recentChild = current;
        current = parentsOfCurrentNode.pop();
        return current;
    }
    else if(recentChild == current.children.get(0))
    {//We just came from the left child so now we go to the middle one
        Node out = new Node(current.keys.get(0));// will always exist
        current = current.children.get(1); //middle path
        while(current.children.size() != 0)
        {
            parentsOfCurrentNode.push(current);
            current = current.children.get(0); /*traversing again to the lowest value
                 in the path with no children,
                 triggering the first if-case when next is called*/
        }
        return out;
    }
    else if(recentChild == current.children.get(1))
    {//We just came from the right/middle child so now we go to the parent/right node
        if(current.children.size() == 2)
        {
            recentChild = current;
            if(!parentsOfCurrentNode.isEmpty())
            {
                current = parentsOfCurrentNode.pop();
                while(current.children.get(current.children.size()-1) == recentChild)
                {//testing for always rigth-most Node
                    if(parentsOfCurrentNode.isEmpty())
                    {
                        return null; //no more elements
                    }
                    recentChild = current;
                    current = parentsOfCurrentNode.pop();
                }
                //we are now guaranteed to be at a point where the most recent node was not the right most node
                if(recentChild == current.children.get(0))
                {//We just came from the left child so now we go to the middle one
                    Node out = new Node(current.keys.get(0));// will always exist
                    current = current.children.get(1); //middle path
                    while(current.children.size() != 0)
                    {
                        parentsOfCurrentNode.push(current);
                        current = current.children.get(0); /*traversing again to the lowest value
                            in the path with no children,
                            triggering the first if-case when next is called*/
                    }
                    return out;
                }
                else if(recentChild == current.chidren.get(1))
                {//Can only happen for size 3 de facto
                    Node out = new Node(current.keys.get(1)//
                            current = current.children.get(2); //right path
                    while(current.children.size() != 0)
                    {
                        parentsOfCurrentNode.push(current);
                        current = current.children.get(0); /*traversing again to the lowest value
                            in the path with no children,
                             triggering the first if-case when next is called*/
                    }
                    return out;
                }
            }
        }
        else
        { //this is size 3 so we continue
            Node out = new Node(current.keys.get(1));//
            current = current.children.get(2); //right path
            while(current.children.size() != 0)
            {
                parentsOfCurrentNode.push(current);
                current = current.children.get(0); /*traversing again to the lowest value
                 in the path with no children,
                 triggering the first if-case when next is called*/
            }
            return out;
        }
    }
    else
    {//we are coming from right child and current is of size 3
        recentChild = current;
        if(!parentsOfCurrentNode.isEmpty())
        {
            current = parentsOfCurrentNode.pop();
            while(current.children.get(current.children.size()-1) == recentChild)
            {//testing for always rigth-most Node
                if(parentsOfCurrentNode.isEmpty())
                {
                    return null; //no more elements
                }
                recentChild = current;
                current = parentsOfCurrentNode.pop();
            }
            //we are now guaranteed to be at a point where the most recent node was not the right-most node
            if(recentChild == current.children.get(0))
            {//We just came from the left child so now we go to the middle one
                Node out = new Node(current.keys.get(0));// will always exist
                current = current.children.get(1); //middle path
                while(current.children.size() != 0)
                {
                    parentsOfCurrentNode.push(current);
                    current = current.children.get(0); /*traversing again to the lowest value
                        in the path with no children,
                        triggering the first if-case when next is called*/
                }
                return out;
            }
            else
            {//Can only happen for size 3 de facto
                Node out = new Node(current.keys.get(1));//
                        current = current.children.get(2); //right path
                while(current.children.size() != 0)
                {
                    parentsOfCurrentNode.push(current);
                    current = current.children.get(0); /*traversing again to the lowest value
                        in the path with no children,
                         triggering the first if-case when next is called*/
                }
                return out;
            }
        }
    }
    return null; //if it ever gets here something is seriously wrong
}
} //end of class

So this is only the next() method specified in the Iterator interface of Java (I guessed that is what you are using because of the syntax you are using). Please keep in mind that you also have to implement hasNext() and optionally remove(), which will in this case now actually remove from your tree. hasNext() can be implemented by
a) finding the right-most element when you construct the iterator and compare current to it whenever hasNext() is called. This approach makes it static meaning that changes to the tree will not be taken into consideration.
b) checking if current is the right-most element already. If you want to do that, just look at the code whenever we traverse back to the root and check if the node we are at right now is the node most to the right (be aware that you have to clone the Stack otherwise you will lose all the parents).
The latter check is dynamic but very slow. The first check thus, is way better for time effienciency.
In it's entirety this method is save to not cause a stack overflow and it uses less memory since we are moving around in the Tree itself. On the other hand it is slower during access, with O(d) during runtime d being the depth of your tree, being the max time complexity. Another issue is that the hasNext() method needs to be linked to the right-most element to be time efficient (O(1)). Otherwise it will always be O(d) to find out if your iterator has a next element. So the advantage of not ever throwing a StackOverflowError is in competition with the higher time complexity overall. What is more important to you is on you to decide. (EDIT: You should keep in mind that the worst case complexity is O(d) and not O(n) (where n is the number of elements in the tree).)
You asked what you can do to make this efficient: nothing. You will always lose some efficiency somewhere. I like your approach of just putting all your data in a List and take its iterator, it's nice and smooth, and definitely more efficient than my proposed variant. I just wanted to give you a different angle at this, because even though your question is broad it is justified. The simple answer is still that what you are doing is most efficient for traversal and you just have to tell yourself that nobody will ever create a Tree large enough to break it.
Also do not take the code word for word, it is probably not 100% error free. I was not in the mood to build a Node class just like yours so it might not 100% work with what you have. If you really need something for huge 2-3 Trees and choose my approach, rewrite it for your needs.


text:
Q: Having trouble while importing xmlaccess in Websphere Portal I am having trouble importing xmlaccess in Websphere Portal, giving some SSL exception error.
Could not connect to portal.
 An error occurred on the client: Could not establish SSL connection to portal. SSLHandshakeException occured.
Is there anyway I can import it through Portal administration console?

A: Yes, you can import xmlaccess files through Portal Administration:
Administration > Portal Settings > Import XML

A: In addition to the already mentioned option within the Admin user interface you can define the key and trust store the xmlaccess client should use
xmlaccess.sh -user wpsadmin -password your_password -url https://portalhost:10035/wps/config/
             -in $PortalHome/doc/xml-samples/ExportAllUsers.xml -out result.xml
             -truststore $WASHome/profiles/wp_profile/etc/trust.p12
             -trustpwd WebAS -trusttype PKCS12

https://www.ibm.com/support/knowledgecenter/SSYJ99_8.5.0/admin-system/adxmltsk_cmdln_sntx_ssl_elements.dita


text:
Q: Excel Dropdown selected value not displayed after save and reopen I have an excel spreadsheet which uses a button to allow users to add new resources to a list. When the button is clicked, a row is inserted above it and a dropdown is created in the first cell of that row with various resource types. The rows and dropdowns are being created successfully, however if you select the resource types for all of the added rows and then save an exit the workbook, the selections are not displayed when the sheet is re-opened. If another resource row is added, all the drop down selections re-appear. Also, if the drop down box itself is moved at all, the select will re-appear.
On top of that, this does not happen with ever selection. If the first drop down option is selected, it is displayed upon re-opening.
All of the combo boxes have a linked cells, and it is being saved as a Macro enabled work book. I cannot think of why they would not be displayed - anyone have any ideas?
---UPDATE---
How the Drop down is being created:
Set curCombo = ActiveSheet.Shapes.AddFormControl(xlDropDown, Left:=Cells(cs, 1).Left, Top:=Cells(cs, 1).Top, Width:=110, Height:=16)
With curCombo
    .ControlFormat.DropDownLines = 4
    .ControlFormat.AddItem "Labor - Engineer"
    .ControlFormat.AddItem "Labor - Technician"
    .ControlFormat.AddItem "Labor - Support"
    .ControlFormat.AddItem "Shop"
    .Name = "resource_" & cs & "_comboBx"
End With

ActiveSheet.DropDowns("resource_" & cs & "_comboBx").LinkedCell = Cells(cs, 1).Address


text:
Q: C++ operator overloading return pointer I'm fairly new to programming in C++ and I was wondering something:
whenever I see operator overloading in C++ it's done like this:
#ifndef STONE_H
#define STONE_H

class Stone {
    private:
    int weight;

    public:
    .......

    Stone operator+(const Stone& s) {
        Stone stone;
        stone.weight = this->weight + s.weight;
        return stone;
    }

    .......
}

#endif

But when the "+" operator is called, it creates an object "stone", and returns a copy of this. This can't be good for performance when dealing with huge objects?
Wouldn't it be better to use dynamic memory for this as in the example below:
Stone * operator+(const Stone& s) {
    Stone * stone = new Stone;
    stone->weight = this->weight + s.weight;
    return stone;
}

Or am I seeing this wrong?
Thanks in advance

A: Trying to reason things out is not particularly accurate way of estimating performance: you need to actually write a program to measure whether or not one implementation is better than another.
There are a number of ways in which no copy will happen at all; the named return value optimization (NRVO) and move assignment are relevant ideas here.
Even if you decide that you want to do something like your suggestion, you shouldn't implement it as you have, since it has the wrong semantics: you've had operator+ return a pointer-to-thing rather than a thing. Also, working with pointers (especially bare pointers) is risky, since it gives you a lot more opportunities to make mistakes.
If you want to implement something along those lines, you need to wrap the pointer semantics in a class that provides value semantics.

A: Turns out on the current standard, this is a bit different:
#include <iostream>

class big {
  int* v; // Demonstration purposes. A smart pointer or a standard container would be better.
  public:
  big& operator+=(big& o) {
    for (int i=0;i<1000;++i) {
      v[i] += o.v[i];
    }
    return *this;
  }

  big(int val = 0)
      :    v{new int[1000]} // We're using RAII to prevent resource leaking.
  {
    std::cout << "a construction.\n";
    for (int i=0;i<1000;++i) {
      v[i] = val;
    }
  }

  // Copy constructor
  big(big& o)
      :    v{new int[1000]}
  {
    std::cout << "a copy construction.\n";
    for (int i=0;i<1000;++i) {
      v[i] = o.v[i];
    }
  }

  // Move assignment
  big& operator=(big&& o) {
    std::cout << "a move assignment.\n";
    if (v) delete[] v;
    v = o.v;
    o.v = nullptr;
  }

  // Move constructor
  big (big&& o) {
    std::cout << "a move construction.\n";
    v = o.v;
    o.v = nullptr;
  }

  ~big() {
    if (v) delete[] v;
  }
};

// a will be move-constructed if using a temporary, or copy-contructed if not.
// The result will always be passed by a cheap move
big operator+(big a, big& b) {
  return std::move(a += b);
}

int main() {
  big a{1};
  big b{2};
  big c{3};

  big d = a+b+c;
}

Output: (with comments added)
a construction. // Constructed a
a construction. // Constructed b
a construction. // Constructed c
a copy construction. // a+b <- a copied into parameter "a" of operator+. b is passed by reference.
a move construction. // The temporary from the operation above, moved into parameter "a" of operator+. c is passed by reference.
a move construction. // d is move constructed from the temporary generated by a+b+c.


text:
Q: Skipping to the beginning of a for loop in a Scala program In a for loop in my Scala code, i want to skip to the beginning of the loop and not execute following statements if a particular condition is true. In Java i can use 'continue' for doing this. But 'continue' does not seem to work in Scala.
So how can i skip to the beginning of my loop in a Scala program ?
Please Help
Thank You.

A: First, your best option is usually to avoid that sort of construct anyway, and try to use higher-level methods instead (e.g. you can often do xs.map(doSomeStuff).filter(condition).foreach(doConditionalStuff)).  This isn't always practical, but it is far more often than you might initially suspect.  Still, the issue remains for those cases where continue is useful: a very long series of guards within a long code block that cannot be logically broken into pieces.
continue is a difficult language construct for a language with anonymous functions.  One reason is practical: the anonymous function is a function, and you can't easily go back to some loop that's calling it just by executing a jump.  Another reason is conceptual: if you're in a map method, which itself is a kind of loop, where exactly should the continue take you back to the beginning of?
Rather than dealing with these awkward cases, Scala provides (as a library function, based upon exceptions) a breakable construct that explicitly specifies where you want to break to:
import scala.util.control.Breaks._
breakable {
  for (i <- 1 to 10) {
    if (i>3) break
    println(i)
  }
}

But because this is a generic construct, you can use it inside the for loop also:
import scala.util.control.Breaks._
for (i <- 1 to 10) {
  breakable {
    if ((i%2)==0) break
    println(i)
  }
}

You can even break to multiple levels if you create your own break classes.  Here's an example of simulating a for loop with both break and continue:
val outer,inner = new scala.util.control.Breaks
outer.breakable {
  for (i <- 1 to 10) {
    inner.breakable {
      if ((i%2)==0) inner.break
      if (i>3) outer.break
      println(i)
    }
  }
}

And if you use this pattern a lot, you can change your imports to make it nicer:
// Do this once at the top of the file
import scala.util.control.Breaks._
object Continued extends scala.util.control.Breaks {}
import Continued.{break=>continue, breakable=>continuing}

// Now every time you need it:
breakable{ for (i <- 1 to 10) continuing {
  if ((i%2)==0) continue
  if (i>3) break
  println(i)
}}

It is a bit more work to type if you really need that functionality, but given how nonsensical breaks and continues are in the context of the other very useful functionality that Scala has, it's not a bad compromise.

A: If you're using Scala 2.7, from http://www.scala-lang.org/node/257

These keywords are not included in Scala 2.7, and must be implemented in a different way. For break, the simplest thing to do is to divide your code into smaller methods and use the return to exit early. For continue, a simple approach is to place the skipped-over parts of a loop into an if.
  Scala 2.8 will include break, but not continue.

If you're using Scala 2.8
import util.control.Breaks._
// for continue, write this somewhere in your program
val continue = new Breaks
/* use like */
Breaks.breakable {
  for (i <- 1 to 10)
  continue.breakable { if (i % 2 == 0) continue.break; println(i); if (i == 7) Breaks.break }
}

//source http://daily-scala.blogspot.com/2010/04/breaks.html

Note that normally needing break and continue means that you aren't being as functional as Scala would like you to be.


text:
Q: How to get the Windows Phone system language from code? Solution:
Use CultureInfo.CurrentUICulture
User can change the system language of Windows Phone at:
Settings > language+region > Phone language
How can I get the selected language (Phone language) from C# code?
Below is my phone settings:

Here is my code snippet:
System.Diagnostics.Debug.WriteLine(
    "*************************************   CultureInfo.CurrentCulture.Name = " + CultureInfo.CurrentCulture.ToString() + ", "  +
    "CultureInfo.CurrentCulture.CompareInfo = " + CultureInfo.CurrentCulture.CompareInfo + ", " +
    "CultureInfo.CurrentCulture.DisplayName = " + CultureInfo.CurrentCulture.DisplayName + ", " +
    "CultureInfo.CurrentCulture.EnglishName = " + CultureInfo.CurrentCulture.EnglishName + ", " +
    "CultureInfo.CurrentCulture.Name = " + CultureInfo.CurrentCulture.Name + ", " +
    "CultureInfo.CurrentCulture.NativeName = " + CultureInfo.CurrentCulture.NativeName + ", " +
    "CultureInfo.CurrentCulture.TextInfo = " + CultureInfo.CurrentCulture.TextInfo
);

Here is the output:
CultureInfo.CurrentCulture.Name = zh-HK,
CultureInfo.CurrentCulture.CompareInfo = CompareInfo - zh-HK,
CultureInfo.CurrentCulture.DisplayName = Chinese (Traditional, Hong
Kong SAR), CultureInfo.CurrentCulture.EnglishName = Chinese
(Traditional, Hong Kong SAR), CultureInfo.CurrentCulture.Name = zh-HK,
CultureInfo.CurrentCulture.NativeName = 中文(香港特別行政區),
CultureInfo.CurrentCulture.TextInfo = TextInfo - zh-HK

I cannot find the 'Phone Language'

A: Use System.Threading.Thread.CurrentThread.CurrentCulture. It should correctly reflect the phone language.

A: you can check my answer, this will help you to change the language at runtime:
https://stackoverflow.com/a/17131401/2467917


text:
Q: Expected number of rolls for unfair die until both even and odd have shown An unfair die is rolled until both an even number and odd number have appeared on top. The probability that the roll shows $n$ is proportional to $n$, where $n$ = 1,2,3,4,5,6.
What is the expected number of rolls, and what is the probability that the last roll shows even?
I believe the answer to the latter is $12/21$, but I am not sure. Additionally, I am unsure of how to compute the expectation value for the number of rolls until both even and odd have shown.

A: You should get the following pmf for the number obtained in a given roll, $X$, $$\begin{array} {|r|r|}\hline x & 1 & 2 & 3 & 4 & 5 & 6 \\ \hline \mathbb{P}(X=x) & \frac1{21} & \frac2{21} & \frac3{21} & \frac4{21} & \frac5{21} & \frac6{21} \\ \hline  \end{array}$$
Thus we have that
$$\mathbb{P}(\text{even number})=\frac2{21}+\frac4{21}+\frac6{21}=\frac47$$
$$\mathbb{P}(\text{odd number})=\frac1{21}+\frac3{21}+\frac5{21}=\frac37$$
Then, applying linearity of expectation, we get
$$\begin{align}
\mathbb{E}(\text{number of rolls})
&=1+\mathbb{P}(\text{even number})\cdot\mathbb{E}(\text{number of rolls to obtain an odd number})\\
&+\mathbb{P}(\text{odd number})\cdot\mathbb{E}(\text{number of rolls to obtain an even number})\\
&=1+\frac47\cdot\frac1{\left(\frac37\right)}+\frac37\cdot\frac1{\left(\frac47\right)}\\
&=\frac{37}{12}\\
\end{align}$$
As @lulu stated in the comments, the probability that the last roll is even is just $\mathbb{P}(\text{odd number})=\frac37$ because we would otherwise throw until we obtain an odd number.


text:
Q: ValueError: could not convert string to float: 'singlet' I have this data in csv file which a column has string value (prediction column). How do I rectify the ValueError so that I can read the file?'
Code I attempted:
adata['prediction'].replace('singlet').astype(float)


text:
Q: What does the "bisector angle of vertex for original geometry" mean in the Extract Vertices tool? I need to calculate the number of notches in my polygons.
Therefore I need to know the angles of the vertices in a set polygons.
I managed to extract a value for the angle by the Extract Vertices tool but cannot make sense of the values I am given. The description of the value is given as "the bisector angle of vertex for original geometry". I tried to search what does this term mean, but to no avail.
Any help is welcome.

A: I just had the same query and only found your unanswered question.  So I drew a line, extracted the vertices and came up with the picture below. The labels are the angles produced by the Extract Vertices tool:
I can't think of the most concise way to say it, but the angles seem to be:
the average of the bearings of the two line segments connected to the vertex
Maybe my clumsy wording will provoke a better explanation.
See the vertex at bottom left has an angle of 135 degrees.  The segment leading into the vertex has a bearing of 180 and segment running out of the vertex has a bearing of 90, so if you average those two bearings (or bisect those two angles) you end up with 135.  I found it easier to visualise the bisector if the incoming line segment was relocated to be leading away from the vertex:

Here's another picture with the angles symbolised (they reminded me of tangents, although I know that's not what they are):
The angle for the first and last vertices are just the bearing of the single segment connected to the vertex.
Edit: I guess if the angle is relative to the horizontal you get a different kind of bisector:


text:
Q: how to verify in assertj that elements are one of I can't find how to do check with assertj the following (which is very common):
Suppose I have:
 result1 = {"AAA", "BBB"}
 result2 = {"DDD"}

I want to check the values in result is one of these:
String[] valid = String[]{"AAA", "BBB", "CCC"};

using assertj, whould be something as:
assertThat(result1).xxxx(valid);
assertThat(result2).xxxx(valid);

So that result1 would pass check, but result2 not.
contains() does not work (it checks that result contains all valid elements)
I don't want have to create a custom condition for this kind of checking
Any idea?

A: You can wtite it the other way around:
assertThat(valid).contains(result1);
assertThat(valid).contains(result2);

If you insist on having the result on the left and valid on the right side, you can use:
assertThat(result1).isSubsetOf(Arrays.asList(valid));
assertThat(result2).isSubsetOf(Arrays.asList(valid));

Or, why not to define the valid as a set, rather than an array?
Set<String> valid = Sets.newHashSet("AAA", "BBB", "CCC"); //Sets comes from google guava
assertThat(result1).isSubsetOf(valid);
assertThat(result2).isSubsetOf(valid);


text:
Q: Are property values in CSS case-sensitive? I have observed that some CSS properties, like font-family declared with quotation marks, perhaps are case-sensitive, but all other are not... But how web-browsers and "HTML renderers" MUST interpret? Is the same in any CSS context (XML, SVG, etc.) and all other applications? What the standards say about?
Example: Adobe InDesign exported both, font-family:'Optima Bold' and font-family:'optima bold'. Can I "normalize to lower case" (ex. to merge similar classes)?
NOTES
References are incomplete and in conflict:

*

*sitepoint.com/font-family say "Note that font family names may be case sensitive on some operating systems"... It is valid for XHTML, it is updated with HTML5? font-family  is really the unique case-sensitive value?

*Is it necessary to use lowercase for every Element and attribute , properties in css and xhtml ? say indirectly "... use lowercase for every properties...", and answers not negate it.

Comparing with  this question/answers, the point here, perhaps, can be translated to some (personal) objective considerations:

*

*There are a (objective!) normative (W3C spec of CSS2, CSS3, XHTML1, or HTML5) source for this answer?

*"Standard font-family unique names" can not be case-sensitive (otherwise cease to be standard)... So, the only justifiable (by sensible arguments) properties to be case-sensitive are:
2.1. X values at url(X), see background, etc. properties;
2.2. content values, example;
2.3. ... more ?? ...

A: The spec for CSS 2 says:

CSS syntax is case-insensitive within the ASCII range (i.e., [a-z] and
  [A-Z] are equivalent), except for parts that are not under the control
  of CSS. For example, the case-sensitivity of values of the HTML
  attributes "id" and "class", of font names, and of URIs lies outside
  the scope of this specification. Note in particular that element names
  are case-insensitive in HTML, but case-sensitive in XML.

... which makes quite sense: CSS itself accepts both background-image and BACKGROUND-IMAGE but it has no way to know whether your web server considers LOGO.PNG and logo.png as identical or different resources.
(I've been unable to find the equivalent document for CSS3)

A: (updating @ÁlvaroG.Vicario answer and comments, and complementing this answer... This is a Wiki, please edit to enhance)
Example: for CSS3 (and HTML5) there are new explicit rules, as "font-face property must be case-insensitive".[2]

Context
W3C interoperating standards, mainly XML, HTML, CSV and CSS.
CSS general rules
CSS2 (a W3C standard of 2008) fixed basic conventions about "Characters and case", and CSS3 (a W3C standard for 2015) added something more.

*

*By default "all CSS syntax is case-insensitive (...)" [1]

*There are exceptions, "(...) except for parts that are not under the control of CSS"[1]
2.1. element names are case-sensitive in HTML5 (?) and XML, but  case-insensitive in HTML4.
2.2. identifiers (including element names, classes, and IDs in selectors) are case-sensitive.  HTML attributes id and class, of font names, and of URIs lies outside the scope of the CSS specification.

*....

*The
Case matrix
Exceptions and specific (explicited in a reference) rules. "YES" indicate that value is case-sensitive.
Property values:

 CSS property      | Case-sens. | Reference and notes
 ------------------|------------|--------------------
 %colorVals        | NO         | [3]
 font-family       | NO         | [2]
 %url              | YES        | ...
 content           | YES        | ...
 ----------------------------------------------------
 %colorVals = color, background, etc.
 %url = background-image, etc. that use `url()`, see [7] and notes.

Selector values:

 CSS selector      | Case-sens. | Reference and notes
 ------------------|------------|--------------------
 id                | YES        |...
 element           | YES/NO     | ... YES for XML...
 class name        | YES        | [5]
 (`~ i` operator)  | NO         | [6]
 ----------------------------------------------------
 YES/NO = depends on the document language (see ref. and notes).

REFERENCES:
[1] W3C/CSS2/syndata, sec. 4.1.3 Characters and case.
[2] W3C/CSS3-fonts, sec. 5.1 Case sensitivity of font family names
[3] W3C/CSS3-color, sec. 4.1. Basic color keywords
[4] W3C/CSS3-values, sec. 3.1. Pre-defined Keywords
[5] W3C/Selectors, sec. 3. Case sensitivity
[6] W3C/Selectors4, sec. 6.3. Case-sensitivity
[7] RFC 3986 and URL syntax illustration at Wikipedia.

Quotations and notes

*

*Typical URLs starts with domain, that is case insensitive, but after it (path, query or fragment syntatical components), is case sensitive. See [7].

*"User agents must match these names case insensitively". [2]


text:
Q: Strategy for reaching Wave 30 on Modern Warfare 3's survival map 'Resistance'? I've been trying to survive Modern Warfare 3's survival map 'Resistance', but I cant get past Wave 25. I'm trying to survive until wave 30 but I'm not having any luck.
What is the best way for me to achieve this? I've used every tactic I know but none work.

A: I'd ask this in a comment but I don't have enough reputation

*

*What weapons are you using? - I prefer 2 lmg's (if you're level 50)

*What perks are you using?

*

*At later levels, the self-revive is pretty much useless, because the enemies have so much armor, there's no way you can kill them with a pistol (before getting killed).

*The reason why I prefer 2 lmg's if you're level 50, is because that's when you get Sleight Of Hand in survival. That's really op with 2 lmg's.

*The other perk is your personal choice, you can take the self-revive (it's still good if playing with a friend because of the extra time you get) if you want, but i prefer Steady Aim or Quickdraw.

*Where does all your money go?

*

*If you follow  these instructions, you should have a decent amount of money at round 24, 2 lmg's are worth of 14 000 + attachments (I prefer red dot sight and grip).

*Riot shield group is good IF you know how to use them properly, they can't stand outside of the house, the helicopters will shoot them down. So don't waste your money on that every time they get killed unless you have a sentry gun (that doesen't shoot in a position the riot shield guys are).

*What level are you?

*

*Like I said before, you need Sleight Of Hand. It's just that great.

Now, if you are level 50, you have 2 light machine guns (MG36 or MK46 and L86 LSW are my favourites), Sleight Of Hand, some claymores in your pocket (and air strike/predator missile, i prefer air strike because you can just throw it out of the door on your left and everyone camping there dies/takes damage and you don't risk yourself by controlling the predator missile, which probably won't hit the target if it's middle round since there's enemies shooting at you) what you need to do, is just go in the house at the middle and just camp behind the sofa. (Or behind the table, requires more skill but it's better if you believe you can handle the people coming from the door on your left).
Put the claymores outside the door and the usual cover spots the enemies use inside the house.
When you run out of ammo, switch your weapon. There's no reason to reload if you have another lmg with full ammo. When you run out of ammo in that gun, then reload. And remember, you have Sleight Of Hand.
IMO This is probably the best strategy there is, if you still can't do it, just practice more and try again.
Oh, almost forgot: You'll also need flashbangs. Not to blind the enemy so you can shoot them without getting shot, you should find a cover to do that. But so you can run pass them if you need some ammo/armor.
Hopefully this was helpful.

A: Grab a couple friends, and camp inside the center building. When Juggernauts spawn, buy predator missiles from the nearby shop and take them out. You have to be kinda good at the game to do it right though.

A: Honestly I use two grenade turrets two light heave machine gun. Many c4s and mines also I hide in the house until the jugs come out to play. Then I flash the hell out of them and unload my heavys on them ! I made it to wave 34 but not past it.

A: One of the best strategies of more armored enemies is buying a couple of c4 ...hide in the center building then plant some c4 around the courtyard ...they usually bundle up in that area and once they do BANG took out 50% then predator missle the juggs

A: Hide in the kitchen and and have your turrets by the fire place. But watch for the turrets sometimes can hurt you if an enemy gets to close. But for jugs yes the predator missile does help but I have gotten to wave 30 no problem with out using that. Just flash the hell out of them and the enemy's but don't stay in the house when you got 3 or more jugs plus men and dogs run lol. Lay down c4 and flash em and blow them up! I been doing that since the first day I never have a problem getting past 30 but everyone has their own way. I favor the light heavy guns they help a lot with the grip and steady aim


text:
Q: Scala: Could not find main class when running fat jar I recently got into some issues after I added two dependencies in my little Scala project. I can no longer run my project. Error: Could not find or load main class a.b.c.DataExtractor. I already spent the entire day looking for similar problems as the same error appeared in quite a lot of posts either here on other platforms.
My fat jar is being created with sbt assembly.

Seq(
  "org.apache.httpcomponents" % "httpclient" % "4.5.12",
  "org.apache.httpcomponents" % "httpmime" % "4.5.12",
  "org.apache.olingo" % "olingo-odata2-api" % "2.0.11",
  "org.apache.olingo" % "olingo-odata2-core" % "2.0.11",
  "com.azure" % "azure-security-keyvault-secrets" % "4.1.0",
  "com.azure" % "azure-identity" % "1.0.5",
  "org.slf4j" % "slf4j-api" % "1.7.30"
  )

As soon as I add the com.azure dependencies, they come witha a lot more of them and I can no longer start up my project.
In my target/scala-2.11 folder I have the two needed jars:

*

*data-extractor-assembly-0.1.0-SNAPSHOT.jar

*scala-library-2.11.12.jar

In order to start the app, I run the following
java -cp data-extractor-assembly-0.1.0-SNAPSHOT.jar:scala-library-2.11.12.jar -Dorg.apache.commons.logging.Log=org.apache.commons.logging.impl.SimpleLog -Dorg.apache.commons.logging.simplelog.showdatetime=true -Dorg.apache.commons.logging.simplelog.log.org.apache.http=DEBUG -verbose a.b.c.DataExtractor
My guess is it's got something to do with the build of the assembly. I checked the produced artifact and the MANIFEST.MF file was displaying Main-Class: a.b.c.DataExtractor as expected, but still something is failing. I just can't put my finger of what is the source of the problem.
So, Scala 2.11.12, sbt 1.2.8 and Java 1.8.0_162, if that is relevant
Any information or hints would be greatly appreciated. Thanks.

A: I did manage to solve this in the end with some sbt assembly magic in the build.sbt file I am also including the scala library files so I only need to specify the fat-jar for the -cp parameter.
assemblyOption in assembly := (assemblyOption in assembly).value.copy(includeScala = true),
assemblyMergeStrategy in assembly := {
  case PathList("javax", "activation", xs @ _*)     => MergeStrategy.last
  case "about.html"                                 => MergeStrategy.rename
  case "plugin.properties"                          => MergeStrategy.last
  case "log4j.properties"                           => MergeStrategy.last
  case "module-info.class" => MergeStrategy.discard
  case PathList("META-INF", xs @ _*) =>
    xs match {
      case ("MANIFEST.MF" :: Nil) => MergeStrategy.discard
      // Concatenate everything in the services directory to keep GeoTools happy.
      case "mailcap" :: Nil => MergeStrategy.last
      case "mimetypes.default" :: Nil => MergeStrategy.last

      case ("services" :: _ :: Nil) =>
        MergeStrategy.concat
      // Concatenate these to keep JAI happy.
      case "javax.media.jai.registryFile.jai" :: Nil | "registryFile.jai" :: Nil |
           "registryFile.jaiext" :: Nil =>
        MergeStrategy.concat
      case name :: Nil => {
        // Must exclude META-INF/*.([RD]SA|SF) to avoid "Invalid signature file digest for Manifest main attributes" exception.
        if (name.endsWith(".RSA") || name.endsWith(".DSA") || name.endsWith(".SF"))
          MergeStrategy.discard
        else
          MergeStrategy.first
      }
      case _ => MergeStrategy.first
    }
  case x =>
    val oldStrategy = (assemblyMergeStrategy in assembly).value
    oldStrategy(x)
}


text:
Q: How to change the level (hierarchy) of a nested list in r I have a nested list (see image) and I'd like to change the position of elements that are in the second level to first level and the name of this elements also changes. For example, element [1][1] turns into [[1.1]], element [1][[2]] turns into [[1.2]], element [1][[3]] turns into [[1.3]] and so on. It needs to be happen in all elements.
It's a huge list where a put some regressions results and I want to compare them using compare_performance from Performance package.
Does anyone know how to do it in fast and easily way ?
I tried unlist but it becomes a mess. I tried flatten from rlist but I get the same result unlist.

A: I think this is a duplicate from here. You can use unlist(my_list, recursive = FALSE) to get a list of all regression model as first level entries.

A: You can make a loop to create the new names, pasting the index of the first level element, ".", and 1 to the number of second level elements. I used purrr to do that, but you can choose any looping method you like.
The purrr::imap function iteratively takes each element from my_list and it's name (when it doesn't have a name, it's index), and passes it to the .x and .y arguments of the function written in the second argument.
Then, we flatten the list with unlist(my_list, recursive = FALSE), as @FactOREO suggested, and give it the new names.
names = purrr::imap(my_list, ~ paste0(.y, ".", 1:length(.x))) |> unlist()
my_list_new = unlist(my_list, recursive = FALSE) |> setNames(names)

Result:
# Dummy data
my_list = list(
  list(
    list("item 1.1"),
    list("item 1.2"),
    list("item 1.3")),
  list(
    list("item 2.1"),
    list("item 2.2"),
    list("item 2.3")))

> my_list_new
$`1.1`
$`1.1`[[1]]
[1] "item 1.1"

$`1.2`
$`1.2`[[1]]
[1] "item 1.2"

$`1.3`
$`1.3`[[1]]
[1] "item 1.3"

$`2.1`
$`2.1`[[1]]
[1] "item 2.1"

$`2.2`
$`2.2`[[1]]
[1] "item 2.2"

$`2.3`
$`2.3`[[1]]
[1] "item 2.3"