text:
Q: Error: Module build failed (from ./node_modules/sass-loader/dist/cjs.js): SassError: Can't find stylesheet to import: @use '@angular/material' as mat; hey guys i have no clue why i cant use this stylesheet. i have read other threads about this issue but none of the solutions worked for me. i am a newb to angular and pulling my hair out. keep getting Error: Module build failed (from ./node_modules/sass-loader/dist/cjs.js): SassError: Can't find stylesheet to import: @use '@angular/material' as mat; no matter what i do. here is my .scss and angular.json files:
// Custom Theming for Angular Material
// For more information: https://material.angular.io/guide/theming
@use '@angular/material' as mat;
// Plus imports for other components in your app.

// Include the common styles for Angular Material. We include this here so that you only
// have to load a single css file for Angular Material in your app.
// Be sure that you only ever include this mixin once!
@include mat.core();

// Define the palettes for your theme using the Material Design palettes available in palette.scss
// (imported above). For each palette, you can optionally specify a default, lighter, and darker
// hue. Available color palettes: https://material.io/design/color/
$theme-primary: mat.define-palette(mat.$indigo-palette);
$theme-accent: mat.define-palette(mat.$pink-palette, A200, A100, A400);

// The warn palette is optional (defaults to red).
$theme-warn: mat.define-palette(mat.$red-palette);

// Create the theme object. A theme consists of configurations for individual
// theming systems such as "color" or "typography".
$theme: mat.define-light-theme((
  color: (
    primary: $theme-primary,
    accent: $theme-accent,
    warn: $theme-warn,
  ),
  typography: mat.define-typography-config(),
));

// Include theme styles for core and each component used in your app.
// Alternatively, you can import and @include the theme mixins for each component
// that you are using.
@include mat.all-component-themes($theme);

{
  "$schema": "./node_modules/@angular/cli/lib/config/schema.json",
  "version": 1,
  "newProjectRoot": "projects",
  "projects": {
    "movieSearch": {
      "projectType": "application",
      "schematics": {
        "@schematics/angular:component": {
          "style": "scss"
        },
        "@schematics/angular:application": {
          "strict": true
        }

      },
      "root": "",
      "sourceRoot": "src",
      "prefix": "app",
      "architect": {
        "build": {
          "builder": "@angular-devkit/build-angular:browser",
          "options": {
            "progress": false,
            "outputPath": "dist",
            "index": "src/index.html",
            "main": "src/main.ts",
            "polyfills": "src/polyfills.ts",
            "tsConfig": "tsconfig.app.json",
            "inlineStyleLanguage": "scss",
            "aot": true,
            "assets": [
              "src/assets"
            ],
            "styles": [
              "node_modules/bootstrap/dist/css/bootstrap.min.css",
              "src/styles.scss"

            ],
            "stylePreprocessorOptions": {
              "includePaths": [ "node_modules/" ]
            },
            "scripts": []
          },
          "configurations": {
            "production": {
              "optimization": true,
              "outputHashing": "all",
              "sourceMap": false,
              "extractCss": true,
              "namedChunks": false,
              "extractLicenses": true,
              "vendorChunk": false,
              "buildOptimizer": true,
              "budgets": [
                {
                  "type": "initial",
                  "maximumWarning": "500kb",
                  "maximumError": "1mb"
                },
                {
                  "type": "anyComponentStyle",
                  "maximumWarning": "2kb",
                  "maximumError": "4kb"
                }
              ],
              "fileReplacements": [
                {
                  "replace": "src/environments/environment.ts",
                  "with": "src/environments/environment.prod.ts"
                }
              ]

            },
            "development": {
              "buildOptimizer": false,
              "optimization": false,
              "vendorChunk": true,
              "extractLicenses": false,
              "sourceMap": true,
              "namedChunks": true
            }
          },
          "defaultConfiguration": "production"
        },
        "serve": {
          "builder": "@angular-devkit/build-angular:dev-server",
          "configurations": {
            "production": {
              "browserTarget": "movieSearch:build:production"
            },
            "development": {
              "browserTarget": "movieSearch:build:development",
              "proxyConfig": "proxy.conf.js"
            }
          },
          "defaultConfiguration": "development"
        },
        "extract-i18n": {
          "builder": "@angular-devkit/build-angular:extract-i18n",
          "options": {
            "browserTarget": "movieSearch:build"
          }
        },
        "test": {
          "builder": "@angular-devkit/build-angular:karma",
          "options": {
            "main": "src/test.ts",
            "polyfills": "src/polyfills.ts",
            "tsConfig": "tsconfig.spec.json",
            "karmaConfig": "karma.conf.js",
            "assets": [
              "src/assets"
            ],
            "styles": [
              "src/styles.scss"
            ],
            "scripts": []
          }
        },
        "server": {
          "builder": "@angular-devkit/build-angular:server",
          "options": {
            "outputPath": "dist-server",
            "main": "src/main.ts",
            "tsConfig": "tsconfig.server.json"
          },
          "configurations": {
            "dev": {
              "optimization": true,
              "outputHashing": "all",
              "sourceMap": false,
              "namedChunks": false,
              "extractLicenses": true,
              "vendorChunk": true
            },
            "production": {
              "optimization": true,
              "outputHashing": "all",
              "sourceMap": false,
              "namedChunks": false,
              "extractLicenses": true,
              "vendorChunk": false
            }
          }
        }
      }
    }
  },
  "defaultProject": "movieSearch",
  "cli": {
    "analytics": false
  }
}

package.json:
{
  "name": "moviesearch",
  "version": "0.0.0",
  "scripts": {
    "ng": "ng",
    "prestart": "node aspnetcore-https",
    "start": "run-script-os",
    "start:windows": "ng serve --port 44400 --ssl --ssl-cert %APPDATA%\\ASP.NET\\https\\%npm_package_name%.pem --ssl-key %APPDATA%\\ASP.NET\\https\\%npm_package_name%.key",
    "start:default": "ng serve --port 44400 --ssl --ssl-cert $HOME/.aspnet/https/${npm_package_name}.pem --ssl-key $HOME/.aspnet/https/${npm_package_name}.key",
    "build": "ng build",
    "build:ssr": "ng run movieSearch:server:dev",
    "watch": "ng build --watch --configuration development",
    "test": "ng test"
  },
  "private": true,
  "dependencies": {

    "@angular/platform-server": "^15.0.4",

    "bootstrap": "^5.1.3",
    "jquery": "^3.6.0",
    "oidc-client": "^1.11.5",
    "popper.js": "^1.16.0",
    "run-script-os": "^1.1.6",
    "@angular/animations": "~15.0.0",
    "@angular/cdk": "15.0.3",
    "@angular/common": "~15.0.0",
    "@angular/compiler": "~15.0.0",
    "@angular/core": "~15.0.0",
    "@angular/forms": "~15.0.0",
    "@angular/material": "15.0.3",
    "@angular/material-moment-adapter": "15.0.3",
    "@angular/platform-browser": "~15.0.0",
    "@angular/platform-browser-dynamic": "~15.0.0",
    "@angular/router": "~15.0.0",
    "moment": "^2.18.1",
    "rxjs": "~7.4.0",
    "tslib": "^2.3.0",
    "zone.js": "~0.11.5"
  },
  "devDependencies": {
    "@angular-devkit/build-angular": "^15.0.4",
    "@angular/cli": "^15.0.4",
    "@angular/compiler-cli": "^15.0.4",
    "@types/jasmine": "~4.0.3",
    "@types/jasminewd2": "~2.0.10",
    "@types/node": "^18.0.0",
    "jasmine-core": "~4.2.0",
    "karma": "~6.4.0",
    "karma-chrome-launcher": "~3.1.1",
    "karma-coverage": "~2.2.0",
    "karma-jasmine": "~5.1.0",
    "karma-jasmine-html-reporter": "^2.0.0",
    "typescript": "~4.8.4"
  },
  "overrides": {
    "autoprefixer": "10.4.5"
  }
}

have tried ng updates all day, using different options in angular.json etc. feel like I'm missing the tiniest thing but its hard to find.


text:
Q: Django repeating URLS New to Django. Setting up a wiki. When I need it proceed to the next page to add content it duplicates the URL, so we start here:
http://127.0.0.1:8000/mideastinfo/Start

and I have a lick saying "no content, would you like to create, and it is meant to go here:
http://127.0.0.1:8000/mideastinfo/Start/edit

instead it does this:
http://127.0.0.1:8000/mideastinfo/Start/mideastinfo/Start/edit

Which obviously doesn't exist.
Below is the urls.py
# url(r'^admin/', include(admin.site.urls)),
                   (r'^mideastinfo/(?P<page_name>[^/]+)/edit/$', 'mideastinfo.wiki.views.edit_page'),
                   (r'^mideastinfo/(?P<page_name>[^/]+)+/save/$', 'mideastinfo.wiki.views.save_page'),
                   (r'^mideastinfo/(?P<page_name>[^/]+)/$', 'mideastinfo.wiki.views.view_page')

what am I doing wrong? Thanks for the help in advance, I'm a noob.
Here is the views.py:
# Create your views here.
from wiki.models import Page
from django.shortcuts import render_to_response
from django.http import HttpResponseRedirect

def view_page(request, page_name):
try:
    page = Page.objects.get(pk=page_name)
except Page.DoesNotExist:
    return render_to_response("create.html", {"page_name":page_name}
)
content = page.content
return render_to_response("view.html", {"page_name":page_name, "content":content})

def edit_page(request, page_name):
try:
    page = Page.objects.get(pk=page_name)
    content = page.content
except Page.DoesNotExist:
    content = ""
return render_to_response("edit.html", {"page_name":page_name, "content":content}
)

def save_page(request, page_name):
content = request.POST["content"]
try:
    page = Page.objects.get(pk=page_name)
    page.content = content
except Page.DoesNotExist:
    page = Page(name=pahe_name, conent=content)
page.save()
return HttpResponseRedirect("/mideastinfo/" + page_name + "/")

This is the template for the create page:

    <title>{{page_name}} = Create</title>

{{page_name}}

    This page does not exist. Create?

and for the edit page:

    <title>{{page_name}} - Editing</title>

Editing {{page_name}}

    <form method="post" action="/{{page_name}}/save/">
        <textarea name="content" rows="20" cols="60">{{content}}</textarea>

        <input type="submit" value="Save Page"/>
    </form>

A: use {url 'name' param %} instead of hard code url in templates, and use reverse('name') to get corresponding url in views.py and other scripts:
urls.py
(r'^mideastinfo/(?P<page_name>[^/]+)/edit/$', 'mideastinfo.wiki.views.edit_page',name='edit'),
(r'^mideastinfo/(?P<page_name>[^/]+)+/save/$', 'mideastinfo.wiki.views.save_page',name = 'save'),
(r'^mideastinfo/(?P<page_name>[^/]+)/$', 'mideastinfo.wiki.views.view_page',name = 'view')

used in templates
{% url 'edit' 'page_name' %}

used in views.py or other scripts such as models.py
reverse('view', args=('value',))

In this way, you could fix your mistake, and some day if you want to modify your urls, just modify urls.py, that is all.
UPDATED 2014 05 31
in a high lever you can defined a get_absolute_url() in class(es) of your models.py.
https://docs.djangoproject.com/en/dev/ref/models/instances/#get-absolute-url
Then you can redirect more easily.
views.py and so on
from django.shortcuts import redirect
def view2(request):
    obj = Model2.objects.get(id=33)
    return redirect(obj,permanent=True)

in templates use {{ obj.get_absolute_url }}
more see: https://docs.djangoproject.com/en/dev/topics/http/urls/#reverse-resolution-of-urls
about redirect: https://docs.djangoproject.com/en/dev/topics/http/shortcuts/#redirect

redpajama_set_name: RedPajamaStackExchange


text:
Q: How do you reset saved multiplayer progress in Portal 2? Multiplayer progress in Portal 2 is saved to Steam Cloud:
Is progress in the coop campaign in Portal 2 saved?
How do you reset your progress to zero and experience the game from scratch with someone who has not played it yet?

A: I know this is an old question, but I was just skimming through and had a bit of an addendum to the best answer here (the one involving the mp_mark_all_maps_complete command and all that).  At first I submitted it as an edit to that answer, but I think it's enough to warrant it's own post here.
So here it is.
Step-by-step how to reset your own progress (without affecting anybody else).

*

*Launch Portal 2.

*Select "Play Cooperative Mode"

*Select "Standard Coop"

*From here, open the Console (default ~, otherwise check the related questions for more info.

*CONSOLE COMMAND: ss_map lobby_2

*CONSOLE COMMAND: mp_mark_all_courses_incomplete

*Leave the map, and go play with your friends, as if you started from scratch.
This is especially useful for people looking to experience the transitions and extra few GLaDOS lines.

A: Contrary to all the answers on here, it is in fact possible to reset your progress in co-op. Make sure you are the host (you invited your friend, rather than you were invited by your friend). Start a co-op game. Make sure you are in the hub when doing this.
Warning: This applies to both players. Make sure the other player is fine with you doing this.
Unfortunately, this doesn't work with ss_map. You have to be in a session with another player, and this will set both players' progress.
Enable the developer console in the options, then press ~ to open it. If you are having trouble, see this question. Then, enter the following command in the console:
mp_mark_all_maps_incomplete

You might see a weird message about DLC, but the command will have no other visible effect. Now, enter this command:
changelevel mp_coop_lobby_2

This will reload the lobby, and your progress will be reset at zero.
You can use this command to change your progress manually:
mp_mark_course_complete <course>

Whereas the number is the number of the course you want to unlock (have finished), minus 1. So to unlock course 1, use mp_mark_course_complete 0, to unlock 2, mp_mark_course_complete 1, and so on. This means that mp_mark_course_complete 0 unlocks course 1 fully, and will then open 2.
There is also mp_mark_all_maps_complete if you want to get Professor Portal.
Thanks to fail badp♦ for allowing me to waste his time.

A: I am wondering precisely why you would care to fully reset things. I don't think you can, but it shouldn't hurt the experience at all if you don't reset it.
I will assume that you really just want to play through the intro puzzles with your friend. If so, here are a few things to note:

*

*When at the level selection Hub, you can bring up the Menu and go back to the Calibration area. This is the first area you start at when a new person starts playing, and has some simple puzzles that get you in the swing of cooperation.

*When at the level selection Hub, you can look at the door above each puzzle set. You will see little Orange/Blue rectangles. These indicate how far each player has progressed through the section. If you find a door with more of one color than another, you've found a puzzle set that you (or your friend) hasn't completed.

*As you enter a puzzle area in the Hub, you will see a small monitor on your left that indicates, once again, how far each player has progressed. There are small buttons under this monitor to select which level you would like to play.

A: As the game is saved to the Steam Cloud and no option is provided to reset this, this is impossible.
The only difference would be the animations in The Hub for loading new zones, in order for the player to see them they have to play with someone that hasn't completed them. Apart from that, you can just run to the game and selecting the first chamber in each zone...
You can, however, try to contact the Steam Support and ask them to reset it for you.

A: The whole point why I wanted this is to let my second Cooperative Testing Partner in Science™ (who got me Professor Portal, by the way) experience the 5 unlocking sequences; I missed the first three myself. Listening to GLaDOS is a large part of the Portal 2 experience.
Apparently, however, we can't just do that, so here goes Youtube scavenging. :(
Surprise surprise, finding decent videos of those sequences is challenging. Let's plays drown out GLADoS ruining the whole point of this exercise, while walkthroughs have probably have everything unlocked already (when they don't skip the lobby entirely), so finding good Youtube videos of this is challenging. So I'm marking CW to let you help me find those videos.

*

*

*

*?

*?

*

A: It's really a non-issue in my opinion since there is so little storyline in the coop mode. But if you want to hear all of GLaDOS' comments (in coop mode), you can watch these videos:

Oh and BTW, if you finished coop and you play with a friend who haven't played yet, you'll get the "Professor Portal" achievement. Only 2.3% of all players have unlocked this achievement.


text:
Q: React Hook Form Controller, onChange not firing I am trying to wrap my component with controller to return some numeric values but in some component onChange for controller is not firing. Not sure, why
Please find the code attached. Thanks in advance
const Percentage: FC<PercentageProps & Partial<HTMLInputElement>> = ({ withForm, ...otherProps}) => {
  if(withForm){
    return (
      <FormControl {...otherProps}>
        <Controller
          render={({field: { value, onChange, name }}) => {
            return (
              <PercentageWrapper
                name={name}
                value={value}
                withForm={withForm}
                onChange={(e) => {
                  console.log('inside percentage controller >>>>>>>', e)
                  onChange && onChange(Math.ceil(e.target.value))
                }}
              />
            )
          }}
        >
        </Controller>
      </FormControl>
    )
  }
  return <PercentageWrapper {...otherProps}/>
}

This is percentageWrapper to handle the form condition
PercentageWrapper
const PercentageWrapper: FC<PercentageProps & Partial<HTMLInputElement>> = (
  props: PercentageProps
) => {
  // Framework generated code, below line registers the component
  // NOT TO BE DELETED
  setMetaData('Percentage', metadata);

  // Framework generated code, below line provides the contextProvider instance

  const {
    id,
    onChange,
    showPercentSymbol,
    allowDecimalPlaces,
    withForm,
    value,
    ...rest
  } = props;
  return (
    <div data-component="atomic/percentage">
      <Input
        placeholder={'Percent'}
        value={value}
        inputSuffix={
          showPercentSymbol
            ? () => (
                <Text
                  type={TextTypes.Body}
                  size={TextSizes.Medium}
                  marginTop={'2px'}
                >
                  {'%'}
                </Text>
              )
            : undefined
        }
        {...rest}
      />
    </div>
  );
};

A: You are not passing onChange to the input.
const {
    id,
    onChange, // <-- you destructure it here
    showPercentSymbol,
    allowDecimalPlaces,
    withForm,
    value,
    ...rest // <-- so it's not part of the `rest`
  } = props;


text:
Q: IBM Bluemix account with Outlook.com Email Address IBM or their billing company won't allow any bluemix.com accounts with an @outlook.com email address. My question, does anyone else have this problem? Does anyone have a bluemix.com IBM cloud account with an outlook.com email address?
Hello,

As we do not support the Outlook Domain, would you mind creating another email to use?

Thank you

XXX XXXXXXXX
Representative, Revenue Services
IBM Cloud infrastructure

A: I verified with management that the information in the email is correct. You cannot create an IBM Cloud platform account using an @outlook.com address due to historical issues with that domain. As recommended, please use an email address with a different domain.


text:
Q: Why is this angularjs on jsFiddle not working http://jsfiddle.net/maxl/tNZAm/102/
I would expect to have the repeater listing this array :

function MyControl(){
      var self = this;
self.values = ["a","b","c","d","e","f"];
self.selectedIndex = -1;

self.toggleSelect = function(ind){
    if( ind === self.selectedIndex ){
        self.selectedIndex = -1;
    } else{
        self.selectedIndex = ind;
    }
}

self.getClass = function(ind){
    if( ind === self.selectedIndex ){
        return "selected";
    } else{
        return "";
    }
}

self.getButtonLabel = function(ind){
    if( ind === self.selectedIndex ){
        return "Deselect";
    } else{
        return "Select";
    }
} }

A: You should be using the $scope injectable to attach data to the DOM. Additionally, you were loading Angular.js twice (once via the "Choose Framework" dropdown and once via the "Add Resources" panel), resulting in a very, very strange bug.
Here's a working jsFiddle: http://jsfiddle.net/BinaryMuse/tNZAm/103/
function MyControl($scope){
    $scope.values = ["a","b","c","d","e","f"];
    $scope.selectedIndex = -1;

    $scope.toggleSelect = function(ind){
        if( ind === $scope.selectedIndex ){
            $scope.selectedIndex = -1;
        } else{
            $scope.selectedIndex = ind;
        }
    }

    $scope.getClass = function(ind){
        if( ind === $scope.selectedIndex ){
            return "selected";
        } else{
            return "";
        }
    }

    $scope.getButtonLabel = function(ind){
        if( ind === $scope.selectedIndex ){
            return "Deselect";
        } else{
            return "Select";
        }
    }
}


text:
Q: How to get Text from H1 Tag which has no arguments in Web Driver?
  ...

Phonetic Translator

    <link rel="stylesheet" href="/style.css" type="text/css">
    <title>electRa Phonetic Translator</title>

Today's password is:

      MQQJXJLCQZ

The phonetic translation is:

      ...

    ...

Hi,
I want to get the text MQQJXJLCQZ. As there are two H1 tags after Body. I have used XPath to get the text value but unfortunately I am getting the error message Type mismatch: cannot convert from String to WebElement
The code I have written is :
    String PasswordxPath = "/html/body/h1[2]/text()";
    WebElement H1Element = driver.findElement(By.xpath(PasswordxPath));
    WebElement getPassword = H1Element.getText();

Please, can someone correct this code or suggest another way to get the text Value ?
Thanks,
UPDATE1
I have used string to get the text value, but now i am unable to put this value in the form using sendKeys. Error log as below:

Element info: {Using=xpath, value=/html/body/h1[2]/text()} at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)

A: I had a similar problem where getText() wasn't working.
 Try using getAttribute("innerHTML")

A: Replace WebElement by String in the last line :
String PasswordxPath = "/html/body/h1[2]/text()";
WebElement H1Element = driver.findElement(By.xpath(PasswordxPath));
String getPassword = H1Element.getText();

A: As said, here is the problem
  WebElement getPassword = H1Element.getText();

getText() returns the String value but not WebElement. So you need to use String here, like
   String getPassword = H1Element.getText();


text:
Q: Joining multiple columns in one table to a single column in another table I am looking to create a view that pulls data from two tables "Schedule" and "Reference".
Schedule has 50+ columns (it's almost completely denormalized -- not my design), most of which contain a value that could be joined to a column in the Reference table.
How do I write the SQL statement to correctly join each column in Schedules to the single column in Reference?
The Schedule table is defined as:
    CREATE TABLE [dbo].[Schedule](
    [ID] [int] NOT NULL,
    [SCHEDULEWEEK] [datetime] NOT NULL,
    [EMPNO] [numeric](10, 0) NOT NULL,
    [EMPLNAME] [varchar](32) NULL,
    [EMPFNAME] [varchar](32) NULL,
    [EMPSENDATE] [datetime] NULL,
    [EMPHIREDATE] [datetime] NULL,
    [EMPTYPE] [char](1) NULL,
    [EMPSTATUS] [char](1) NULL,
    [SNREFUSALS] [tinyint] NULL,
    [QUALSTRING] [varchar](128) NULL,
    [JOBOVERSHIFTTYPE] [bit] NULL,
    [SHORTNOTICE] [bit] NULL,
    [SHORTNOTICEWAP] [bit] NULL,
    [SHORTNOTICEPHONE] [varchar](32) NULL,
    [LEADHAND] [bit] NULL,
    [DUALCURRENCY] [bit] NULL,
    [MIN100WINDOW] [bit] NULL,
    [STATHOLIDAY] [bit] NULL,
    [AREAOVERHOURS] [bit] NULL,
    [DOUBLEINTERZONES] [bit] NULL,
    [MAXDAYSPERWEEK] [tinyint] NULL,
    [MAXHOURSPERWEEK] [numeric](10, 2) NULL,
    [MAXHOURSPERSHIFT] [numeric](10, 2) NULL,
    [MAXDOUBLESPERWEEK] [tinyint] NULL,
    [ASSIGNEDDAYS] [tinyint] NULL,
    [ASSIGNEDHOURS] [numeric](10, 2) NULL,
    [ASSIGNEDDOUBLES] [tinyint] NULL,
    [ASSIGNEDLOAHOURS] [numeric](10, 2) NULL,
    [SHIFTNO1] [int] NULL,
    [TEXT1_1] [varchar](64) NULL,
    [TEXT2_1] [varchar](64) NULL,
    [DAYFLAG1] [bit] NULL,
    [COMMENT1] [text] NULL,
    [SHIFTNO2] [int] NULL,
    [TEXT1_2] [varchar](64) NULL,
    [TEXT2_2] [varchar](64) NULL,
    [DAYFLAG2] [bit] NULL,
    [COMMENT2] [text] NULL,
    [SHIFTNO3] [int] NULL,
    [TEXT1_3] [varchar](64) NULL,
    [TEXT2_3] [varchar](64) NULL,
    [DAYFLAG3] [bit] NULL,
    [COMMENT3] [text] NULL,
    [SHIFTNO4] [int] NULL,
    [TEXT1_4] [varchar](64) NULL,
    [TEXT2_4] [varchar](64) NULL,
    [DAYFLAG4] [bit] NULL,
    [COMMENT4] [text] NULL,
    [SHIFTNO5] [int] NULL,
    [TEXT1_5] [varchar](64) NULL,
    [TEXT2_5] [varchar](64) NULL,
    [DAYFLAG5] [bit] NULL,
    [COMMENT5] [text] NULL,
    [SHIFTNO6] [int] NULL,
    [TEXT1_6] [varchar](64) NULL,
    [TEXT2_6] [varchar](64) NULL,
    [DAYFLAG6] [bit] NULL,
    [COMMENT6] [text] NULL
-- Snip
) ON [PRIMARY]

And the Reference table is defined as:
CREATE TABLE [dbo].[Reference](
    [ID] [int] NOT NULL,
    [CODE] [varchar](21) NOT NULL,
    [LOCATIONCODE] [varchar](4) NOT NULL,
    [SCHAREACODE] [varchar](16) NOT NULL,
    [LOCATIONNAME] [varchar](32) NOT NULL,
    [FLTAREACODE] [varchar](16) NOT NULL
) ON [PRIMARY]

I am trying to join each [TEXT1_]/[TEXT2_] column in Schedule to the [SCHAREACODE] column in reference.  All the reference table contains is a list of areas where the employee could work.

A: I think he means to join on the Reference table multiple times:
SELECT *
  FROM Schedule AS S
 INNER JOIN Reference AS R1
         ON R1.ID = S.FirstID
 INNER JOIN Reference AS R2
         ON R2.ID = S.SecondID
 INNER JOIN Reference AS R3
         ON R3.ID = S.ThirdID
 INNER JOIN Reference AS R4
         ON R4.ID = S.ForthID

A: Your description is a bit lacking, so I'm going to assume that

Schedule has 50+ columns (it's almost completely denormalized -- not my design), most of which contain a value that could be joined to a column in the Reference table.

means that 1 of the 50+ columns in Schedule is a ReferenceId. So, given a table design like:
Schedule ( MaybeReferenceId1, MaybeReferenceId2, MaybeReferenceId3, ... )
Reference ( ReferenceId )

Something like:
SELECT *
FROM Schedule
JOIN Reference ON
     Schedule.MaybeReferenceId1 = Reference.ReferenceId
     OR Schedule.MaybeReferenceId2 = Reference.ReferenceId
     OR Schedule.MaybeReferenceId3 = Reference.ReferenceId
     OR Schedule.MaybeReferenceId4 = Reference.ReferenceId
     ...

would work. You could simplify it by using IN if your RDBMS supports it:
SELECT *
FROM Schedule
JOIN Reference ON
     Reference.ReferenceId IN (
        Schedule.MaybeReferenceId1,
        Schedule.MaybeReferenceId2,
        Schedule.MaybeReferenceId3,
        Schedule.MaybeReferenceId4,
        ...
     )

A: From updated question
Perhaps something like this?  It will be messy no matter what you do.
SELECT S.ID
  S.TEXT1_1,
  TEXT1_1_RID = COALESCE((SELECT MAX(R.ID) FROM Reference R WHERE R.SCHAREACODE = S.TEXT1_1), 0),
  S.TEXT1_2,
  TEXT1_2_RID = COALESCE((SELECT MAX(R.ID) FROM Reference R WHERE R.SCHAREACODE = S.TEXT1_2), 0),
  ...
FROM Schedule S

A: Agree with TheSoftwareJedi, but can I just suggest using LEFT JOINs so that failures-to-match don't cause your Schedule row to disappear?
Of course, doing 28 JOINs is going to be a bit cumbersome whatever the details.
I'm not sure I'd call this "denormalized", more "abnormalized" ... :-)

A: Try a query like this:
select s.*, r.schareacode from schedule s,
where
s.text1_1 = s.schareacode
or s.text2_1 = s.schareacode
or s.textx_x = s.schareacode
..

You should be able to get the same results with traditional joins so I recommend you experiment with that as well.


text:
Q: Multiple choice question on continuous function on a unit ball Pick out true:
Let $B$ be the closed unit ball and $D$ be the open unit ball.
a.Given a continuous function $g:B\rightarrow \mathbb R$ there always exists a continuous function $f:\mathbb R^2\rightarrow \mathbb R$ such  that $f=g$ on  $B$.
b.
Given a continuous function $g:D\rightarrow \mathbb R$ there always exists a continuous function $f:\mathbb R^2\rightarrow \mathbb R$ such  that $f=g$ on  $D$.
c.there always exists a continuous function $f:\mathbb R^2\rightarrow \mathbb R$ such  that $f\equiv 1$ on the set $\{(x,y)\in \mathbb R^{2}:x^2+y^2=3/2\}$ and $f\equiv 0$ on the set $B \cup \{(x,y)\in \mathbb R^{2}:x^2+y^2 \geq 2\}$
I dont know where to start.I feel that I have not learnt any theorem which can give me any conclusion on this.I have finished learning metric spaces.

A: a) Find a function $h\colon \mathbb R^2\to B$ that is the identity on $B$ (Hint: scale any point at distance $>1$ down to distance $1$ fro the origin). Then let $f=g\circ h$.
b) Consider $g(x,y)=\frac1{1-x}$
c) Hint: Try to find a continuous function $h\colon[0,\infty)\to \mathbb R$ such that $h(r)=0$ for $0\le r\le 1$ as well as  for $r\ge 2$, whereas $h(\frac32)=1$.


text:
Q: Wordpress: Combination of Page id and Category id I am working on an old wordpress site (3.6), I have imported all the posts succesfully, I'm trying to replicate some page which have urls which are combination of page id and category id, example:
http://localhost/?page_id=17&cat_id=3
I know there are ids for pages and categories but I'm not quite sure what their combination means and how to replicate it, I've tried to use the same url for the new site but it does not work. I've tried googling for a solution but couldn't find any.

A: It means display all posts on page with id 17 from category 3. The reason you are not able to find anything with the old URL on the new site is because the URL structure might be different from the old site.


text:
Q: Middleware when running Artisan console request I want a custom piece of middleware to run whenever I run an artisan command. I need to set a few environment variables to be used in the app configuration before the actual command executes but Im not able to find any documentation on the Artisan request lifecycle.
Is this possible to do?

A: I found a way, not sure if the correct one, but works. Just open up the Kernel class and override the bootstrap method. Laravel 5.3, have not tested on other versions, but should work similiary.
class Kernel extends ConsoleKernel
{
    protected $commands = [
        // Your commands here
    ];

    public function bootstrap()
    {
        // Don't forget to call parent bootstrap
        parent::bootstrap();

        // Do your own bootstrapping stuff here
    }

    protected function schedule(Schedule $schedule)
    {
        // Add cron schedules here, if needed
    }
}


text:
Q: AltoRouter send Mime Type I'm using AltoRouter to route my urls to the correct files. Now basically here, I describe my problem already.
On one page, I have an alert included, styled by bootstrap.
It's defined as simple as that:
$('#wrongPasswordDiv').html('

Falsches Passwort. Bitte erneut versuchen!
');

Also, before, Bootstrap css file is included:
<link rel="stylesheet" type="text/css" href="/bootstrapcss" />

bootstrapcss is routed to the correct css file using AltoRouter and this line of code:
$router->map('GET','/bootstrapcss','vendor/twbs/bootstrap/dist/css/bootstrap.css','bootstrapcss');

Now, in console, it throws a warning saying Resource interpreted as Stylesheet but transferred with MIME type text/html: "http://localhost/bootstrapcss".
If I use the complete path to the css file, a CDN  or remove the DOCTYPE, its working fine. But I don't wanna do either of those variations... Removing the doctype, might damage other functions and if I would use the complete css path, then I wouldn't need the routing...
Any ideas how I could send the Content-type: text/css header, in order to get it working?

A: You should send the proper Content-Type before you send the response content. I don't know much PHP so I may not read the CSS in the best way, but this is a working example:
Using this route:
$router->map('GET','/bootstrapcss','example.css','bootstrapcss');

And then while matching:
$match = $router->match();

if($match['name'] === 'bootstrapcss'){
    header("Content-Type: text/css");
    $fileName = $match['target'];
    echo file_get_contents($fileName);
    return;
}

For context, I have a full example here: https://gist.github.com/kobi/09eaeeecb3406b193a84a674218798a9
This is based on the basic example on AltoRouter: https://github.com/dannyvankooten/AltoRouter/tree/master/examples/basic


text:
Q: Where do I locate Java Servlet container I have installed JRE and now I'm trying to install Solr by following the Solr Reference Guide.
The guide dictates:

*

*Stop your Java servlet container.

*Copy the solr.war file from the Solr distribution to the webapps directory of your servlet container...

*Start your servlet container, passing to it the location of your Solr Home in one of these ways:

*
*Set the Java system property solr.solr.home to your Solr
  Home. (for example, using the example jetty setup: java
  -Dsolr.solr.home=/some/dir -jar start.jar).
*Configure the servlet container so that a JNDI lookup of java:comp/env/solr/home by
  the Solr webapp will point to your Solr Home.
*Start the
  servlet container in the directory containing ./solr: the default Solr
  Home is solr under the JVM's current working directory
  ($CWD/solr).

Questions:

*

*Where do I find this Java Servlet container?

*Where/how do I execute those commands to start/stop/configure the Java Servlet container?

*How do I set Java system properties?

A: Mine was quite straight forward. After downloading the file, I extracted it to a folder on  my Server. I used the Command Line to complete the installation.
With the Command line, navigate to the example folder inside the solr-X.XX.X folder you extracted the file to, once there run the java command:
cd C:/<folder>/app/solr-X.XX.X/example
    java -jar start.jar

It would perform the installation for you, like magic.
You can access SOLR by visiting localhost:8983/solr
I'm using a Windows Server though, it may be different on yours, but I guess the logic is the same.

A: You should to install Apache Tomcat. All information about these servers you can find here.
You also could to install Jetty, JBoss, vSphere, tc vFabric Server ... but I think that you'll setup tomcat and solr easier (it is mine personal opinion, if you are familiar with any one, use them of course).
Tomcat setup is described here.


text:
Q: TeamCity HTTP Request in the context of Kotlin DSL Is it possible to do an HTTP GET request inside the settings.kts file used to implement your TeamCity configuration with Kotlin?
If it is possible, how can it be achieved?
If it is not, what are the reasons?
Thanks

A: you can create the projects using TeamCity REST API
Create a new build configuration with all settings:
POST http://teamcity:8111/app/rest/buildTypes. The XML/JSON posted is the same as retrieved by GET request. (Note that /app/rest/project/XXX/buildTypes still uses the previous version notation and accepts another entity.)
Create a new empty build configuration:
POST plain text (name) to http://teamcity:8111/app/rest/projects/<projectLocator>/buildTypes

also, you able to create the projects using Kotlin DSL, but should use UI for acheave it.
package _Self.buildTypes

import jetbrains.buildServer.configs.kotlin.v2018_2.*
import jetbrains.buildServer.configs.kotlin.v2018_2.buildSteps.script

object Example : BuildType({
    name = "example"
steps {
    script {
        scriptContent = "ls -al"
    }
}
})


text:
Q: Listener to change url before loading it on Mozilla SDK I'm trying to get something similar to a typo correction for the location bar on mozilla sdk. The user inputs a url on the locationbar and it gets changed before it is loaded. I've tried:
sdk/pagemod as seen here. The problem is it runs when the page starts rendering, not before it starts downloading it.
sdk/tabs => It doesn't have a event that gets called before it starts loading a website.
Above is what I've found that would catch websites the user is trying to enter into. I have also found sdk/system/events, but the only event I found I could use is http-on-modify-request, this does catch every http request. The problem is, you can't modify the url of that request.
To solve this I've seen 2 options:
This addon's way => Get the current tab and load there the new url. The problem is clear, the request may not be from a url the user is trying to load, but from a url inside a page's html. I tried comparing the request url to tabs.activeTab.url, but it gets set after the http-on-modify-request event is sent.
or the solution explained here that I am not sure could work (it is not for mozilla sdk).
So basically my problem right now could be solved with:
-a way to capture the url from the location bar before it starts loading & changing it (I haven't seen anything for this on the sdk) or
-a way to know when a request corresponds to a website the user is trying to load in the location bar or
-a way to modify the request (url)

A: I do that in my add-on Google Redirects Fixer which source code you can see here.
Basically, what you're looking for is listening to the http-on-modify-request event. If you follow that code you'll see how to intercept the request and, under certain conditions, abort it and replace it with a new request.
Hope it helps.

A:
"sdk/pagemod as seen here. The problem is it runs when the page starts rendering, not before it starts downloading it."

You can tell it to attach before any content is loaded with contentScriptWhen: start.

Load content scripts immediately after the document element is inserted into the DOM, but before the DOM content itself has been loaded


text:
Q: How do I pass a ROS package to another person? I have made a ROS workspace and inside a package.
I did catkin_make and everything is working well.
I would like to give this package (or should I give the entire workspace?) to another person.
I am thinking to give him a zip file of the files and folders (it contains launch files, python scripts, rviz files etc) so I am expecting he will unzip it in his machine
I would like he can run the launch files without problems
What is what he needs to do for this? (of course he will have ROS installed, that is no problem)
I am thinking perhaps he should do source devel/setup.bash but is this enough?

A: When sharing a workspace with somebody only the source space src has to be shared. It should contain all our packages with their launch files (*.launch), Python (*.py) and C++ nodes (*.cpp,  *.hpp), YAML configuration files (*.yaml), RViz configurations (*.rviz), robot descriptions (*.urdf, *.xacro) and describe how each node should be compiled in a CMakeLists.txt. Additionally you are supposed to keep track of all the Debian packages you install inside the package.xml file of each package.
If for some obscure reason there are things that I have to do that can't be accommodated in the standard installation instructions given above, I will actually write a bash script that performs these steps for me and add it either to the package itself or the workspace. This way I can automate also more complex steps such as installing OpenCV or modifying the .bashrc. Here a small example of what such a minimal script (I generally name them install_dependencies.sh) might look like:
#!/bin/bash

# Get current workspace
WS_DIR="$(dirname "$(dirname "$(readlink -fm "$0")")")"

# Check if script is run as root '$ sudo ...'
if ["$EUID" -ne 0]
  then
    echo "Error: This script has to be run as root '$ sudo ./install_dependencies.sh'
    exit 1
fi

echo "Installing dependencies..."

# Modify .bashrc
echo "- Modifying '~/.bashrc'..."
echo "source ${WS_DIR}/devel/setup.bash" >> ~/.bashrc

echo ""
echo "Dependencies installed."

If for some reason even that is not possible I make always sure to document it properly either in a Markdown *.md read-me either in a /doc folder inside your package, in the read-me.md inside the base folder of your repository or inside the root folder of your workspace.
The receiver then only has to

*

*Create a new workspace

*Copy or clone the package files to its src folder

*Install all the Debian package dependencies listed in the package.xml files with $ rosdep install

*(If any: Execute the bash scripts I created by hand $ sudo ./install_dependencies.sh or perform the steps given in the documentation)

*Build the workspace with $ catkin_make or $ catkin build from catkin-tools

*Source the current environment variables with $ source devel/setup.bash

*Make sure that the Python nodes are executable either by $ chmod +x <filename> or right-clicking the corresponding Python nodes (located in src or scripts of your package), selecting Properties/Permissions and enabling Allow executing file as program.

*Run the desired Python or C++ nodes ($ rosrun <package_name> <executable_name>) and launch files ($ roslaunch <package_name> <launch_file_name>)

It is up to you to share the code as a compressed file, in form of a Git repository or a more advanced way (see below) but I will introduce some best practices in the following paragraphs that will pay off in the long run with larger packages.

*Sharing a package or sharing a workspace?
One can either share a single package or an entire workspace. I personally think that most of the time one should share the entire workspace instead of the package alone even if you only cloned the other packages from a public Github repo. This might save the receiver a lot of headache e.g. when checking out the wrong branch.

*

*Version control with Git
Arguably the best way to arrange your packages is by using Git. I'd actually make a repository for every package you create (if a couple of packages are virtually inseparable you can also bundled them to a single Git repo or better use metapackages). Then create an additional repository for your workspace and include your own packages and packages from other sources as submodules. This allows your code to be modular and re-usable: You can share only a package or the entire workspace!
As a first step I always add a .gitignore file to each package repository which excludes *.pyc files and another one to the workspace repository that ignores the build, devel and install folders.
You can add a particular repository as submodule to your workspace Git repository by opening a console inside the src folder of your workspace repository and typing
$ git submodule add -b <branch_name> <git_url_to_package> <optional_directory_rename>

Note that you can actually track a particular branch of a repository that you include as a submodule. In case you need a submodule at some point follow this guide.
If you share the workspace repository with someone they will have to have access to each individual submodule repository and they will have to not only pull the repository but also update the submodules with
$ git clone --recurse-submodules <git_url_to_workspace_repository>

and potentially update them to the latest commit with
$ git submodule update --remote

After these two steps they should have a full version of the repository with submodules and they should be able to progress with the steps listed in the section above.
1.1 Unit-testing and continuous integration
Before sharing a repository you will have to verify that everything is working correctly. This can take a decent amount of time, in particular if the code base is large and you are modifying it frequently. In the ideal case you would have to install it on a brand new machine or inside a virtual box in order to make sure that the set-up works which would take quite some time. This is where unit testing comes into play: For every class and function you program you will write a test. This way you can simply run these tests and make sure everything is working correctly. Generally these unit tests will be performed automatically and the working branches merged continuously. Generally the test routines are written with the libraries Boost::Test (C++), GoogleTest (generally used in ROS with C++), unittest (for Python) and QtTest (for GUIs). For ROS launch files there is additionally rostest. How this can be done in ROS is described here and here.

*ROSjects
If you do not even want the person you are sending the code to to go through the hassle to set it up you might consider sending them a ROSject. A ROSject is an online virtual ROS environment (by the guys behind The Construct, the main source of ROS courses and of ROS tutorials on Youtube) that can be created and shared very easily from your existing Git repository as can be seen here. The simulation runs entirely in the cloud on a virtual machine. This way the potential of failure is very low but it is not a choice if your code is supposed to run on hardware and not only in simulation.

*Docker
If your installation procedure is complex you might as well use a container such as a Docker.
More information about using Docker in combination with ROS can be found here. The Docker container might introduce though a bit of overhead and it is probably no choice for code which should have real-time priority in combination with a real-time patched operating system.

*Debian or snap package
Another way of sending somebody a ROS package is by packing it into a Debian or snap package. This process takes a while and is in particular favourable if you want to give your code to a large number of users that should use the code out of the box. Instructions on how this can be done for Debian packages can be found here  and here, while a guide for snap can be found here.


text:
Q: Image transcoding (JPEG to PNG) with Java In my Java application I would like to download a JPEG, transfer it to a PNG and do something with the resulting bytes.
I am almost certain I remember a library to do this exists, I cannot remember its name.

A: This is what I ended up doing, I was thinking toooo far outside of the box when I asked the question..
// these are the imports needed
import java.awt.image.BufferedImage;
import java.io.File;
import javax.imageio.ImageIO;
import java.io.ByteArrayOutputStream;

// read a jpeg from a inputFile
BufferedImage bufferedImage = ImageIO.read(new File(inputFile));

// write the bufferedImage back to outputFile
ImageIO.write(bufferedImage, "png", new File(outputFile));

// this writes the bufferedImage into a byte array called resultingBytes
ByteArrayOutputStream byteArrayOut = new ByteArrayOutputStream();
ImageIO.write(bufferedImage, "png", byteArrayOut);
byte[] resultingBytes = byteArrayOut.toByteArray();

A: javax.imageio should be enough.
Put your JPEG to BufferedImage, then save it with:
File file = new File("newimage.png");
ImageIO.write(myJpegImage, "png", file);

A: ImageIO can be used to load JPEG files and save PNG files (also into a ByteArrayOutputStream if you don't want to write to a file).

A: BufferedImage bufferGambar;
try {

    bufferGambar = ImageIO.read(new File("ImagePNG.png"));
    // pkai type INT karna bertipe integer RGB bufferimage
    BufferedImage newBufferGambar = new BufferedImage(bufferGambar.getWidth(), bufferGambar.getHeight(), BufferedImage.TYPE_INT_RGB);

    newBufferGambar.createGraphics().drawImage(bufferGambar, 0, 0, Color.white, null);
    ImageIO.write(newBufferGambar, "jpg", new File("Create file JPEG.jpg"));

    JOptionPane.showMessageDialog(null, "Convert to JPG succes YES");

} catch(Exception e) {
    JOptionPane.showMessageDialog(null, e);
}


text:
Q: Why does $(a + b)^3$ expand to $a^3 + 3ab^2 + 3a^2b + b^3$
Why does $(a + b)^3$ expand to $a^3 + 3ab^2 + 3a^2b + b^3$

Why does this work? I am confused as to why this happens.

A: In overly pedantic detail:
\begin{align}
(a+b)^3
 &= (a+b)[(a+b)(a+b)] \tag{by definition} \\
 &= (a+b)[a(a+b) + b(a+b)] \tag{distribution} \\
 &= (a+b)[a^2 + ab + ba + b^2] \tag{distribution} \\
 &= (a+b)[a^2 + 2ab + b^2] \tag{commutativity} \\
 &= a[a^2 + 2ab + b^2] + b[a^2 + 2ab + b^2] \tag{distribution} \\
 &= a^3 + a2ab + ab^2 + ba^2 + b2ab + b^3 \tag{distribution} \\
 &= a^3 + 2a^2b + ab^2 + a^2b + 2ab^2 + b^3 \tag{commutativity} \\
 &= a^3 + 3a^2b + 3ab^2 + b^3. \tag{collect like terms}
\end{align}

A: Since pictures don't appear in the comments well,

A: Let's break the algebra down, one step at a time. Trying to use colors to keep track of what comes from what.
You have that $$(a+b)^3 = \color{green}{(a+b)^2}\cdot (\color{#AA33FF}{a}+\color{#11AAFF}{b})$$
I assume you know $(a+b)^2 = a^2+2ab+b^2$, from which
$$
(a+b)^3 = \color{green}{(a^2+2ab+b^2)}\cdot (\color{#AA33FF}{a}+\color{#11AAFF}{b})
$$
Now, distributing (i.e., $c(a+b)=ca+cb$),
$$
(a+b)^3 = \color{green}{(a^2+2ab+b^2)}\cdot \color{#AA33FF}{a}+\color{green}{(a^2+2ab+b^2)}\cdot \color{#11AAFF}{b}
$$
Distributing again,
$$
(a+b)^3 = a^2\cdot \color{#AA33FF}{a}+2ab\cdot \color{#AA33FF}{a}+b^2\cdot \color{#AA33FF}{a} + a^2\cdot \color{#11AAFF}{b}+2ab\cdot \color{#11AAFF}{b}+b^2\cdot \color{#11AAFF}{b}
$$
that is
$$
(a+b)^3 = a^3+\color{red}{ 2a^2b}+\color{blue}{ a b^2} + \color{red} {a^2b}+\color{blue}{ 2ab^2}+b^3
$$
and regrouping the blue and red terms together,
$$
(a+b)^3 = a^3+\color{red}{3a^2b}+\color{blue}{3ab^2}+b^3
$$
giving the result.

A: Algebra meets combinatorics.  The exponent $3$ tells us to expand the product of three binomials
\begin{align*}
(a+b)^3=(a+b)(a+b)(a+b)
\end{align*}
From each of the three factors $a+b$ we have to select either $a$ or $b$.

Let's list the different possibilities:

*

*From each    binomial   we select an  $a$. Since there is only one way to do so we obtain
  \begin{align*}
aaa\qquad\rightarrow\qquad \color{blue}{1a^3}\qquad\qquad\ \
\end{align*}

*Number of ways to select two  $a$'s and  one $b$
  \begin{align*}
aab,\ aba,\ baa\qquad\rightarrow\qquad aab+aba+baa=\color{blue}{3a^2b}
\end{align*}

*Number of ways to select two  $b$'s and  one $a$
  \begin{align*}
bba,\ bab,\ abb\qquad\rightarrow\qquad bba+bab+abb=\color{blue}{3ab^2}
\end{align*}

*Number of ways to select three  $b$'s
  \begin{align*}
bbb\qquad\rightarrow\qquad \color{blue}{1b^3}\qquad\qquad\ \
\end{align*}

*No  other possibilities.

  We conclude
  \begin{align*}
(a+b)^3=a^3+3a^2b+3ab^2+b^3
\end{align*}

Hint:  Observe the nice symmetry between $a$ and $b$.
Challenge: Try a similar approach with $(a+b)^\color{blue}{4}$ and verify the result algebraically. This is more complex but still feasible .

A: If you want something step by step use the distributive property and associative property:
$$
\begin{array}{rll}
(a+b)^{3}=
&
\underbrace{(\color{red}{a}+\color{red}{b})}_{=x}
\cdot
\underbrace{(\color{green}{a}+\color{green}{b})}_{=y}
\cdot
(\color{blue}{a}+\color{blue}{b})
&\\
=&\underbrace{\color{red}{x}
\cdot
\color{green}{y}}_{=z}
\cdot
(\color{blue}{a}+\color{blue}{b})
&\\
=&
z\cdot (\color{blue}{a}+\color{blue}{b})
&\\
=&
z\cdot \color{blue}{a}+z\cdot\color{blue}{b}
&
\mbox{distributive property}
\\
=&
(x\cdot y)\cdot \color{blue}{a}+(x\cdot y)\cdot\color{blue}{b}
&
z=(x\cdot y)
\\
=&
x\cdot (y\cdot \color{blue}{a})+x\cdot (y\cdot\color{blue}{b})
&
\mbox{associative property}
\\
=&
x\cdot \big((\color{green}{a}+\color{green}{b})\cdot \color{blue}{a}\big)
+
x\cdot \big((\color{green}{a}+\color{green}{b})\cdot\color{blue}{b}\big)
&
y=\color{green}{a}+\color{green}{b}
\\
=&
\underbrace{x\cdot \big(\color{green}{a}\color{blue}{a}+\color{green}{b}\color{blue}{a}\big)}_{}
+
\underbrace{x\cdot \big(\color{green}{a}\color{blue}{b}+\color{green}{b}\color{blue}{b}\big)}_{}
&
\mbox{distributive property}
\\
=&
x\cdot(\color{green}{a}\color{blue}{a})+x\cdot(\color{green}{b}\color{blue}{a})
+
x\cdot(\color{green}{a}\color{blue}{b})+x\cdot(\color{green}{b}\color{blue}{b})
&
\mbox{distributive property}
\\
=& x\color{green}{a}\color{blue}{a}\;+
\\
&\hspace{6mm} + 2x\color{green}{a}\color{blue}{b}\;+
\\
&\hspace{18mm} + x\color{green}{b}\color{blue}{b}
\\
=& (\color{red}{a}+\color{red}{b})\color{green}{a}\color{blue}{a}\;+
\\
&\hspace{5mm} + 2(\color{red}{a}+\color{red}{b})\color{green}{a}\color{blue}{b}\;+
\\
&\hspace{15mm} + (\color{red}{a}+\color{red}{b})\color{green}{b}\color{blue}{b}
\\
=& \color{red}{a}\color{green}{a}\color{blue}{a}+\color{red}{b}\color{green}{a}\color{blue}{a}\;+
&\mbox{distributive property}\\
&\hspace{5mm} + 2(\color{red}{a}\color{green}{a}\color{blue}{b}+\color{red}{b}\color{green}{a}\color{blue}{b})\;+
& \mbox{distributive property}\\
&\hspace{15mm} + \color{red}{a}\color{green}{b}\color{blue}{b}+\color{red}{b}\color{green}{b}\color{blue}{b}
&\mbox{distributive property}
\\
=& \color{red}{a}\color{green}{a}\color{blue}{a}+\color{red}{b}\color{green}{a}\color{blue}{a}\;+
&\\
&\hspace{8mm} + 2\color{red}{a}\color{green}{a}\color{blue}{b}+2\color{red}{b}\color{green}{a}\color{blue}{b}\;+
& \mbox{distributive property}\\
&\hspace{21mm} + \color{red}{a}\color{green}{b}\color{blue}{b}+\color{red}{b}\color{green}{b}\color{blue}{b}
\\
=&
a^3+a^2b+
&\\
&\hspace{8mm} + 2{a}^2{b}+2{a}{b}^2\;+
& \\
&\hspace{21mm} + {a}{b}^2+{b}^3
\\
=& a^3+3a^2b+3ab^2+b^3
\end{array}
$$


text:
Q: What is functional data? Let's say I run a separate regression on different cross-sections at each point in time t. I would then have a time series for each regression coefficient over different periods in time. Would this data be considered functional data? Can I use k-means clustering on it?
If not, does anyone have any other suggestions on how I can look at structural changes time series data with panel data? Also open to ML techniques.


text:
Q: What's the difference between reserved and committed memory? I understand that memory has to be reserved before being committed.  And when it's reserved, no other process can use it. However reserved memory does not count against available RAM. But shouldn't it? Because if no one else can use it, then what good is it being "available"?
Or is there some bigger difference?

A: In the context of Win32, "reserved" means that the address space is allocated within the process that requested it. This may be used, for example, to reserve space for a large buffer that's not all needed right away, but when it's needed it would need to be contiguous.
Reserving memory does not interact with other processes at all, since each process has its own private address space. So the statement that "when it's reserved, no other process can use it" is meaningless, since processes can't normally allocate memory in the address space of another process anyway.
When the reserved pages are requested to be committed (backing store allocated for them), that operation can potentially fail due to lack of physical memory (or pagefile).

A: I like to view Reserved as booking the address space so that no one else can allocate it (but I can't use memory at that address because it is not yet available). And Committed as mapping that address space to the physical memory so that it can be used.
Why would I want to reserve? Why not just get committed memory? There are several reasons I have in mind:

*

*Some application needs a specific address range, say from 0x400000 to 0x600000, but does not need the memory for storing anything. It is used to trap memory access. E.g., if some code accesses such area, it will be caught. (Useful for some reason.)

*Some thread needs to store progressively expanding data. And the data needs to be in one contiguous chunk of memory. It is preferred not to commit large physical memory at one go because it is not needed and would be such a waste. The memory can be utilized by some other threads first. The physical memory is committed only on demand.

A: Process Virtual Memory (Address Space ) and Actual RAM are both different. you can have 512MB physical RAM but still your process can address 4GB virtual address space(2GB Userspace)
Every address in a process can be thought of as either free, reserved, or committed at any given time.
A process begins with all addresses free, meaning they are free to be committed
to memory or reserved for future use.Before any free address may be used, it must first be allocated as reserved OR committed. But doesn't need to be reserved in order for it to be committed.
reserving memory means reserving virtaul address space for future purposes. it doesn't associated with Physical RAM (mapped to RAM Addresses).where as committed memory means it will be associated with actual RAM so that you can store data in it.
http://msdn.microsoft.com/en-us/library/ms810627.aspx

A: I think the simplest answer is that:

*

*you reserve memory in virtual address space, so that no other part of code within the same process gets it

*you commit memory to physical RAM/swap so that no other process gets it

So for example if a process has mem limit of 1 GB and does malloc reserve of 1 GB at start it cannot malloc any more even though process memory usage at OS level (commited memory) is nearly 0.


text:
Q: Getting Map Key's Value Cleanly How can I idiomatically get a Map key's value if I know that it exists?
scala> val m = Map(1 -> "hi", 2 -> "world")
m: scala.collection.immutable.Map[Int,String] = Map(1 -> hi, 2 -> world)

scala> if (m.contains(1)) println(m.get(1) )
Some(hi)

Is there a more idiomatic alternative over m.get(1).get.get?
scala> if (m.contains(1)) println(m.get(1).get )
hi

A: scala Map has apply method:
scala> m.apply(1)
res1: String = hi

or with syntax sugar:
scala> m(1)
res0: String = hi

But more idiomatic ways is to iterate over Option:
scala> m.get(1) foreach println
hi


text:
Q: Intent activity class not working hey guys so im having a problem when trying to run the emulator of my application on android studio. this is the error im getting:
Starting: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] cmp=com.example.dre.appli/com.example.dre.appli_app.LoginActivity }
Error type 3
Error: Activity class {com.example.dre.appli/com.example.dre.appli_app.LoginActivity} does not exist.

ive tried everything that people have suggested to no avail. here is my manifest
<?xml version="1.0" encoding="utf-8"?>
<manifest
    xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.example.wheretas.appli_app">

    <!-- To auto-complete the email text field in the login form with the user's emails -->
    <uses-permission android:name="android.permission.GET_ACCOUNTS" />
    <uses-permission android:name="android.permission.READ_PROFILE" />
    <uses-permission android:name="android.permission.READ_CONTACTS" />

    <application
        android:allowBackup="true"
        android:icon="@mipmap/ic_launcher"
        android:label="@string/app_name"
        android:supportsRtl="true"
        android:theme="@style/AppTheme">

        <activity
            android:name=".LoginActivity"
            android:label="@string/app_name">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>

        <activity
            android:name=".CreateAccount"
            android:label="@string/title_activity_create_account"
            android:theme="@style/AppTheme.NoActionBar">
            <intent-filter>
                <action android:name="app.createaccount" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>

</application>
</manifest>

A: I suppose your LoginActivity has a package com.example.dre.appli_app.LoginActivity
But your manifest's package is different:
<manifest
    xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.example.wheretas.appli_app">
...

Try to set it com.example.dre.appli_app


text:
Q: como creo paginacion en una entrada en wordpress Quisiera hacer una paginacion en la entrada de wordpress
busque por la web intentando con <--nextpage--> en el editor y agregando la función  en el archivo sinple.php pero no me funciona
Conocen algun plugin en el que pueda paginar solo entradas o artículos que sean largos , por ejemplo que tengan mas de 6 párrafos se pagina el contenido o por cantida de caracteres o algo así
Le agradezco sus respuestas

A: Te doy opciones para que puedas hacerlo :
1) La más sencilla :
Usar Read More en el post :
        <?php the_content( $more_link_text , $strip_teaser ); ?>

Aquí tienes una guía completa : https://codex.wordpress.org/Customizing_the_Read_More
2) Un poco más complicada :
Esta la use hace mucho tiempo para partir un post en dos columnas, es decir un Flipbook.

                <?php if(have_posts()) : while(have_posts()) : the_post(); ?>

                        <?php $content = split_content();?>
                        <?php echo '', array_shift($content), ''; ?>

                <img class="bgr-space-3" src="<?php bloginfo('template_directory'); ?>/images/bgr-space-2.png" alt="#"/>

                        <?php echo '', implode($content), ''; ?>

                <img class="bgr-space-3" src="<?php bloginfo('template_directory'); ?>/images/bgr-space-2.png" alt="#"/>

            <?php endwhile; ?>  <?php endif; wp_reset_query();?>

                <img class="bgr-space-3" src="<?php bloginfo('template_directory'); ?>/images/bgr-space-2.png" alt="#"/>

Debes agregar la siguiente función al functions.php de WP :
  // Función para mostrar contenido en 2 columnas
  function split_content() {
      global $more;
      $more = true;
      $content = preg_split('/<\/span>/i',get_the_content('more'));
      for($c = 0, $csize = count($content); $c < $csize; $c++) {
         $content[$c] = apply_filters('the_content', $content[$c]);
  }
  return $content;
}


text:
Q: How correctly deploy a Laravel application from my local environment to my remote server? I am pretty new in Laravel and I have the following doubt.
I have to migrate a Laravel 5.4 application that I have developed from my local environment to my remote server.
Can I do it in the following way?

*

*Take the entire directory containing my local application and upload it into the /var/www/html directory of my remote server.

*Export my local database and import on my remote database.

*Change the content of the .env file.
Now the application should work on my remote server. Is it correct or am I missing something and I have to do something else?

A: here is the steps
Installation On Shared Hostings

*

*Unzip the main zip file and upload your public_html folder ( upload vendor folder as well)

*Give 777 recursive permission to storage/ and bootstrap/ folder

*Create database in phpmyadmin and import .sql file

*Set Database in .env file

*Move all public folder files to root folder in(public_html or your website folder)

*open index.php
Replace these lines with
 require __DIR__."/../bootstrap/autoload.php";
 $app = require_once __DIR__."/../bootstrap/app.php";

To
require __DIR__.'/bootstrap/autoload.php';
$app = require_once __DIR__.'/bootstrap/app.php';

Add these line for setting public path
$app->bind('path.public', function() { return __DIR__; });
(Add this index.php)
Site is ready
Installation On Linux

*

*Unzip the main zip file and upload your html folder (without vendor folder)

*Give 777 permission to storage/ and bootstrap folder

*i.e (Linux: chmod -R 777 foldername)

*Run Linux command (composer install or composer update)

*Create database in phpmyadmin and import .sql file from DB folder

*Set Database in .env file

*create vertual host for removing public folder from url

Done

A: you'll maybe have to update some packages on your remote server so Laravel can work properly.
More details here : https://github.com/petehouston/laravel-deploy-on-shared-hosting/blob/master/README.md


text:
Q: `unsigned int constexpr` in doxygen/sphinx C++17 In a valid and working C++17 header file, whenever I use return types of type unsigned int constexpr this results in sphinx WARNINGs since apparently it mixes up while parsing my code (see output below). For example, the perfectly fine C++17 function:
/**
   * Get the nucleus mass number A.
   *
   * @param code for nucleus
   * @return unsigned int constexpr
   */
  inline unsigned int constexpr get_nucleus_A(Code const code) {
    return (static_cast<CodeIntType>(code) % 10000) / 10;
  }

produces the following sphinx WARNING:
Running Sphinx v3.5.3

 WARNING: Error when parsing function declaration.
If the function has no return type:
  Error in declarator or parameters-and-qualifiers
  Invalid C++ declaration: Expected identifier in nested name, got keyword: unsigned [error at 8]
    unsigned constexpr int get_nucleus_A (Code const)
    --------^

If I replace unsigned int with size_t this warning disappears, but isn't there another less intrusive way to fix this?
EDITs

*

*This is doxygen 1.8.17


text:
Q: Hide/remove random string? I have used this question here on stackoverflow to create a random string without problem :D
( Show random string)
Some times the same string shows up and that's annoying.
So I want the string to only show one time per session, I have already a Quit Session button that kills the class. So lets say I have numbers from 1-3. Number 2 shows up first, then 1, becuase there's only one number left only 3 can be shown.
My button code for the "next button". Currently it kills the class and starts it again! How can I change it so it just displays a new string?
private void onButtonClick(Button clickedButton) {
    Intent startIntent = null;
    if (clickedButton.getId() == R.id.quit) {
        startIntent = new Intent(this, mainmenu.class);
        finish();
    }

    else if (clickedButton.getId() == R.id.next) {
         startIntent = new Intent(this, play.class);
         startActivity(startIntent);
         finish();
    }

    if (startIntent != null) {
        startIntent.setFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT);
        startActivityIfNeeded(startIntent, 0);
    }
}
private void setupbutton() {
    View.OnClickListener onClickHandler = new View.OnClickListener() {

        public void onClick(View v) {
            onButtonClick((Button)v);
        }
    };
    Button button = (Button)findViewById(R.id.quit);
    button.setOnClickListener(onClickHandler);

    button = (Button)findViewById(R.id.next);
    button.setOnClickListener(onClickHandler);

A: Make a random permutation of the indexes and then use it to pick the next string in the sequence.

A: The same string is appearing because the random number generator generates random numbers! It could generate the same number multiple times in a row.
There are many possibilities, to name two:

*

*Put all strings in an array and shuffle it. Then take the elements out one by one starting with index one:
List strings = new ArrayList<String>(getResources().getStringArray(R.array.myArray));
Collections.shuffle(list);

*Put all strings in an array, select a string with a random index and remove the string:
    Random rgenerator = new Random();

    ArrayList<String> strings = new ArrayList<String>(getResources().getStringArray(R.array.myArray));
    int index = rgenerator.nextInt(strings.size());
    String randomString =  strings.get(index);
    strings.remove(index);

EDIT:
Ok, I see...
You have to remember which strings have not been used already. Store the strings in a List and make the list static, so you can save state between the creation of different instances of the Activityplay:
private static ArrayList<String> myString;

Then change your constructor a bit:
@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.play);
    setupbutton();

    if (myString == null || myString.size() == 0) {
        Resources res = getResources();
        myString = new ArrayList(Arrays.asList(res.getStringArray(R.array.myArray)));
    }

    // get a random string
    int rand = rgenerator.nextInt(myString.size());
    String q = myString.get(rand);

    // remove the last used string from the list
    myString.remove(rand);

    TextView tv = (TextView) findViewById(R.id.text1);
    tv.setText(q);
}


text:
Q: Reshape a numpy array Although I have tried np.reshape and transpose, I am not getting the desired output.
I have a numpy array that looks like this:
>>> a = np.array([[1, 1, 2, 2],[1, 1, 2, 2],[1, 1, 2,2]])
>>> a
array([[1, 1, 2, 2],
       [1, 1, 2, 2],
       [1, 1, 2, 2]])

I want the following:
>>> b = np.array([[1, 2],[1,2],[1,2],[1, 2],[1,2],[1,2]])
>>> b
array([[1, 2],
       [1, 2],
       [1, 2],
       [1, 2],
       [1, 2],
       [1, 2]])

The best I can do is in four lines of code:
e, f = np.hsplit(a,2)
e = e.reshape(np.size(e))
f = f.reshape(np.size(f))
b = np.vstack((e,f)).T

Can someone provide me with the pythonic way to reshape an array in this manner?

A: It is not clear exactly what you are looking for by only using 1s and 2s in the example. Please use letters or unique numbers so the mapping is clearer.
I was able to do some jiggling to make it work but I'm not 100% if this is the mapping you want. See the steps below:
>>> a = np.array([[1, 1, 2, 2],[1, 1, 2, 2],[1, 1, 2,2]])

array([[1, 1, 2, 2],
       [1, 1, 2, 2],
       [1, 1, 2, 2]])

>>> a.reshape(6,2)

array([[1, 1],
       [2, 2],
       [1, 1],
       [2, 2],
       [1, 1],
       [2, 2]])

>>> a.reshape(6,2).transpose()

array([[1, 2, 1, 2, 1, 2],
       [1, 2, 1, 2, 1, 2]])

>>> a.reshape(6,2).transpose().reshape(6,2)

array([[1, 2],
       [1, 2],
       [1, 2],
       [1, 2],
       [1, 2],
       [1, 2]])


text:
Q: can't find my class when i use classLoader.loadClass(completeClassName); I use code
// name of the DEX file
String dexFile = "/classes.jar";
            // Get the path to the SD card
            File f = new File( Environment.getExternalStorageDirectory().toString() +  dexFile);
            if (f.exists()) {
                Log.d(TAG, "file exist");
            }
            // optimized directory, the application and package directory
            final File optimizedDexOutputPath = getDir("dex", 0);

            // DexClassLoader to get the file and write it to the optimised directory
            DexClassLoader classLoader = new DexClassLoader(f.getAbsolutePath(),
            optimizedDexOutputPath.getAbsolutePath(),null, getClassLoader());
            // The classpath is created for the new class
            String completeClassName = "com.test.mylibrary.UpgradeVerifcaiton";
            String methodToInvoke = "playTest";

            try {
                Class<?> myClass = classLoader.loadClass(completeClassName);
                Object obj = (Object)myClass.newInstance();
                Method m = myClass.getMethod(methodToInvoke);
                String s = ""+m.invoke(obj);
                makeToast(s);

this line  Class<?> myClass = classLoader.loadClass(completeClassName); is throw exception that class in not found
please advise


text:
Q: Convert DateTime with TypeDescriptor.GetConverter.ConvertFromString (using custom format) Is there any way to make
TypeDescriptor.GetConverter.ConvertFromString convert to DateTime using a custom format e.g. "2011-04-21 13-03-56"?
If not, is there any DateTime-format out there that can be applied to a folder name (/,\,:,etc. are not allowed as you know)?
Help is very much appreciated. Thanks in advance
Random-I-Am
Edit:
Since my request still seems to not be understood correctly I am again trying to elaborate on my question. My users are creating folders with specific names. For example "1000_Link_Topic1_2011-01-25 14-12-10". They are free to combine their information as they like and omit information where needed. They don't even have to care about case sensitivity. So I could face another folder named "1000_link_Topic2".
What I have is a single class with a single property for each possible fragment of information. In this case I would have (Since I had to find a way of checking each properties default value regardless of the property type I am using nullable types):
Short? short_val;
EContentType? enum_val;
String string_val;
DateTime? datetime_val;

My code obviously splits the folder name at "_" and then tells for each fragment to which of the above property types it belongs. As soon as I know the corresponding type I am trying to convert to the Type, lets say t, using TypeDescriptor.GetConverter(t).ConvertFromString(info_frag[i]). I hope you now understand why I cannot use another conversion Method.
The code works for all the types mentioned above. My problem is to find a custom DateTime format that can be used on a folder name. All of the formats I know are using colons to separate hours from minutes and seconds.
What I want is a way to convert from a custom DateTime-format to a DateTime-object using TypeDescriptor.GetConverter.ConvertFromString. If that is not possible I either need to find a standard DateTime-format which can be assigned as a folder name without any further conversion or somehow extend the built-in DateTime-formats by my custom format. If it is going to be the latter I do not care about being able to use seconds or minutes. Hours will do the job.
Thanks again for being as patient as you are and helping me out with this one. Feel free to ask as many further questions as you like. I hope you can help me getting this one to work.
Random-I-Am

A: I have looked into your problem a little and found that the standard DateTimeTypeConverter uses DateTime.Parse internally which doesn't listen to CurrentCulture info at all. Instead you can trick the conversion process with your own TypeConverter!
I do not know how to attach the new typeconverter to the existing DateTime structure, if you even can, so I made a miniture AdvancedDateTime structure .. which is empty. Noone said your custom TypeConvert should even return such a thing! This one returns a regular DateTime. I provided the code below:
public class CustomDateTimeTypeConverter : TypeConverter
{
    public override object ConvertFrom(ITypeDescriptorContext context, CultureInfo culture, object value)
    {
        return DateTime.ParseExact(value.ToString(), "yyyy-MM-dd HH-mm-ss", culture);
    }
}

[TypeConverter(typeof(CustomDateTimeTypeConverter))]
struct AdvancedDateTime
{
}

[TestFixture]
public class DateTime
{
    [Test]
    public void TypeConvert_StrangeFormat_ConvertsWithoutProblem()
    {
        string datetime = "2011-04-21 23-12-13";
        TypeConverter converter = TypeDescriptor.GetConverter( typeof (AdvancedDateTime) );
        var convertedFromString = converter.ConvertFromString(datetime);
        Assert.AreEqual(new DateTime(2011,4,21, 23,12,13), convertedFromString);
    }
}

A: Try this
 string m_strDate = DateTime.Now.ToString("MM/dd/yyyy");
 m_strDate = m_strDate.Replace("/", "");

Append this m_strDate to your folder
A sample i used for text file is as follows
strPath += "/FileHeader_" + m_strDate + ".txt";

Check this sample
DateTime dt=new DateTime(1990,5,6);
Console.WriteLine(TypeDescriptor.GetConverter(dt).ConvertTo(dt, typeof(string)));
string myStr="1991-10-10";
Console.WriteLine(TypeDescriptor.GetConverter(dt).ConvertFrom(myStr));

The sample code i written just to display as per you need try as per your requirement
       string s = "Folder";
        DateTime dt = new DateTime(1990, 5, 6);
        string str = TypeDescriptor.GetConverter(dt).ConvertTo(dt, typeof(string)).ToString();
        string myStr = "1991-10-10";
        string str1 = TypeDescriptor.GetConverter(dt).ConvertFrom(myStr).ToString();
        s = s + str1.Replace("/", "").Replace(":", "");
        textBox1.Text = s;


text:
Q: height width according to device size - bootstrap I have a div element like below

Dear friends,

Lorem Ipsum is just a dummy text for a web page.Lorem Ipsum is just a dummy text for a web page.Lorem Ipsum is just a dummy text for a web page.!

Lorem Ipsum is just a dummy text for a web page.Lorem Ipsum is just a dummy text for a web page.Lorem Ipsum is just a dummy text for a web page.

Lorem Ipsum is just a dummy text for a web page.Lorem Ipsum is just a dummy text for a web page.Lorem Ipsum is just a dummy text for a web page.Lorem Ipsum is just a dummy text for a web page.Lorem Ipsum is just a dummy text for a web page.Lorem Ipsum is just a dummy text for a web page.

Lorem Ipsum is just a dummy text for a web page. Lorem Ipsum is just a dummy text for a web page.Lorem Ipsum is just a dummy text for a web page.

I wish you a good experience and a super day ahead!

Yours sincerely,

Here's somewhat similar fiddle.
I am not able to set the height and width of the pages according to the mobile/tablet's size?
I have a number of pages where there are problems like these. For eg. On iPad I see a white space below when the content is less on the page.
For example, this page has less content but If I scroll I see empty unused space, It shouldn't be the case.

CONTACT US

test.comm

TEST PVT LTD

Mumbai 400012, India.

Contact No. :   + 91 21455487

[Mon-Sat, 9:30 AM - 5:30 PM IST]

Toll Free No.   :   145414

[Toll free while calling from within India]

Email ID    :   abc@pqr.com

It's CSS is here:
.contact-wrapper {
    position: relative;
    padding-bottom: 380px;
    top:134px;
}
.contact-wrapper p {color: #fff;
    font-size: 13px;
    line-height: 15px;
}

What could be the best solution for it?
Media queries?
Please suggest.

A: So are you trying to get the contact-wrapper to fill the whole page? If so, you need to set
html, body {
    height: 100%;
}

in order to get full height covered. Otherwise the contact-wrappers height is just as much as it has content.
Here's a modified fiddle: http://jsfiddle.net/h4pce7tL/2/

A: For  small screen devices, you better use col-sm-12. And to optimize height, try to media query text size. Do not worry much about height. Because height is not of much importance, while styling responsive layouts.

A: Usually for mobile devices we control WIDTH and let the device scroll vertically.

A: The problem is with the fixed padding-bottom: 380px and top:134px.
Try this
  padding-bottom: auto;
  top: auto;


text:
Q: Scala: how to inherit a "static slot"? Well, I'm learning Scala so this question may be too basic for most people.
In Java I can have a static slot (function or variable) in a class, and then I will have that slot in inherited classes too.
In Scala I don't have static slots, but I have companion objects. But I'm finding out that those objects are not part of the inherited class, so if I have two classes Person and Student, and Person has a companion object with a variable all:List that returns a list of all persons so I can do Person.all, I was expecting that I could do Student.all too, but that's not the case.
Is there any way to get the same behaviour that I would get in java?
Thanks!

A: I don't know if this is what you meant, but a companion object can extend from some traits/classes:
class Person
class Student extends Person

trait Aggregation[T] {
  val all: List[T]
}

object Person extends Aggregation[Person] {
  val all: List[Person] = List(new Person, new Person)
}

object Student extends Aggregation[Student] {
  val all: List[Student] = List(new Student, new Student)
}

println(Person.all) // prints all persons
println(Student.all) // prints all students

A: Objects in Scala are not class-level entities like statics are in Java. They are simply a class definition and singleton instantiation rolled into one.
A companion object is a special case that allows the sharing of private data between it and its companion class.
Objects can extend classes, but not other objects. After all an 'object' is just a singleton instance - the class definition of an 'object' is hidden.
Is it reasonable to expect the special relationship between companion objects and companion classes to project an additional class hierarchy on companion objects?
I suspect the best way to achieve a dependency between Person and Student is to delegate.
object Person { val all = List(1,2,3) }
object Student { val all = Person.all.filter(_ % 2 == 0) }

A: Theoretically speaking, Java's behavior in this respect is very broken.  The fact that subclasses inherit static members really doesn't make any sense from an object-oriented point of view.  Statics are really nothing more than fancy, scoped globals.  Inheritance is something you see at the class level, but statics really aren't at the class level (since they're global) so inheritance shouldn't apply.  The fact that it does in Java is...disturbing.
Scala has really taken the high road in this department; something for which we should all be grateful.  As mentioned in another answer, the correct way to define "inherited" statics is to extract the inherited members out into a trait:
trait Inherited {
  def foo() { ... }
  def bar(i: Int) = ...
}

class Person {
  ...
}

object Person extends Inherited

class Student extends Person {
  ...
}

object Student extends Inherited

It may seem needlessly more verbose than Java, but trust me when I say that the semantics are a lot less surprising as a result.

A: Afaics, Daniel Spiewak's and Walter Chang's answers appear to provide two separate copies of the all list. I didn't test the following, but I hope this provides the correct outline even it if has errors.
class Person
class Student extends Person

object Person {
  val all: List[Person]
}

then within Student, access via Person.all
If you want to provide access via Student.all then
object Student {
  def all() = Person.all
}

Another way to do it, would allow you to declare the statics (i.e singleton object) in a trait to be inherited.
trait StaticAll {
   object Static { val all: List[Person] }
}

class Person extends StaticAll
class Student extends Person

Then access with StaticAll#Static.all. I think that is correct and not StaticAll.Static.all. Again this is all off the top of my head, I didn't test any this. Please correct my errors.


text:
Q: How to get MariaDB connection using java? I worked on mysql server and connected my java applications successfully. And  now I changed to MariaDB. How to connect with MariaDB server using java?
How this should be changed?
public class DBConnection {

private Connection connection;
private static DBConnection dBConnection;

public DBConnection() throws ClassNotFoundException, SQLException {
    Class.forName("com.mysql.jdbc.Driver");
    connection = DriverManager.getConnection("jdbc:mysql://localhost:3306/db", "root", "mysql");
}

public static DBConnection getDBConnection() throws ClassNotFoundException, SQLException {
    if (dBConnection == null) {
        dBConnection = new DBConnection();
    }
    return dBConnection;
}

public Connection getConnection() {
    return connection;
}

}

A: Minor changes for MariaDB are as follows: Use the MariaDB Connector/J with the following Driver class:
org.mariadb.jdbc.Driver

For DB Connection use the following structure:
jdbc:(mysql|mariadb)://host:port/[database]

Therefore, your code as above would only require the change for
Class.forName("org.mariadb.jdbc.Driver");

and the rest would work well since MySQL and MariaDB clients are compatible.After all, MariaDB is an enhanced, drop-in replacement for MySQL.
More information about connecting to MariaDB using the Java Connector can be accessed from MariaDB Knowledge Base (MariaDB Connector/J


text:
Q: Replace image in a href with image from another element I want to swap the image in the a element with the image in the img element.
I have done this in a similar situation with the script below:
$('a.testColorbox.cboxElement img').each(function () {
var src = $(this).attr('src');
$(this).attr('src', src.replace("/70/70", "/640/480"));
});

However, since the file ending is ~640~480~1 for this given element this doesn´t work. How to a target this element? I have several elements with this where the same variable is the file ending so i need to target that
70~70~1
640~480~1

HTML:

A: If the original ending of the img will always be ~70~70~1.jpg then you can simplify your replace() call, like this:
$('a.testColorbox.cboxElement img').each(function() {
    $(this).attr('src', function(i, src) {
        return src.replace("~70~70~", "~640~480~");
    });
});


text:
Q: How can I match the content between the first two slashes in an URL? I have an URL like this:
/selt/zvt/202/5/2000981

I just want to capture /selt/
How can I do this?

A: You can split the string on "/" and take the element at index 1.
"/selt/zvt/202/5/2000981".split("/")[1]

Edit:
My previous answer would return "selt" and OP wants the "/" also.
You could use the previous code and manually add the "/" or you can match with regex:
import re
re.findall(r"^/\w+/", "/selt/zvt/202/5/2000981")[0]


text:
Q: How to update the sqlite database in iOS using iPad? I want to do is to update the sqlite database in iOS using iPad. It is possible to drag the sqlite file in iTunes? Just to check if the data from sqlite display correct. I used DB Browser for SQLite.
Thank you in advance.


text:
Q: Trying to remove specific items from an already populated Combobox VBA In VBA I am writing a code that gathers information based off an initial input in a userform.
From the initial entrance point I want the code to go out and find the corresponding data and add it. I have that all working well.
But I am gathering the data from a pivot table and if the pivot table is open it returns "" spaces, "(blank)" and "Grand Total", which I want to get rid of.
My Current code is:
lcomboCount = Sheets(pt).PivotTables("Pivottable1").TableRange2.Rows.Count
For i = 1 To lcomboCount
datapoint = Sheets(pt).PivotTables("PivotTable1").PivotFields("combo").LabelRange.Offset(i, 0).Value
UserForm1.ComboBox.AddItem Sheets(pt).PivotTables("PivotTable1").PivotFields("combo").LabelRange.Offset(i, 0)
Next i
For i = 0 To Me.ComboBox.ListCount - 1
If Me.ComboBox = "" Or Me.ComboBox = "Grand Total" Or Me.ComboBox = ("(blank)") Then
    Me.ComboBox.RemoveItem (i)
End If
Next i

I had a Msgbox in there at one point to see if my values were reading correctly and they were.

A: You just need to .List(i) when you test the values stored into the ComboBox.
Also I changed the "direction" (see second comment for details) of the second loop to avoid missing items.
Here is you revised code :
lcomboCount = Sheets(pt).PivotTables("PivotTable1").TableRange2.Rows.Count
For i = 1 To lcomboCount
    datapoint = Sheets(pt).PivotTables("PivotTable1").PivotFields("combo").LabelRange.Offset(i, 0).Value
    UserForm1.ComboBox.AddItem datapoint
Next i
For i = Me.ComboBox.ListCount - 1 To 0 Step -1
    If Me.ComboBox.List(i) = "" Or Me.ComboBox.List(i) = "Grand Total" Or Me.ComboBox.List(i) = ("(blank)") Then
        Me.ComboBox.RemoveItem (i)
    End If
Next i


text:
Q: Are there any deep details on the specifics of what the "Low Power Mode" in iOS 9 actually affects? So as mentioned in this canonical question and answer thread on iOS 9 features, "Low Power Mode" is a good thing. This is what iOS 9's blurb on "Low Power Mode" explains it does when activated:

Low Power Mode temporarily reduces power consumption until you can
  fully charge your iPhone. When this is on, mail fetch, background app
  refresh, automatic downloads and some visual effects are reduced or
  turned off.

Okay, I get the gist of this. I understand the broad concepts. But is this really all that happens in "Low Power Mode?" For example, what are the exact visual effects which are "reduced or turned off?" Are there any more specific details from Apple on exactly what "Low Power Mode" does?

A: Apple hasn't really discussed specifically what Low Power Mode actually does. Its main underdocumented feature is that it underclocks the processor, reducing performance to increase battery life, but there's a few other tweaks it makes to the system as noted underneath the switch.
As shown in these screenshots, Low Power Mode reduces the performance by ~30%.

Source: http://www.macrumors.com/2015/06/25/ios-9-low-power-mode-benchmarks/
Apple lists the following as features modified by Low Power Mode:

*

*Email fetch

*Hey Siri

*Background app refresh

*Automatic downloads

*Wi-Fi associations

*Some visual effects

Source: https://support.apple.com/kb/HT205234
More details are provided in the developer documentation (Energy Efficiency Guide for iOS Apps):

*

*Reduce CPU and GPU performance

*Pause discretionary and background activities, including networking

*Reduce screen brightness

*Reduce the timeout for auto-locking the device

*Disable Mail fetch

*Disable motion effects

*Disable animated wallpapers

Source: https://developer.apple.com/library/prerelease/ios/documentation/Performance/Conceptual/EnergyGuide-iOS/LowPowerMode.html
Apple encourages developers to take advantage of this feature by implementing a lower power state in their apps. This means that this feature may increase battery life through support in third-party apps.

Your app should take additional steps to help the system save energy when Low Power Mode is active. For example, your app could reduce the use of animations, lower frame rates, stop location updates, disable syncs and backups, and so on.


text:
Q: Concatenate multiple txt files with a name of file as a first column I would like to concatenate multiple .txt files in one single file, putting also the file name as the first column before each file (in order to understand from which file the data comes from). The code I am using below does this, but only for the first row.
for i in *.txt; do echo -n "$i," && cat "$i"; done > tmpfile; mv tmpfile all-files.txt;

for example output like this:
filename1.txt,COVERAGE SUMMARY,,Aligned bases in genome,80754336928,100.00
filename1.txt,COVERAGE SUMMARY,,Average alignment coverage over genome,26.55
filename2.txt,COVERAGE SUMMARY,,Aligned bases in genome,88896465740,100.00
filename2.txt,COVERAGE SUMMARY,,Average alignment coverage over genome,33.40

A: I'd propose the use of awk:
for f in *.txt; do awk "{print \"$f, \" \$0}" "$f"; done

A: suggesting  gawk command:
To print the filename followed by , in first line of each file.
gawk 'BEGINFILE{printf("%s,",FILENAME)}1' *.txt

To print the filename followed by , in every line of each file.
awk '{print FILENAME "," $0}' *.txt

A: 3 different variations, and sub() is a smidgen faster :
CODE
{m,g} 'sub("^",FILENAME",")' FS='^$' *.txt

BENCHMARKING
 ( time ( mawk2  '$NF=FILENAME","$NF' FS='^$' "${m3t}" )  | pvE9 >/dev/null)

 out9: 2.34GiB 0:00:02 [ 896MiB/s] [ 896MiB/s] [ <=> ]

 2.33s user 0.34s system 99% cpu 2.685 total

———————
 ( time ( mawk2  '$!_=FILENAME","$!_' FS='^$' "${m3t}" )  | pvE9 >/dev/null) | lgp3

 out9: 2.34GiB 0:00:02 [ 876MiB/s] [ 876MiB/s] [<=> ]

 2.38s user 0.34s system 99% cpu 2.744 total

———————
( time ( mawk2  'sub("^",FILENAME",")' FS='^$' "${m3t}" )  | pvE9 >/dev/null) | lgp3

 out9: 2.34GiB 0:00:02 [ 987MiB/s] [ 987MiB/s] [ <=> ]

 2.10s user 0.32s system 99% cpu 2.441 total


text:
Q: Query not working when trying to get last 3 years data I have a separate column for a year and month in my database table called Logs and I want to retrieve logs between 2 dates like below:
So if I say retrieve logs between 01/01/2018 to last month that is 02/01/2021 then it should retrieve all the logs but I am not getting any result with the query below:
select COUNT(*)
from Logs
where ((LogYear >= YEAR('01/01/2018') and LogMonth >=Month('01/01/2018')) and (LogYear <=YEAR('02/01/2021') and LogMonth < =Month('02/01/2021')))

Output: 0 records
When I run this query, I am getting a 0 count although I have data for all the year.
What's the issue with this query?
Sample Data:
LogID   LogYear     LogMonth
1       2018           1
2       2018           2
3       2018           3
4       2018           4

I am trying to retrieve data from 1-Jan-2018 to 1-February-2021.

A: You can't compare a date by comparing its component parts, you have to build a proper date and then compare them. Unfortunately this is unsargable i.e. unable to use indexes, you would be better of storing actual dates rather than date components.
As an aside, to avoid unexpected behaviour always use an unambiguous date format.
As you mention you are passing the values from C# just ensure you set the SqlParameter type to date not datetime to avoid any possible issues with time components.
declare @Logs table (LogId int, LogYear int, LogMonth int);

declare @StartDate date = '01 Jan 2018', @EndDate date = '01 Feb 2021';

insert into @Logs (LogID, LogYear, LogMonth)
values
(1, 2018, 1),
(2, 2018, 2),
(3, 2018, 3),
(4, 2018, 4),
(5, 2021, 2),
(6, 2021, 3);

SELECT COUNT(*)
FROM @Logs
WHERE DATEFROMPARTS(LogYear, LogMonth, 1) >= @StartDate
AND DATEFROMPARTS(LogYear, LogMonth, 1) <= @EndDate;

Sample data (tweaked to check end case) produces a result of 5 because record id 5 is in the window and id 6 isn't.

A: I think you need to get the date in an ordered form first, either through converting into a DATETIME or an INT.
Here an example with INT:
WITH Logs2 (ID, LogDate) AS (
    SELECT ID, ((LogYear * 10000) + (LogMonth * 100) + LogDay)
    FROM Logs
)
SELECT COUNT(*)
FROM Logs2
WHERE (LogDate >= 20180101) AND (LogDate < 20210201)

But of course better would be to convert the 3 columns into a DATETIME, DATETIME2 or DATETIMEOFFSET.

A: Try this:
DECLARE @DateFrom   datetime    =   '01/01/2018'
    ,   @DateTo     datetime    =   '02/01/2021'

SELECT
        COUNT(*)
FROM    Logs
WHERE           LTRIM(LogYear*100 + LogMonth)
        BETWEEN CONVERT(varchar(6), @DateFrom   , 112)
            AND CONVERT(varchar(6), @DateTo     , 112)

A: Have you checked the DATEFORMAT -> SET DATEFORMAT (Transact-SQL)
Also I suggest if possible use ISO format date values to remove any regional issues, so
where ((LogYear >= YEAR('20180101') and LogMonth >=Month('20180101')) and (LogYear <=YEAR('20210201') and LogMonth < =Month('20210201')))

A: select COUNT(*)
from Logs
where (LogYear between 2018 and 2020)
or (logyear=2021 and logMonth <= 2)


text:
Q: Roles with Meteor and React I am currently working on a project for a client. I'm trying to assign roles to users at the time they sign up for an account.
handleSubmit(e){
    e.preventDefault();
    this.setState({message:'',messageClass:'hidden'});
    var that = this;
    var first_name = ReactDOM.findDOMNode(this.refs.first_name).value.trim();
    var last_name = ReactDOM.findDOMNode(this.refs.last_name).value.trim();
    var email = ReactDOM.findDOMNode(this.refs.email).value.trim();
    var password = ReactDOM.findDOMNode(this.refs.password).value.trim();
    var type = 'fan';
    var user = {email:email,password:password,profile:{fullname:(first_name + last_name).toLowerCase(),firsname:first_name,lastname:last_name,avatar:'http://placehold.it/150x150',friends:[],type:type}};
    Accounts.createUser(user,function(e){
        if (e) {
            Materialize.toast(e.reason, 5000);
        } else {
            FlowRouter.go('/dashboard');
        }
    })
}

Above is my handle submit event for the signup form. Below is the hook that I added to assign the role to the user after the user is inserted.
Meteor.users.after.insert(function (userId, doc) {
if (doc.profile.type === "fan") {
    Roles.addUsersToRoles(doc._id, [ROLES.Fan])
}

});
What I'm finding is that the user gets created but instead of being redirected to the dashboard, the user remains on the signup page and receives an error in the toaster message stating internal server error. When I go into the console to find the user that was created, the profile type is assigned but the user is missing their email address.
This is the error I'm getting in my terminal window:

Exception while invoking method 'createUser' ReferenceError: ROLES is
  not defined I20160402-16:04:42.482(-4)?     at Object.
  (both/collection_hooks/hooks.jsx:3:35) I20160402-16:04:42.482(-4)?
  at packages/matb33_collection-hooks/insert.js:35:1
  I20160402-16:04:42.482(-4)?     at Array.forEach
  (packages/es5-shim/.npm/package/node_modules/es5-shim/es5-shim.js:417:1)
  I20160402-16:04:42.483(-4)?     at Function..each..forEach
  (packages/underscore/underscore.js:105:1) I20160402-16:04:42.483(-4)?
  at after (packages/matb33_collection-hooks/insert.js:34:1)
  I20160402-16:04:42.483(-4)?     at
  Object.CollectionHooks.defineAdvice.self
  (packages/matb33_collection-hooks/insert.js:49:1)
  I20160402-16:04:42.485(-4)?     at Object.collection.(anonymous
  function) [as insert]
  (packages/matb33_collection-hooks/collection-hooks.js:117:1)
  I20160402-16:04:42.485(-4)?     at [object
  Object].Mongo.Collection.(anonymous function) [as insert]
  (packages/mongo/collection.js:590:1) I20160402-16:04:42.485(-4)?
  at AccountsServer.Ap.insertUserDoc (accounts_server.js:1248:25)
  I20160402-16:04:42.486(-4)?     at createUser
  (password_server.js:980:25)

Does anyone have any idea what exactly is happening?

A: The variable ROLES isn't defined in the context of your hook. It's either not a global or you're using Meteor 1.3 and you haven't exported it from the file you've defined it in and imported it into the file where you defined your hook.