text:
Q: how can color of status bar be changed as per different forms in codenameone? I have gone via the beow link and it works well .
change color

*

*But there is static status color and I want to change of status bar as per the different form.

*I want to use transparent background image as per the attached image , how can it done?
[EDIT]
I have added the android.style in hint build as shown in attached image but there is no changed in status bar, is I using it correctly or not please verify it.

A: Right now transparent status bar is only supported on iOS. We don't support that elsewhere.
It might work using this: Android Completely transparent Status Bar?
But we haven't tested it and the one user who tried it didn't report success. The android.style build hint would allow you to inject to the theme.xml but I'm not sure how android:fitsSystemWindows can work.


text:
Q: Silverlight: Empty Storyboard vs BackgroundWorker Which one performs better to run a game main loop?

A: There's a new option in RC0, it's the CompositionTarget.Rendering event. It seems to have promise for being the best option.
As for other game loop methods, it's generally accepted that the empty Storyboard is best. So I'd recommend the new Rendering event first, and if that seems to have issues, go with the empty Storyboard.
I've got a bit here on the new Rendering event:
http://silverlightrocks.com/cs/blogs/silverlight_games_101/archive/2008/09/26/a-much-cleaner-game-loop-in-silverlight-2-rc0.aspx

redpajama_set_name: RedPajamaStackExchange


text:
Q: How to make ExtJS chart background transparent? It's white now and I need it to be transparent. How can I achieve that?

A: Maybe you need to add <param name="wmode" value="transparent">  to your object tag in HTML. reed this article for more info.

A: Given the fact that extjs stacks many layers of canvases (is this the right plural?) I've achieved chart transparency (on extjs 5) by doing this:
bodyStyle: 'background:transparent !important;'

for both your CHART and it's CONTAINER (in my case a panel).
In addition to this, set
background: {
            style: {
                opacity: 0.0
            }
        }

for your chart. The interesting is that if now you keep the bodyStyle configuration and set the opacity to 1.0 in the style, your chart will still be transparent. Perhaps extjs doesn't check for opacity changes if background in unset.

A: I used FireBug to replace the white background of Ext JS (3.3) grids with an image of my choosing.  I removed/replaced background, borders, and CSS for active rows for grid DIVs and TABLE.  I started with this:
.x-grid3 { background: none; }


text:
Q: Python CGI - UTF-8 doesn't work For HTML5 and Python CGI:
If I write UTF-8 Meta Tag, my code doesn't work.
If I don't write, it works.
Page encoding is UTF-8.
print("Content-type:text/html")
print()
print("""
    <!doctype html>

        <meta charset="UTF-8">

        şöğıçü

""")

This codes doesn't work.
print("Content-type:text/html")
    print()
    print("""
        <!doctype html>

            şöğıçü

    """)

But this codes works.

A: For CGI, using print() requires that the correct codec has been set up for output. print() writes to sys.stdout and sys.stdout has been opened with a specific encoding and how that is determined is platform dependent and can differ based on how the script is run. Running your script as a CGI script means you pretty much do not know what encoding will be used.
In your case, the web server has set the locale for text output to a fixed encoding other than UTF-8. Python uses that locale setting to produce output in in that encoding, and without the <meta> header your browser correctly guesses that encoding (or the server has communicated it in the Content-Type header), but with the <meta> header you are telling it to use a different encoding, one that is incorrect for the data produced.
You can write directly to sys.stdout.buffer, after explicitly encoding to UTF-8. Make a helper function to make this easier:
import sys

def enc_print(string='', encoding='utf8'):
    sys.stdout.buffer.write(string.encode(encoding) + b'\n')

enc_print("Content-type:text/html")
enc_print()
enc_print("""
    <!doctype html>

        <meta charset="UTF-8">

        şöğıçü

""")

Another approach is to replace sys.stdout with a new io.TextIOWrapper() object that uses the codec you need:
import sys
import io

def set_output_encoding(codec, errors='strict'):
    sys.stdout = io.TextIOWrapper(
        sys.stdout.detach(), errors=errors,
        line_buffering=sys.stdout.line_buffering)

set_output_encoding('utf8')

print("Content-type:text/html")
print()
print("""
    <!doctype html>

        şöğıçü

""")

A: From https://ru.stackoverflow.com/a/352838/11350
First dont forget to set encoding in file
#!/usr/bin/env python
# -*- coding: utf-8 -*-

Then try
import sys
import codecs

sys.stdout = codecs.getwriter("utf-8")(sys.stdout.detach())

Or if you use apache2, add to your conf.
AddDefaultCharset UTF-8
SetEnv PYTHONIOENCODING utf8


text:
Q: How to use templated emails with Bootstrap on Symfony Mailer? I have been following some Symfony Casts tutorial to send emails using Symfony Mailer bundle. I am also using Bootstrap 4 installed with NPM and Webpack Encore. I can't figure out how to provide styles to these templated emails:
Some controller
use Symfony\Bridge\Twig\Mime\TemplatedEmail;
use Symfony\Component\Mailer\MailerInterface;
use Symfony\Component\Mime\Address;

class SomeController extends AbstractController
{
    public function send(MailerInterface $mailer)
    {
        $email = (new TemplatedEmail())
            ->from(new Address('email@email.com', 'My app'))
            ->to(new Address($contact_form->getEmail(), $contact_form->getName()))
            ->subject('Hemos recibido tu mensaje')
            ->htmlTemplate('email/contact_form.html.twig');

        $mailer->send($email);
    }
}

The template email/contact_form.html.twig is extending email/layout.html.twig:
<!doctype html>

    <meta charset="UTF-8">
    <meta name="viewport"
          content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>{% block title %}{% endblock %}</title>
    <link rel="stylesheet" href="{{ absolute_url(asset('build/app.css')) }}">

{% block body %}{% endblock %}

Style and scripts have the right link reference when I see the email HTML source but they don't have any styles or scripts applied anyway.
Usually, in "normal" layout template I use {{ encore_entry_link_tags('app') }} and {{ encore_entry_script_tags('app') }} but that would generate a relative path to the URLs, I have tried wrapping them in absolute_url() function, but it does not work.
I have tried this Github issue by creating a file macros.html.twig, then importing them in the template and adding {{ encore_absolute_link_tags('app') }} and {{ encore_absolute_script_tags('app') }} in the layout. But I still don't have any applied styles to the email.
What is the right way to import Webpack/Encore styles / scripts to templated emails?

A: Most email clients will not download external CSS files and apply styles and apply them to the email HTML. You really shouldn't count on that (and linking to an external javascript file is even less likely to succeed, as it appears you are doing in your example).
Not only that, but email clients will most of the time ignore any


text:
Q: Overheated laptop My laptop got heated up and then there was some spark n smoke n it got shutdown. What might be the problem?

A: If there was 'smoke and fire' you very probably have device failures and need servicing.
Reasons that could lead to this,

*

*Did you have the laptop vents blocked?
Like, were you working on the bed or a mattress?

*Do you work in a hot and/or humid environment?

*Does your adapter still work (if it has a LED light on it, does it still glow)?

*Do you suspect quality of the power delivered from the source you were using when this happened?

A: I would guess that it was a failure of the active cooling system, anything from the fan to the fan controller or even just the heatsink becoming disconnected through mis-treatment of the laptop.

A: I know certain tech geeks who insist on taking off the lower covering of their laptop whenever they go hardcore gaming or into any other process that requires a lot of CPU usage. This helps a LOT in fact but for most normal people this isn't the obvious way to go solution. So what can you do to prevent your laptop from overheating then?

*

*Don't use in high temperatures
Don't use your laptop when the temperature is high (Above 40 degrees). This might cause your laptop to overheat very quickly (as normally the laptop is hotter than the outside temperature, which is called the base temperature).

*

*Prevent use in humid conditions
Don't use your laptop for a very long time (exceeding two hours) or for gaming when the conditions are above 60% humid. Because this causes the hot air blown out of the laptop to find it difficult to escape (Since vapor is generally denser than normal air and the molecules find it pave their way out)

*

*NEVER Block the vents
Your Laptop's air outlets or vents are its best friends, NEVER block them, especially the vents at the bottom of the laptop, they put a lot of air out, therefore always keep your laptop on something which provides sufficient area for the hot air to escape (preferably some sort of a stand). If you keep your laptop on your lap, try to put something on your lap first so it doesn't block the vents.

*

*Never leave a running laptop closed
Sometimes people tend to leave their running laptops closed, as in, they powered a laptop on but didn't turn it off and just closed it that way and kept it inside some enclosed place. If you do this, there is a high chance your laptop's hardware gets fried due to the trapping of hot air.

*

*Don't go hardcore
Laptops are meant for casual usage, yet sometimes people insist on gaming on their laptops, there is no problem with gaming on a laptop, but when you go on for a LONG time (2 hours plus) it becomes inevitable for the laptop to sustain some damage due to overheating caused by your actions. Not just gaming, this applies even to the usage of softwares which are high on CPU usage (Photoshop, CS, Flashy GUI stuff). If you want to game/use these softwares, do it, but try not to exceed a few hours.

*

*Turn your laptop OFF sometimes
A lot of people don't turn their laptop off, which is not just a major cause of all overheating problems, but actually of ALL laptop problems. Ideally, one should turn their laptop off for at least five-six hours everyday so that it is cooled off. By cooled off I don't mean the cooling of the outer crust, but there are SEVERAL internal parts of laptops which don't cool easily, they need time, and to get the most out of your laptop, you need to take care of them as well.

*

*Get more cooling
You could install some extra cooling for your laptop, something like a small water cooler, you know the ones found in certain high end gaming CPU's, something like that, and then you could affix a place for the actual blower inside the laptop in a way such that the cooler could be taken out and carried with you and your laptop, it would require extra power supply of course.

*

*Clean your Laptop sometimes
You must clean the internal area of your laptop sometimes, the recommended time is every two months. IF you believe you cannot do it, take your laptop to some repair shop and get it done. A laptop is frequently exposed to outside surroundings and hence has the biggest chance of catching dust hence obstructing the flow of hot air to the outside of the laptop.
Also, if ever your Laptop gets overheated and shuts down (for the first time) DO NOT turn it on until it has cooled off, or else there is a big possibility your laptop would get overheated and get some permanent damage on it.
Source


text:
Q: Laravel route errror I started using Laravel not that long ago and still feeling my way around it. Trying to create a simple user profile/edit profile using the framework. Got the code for the view from a git repo..Im also open to seeing other examples of profile/edit porifles as well!!
I got this error:

Route [profile] not defined. (View:
/var/www/html/swarzieapp/resources/views/layouts/app.blade.php)

Route:
Route::post('profile/user/{username}', 'ProfileController@show')->name('profile.user');

Controller:
<?php

namespace App\Http\Controllers;

use Illuminate\Http\Request;

class ProfileController extends Controller {

    /**      * /username     *   * @param $username      * @return Response      */     public function show($username)     {       $user = $this->getUserByUsername($username);

        return View::make('profile.profile')->withUser($user);  }

    /**      * /profiles/username/edit   *   * @param $username      * @return mixed     */     public function edit($username)     {       $user = $this->getUserByUsername($username);

        return View::make('profile.editpro')->withUser($user);  }

    /**      * Update a user's profile   *   * @param $username      * @return mixed     * @throws Laracasts\Validation\FormValidationException      */     public function update($username)   {       $user = $this->getUserByUsername($username);        $input = Input::only('location', 'bio', 'twitter_username', 'facebook_username', 'facebook_username');

        $this->profileForm->validate($input);

        $user->profile->fill($input)->save();

        return Redirect::route('profile.editpro', $user->username);     }

    /**      * Fetch user    * (You can extract this to repository method)
*    * @param $username      * @return mixed     */      public function getUserByUsername($username)       {
            return User::with('profile')->where('username', $username)->firstOrFail();      }

**Profile.blade.php:**

    @extends('layouts/layout')

    @section('content')
        @if ($user->profile)

{{ $user->username }} {{ $user->profile->location }}

                    {{ $user->profile->bio }}

{{ link_to('http://twitter.com/' . $user->profile->twitter_username, 'Find Me On Twitter') }}

{{ link_to('http://facebook.com/' . $user->profile->facebook_username, 'Find Me On Facebook') }}

{{ link_to('http://instagram.com/' . $user->profile->instagram_username, 'Find Me On Instagram') }}

            @if ($user->isCurrent())
                {{ link_to_route('profile.edit', 'Edit Your Profile', $user->username) }}
            @endif
        @else

No profile yet.

        @endif
    @stop

Editpro.blade.php
@extends('layouts/layout')

@section('content')

Edit Profile

    {{ Form::model($user->profile, ['method' => 'PATCH', 'route' => ['profile.update', $user->username]]) }}

            {{ Form::label('location', 'Location:') }}
            {{ Form::text('location', null, ['class' => 'form-control']) }}
            {{ errors_for('location', $errors) }}

            {{ Form::label('bio', 'Bio:') }}
            {{ Form::textarea('bio', null, ['class' => 'form-control']) }}
            {{ errors_for('bio', $errors) }}

            {{ Form::label('twitter_username', 'Twitter_username:') }}
            {{ Form::text('twitter_username', null, ['class' => 'form-control']) }}
            {{ errors_for('twitter_username', $errors) }}

            {{ Form::label('github_username', 'Github_username:') }}
            {{ Form::text('github_username', null, ['class' => 'form-control']) }}
            {{ errors_for('github_username', $errors) }}

            {{ Form::submit('Update Profile', ['class' => 'btn btn-primary']) }}

    {{ Form::close() }}

@stop

App.blade.php
<!doctype html>
getLocale()) }}">

    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">

    <meta name="csrf-token" content="{{ csrf_token() }}">

    <title>SWARZIE</title>

    <link rel="dns-prefetch" href="//fonts.gstatic.com">
    <link href="https://fonts.googleapis.com/css?family=Nunito" rel="stylesheet">

    <link href="{{ asset('css/app.css') }}" rel="stylesheet">

                    {{ config('app.name', 'SWARZIE') }}

                <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="{{ __('Toggle navigation') }}">

                </button>

                        @guest

                                {{ __('Login') }}

                            @if (Route::has('register'))

                                    {{ __('Register') }}

                            @endif
                        @else

                                    {{ Auth::user()->name }}

                                        {{ __('Profile') }}

                                    <form id="profile" action="{{ route('profile') }}" method="POST" style="display: none;">
                                        @csrf
                                    </form>

                                        {{ __('Logout') }}

                                    <form id="logout-form" action="{{ route('logout') }}" method="POST" style="display: none;">
                                        @csrf
                                    </form>

                        @endguest

            @yield('content')

Any help with this would help so very much :) <3

A: the route for show should be (get) method
Route::get('profile/user/{username}', 'ProfileController@show')->name('profile.user');


text:
Q: Proper setup for IIS7.5 machine account for anonymous Web site access Using IIS 7.5, IIS_IUSRS is supposed to be the account to use. I get '401 - Unauthorized: Access is denied due to invalid credentials' error. If I add an EVERYONE account with Read, it works. But rather not have Everyone account. Any idea why IIS_IUSRS does not work? It has Read access. Anonymous Access=enabled. Specific User=IUSR
As a side, on the Basic Settings... for the site, Test Settings button says 'ok-on Authenticate' but Authorization 'cannot verify access to path'.

A: In IIS 7.5 this has changed from being an IIS_IUSRS account to being a user under the IIS AppPools top level windows group
if you create an application pool called
www.mysite.com
then the sites default created user account that it runs as becomes
IIS AppPools\www.mysite.com
Check the following Microsoft Doc under "Securing Resources" to see more
http://learn.iis.net/page.aspx/624/application-pool-identities/

A: Under the 'Securing Resources' section listed here:

*

*Open Windows Explorer.

*Select a file or directory.

*Right click the file and select "Properties"

*Select the "Security" tab Click the "Edit" and then "Add" button

*Click the "Locations" button and make sure you select your machine. Enter "IIS AppPool\DefaultAppPool" in the "Enter the object names to select:" text box.

*Click the "Check Names" button and click "OK".

Substitute DefaultAppPool with the name of the application pool you created/used when adding your site to IIS. This IIS AppPool (not IIS AppPools as of iis 7.5.7600 on Windows 7 pro) group is a group of virtual accounts that you will not see when performing a normal account search on your local machine or via a directory service.


text:
Q: Way to remotely update Jenkins "System Message" string? Is there a way to remotely insert/update the Jenkins "System Message" (instance description that is displayed across the top of the screen)?
We deploy our Jenkins Jobs via API and would like to be able to tell what versions of jobs were deployed at a glance.

A: There is no API for modifying the system message. This value can only be modified by the config window, as of jenkins-2.143.
<f:entry title="${%System Message}" help="/help/system-config/systemMessage.html">
        <f:textarea name="system_message" value="${it.systemMessage}"
                    codemirror-mode="${app.markupFormatter.codeMirrorMode}" codemirror-config="${app.markupFormatter.codeMirrorConfig}" previewEndpoint="/markupFormatter/previewDescription"/>
</f:entry>

However, you  can set the description entry for the main page (or any page) with the submitDescription API. The description entry is right below the system message field on the main page, so if you leave system message empty, you can use the description field as a pseudo system message.
This is a sample using curl. submitDescription is available with the XML, python and JSON API as well.
user=my_user
password=12345678
description="this is a description"
jenkins_url="my_server"

curl -u $USER:$PASSWORD --data-urlencode "description=$description" \
    --data-urlencode "Submit=Submit" \
    "$jenkins_url/submitDescription"

You can also use it for a job, or job number description if you use the following url instead:
"$jenkins_url/job/$job/submitDescription
"$jenkins_url/job/$job/$build_number/submitDescription

A: I also found a solution involving using a curl against the Script API to run a Groovy script to write directly to the SystemMessage:
curl:
user=my_user
password=12345678
jenkins_url="my_server"

curl -u $USER:$PASSWORD -d "script=$(cat /tmp/script.groovy)" \
"$jenkins_url/script"

Groovy Script (/tmp/script.groovy):
import jenkins.model.Jenkins
Jenkins j = Jenkins.instance
def now = new Date()
String system_message = ('System Header Message')

j.systemMessage = system_message


text:
Q: How to organize the code with GUI (with Tkinter) and logical components? I'm doing a TicTacToe. So I have a class TicTacToe representing the state of the game (the grid, who own which cells, who is the next player to play) exposing methods to act on the game. It's the logical part.
I would like to put this in a GUI with Tkinter (imported as tk). I'm hesitating in several ways to do that:

*

*create a TicTacToeUI class which inherits of both tk.Frame and TicTacToe;

*create a TicTacToeUI class which inherits of tk.Frame and has a TicTacToe attribute;

*create a TicTacToeUI class which inherits of tk.Frame which only defines graphical elements and aTicTacToeBindingUI which bind an instance of TicTacToe with an instance of TicTacToeUI.
Is this an idiomatic way to separate logical and GUI with Tkinter ?
Below is the code I did; it's commented in french but the name of the variables seem clear enough to understand the process. As you can see, I choose the 2ond solution. Any comment welcome.
from tkinter import *

class AlreadyTaken(Exception):
    pass

class GameOver(Exception):
    pass

class TicTacToe:
    def __init__(self):
        """ Built an object representing the state of the TicTacToe.
        An instance of TicTacToe has two attributes:
        self.next_player_to_play : indicate who is the next player (coding by 1 or 2).
        self.grid (list of list): the grid 3x3 of the game; 0 is for
        empty cells, 1 (resp. 2) is for the first (resp. second player).
        """
        self.grid = [[0] * 3 for i in range(3)]
        self.next_player_to_play = 1
        self.game_over = False

    def is_cell_free(self, i, j):
        """ Return True if the cell (i, j) is empty, False orthewise.
        Raises IndexError if i and j are not in [0,2]."""
        if not ( 0 <= i <= 2 and 0 <= j <= 2):
            raise IndexError('cell (%d, %d) index out of range'%(i, j))
        return not self.grid[i][j]

    def play(self, i, j):
        """ The player self.next_player_to_play capture the cell (i, j),
        if this cell is free. Raises AlreadyTaken exception if (i, j)
        is not empty, or GameOver if the game is over.
        Return 0 if the current player doesn't win, or the number of
        the winning player."""
        if self.game_over:
            raise GameOver('the game is over, the winner is the player %d'
                            %self.next_player_to_play)

        if not self.is_cell_free( i, j):
            raise AlreadyTaken('cell (%d, %d) already taken by player %d'
                                    %(i, j, self.grid[i][j]))
        p = self.next_player_to_play
        self.grid[i][j] = p
        if self._is_victorious(p):
            self.game_over = True
            return p
        # switch les deux joueurs
        self.next_player_to_play = 3 - p
        return 0

    def _is_victorious(self, player):
        """ Return True if the player `player` wins, i.e. if he succeed making a row, a column or a diagonal."""
        g = self.grid
        return (
         # fill a column?
         any(all(g[i][j] == player for i in range(3)) for j in range(3)) or
         # fill a row ?
         any(all(g[i][j] == player for j in range(3)) for i in range(3)) or
         # fill a diagonal ?
         all(g[i][i] == player for i in range(3)) or
         # l'anti-diagonale ?
         all(g[i][2-i] == player for i in range(3))
        )

class TicTacToeUI(Frame):
    def __init__(self,
                 master=None,
                 void_symb=' ',
                 player1_symb='X',
                 player2_symb='O',
                 tictactoe=None):
        """ Build a frame drawing a TicTacToe game with 9 cells.

        * `<situation>_symb`: indicates what symbol to use for a void cell, or owned by a player (1 or 2).
        * `tictactoe`: by default (if `tictactoe` is None),a new game is created,
        but we can use an existing TicTacToe instance instead."""

        super().__init__(master, width=150, height=150)

        if tictactoe is None:
            tictactoe = TicTacToe()
        self.tictactoe = tictactoe
        symbols = [void_symb, player1_symb, player2_symb]
        self._symbols = symbols
        buttons_grid = []
        self.buttons_grid = buttons_grid

        Label(self, text='Super tictactoe!').grid(row=0, column=0, columnspan=3)

        label_player_playing = Label(self, text='Player 1 is playing')
        label_player_playing.grid(row=1, column=0, columnspan=3)
        self.label_player_playing = label_player_playing

        for i in range(3):
            buttons_line = []
            for j in range(3):
                player = tictactoe.grid[i][j]
                button = Button(
                    self,
                    text=symbols[player],
                    command=lambda i=i, j=j: self.play(i, j),
                    bg="green"
                )
                button.grid(row=i+2, column=j)
                buttons_line.append(button)
            buttons_grid.append(buttons_line)
        Button(
            self,
            text='Start a new game',
            command=self.reinit_game
            ).grid(column=0, row=5, columnspan=3)

    def play(self, i, j):
        try:
            player = self.tictactoe.next_player_to_play
            victorious_player = self.tictactoe.play(i, j)
            self.buttons_grid[i][j]['text'] = self._symbols[player]

            if victorious_player:
                self.label_player_playing['text'] = 'Player %d wins!' % player
            else:
                self._update_label_player_playing()
        except (AlreadyTaken, GameOver) as e:
            pass

    def _update_label_player_playing(self):
        player = self.tictactoe.next_player_to_play
        self.label_player_playing['text'] = 'Player %d is playing' % player

    def _all_buttons_to_void(self):
        for line in self.buttons_grid:
            for b in line:
                b['text'] = self._symbols[0]

    def reinit_game(self):
        self.tictactoe = TicTacToe()
        self._all_buttons_to_void()
        self._update_label_player_playing()

m = TicTacToeUI()
m.pack()
m.mainloop()


text:
Q: Assisstance with comparisons in primitive recursion I have been given the following question on a tutorial about recursive functions and am not sure how to compare two arguments
  Show that the sign function, sign: N  -> N, is primitive recursive where
            sign(x)=  x>0 : x=1
                      x=0 : x=0
    Note the number of arguments of sign.

I already know that I will use

succ(zero(x)

to assign 1 and

zero(x)

to assign 0 but I do not know compare the x to zero.


text:
Q: Submitting a javascript object to vbScript and referencing its properties in classic ASP I've never passed a JavaScript object to an .asp page. Can someone give me the syntax here. I've tried googling w/o success. The object is called buyerInfo. Using jQuery.
<form id="aform" action="formact.asp" method="POST">
    <input type="hidden" id="myhid" name="myhid" value="">
    <input type="submit">
</form>

<script>
    buyerInfo = {};
    buyerInfo.name = "Joe Buyer"
    buyerInfo.zip = "12345"
    $("#myhid").val(buyerInfo);
</script>

-- and in formact.asp
<%
    Set buyer = Request("myhid")
    name = buyer.name
%>

yields
Object doesn't support this property or method: 'buyer.name'.
What is the correct way to reference these? I know the JavaScript object is being passed, but I don't know how to access its pieces. Thanks.

A: You could get away without using any Classic ASP libraries
jQuery
    $.post('/process.asp', {
        name: buyerInfo.name,
        zip: buyerInfo.zip
    }, function (data) {
    }).done(function (data) {
        alert(data); // Data that is returned by the ASP pae
    });

ASP
dim name : set name = request.form("name")
dim zip: set zip= request.form("zip")

A: Classic ASP does not have JSON or object's (at least in this sense) built-in by default and you have to load other libraries.
I suggest including this ASP JSON library at the top of formact.asp :
https://github.com/nagaozen/asp-xtreme-evolution/blob/master/lib/axe/classes/Parsers/json2.asp
and then passing the value like this:
<%
    Dim buyer : set buyer = JSON.parse(request.form("myhid"))
    name = buyer.name
%>


text:
Q: ETL Scala script got exception I am writing simple ETL process in scala script and running as 'spark-shell -i rawetl.scala' However got exception "Table not found BaseTable". I also checked file, it is picking correctly.
Here is the sample code
import java.io.File
import sqlContext.implicits._
import scala.io.Source
import org.apache.spark.SparkContext
import org.apache.spark.SparkContext._
import org.apache.spark.SparkConf
import org.apache.spark.sql.SQLContext
import sys.process._
case class pageRow(affiliateid : String , pageurl : String, alertedbrandsafety : String, blockedbrandsafety : String, grossimpressions : String, spider_bot : String, invalidbrowser : String ,outlieractivity : String , day : String)

object batch_nht {
    def main() {
        processRawNHT()
    }

    def processRawNHT() {

        val rawFile = "hadoop fs -ls /tmp/XXX/rawDB/" #| "tail -1" !!
        val fileName = rawFile.substring(rawFile.indexOf("/"))
        val filePathName = "hdfs://AAAAA:8020" + fileName.trim()
        println(filePathName)

        val sc = new SparkContext(new SparkConf().setAppName("analyzeBlog"))
        val sqlContext = new org.apache.spark.sql.SQLContext(sc)

        val inviewraw = sc.textFile(filePathName).map(_.split(",")).map(x=>x.map(_.replace("\"","")))
        val base_people = inviewraw.map{r => if(r(13) == null || r(13).trim.isEmpty) (r(5) ,r(32), r(48), r(49),r(14), r(71), r(72), r(73),r(0)) else (r(5) ,r(32), r(48), r(49),r(14), r(71), r(72), r(73),r(0))}

        val logs_base_page_schemaRDD = base_people.map(p => pageRow(p._1, p._2, p._3, p._4,p._5, p._6, p._7, p._8,p._9)).toDF()

        logs_base_page_schemaRDD.registerTempTable("baseTable")

        sqlContext.sql("select * from baseTable").collect().foreach(println)
    }
}
batch_nht.main()

NOTE: If I run the bellow commands one by one in spark shell(without script), I got correct output without any exception.
val sqlContext = new org.apache.spark.sql.SQLContext(sc)
import sqlContext.implicits._

val inviewraw = sc.textFile("hdfs://AAAAA:8020/tmp/XXX/rawDB/rawFile.csv").map(_.split(",")).map(x=>x.map(_.replace("\"","")))
val base_people = inviewraw.map{r => if(r(13) == null || r(13).trim.isEmpty) (r(5) ,r(32), r(48), r(49),r(14), r(71), r(72), r(73),r(0)) else (r(5) ,r(32), r(48), r(49),r(14), r(71), r(72), r(73),r(0))}

case class pageRow(affiliateid : String , pageurl : String, alertedbrandsafety : String, blockedbrandsafety : String, grossimpressions : String, spider_bot : String, invalidbrowser : String ,outlieractivity : String , day : String)

val logs_base_page_schemaRDD = base_people.map(p => pageRow(p._1, p._2, p._3, p._4,p._5, p._6, p._7, p._8,p._9)).toDF()

--create table
logs_base_page_schemaRDD.registerTempTable("baseTable")
sqlContext.sql("select * from baseTable").collect().foreach(println)

Please suggest what goes wrong? in script

A: Here is the code snippet which is tested. Your approach will not work for Programmatic approach using scala.
import java.io.File
import sqlContext.implicits._
import scala.io.Source
import org.apache.spark.SparkContext
import org.apache.spark.SparkContext._
import org.apache.spark.SparkConf
import org.apache.spark.sql.SQLContext
import sys.process._
import org.apache.spark.sql.Row;
import org.apache.spark.sql.types.{StructType,StructField,StringType};

object batch_nht {
    def main() {
        processRawNHT()
    }

    def processRawNHT() {
        val rawFile = "hadoop fs -ls /user/cloudera/cards/" #| "tail -1" !!
        val fileName = rawFile.substring(rawFile.indexOf("/"))
        val filePathName = "hdfs://quickstart.cloudera:8020" + fileName.trim()
        println(filePathName)
        val schemaString = "color|suit|pip"
        val sqlContext = new org.apache.spark.sql.SQLContext(sc)
        val deck = sc.textFile(filePathName).map(_.split("\\|"))
        val schema =
            StructType(
            schemaString.split("\\|").map(fieldName => StructField(fieldName, StringType, true)))
        val base_deckRDD = deck.map{r => Row(r(0), r(1), r(2))}
        val cardsDataFrame = sqlContext.createDataFrame(base_deckRDD, schema)
        cardsDataFrame.registerTempTable("deck_of_cards")
        val firstTen = sqlContext.sql("select * from deck_of_cards limit 10")
        firstTen.map(r => (r(0), r(1), r(2))).collect().foreach(println)
    }
}

batch_nht.main()


text:
Q: Bcrypt.compareSync always returning false Hi so I'm trying to create my first login with sequelize and I'm struggling with hashing and comparing hashes and it always returns false.
I figured I am doing something wrong on the hashes or comparing since I'm learning. I'm using SQL database
Here's my login code, I'm using express session and sequelize:
     'processLogin': (req, res) => {
            db.User.findOne({
            where: {
              email: req.body.email
            }
          })
          .then(async user => {
            var eSession = req.session.userLogin
            let checkPass = await bcrypt.compare(req.body.password, user.password)
            console.log(checkPass);
            if(checkPass){
              eSession = user;
              res.send("Success");
            }else{
              res.render('login', {errors: [{
                msg: "Incorrect password"
              }]});
            }
             if(user == undefined){
              res.render('login', {errors: [{
                msg: "User not found, please Register"
              }]});}
          })
        }

And here is where I actually hashed the passwords on my register:
      'save': async (req, res) => {
        var a = [req.body.fullname, req.body.email, req.body.number, bcrypt.hashSync(req.body.password, 10), bcrypt.hashSync(req.body.repassword, 10)];
        let errors = validationResult(req);
        if(errors.isEmpty()){
        db.User.create({
          full_name: a[0],
          email: a[1],
          phone_number: a[2],
          password: await bcrypt.hash(a[3], 10),
          confirm_password: await bcrypt.hash(a[4], 10)
        })
        .then(users => {
          res.send("succes!!");
        })
        }else{
          res.render('register', { errors: errors.errors })
        }
      }
    }

A: insted of sync why don't you try async and wait unitll it get's hashed or decrypt.
inside async function to hash password.
let hashedPassword = await hash(password, 10);

and inside async function for comparing password
    let checkPass = await compare(password, foundUser.password);


text:
Q: How to open website at specific point on page in HTML? beginner programmer so apologies if this is really obvious!
How can i get my website to open at a specific point on the page (in HTML)?
I can't find what this is called anywhere! Not Anchor etc. The website will be wider and longer than most screens. I want the screen/viewport to open at the very centre of a 2500x2500 pixel background.
I am working in DreamWeaver CC on Mac OS X 10
Thanks in advance!!
p.s no code to post, this is my first port of call in putting this together

A: You can get the client's screen with $(window).width() & $(window).height() , it's jQuery code so  you'll have to add a balise script to the jQuery lib on your web page. Can you tell me more about what you want to do ? I have trouble understanding. You don't want any anchor but you want ? Apoligies for not understanding.

A: Try this bit of Javascript to fire when the page loads
window.onload = function(){
    window.scrollTo(1250, 1250);
}

The window.scrollTo(x-coord,y-coord) function takes two parameters, x-coord is the pixel along the horizontal axis of the document that you want displayed in the upper left and y-coord is the pixel along the vertical axis of the document that you want displayed in the upper left.
I picked 1250, because that's 2500 divided  by 2, but you may have to tweak that a little if you want that spot in the middle of the screen. You will have to get the screen's viewport and do some math.
(hint: window.innerWidth & window.innerHeight gives you the dimensions including the scroll bar; document.documentElement.clientWidth and document.documentElement.clientHeight is without the scrollbar)

The documentation for window.scrollTo() is here: https://developer.mozilla.org/en-US/docs/Web/API/Window/scrollTo
Some info about the viewport dimensions can be found here: http://ryanve.com/lab/dimensions/

A: As bryguy said, you can calculate the center of your screen and use scrollTo(). Alternatively, if you have a particular element that you want to scroll to, give the element an id and use the scrollIntoView() function. You can also center an invisible div positioning the div absolutely and setting the top and left values to 50%:
HTML

JS
window.onload = function() {
    document.getElementById('scrollToMe').scrollIntoView();
};

A: You can do this without jQuery. You can use the native JavaScript function window.scrollTo() to scroll to the center.
To calculate the center of the screen all you have to do is:
For vertical center

*

*Determine the height of the viewport: The height of the viewport is stored at document.documentElement.clientHeight.

*Determine the height of the entire document: You can use document.documentElement.offsetHeight or document.body.scrollHeight to get the height of the entire document.

*Calculate: Now simply subtract the viewport height from the document height and divide it by two like this:
(document.documentElement.offsetHeight - document.documentElement.clientHeight)/2
For horizontal center

*

*Determine the width of the viewport: The width of the viewport is stored at document.documentElement.clientWidth.

*Determine the width of the entire document: You can use document.body.scrollWidth to accomplish this.

*Calculate: Now simply subtract the viewport width from the document width and divide it by two like this:
(document.body.scrollWidth - document.documentElement.clientWidth)/2
Now time to scroll
Finally, you'll want to make the window scroll to the calculated point.
window.scrollTo(centerWidth, centerHeight);

If you want to do all of it in one step, you'd do:
window.scrollTo( (document.body.scrollWidth - document.documentElement.clientWidth)/2, (document.body.scrollHeight - document.documentElement.clientHeight)/2 );

Please note that we've used document.documentElement.clientHeight (and clientWidth) and they give you the viewport size without the scrollbars. If you wish to include the scrollbars you'll have to use other variables. You can find examples of how to get those measurements on the internet.
For more information: Center a one page horizontally scrolling site in browser (not centering a div)


text:
Q: Standard Error of the ratio of Binomial variates What's the right way to compute the Standard Error of the Mean of the ratio of two random variables that follow a binomial distribution?
I asked a similar question here using Weibull distributions and now I'm interested on the relationship between binomial distributions.
I'm running an experiment that tracks success/failure rate of two distinct groups over 7 days in a row. These two two groups follow a binomial distribution:
$$X \sim \mbox{B}({ n }_{ 1 },{ p }_{ 1 })$$
$$Y \sim \mbox{B}({ n }_{ 2 },{ p }_{ 2 })$$
The experiment starts with a sample of ~ 10k observations in each group but the sample size differs during the following days (eg: I can have [10k 5k 7k 3k 2k 1k 0.5k 0.8k] observations for a group. Each number equals the number of observations of that group in a specific day, no day will have more than the initial sample size observations, an observation on day 3 can also be observed on day 5 and all observations will always be included on day 0).
I want to calculate the $SEM$ of the following ratio:
$$Z=\frac {X-Y}{Y}$$
The method I'm following is obtaining the Expected Value and Variation of the ratio by using Taylor Expansions.
Since both distributions have $N*\hat{p} > 5$ and $N*(1-\hat{p})> 5$ we can assume it follows a normal distribution and compute the $SEM$ by using:
$${SEM_i}= \frac{{\sigma_i}}{\sqrt{N_i}}$$
where ${N_i}$ is the sample size in day $i$.
It turns out that this yields

*

*a very small $SEM$ (about 0.2~1% of the mean) when I use ${N_i}={Nx_i}+{Ny_i}$ and

*a really huge $SEM$ (about 2~3 times the mean) when I use ${N_i} = 7-i$ (the number of days I run the experiment), so it makes me question the right $N$ to use.

Which one of these points is the correct one to get the $ {N_i} $?


text:
Q: Convert epoch to date using DATEADD I explored a lot. I am using this to convert epoch time to date:
CASE
  WHEN json_extract_path_text(cli, 'pickupDate') IS NULL OR json_extract_path_text(cli, 'pickupDate') = ''
  THEN DATEADD(SECOND, CONVERT(bigint, json_extract_path_text(cli, 'pickupTime')), '1970-1-1'), '1970-1-1' )
  ELSE json_extract_path_text(cli, 'pickupDate')
END AS "Start Date"

To give little context, if the key 'pickupDate' in json is not present, i need to make use of this key 'pickUpTime' to get the value. When i do this, i get this error:

Invalid operation: CASE types text and timestamp without time zone cannot be matched;
      1 statement failed.

Can someone help me out here? How do we specify timezone or if there is another way to resolve this?

A: Try breaking it down into parts to see where the issue could be.
Does this expression work?
DATEADD(SECOND, CONVERT(bigint, json_extract_path_text(cli, 'pickupTime')),'1970-1-1')

If it does, then try to find the resulting data types of the previous expression and this one to see if they match: json_extract_path_text(cli, 'pickupDate')
If that works, try explicitly declaring DATE '1970-1-1' as a date using the DATE prefix.
Also, not sure but it looks like there's an extra parentheses in the expression you posted above.

A: The error message is quite clear - you can't return two incompatible data types from a case expression.
The case expression must return compatible data types from all it's branches, so it's not enough to simply read the text from the josn in the else part, you still need to convert it to datetime.
I'm not familiar with the specifics of Amazon redshift but I'm guessing you need convert


text:
Q: Trying to access array offset on value of type null in php 8.1 I have updated PHP 7.3 to version 8.1 but with the following code, I get a warning:
$this->m_intEventId =
    $this->m_objMaintenanceRequest->getEventIds()[CEventSubType::WORKORDER_STATUS_UPDATED]
        ?? $this->m_objMaintenanceRequest->getEventIds()[CEventSubType::WORKORDER_CLOSED]
        ?? $this->m_objMaintenanceRequest->getEventIds()[CEventSubType::WORKORDER_CLOSED_AND_WORK_COMPLETED]
        ?? $this->m_objMaintenanceRequest->getEventIds()[CEventSubType::WORKORDER_COMPLETED];

The warning is

Trying to access array offset on value of type null

We can use isset(), but in this case, do we need to check individual index with isset()? Is there a way to resolve this issue?

A: Without more information, my guess is that one of the values returned by $this->m_objMaintenanceRequest->getEventIds() is null. If you then try to access the element at the given index, the warning is thrown.
You have to check for null first using isset(). For example:
function GetEventIdOfType($eventIds, $type) {
   if(isset($eventIds[$type])) {
      return $eventIds[$type];
   }

   return null;
}

$eventIds = $this->m_objMaintenanceRequest->getEventIds();

$this->m_intEventId =
    GetEventIdOfType($eventIds, CEventSubType::WORKORDER_STATUS_UPDATED)
        ?? GetEventIdOfType($eventIds, CEventSubType::WORKORDER_CLOSED)
        ?? GetEventIdOfType($eventIds, CEventSubType::WORKORDER_CLOSED_AND_WORK_COMPLETED)
        ?? GetEventIdOfType($eventIds, CEventSubType::WORKORDER_COMPLETED);

I did not test this code, but I think you get the idea. I also am assuming that only one of the array elements is set. If for example CEventSubType::WORKORDER_STATUS_UPDATED and CEventSubType::WORKORDER_COMPLETED are set, only the first is returned.


text:
Q: Techniques for blocking domains in Internet Explorer Had a virus on an old Windows XP Pro (SP3) workstation we were given to dispose of that had been powered down for over a year. We were able to clean it up (Malware Bytes, SpyBot, Symantec, etc.), or so we thought.
Sniffing traffic on a hub doesn't reveal anything so it appears that the virus is indeed dormant and/or removed, nor is the workstation experiencing any other symptoms except that you cannot browse to *.microsoft.com, symantec.com, etc. from within Internet Explorer still.
Outside of the usual suspects -- proxy settings change in IE, hosts files, etc. -- where else could you restrict access with Internet Explorer? There doesn't appear to be any add-ons loaded, nor can we see any rogue processes running.
NOTE: we're not looking for another tool to run (i.e. combofix), but technical details on how/where these restrictions are implemented. i.e. hooks into the TCP/IP stack, registry keys, etc.

A: If you want a central configuration point, you could also use your internal DNS server to mis-resolve domains. This works just like the hosts file, but it's centralized.


text:
Q: Can CopyOnWriteArrayList be used with mutable objects? I'm using a collection
    CopyOnWriteArrayList<X> myCOW =  new CopyOnWriteArrayList<X>();

where X is a mutable object. I know that from Java Concurrency in Practice that "the copy-on-write collections derive their thread-safety from the  fact that as long as an effectively immutable object is properly published, no further synchronization is required when accessing it."
I iterate over the collection:
   for (X x : myCOW) {
    if (conditionIsMet) {
       x.modify(); // modify() is a synchronized method in class X
    }
   }

My question is if this way of doing exposes me to thread-safety problems? My guess is that not, since the X's modify() method is synchronized.
Thanks.

A: If you have a class and a collection which is thread safe, they can be used together in a thread safe manner.  There can be gotchas, but I don't see any in your example.


text:
Q: Process.Start - Pass html code to exe as argument I am using the code below to start a executable file from a windows service and I need to pass html code (stored in a variable) as an argument. I am escaping with double quotes but this is not working. What do I need to do in order to pass this correctly? Thanks in advance for any guidance that is offered.
Inside the service:
Process.Start(@"E:\Program Files\MyApp.exe", dr["rec"].ToString() +
                                  " \"" + subject + "\" \"" + htmlVar);

and then within MyApp.exe:
static void Main(string[] args)
{
    Program MyProg = new Program();
    MyProg.MyMeth(args[0].ToString(), args[1].ToString(), args[2].ToString());
}

The exe file is just a simple app that handles the sending of emails. dr["rec"].ToString() is the email address of the recipient. The variable "subject" will contain the subject of the email. The variable "htmlVar" could contain anything, divs, images, hyperlinks, etc.. and the html code could be quite lengthy. Should I not be trying to pass this much data as an argument? Thanks again for the help.

A: You may need to encode the following characters to make them passable in a command line argument:

*

*Double quotes

*Carriage returns

*Line feeds

A: Be careful not to pass too much on the command-line:

*

*What is the command line length limit?
I think 2000+ characters is starting to get too long.

A: From MSDN documentation: http://msdn.microsoft.com/en-us/library/h6ak8zt5.aspx
  // Opens urls and .html documents using Internet Explorer.
   void OpenWithArguments()
   {
      // url's are not considered documents. They can only be opened
      // by passing them as arguments.
      Process.Start("IExplore.exe", "www.northwindtraders.com");

      // Start a Web page using a browser associated with .html and .asp files.
      Process.Start("IExplore.exe", "C:\\myPath\\myFile.htm");
      Process.Start("IExplore.exe", "C:\\myPath\\myFile.asp");
   }

Edit: AaronLS made it a little more clear as to what you're trying to accomplish.
to pass multiple arguments
Process myProcess = new Process();
string arg = String.Format("{0} {1}{2}{1} {1}{3}{1}", dr["rec"], '"',htmlVar);
myProcess.StartInfo.FileName = @"E:\Program Files\MyApp.exe";
myProcess.StartInfo.Arguments = ArgvToCommandLine(new string[] { arg });

myProcess.Start();

The following methods were taken from the MSDN page for ProcessStartInfo arguments: http://msdn.microsoft.com/en-us/library/system.diagnostics.processstartinfo.arguments.aspx
 public static string ArgvToCommandLine(IEnumerable<string> args)
    {
        StringBuilder sb = new StringBuilder();
        foreach (string s in args)
        {
            sb.Append('"');
            // Escape double quotes (") and backslashes (\).
            int searchIndex = 0;
            while (true)
            {
                // Put this test first to support zero length strings.
                if (searchIndex >= s.Length)
                {
                    break;
                }
                int quoteIndex = s.IndexOf('"', searchIndex);
                if (quoteIndex < 0)
                {
                    break;
                }
                sb.Append(s, searchIndex, quoteIndex - searchIndex);
                EscapeBackslashes(sb, s, quoteIndex - 1);
                sb.Append('\\');
                sb.Append('"');
                searchIndex = quoteIndex + 1;
            }
            sb.Append(s, searchIndex, s.Length - searchIndex);
            EscapeBackslashes(sb, s, s.Length - 1);
            sb.Append(@""" ");
        }
        return sb.ToString(0, Math.Max(0, sb.Length - 1));
    }
    private static void EscapeBackslashes(StringBuilder sb, string s, int lastSearchIndex)
    {
        // Backslashes must be escaped if and only if they precede a double quote.
        for (int i = lastSearchIndex; i >= 0; i--)
        {
            if (s[i] != '\\')
            {
                break;
            }
            sb.Append('\\');
        }
    }

That's not the most efficient solution to your problem, but I just copied the code so you could see how to properly escape characters that may be present in your htmlvars variable.

A: " \"" + subject + "\" \"" + htmlVar
Becomes
"SomeSubject" "SomeHTMLVar
Notice there is no closing quote.  Maybe you wanted this:
" \"" + subject + "\" \"" + htmlVar + "\""


text:
Q: Remove common strings in multiple files and copy them I would like to copy and rename all files in a folder that are matching this pattern:

*

*test.mp4.small.mp4

*test2.mp4.small.mp4

*test3.mp4.small.mp4

All files have in common that they end with .mp4.small.mp4.
I would like to copy them to a new folder and rename them - the result should be:

*

*test.mp4

*test2.mp4

*test3.mp4

Attempt:
find . -name '*.mp4.small.mp4' -exec bash -c 'echo cp $0 ${0/PATH/}' {} \;

But this does not rename it.

A: Use the parameter expansion syntax for removing the shortest string from the beginning upto delimiter . of syntax ${word%string} as
find . -name '*.mp4.small.mp4' -exec bash -c 'echo cp $0 ${0%.mp4.small.mp4}.mp4' {} \;

Also I assume, you knowingly have added the echo to just troubleshoot how the renamed string looks like. To actually copy the files, drop it in the final command.

A: rename 's/.mp4.small//' *mp4.small.mp4

will not overwrite by default.
to test just to make sure:
ls *mp4.small.mp4 | sed 's/.mp4.small//' #list resulting file names


text:
Q: SMTP auth do not log in on relay server I'm trying to configure a secondary postfix to enable SMTP AUTH against my main postfix server (postfix + ldap auth + cyrus)
I've follow http://www.postfix.org/SASL_README.html#client_sasl adding:
smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd
smtpd_sasl_auth_enable = yes
smtpd_sasl_security_options = noanonymous
relayhost = [192.168.66.98]

the config files of secondary postfix are:
# postconf -n
alias_database = hash:/etc/aliases
alias_maps = hash:/etc/aliases
command_directory = /usr/sbin
config_directory = /etc/postfix
daemon_directory = /usr/libexec/postfix
data_directory = /var/lib/postfix
debug_peer_level = 2
html_directory = no
inet_interfaces = localhost, 192.168.66.85
inet_protocols = all
local_recipient_maps =
mail_owner = postfix
mailq_path = /usr/bin/mailq.postfix
manpage_directory = /usr/share/man
mydestination = $myhostname, localhost.$mydomain, localhost
mydomain = ddol-test.com
mynetworks = 192.168.66.0/24, 127.0.0.0/8
myorigin = $myhostname
newaliases_path = /usr/bin/newaliases.postfix
queue_directory = /var/spool/postfix
readme_directory = /usr/share/doc/postfix-2.6.6/README_FILES
relay_domains = $mydestination
relayhost = [192.168.66.98]
sample_directory = /usr/share/doc/postfix-2.6.6/samples
sendmail_path = /usr/sbin/sendmail.postfix
setgid_group = postdrop
smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd
smtpd_sasl_auth_enable = yes
smtpd_sasl_security_options = noanonymous
transport_maps =
unknown_local_recipient_reject_code = 550

# cat /etc/postfix/sasl_passwd
[192.168.66.98]         666mgimeno@pre.ddol.es:1234

When I send a mail, it is correctly redirected to .66.98 but it do not auth on it and the behavior of the email is like it for a non authenticated user.
This is my main postfix configuration:
# cat main.cf

...
...
smtpd_sasl_auth_enable = yes
smtpd_sasl_security_options = noanonymous
broken_sasl_auth_clients = yes

smtpd_sasl_authenticated_header = yes
smtpd_sasl_path = smtpd

smtpd_helo_restrictions =
        permit_mynetworks,
        permit_sasl_authenticated,
        reject_non_fqdn_helo_hostname,
        reject_invalid_helo_hostname,
        permit

smtpd_sender_restrictions =
        reject_authenticated_sender_login_mismatch,
        permit

smtpd_recipient_restrictions =
        reject_unauth_pipelining,
        reject_non_fqdn_sender,
        reject_non_fqdn_recipient,
        check_policy_service inet:127.0.0.1:10031,
        permit_mynetworks,
        permit_sasl_authenticated,
        reject_unauth_destination,
        reject_unverified_recipient,
        check_policy_service inet:127.0.0.1:10045,
        reject_rbl_client bl.spamcop.net,
        reject_rbl_client psbl.surriel.com,
        reject_rbl_client sbl.spamhaus.org,
        reject_rbl_client xbl.spamhaus.org,
        reject_rbl_client zen.spamhaus.org,
        reject_rbl_client combined.rbl.msrbl.net,
        reject_rbl_client relays.ordb.org,
        reject_rbl_client list.dsbl.org,
        reject_rbl_client sbl-xbl.spamhaus.org,
        reject_rbl_client dnsbl.njabl.org,
        permit

header_checks = pcre:/etc/postfix/header_checks

smtpd_end_of_data_restrictions =
        check_policy_service inet:127.0.0.1:10031

soft_bounce = no

smtpd_helo_required = yes

smtpd_delay_reject = yes
disable_vrfy_command = yes

smtpd_sender_login_maps = ldap:/etc/postfix/sender_maps

amavisd-new_destination_concurrency_limit = 20

virtual_alias_maps = ldap:/etc/postfix/mailRedirect ldap:/etc/postfix/virtual ldap:/etc/postfix/catch-all

smtpd_sasl_local_domain =

smtp_tls_security_level = may
smtpd_tls_security_level = may
smtpd_tls_auth_only = no
smtp_tls_note_starttls_offer = yes
smtpd_tls_key_file = /etc/ssl/private/smtpd.key
smtpd_tls_cert_file = /etc/ssl/certs/smtpd.crt
smtpd_tls_CAfile = /etc/ssl/certs/cacert.pem
smtpd_tls_loglevel = 1
smtpd_tls_received_header = yes
smtpd_tls_session_cache_timeout = 3600s
tls_random_source = dev:/dev/urandom

message_size_limit=15728640

Right now, any mail sent from secondary postfix, is relayed to main postfix but it passes all the checks as it was for a non authenticated user, but I don't want that. I would like that the behavior of the email was the same as an authenticated user and stops in "permit_sasl_authenticated" in smtpd_recipient_restrictions.

A: Your problem is here:
smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd
smtpd_sasl_auth_enable = yes
smtpd_sasl_security_options = noanonymous
relayhost = [192.168.66.98]

Note that you've used 'smtpd' rather than 'smtp'.  This means you're setting up sasl for the listening deamon, not the sending agent.
Here's what I use in mine:
# use authentication
relayhost = [mail.messagingengine.com]:587
smtp_sasl_auth_enable = yes
smtp_sasl_password_maps = hash:/etc/postfix/saslpass
smtp_sasl_security_options = noanonymous

And it's working fine.
Oh - and the content of saslpass is:
mail.messagingengine.com myuser@my.domain:mypass

Note the colon and the space.  I'm guessing you'll need to do the IP address there instead, or put an entry in /etc/hosts and use a name.  The @my.domain is because messagingengine uses fully qualified email addresses for login.  You probably just need a username.


text:
Q: Disable warmers on replicas in Elasticsearch I am working on a cluster that handles a lot of complex aggregation calculations. This means that our field data cache gets large. Furthermore data is bulk loaded at certain times of the day.
Ideally we only want the primary shards to serve requests and let the replica act as a failover. We can do this via the preferences API but it introduces one of two issues...
If we just set the fields to be lazy loaded then right after a bulk load, things take a bit to cache. This causes a huge spike in response times. If we enable eager loading then field data eats up a lot of memory on the replicas. Same goes for using warmers (unless there is a way to disable them for replicas).
What I want is eager on the primaries and lazy on the replicas. Is this possible?

A: This is currently not possible in Elasticsearch (sorry!)


text:
Q: How to remove request headers in HTTPS npm module I'm trying to access Google API from localhost. Chrome says that it's impossible due to origin
XMLHttpRequest cannot load https://maps.googleapis.com/maps/api.... No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:8000' is therefore not allowed access.

I'm using https-browserify to make ajax request.
   options = {
      hostname: "maps.googleapis.com",
      port: 443,
      path: "/maps/api/....",
      method: "get",
      headers: {
        "Origin": null,
        "Referer": null
      }
    };
    result = null;
    req = https.request(options, function(res) {
      res.on("data", function(chunk) {
        return result += chunk;
      });
      return res.on("end", function() {
        debugger;
      });
    });
    req.end();

But this didn't help. Origin and Referer headers are still there when making this request. How can I remove them?

A: Origin is considered an unsafe header by the Request object (source code)
This is why you cannot remove them; the Request implementation only allows you to remove or modify headers that are deemed safe.

A: Google Maps API does have Access-Control-Allow-Origin.
I could quickly tested it using the below after loading a jquery on a localhost page, it works.
$.getJSON("https://maps.googleapis.com/maps/api/timezone/json?location=-33.86,151.20")

A: Check out the same origin policy in wikipedia or the mdn !
U should use an HTTP Sniffer like fiddler to analyse the request!
Then u should check if the Access-Control-Allow-Origin: * header is present! Your request can only work from a browser when this header is present on the response! So the server, in your case the google server, has to sent it! Google will usually do this on all public APIs for in-browser use. Since else there is no way to directly acces this URL via an AJAX request.
Its important to understand that the same origin policyis a browser feauture build by security reasons! So it does not affect u when u make the request from a non browser enviroment like node.js or any other server side programming enviroment! Also it does not affect u when u make the request directly via the browser, since its a limitation to AJAX requests, not generall every request.
There are ways to go around this limitation, so if u have to make a AJAX request to a server that dosnt sent the Access-Control-Allow-Originheader u can still proxy the request by your server!
Another work around is JSONP, but this does also support from the requested server!
Important note:
If in the Access-Control-Allow-Origin header is returned a origin instead of * the request is only possible as long you are on the origin returned by the server! So maybe the server is returning the productive origin, but denys localhost?
At least from google reCAPTCHA I know u can limitate a API Key to a specific origin. For development purposes normally google allows all requests from localhost, but maybe for any reason not in your case. The best way to check this is to analyse the HTTP traffic with an simple HTTP sniffer as said above!


text:
Q: is it possible to use selenium web driver for AngularJS site? We have very good Automation framework already in place which is in java/selenium to verify our web application but now our site will be migrated to Angular and we do not want to move to protractor. So shall we use selenium for Angular app ?

A: You can use selenium for Angular app but it is more suitable  to use the protractor for Angular app testing, as it is built in framework for the Angular app.


text:
Q: if else in php echo (acf true/false condition) I need to output a different link based on the ACF true/false field.
This is my code:
            $output_map[$the_ID]['map'] = '

'.get_the_title().'

IF
Zum Objekt

ELSE
NO LINK

';

How could I do a if/else statement within this output? I've already read about ternary operators in a other post, but I don't know how to do this my case..

A: You didn't specify where ACL is defined so I'll assume it's in $field['asf']
then

When $field['asf'] equals true then get_permalink() will be invoked otherwise get_other_link() will be invoked

A: $text = '

' . get_the_title() . '
';

IF $text .= '
Zum Objekt
';

ELSE $text .= '
NO LINK
';

$text .= '

';

$output_map[$the_ID]['map'] = $text;

A: You can try these functions ob_start() and ob_get_clean(). Here is the code:
<?php $output_map[$the_ID]['map'] = '';
ob_start();
?>

'.get_the_title().'

  <?php if(){?>

Zum Objekt

  <?php }else{?>

NO LINK

  <?php } ?>

<?php
$output_map[$the_ID]['map'] = ob_get_clean();
?>

Html code given within these functions can be stored in a variable.


text:
Q: Symfony 4: Create a custum Service Error: Expected to find class I've a problem with  creation of a custom sumfony 4 service: I've created a custom class UtilasteurService in sub-folder src/CustumService. But when i run the command  php bin/console debug:autowiring I've the following error.

Expected to find class "App\CustumService\UtilisateurService" in file
  "C:\wamp\www\semges_api\src/CustumService\UtilisateurService.php"
  while im   porting services from resource "../src/*", but it was not
  found! Check the namespace prefix used with the resource.

See below my service.yml file and UtilisateurService file.
#service.yml
parameters:
    locale: 'en'
services:
      _defaults:
        autowire: true      # Automatically injects dependencies in your services.
        autoconfigure: true # Automatically registers your services as commands, event subscribers, etc.
        public: false       # Allows optimizing the container by removing unused services; this also means

    App\:
        resource: '../src/*'
        exclude: '../src/{DependencyInjection,Entity,Migrations,Tests,Kernel.php}'

    App\Controller\:
        resource: '../src/Controller'
        tags: ['controller.service_arguments']

#src/CustumService\UtilisateurService.php

namespace App\CustumService;

use Symfony\Component\Security\Core\Encoder\UserPasswordEncoderInterface;

class UtilisateurService
{
    private $passwd;

    public function __construct($motdepasse)
    {
      $this->paswd=$motdepasse;
    }

    public function encodePassword($motdepasse )
    {
        return $this->passwordEncoder->encodePassword($motdepasse);
    }
}

Can somebody help me to understand what is wrong?

A: Greattttttttt thank you to all. I've solved my problem by executig this command: composer dump-autoload
I get this solution by reading the solution of this problem : Symfony4 Error loading classes custom folder "Expected to find class... but it was not found"
Regards

A: There's nothing wrong with your setup. Maybe try to clear the cache with php bin/console cache:clear and then try again?
Works for me:
Autowirable Services
====================

 The following classes & interfaces can be used as type-hints when autowiring:

 ------------------------------------------------------------------------------------
  App\Controller\IndexController
  App\CustumService\UtilisateurService


text:
Q: How can I drag down a formula and leave some rows blank, but count sequentially the numbers? I have a table with product details and I want to generate another table ready for Magento export.
It's hard to explain so please have a look at the table: https://docs.google.com/spreadsheets/d/1s503gaqo1XV3PiJyr7HBkGago6YXiY4YesQVBETBbvY/edit?usp=sharing
I populate the data on the "Granit" page (I stripped 99% of the things as it's only an example) and I want to fill in the CSV page with the data from my Granit page. Go to the CSV page and have a look at column A  =Granit!J2 then I need to have 3 blank rows and the next one is =Granit!J3, 3 blank rows, =Granit!J4.. you get it. How can I achieve that? If I just drag it down I get weird numbers that are not sequential.
The next colum H on the csv page has another pattern I want to achive:
=Granit!K2
=Granit!M2
=Granit!L2
=Granit!L2

I want to continue with
=Granit!K3
=Granit!M3
=Granit!L3
=Granit!L3
=Granit!K4
=Granit!M4
=Granit!L4
=Granit!L4

(you get it)
Could you please help me? It would be really appreciated!

A: to mimic K2 > M2 > L2 > L2 patern delete everything in range H2:H and paste this into H2 cell:
=ARRAYFORMULA(TRANSPOSE(SPLIT(QUERY(IF(Granit!H2:H<>"";
 "♦"&Granit!K2:K&"♦"&Granit!M2:M&"♦"&Granit!L2:L&"♦"&Granit!L2:L; )
 ;;999^99); "♦")))


text:
Q: Promisfy gzip stream I am trying to create a gzip stream which I can re-use elsewhere. Gzip works good to compress a stream of data but I wanted to refactor my code so I could seperate concerns. In doing so I ended up with the following. However, I can't utilised the returned stream.
const zlib = require('zlib');

function compress(stream) {
  return new Promise((resolve, reject) => {
    const gzipStream = zlib.createGzip();

    gzipStream.on('end', () => {
      resolve(gzipStream);
    });

    gzipStream.on('error', (e) => {
      reject(e);
    });

    stream.pipe(gzipStream);
  });
}

However I get empty output when I use the returned stream. E.g. I compress a 50mb file filled with 0's, and after using my new function, I get an empty file.
async function handler(req, res) {
  const fileStream = fs.createReadStream("./test_50m");
  const compressedStream = await compress(fileStream);

  compressedStream.pipe(fs.createWriteStream("./test_50m_output"));
}

Thanks


text:
Q: Conexiones a Base de datos Oracle con Python He intentado hacer desde mi script una conexión a una BBDD de Oracle mediante
import cx_Oracle

Desde mi máquina local funciona bien (Tengo un Oracle de 32 y 64 bits) pero en el cliente tengo un error debido a que tienen instalado un Oracle de 32 y un python de 64. (Los cuales no puedo tocar ni cambiar de versiones).
He probado ha hacer la conexion con JayDeBeapi pero me pide dependencias (Jpype,...)
¿Conocéis alguna otra manera de hacerlo?


text:
Q: What are the current and voltage ratings of the USB C CC1 (VCONN) pins? I can't seem to find this information, but obviously I searched wrong, or Google is weighing my earlier search history too much.
So, what are these power ratings exactly for the CC1 pin?

A: Valid range for CC1/VCONN pin is 3.0 to 5.5V and connector pin is rated for 1.25A, and how much power is available depends on which devices you support.
Compare that to CC2 connector pin, which has a rating of 0.25A, and pull-up maximum voltage is 5.5v.
You can read the details from the USB standard which is freely available.

A: Without an emarker chip, 3A at 20V.
With an emarker chip and certified 5A cable, 5A at 20V.
And with the newer extended power range feature and a EPR cable, 5A at 48V.
As far as specs go anyway. Any given cable or connector will vary.


text:
Q: How do you install a pod's sub spec without installing the whole pod? I just want one subspec of one library, for example, the nimbus podspec is as follows:
pod search Nimbus
-> Nimbus (1.0.0)

An iOS framework whose growth is bounded by O(documentation).
- Homepage: http://docs.nimbuskit.info/index.html
- Source:   https://github.com/jverkoey/nimbus.git
- Versions: 1.0.0, 0.9.3, 0.9.2, 0.9.1, 0.9.0 [master repo]
- Sub specs:
    - Nimbus/Core (1.0.0)
    - Nimbus/Badge (1.0.0)
    - Nimbus/CSS (1.0.0)
    - Nimbus/AttributedLabel (1.0.0)
    - Nimbus/Interapp (1.0.0)
    - Nimbus/Launcher (1.0.0)
    - Nimbus/Models (1.0.0)
    - Nimbus/NetworkControllers (1.0.0)
    - Nimbus/NetworkImage (1.0.0)
    - Nimbus/Overview (1.0.0)
    - Nimbus/PagingScrollView (1.0.0)
    - Nimbus/Photos (1.0.0)
    - Nimbus/Operations (1.0.0)
    - Nimbus/Operations/JSON (1.0.0)
    - Nimbus/WebController (1.0.0)

I just want to install the Nimbus/core, what should the podfile contain?

A: just use following line in your pod spec
pod 'Nimbus/Core', '= 1.0.0'

Complete pod spec sample:
platform :iOS,'6.0'

pod 'Nimbus/Core', '= 1.0.0'


text:
Q: What is the best way to target users for which "Hometown " is different to "Location" on Facebook? Facebook doesn't allow you to target hometown, only location.
https://www.facebook.com/help/community/question/?id=10151621858082186
However, there must be a clever strategy to get around this. What are people doing to target users that live in other cities to the one they grew up in?

A: You have the ability to target people who are away from home and also by their location. So you could target people who live in London and who are away from home.
This will not let you target people who are from a specific city however.


text:
Q: Variable TaskId in workflow is empty I built a workflow in SP designer that assigns a task depending on some actions on a list in SharePoint.
then Assign a task to Current Item:Responsible user (Task outcome to Variable: Outcome1 | Task ID to Variable: TaskID1)

When the task is assigned, I want to send an email with a link to the task and the edit form:
http://myspsite/list/MyList/EditForm.aspx?ID=[%Variable:TaskID1%]

This gives me nothing after ?ID=
I should be able to use the variable TaskID1 in the email settings in the Assign task properties?


text:
Q: javadoc fails with error class file for javax.interceptor.InterceptorBinding not found I am using jhipster project on intellij using java 10.
I want to export the javadoc tools -> generate javadoc and i got following errors :
javadoc: error - com.sun.tools.doclets.internal.toolkit.util.DocletAbortException: com.sun.tools.javac.code.Symbol$CompletionFailure: class file for javax.interceptor.InterceptorBinding not found

and it fails.

A: you need only to add the interceptor dependency to you project and it should work
<dependency>
        <groupId>javax.interceptor</groupId>
        <artifactId>javax.interceptor-api</artifactId>
        <version>1.2</version>
</dependency>


text:
Q: JS RegEx that matches commas within quotes I am trying to take a text-based log file, like below:

type: 'click', category: 'REFRESH_DOOR', desc: 'clicked refresh from
  door 0124', site: 'mysite', pathname: '/load_areas/all/doors', params:
  '?sort_by=code&layout=view_by_4', time: '1515838628166', mobile:
  'false', bp: 'xlarge', size: '[1920, 935]', area: 'all', sid:
  '15158225889', facility: 'MMMM', IP Address: 'XXX.XXX.XXX.XXX',
  created: 'January 13, 2018 04:17'

and traverse it to build a JSON object from it. When I log.split(",") on the entry above to make separate objects out of the parts of the string, it takes the date and splits it up, breaking the data.
What would be a RegEx that finds commas within single quotes, which I can replace before trying to split this string into a JS array?
I basically want to change: 'January 13, 2018 04:17' to 'January 13; 2018 04:17', and worry about the conversion later.
I tried expressions like:
'([^']*)'

Which takes everything between quotes, but I haven't been able to target just commas between quotes.

A: You could first replace the commas in question with some distinctive name and then split by this. In the end, we loop over the parts and actually build our object:

var subject = "type: 'click', category: 'REFRESH_DOOR', desc: 'clicked refresh from door 0124', site: 'mysite', pathname: '/load_areas/all/doors', params: '?sort_by=code&layout=view_by_4', time: '1515838628166', mobile: 'false', bp: 'xlarge', size: '[1920, 935]', area: 'all', sid: '15158225889', facility: 'MMMM', IP Address: 'XXX.XXX.XXX.XXX', created: 'January 13, 2018 04:17'";

var regex = /'[^']+'|(,)/g;
var kv = /(\w+):\s*'([^']+)'/;

replaced = subject.replace(regex, function(m, group1) {
    if (typeof group1 == 'undefined') return m;
    else return 'SUPERMAN';
});

// create an object that holds our values
var jsonObject = {};

// create a function that splits the individual items
function splitter(item) {
 var match = kv.exec(item);
  jsonObject[match[1]] = match[2];
}

parts = replaced.split("SUPERMAN");
parts.forEach(splitter);
console.log(jsonObject);

Which yields:

{
  "type": "click",
  "category": "REFRESH_DOOR",
  "desc": "clicked refresh from door 0124",
  "site": "mysite",
  "pathname": "/load_areas/all/doors",
  "params": "?sort_by=code&layout=view_by_4",
  "time": "1515838628166",
  "mobile": "false",
  "bp": "xlarge",
  "size": "[1920, 935]",
  "area": "all",
  "sid": "15158225889",
  "facility": "MMMM",
  "Address": "XXX.XXX.XXX.XXX",
  "created": "January 13, 2018 04:17"
}

Adapted from The Best Regex Trick.

A: I changed the regex a bit to /'.*?'/g so it selects anything inside of quotes, and then we just do a replacement on that to find all commas and replace them with semicolons.

var str = "type: 'click', category: 'REFRESH_DOOR', desc: 'clicked refresh from door 0124', site: 'mysite', pathname: '/load_areas/all/doors', params: '?sort_by=code&layout=view_by_4', time: '1515838628166', mobile: 'false', bp: 'xlarge', size: '[1920, 935]', area: 'all', sid: '15158225889', facility: 'MMMM', IP Address: 'XXX.XXX.XXX.XXX', created: 'January 13, 2018 04:17'";

//Select all quoted strings...
var replacedCommas = str.replace(/'.*?'/g, function(match){
  //Now replace any commas found in each match with semicolons
  return match.replace(/,/g, ';');
});

console.log(replacedCommas);


text:
Q: How do I cast Widget to Label in Haskell's GI-Gtk? I have this sample code where I have a ListBox containing ListBoxRows, which in turn contain a Label. When I click on the ListBox, I get a ListBoxRow. So far so good. The problems start when I want to interact with the ListBoxRows children.
I have used this function to get the Label, which is the child of the ListBoxRow.
https://hackage.haskell.org/package/gi-gtk-3.0.18/docs/GI-Gtk-Objects-Container.html#g:13
However, the returned type is Widget. How do I convert the type of the object? Function widgetGetName tells me it is a label, but the Haskell Type system insists it is a Widget, so I can not use label specific functions.
working code
  _ <- onListBoxRowSelected listbox2 (\(Just r) -> do
                                         cc <- containerGetChildren r
                                         mlabel <- castTo Label (head cc)
                                         case mlabel of
                                           Nothing -> putStrLn "Not a label!"
                                           Just label -> (labelGetText label) >>= putStrLn . unpack)

Thanks to Dan

A: Try this:
cc <- containerGetChildren r
mlabel <- castTo Label (head cc)
case mlabel of
  Nothing -> putStrLn "Not a label!"
  Just label -> labelGetText label >>= putStrLn


text:
Q: How can I calculate this integral I solve integral considerable number, but the following integral I could not solve.  It is about this integral:
$$
\int\frac{\ln^2(a+bx)dx}{x^n}
$$
I want to make the solution through partial method: $\int udv=uv-\int vdu$
I've solved the integral $$\int\frac{\ln(a+bx)dx}{x^n}$$.
Please help, thank you for your help preliminarily

A: This is just an (failed) attempt to find a reduction formula, and as @mtiano noted, the close form requires some hypergeometric functions. Let
$$\begin{align}
u =& \frac{\ln(a+bx)}{x^n} \\
du =& \frac{\frac{bx^n}{a+bx}-n x^{n-1}\ln(a+bx)}{x^{2n}}dx
 = \left[ \frac{b}{x^n(a+bx)}-\frac{n\ln(a+bx)}{x^{n+1}}\right]dx\\
dv =& \ln(a+bx) dx \\
v =& \frac{(a+bx)\ln(a+bx)}{b}-x
\end{align}$$
Also let (since OP has solved it)
$$I_n(x)=\int\frac{\ln(a+bx)dx}{x^n}$$
$$\begin{align}
J_n(x)=&\int\frac{\ln^2(a+bx)dx}{x^n}\\
=& \int\frac{\ln(a+bx)}{x^n}\ln(a+bx)dx\\
=& \frac{\ln(a+bx)}{x^n} \cdot \left[ \frac{(a+bx)\ln(a+bx)}{b}-x \right]- \\
 & \int{\left[ \frac{(a+bx)\ln(a+bx)}{b}-x\right] \left[\frac{b}{x^n(a+bx)}-\frac{n\ln(a+bx)}{x^{n+1}}\right]dx}\\
=& \frac{(a+bx)\ln^2(a+bx)}{bx^n}-\frac{\ln(a+bx)}{x^{n-1}} -\\
 & \int \left[ \frac{\ln(a+bx)}{x^n} - \frac{b}{x^{n-1}(a+bx)}- \frac{n(a+bx)\ln^2(a+bx)}{bx^{n+1}} +\frac{n\ln(a+bx)}{x^{n}}\right]dx \\
=& \frac{(a+bx)\ln^2(a+bx)}{bx^n}-\frac{\ln(a+bx)}{x^{n-1}} - (n+1) I_n(x) +\frac{na}{b} J_{n+1}(x) + nJ_n(x) +\\
 &  \int\frac{b\,dx}{x^{n-1}(a+bx)}\\
=& \frac{(a+bx)\ln^2(a+bx)}{bx^n}-\frac{\ln(a+bx)}{x^{n-1}} - (n+1) I_n(x) +\frac{na}{b} J_{n+1}(x) + nJ_n(x) +\\
 & \left(-\frac{b}{a}\right)^{n-1} \int \frac{b\,dx}{a+bx}
 - \sum_{k=1}^{n-1} \left(-\frac{b}{a}\right)^{n-k}\int\frac{dx}{x^k} &\text{(1)}\\
=& \frac{(a+bx)\ln^2(a+bx)}{bx^n}-\frac{\ln(a+bx)}{x^{n-1}} - (n+1) I_n(x) +\frac{na}{b} J_{n+1}(x) + nJ_n(x) +\\
 & \left(-\frac{b}{a}\right)^{n-1} \ln(a+bx) -\left(-\frac{b}{a}\right)^{n-1} \ln x - \sum_{k=2}^{n-1} \left(-\frac{b}{a}\right)^{n-k}\frac{1}{(-k+1)x^{k-1}} &\text{(2)}\\
\end{align}$$
Notice, for line $\text{(1)}$, the final summation term exists only for $n \ge 2$. For line $\text{(2)}$, the second last term (involving $\ln x$) exists only for $n \ge 2$, and the final summation term exists only for $n \ge 3$.
Making $J_{n+1}(x)$ the main term,
$$\begin{align}
-\frac{na}{b} J_{n+1}(x)=& \frac{(a+bx)\ln^2(a+bx)}{bx^n}-\frac{\ln(a+bx)}{x^{n-1}} - (n+1) I_n(x) + (n-1)J_n(x) +\\
 & \left(-\frac{b}{a}\right)^{n-1} \ln(a+bx) -\left(-\frac{b}{a}\right)^{n-1} \ln x - \sum_{k=2}^{n-1} \left(-\frac{b}{a}\right)^{n-k}\frac{1}{(-k+1)x^{k-1}}\\
J_{n+1}(x)=& -\frac{(a+bx)\ln^2(a+bx)}{nax^n}+\frac{b\ln(a+bx)}{nax^{n-1}} + \frac{b(n+1)}{na} I_n(x) - \frac{b(n-1)}{na}J_n(x) +\\
 & \left(-\frac{b}{a}\right)^{n} \frac{\ln(a+bx)}{n}  -\left(-\frac{b}{a}\right)^{n} \frac{\ln x}{n} - \frac{1}{n}\sum_{k=2}^{n-1} \left(-\frac{b}{a}\right)^{n-k+1}\frac{1}{(-k+1)x^{k-1}}\\
\end{align}$$
This gives a reduction formula for $J_{n+1}(x)$ for $n = 1, 2, 3, \ldots$. Same as above, the second last term (involving $\ln x$) exists only for $n \ge 2$, and the final summation term exists only for $n \ge 3$. Lastly, I could not solve the base case
$$J_1(x) = \int \frac{\ln^2 (a + bx)dx}{x}$$
yet, and reading from WolframAlpha the solution requires polylogarithm function.


text:
Q: Does Windows 10 "hibernate after sleep" wake the machine before hibernating? In Windows 10, it is set as
 Turn off the display/screensaver: Never
 Sleep after: 10 minutes
 Hibernate after: 30 minutes

At 0:10, the PC sleeps, and the screen goes blank
What happens at 0:30?
does it

*

*fully wake up (login screen shows up) and then hibernates

*hibernates directly from sleep (computer appears to be shut down, screen remains blank)

*remains in sleep mode and disregards hibernate

A: It cannot "hibernate from sleep". It has to wake up and write the memory contents to disk. Of course, it doesn't have to activate the screen to do so.
When it's time to hibernate, you can find the following event in the System log:

The system has returned from a low power state.
Sleep Time: 2017-01-20T18:38:20.615607200Z
  Wake Time: 2017-01-20T18:38:20.608105500Z
Wake Source: S4 Doze to Hibernate

A few seconds later, it will start the hibernation process:

The system is entering sleep.
Sleep Reason: Hibernate from Sleep - Fixed Timeout

I'd guess the screen isn't activated for this, but I haven't actually observed it.


text:
Q: Jenkins Creates Random Folders In Workspace I have a windows Jenkins server, and in some jobs, Jenkins is creating random folders in the ws@script folder and puts the checked-out repo inside of them. This skews jobs as I am unable to target files in the repo's folder.
If I delete the folder, it gets generated using a different name in the next checkout. I found a few articles online but they are all old and not relevant anymore.
example: ProjectName\ws@script\e5a1a87afa81141b22dc42f9e6af441b7f7353d397659b1911e6e150675b9e34\checkedOutRepo
It will be great if anyone can help with this.


text:
Q: Problema de salto de linea powershell 5 Tengo esta línea, la cual me escribe en un archivo de texto, el problema es que me sobrescribe la misma línea, y yo quiero que me ponga todo línea por línea.
1..100 | % { $ping.send("10.1.5.$_") | select address, status, name | Write-Output > archivo.txt}

A: Lo primero es quitar el Write-Output del foreach, porque al filtrar en el pipeline con un select, cada entrada que quieras registrar se va a guardar como una tabla individual (encabezados y datos), para que puedas registrar mejor el resultado tendrías que hacer lo siguiente:
1..100 | % { $ping.send("10.1.5.$_") | select address, status, name}  | Write-Output > archivo.txt

Y así tendrías en el archivo algo como esto:
address      status   name
-------      ------   ----
10.1.5.1      xxxx     xxx
10.1.5.2      xxxx     xxx
10.1.5.3      xxxx     xxx


text:
Q: Группировка в регулярных выражениях java Подскажите. Есть код с сайта.
Почему m.group(1) выдает Найдено значение: Крещение Руси произошло в 98
Почему m.group(2) выдает Найдено значение: 8
 import java.util.regex.Matcher;
import java.util.regex.Pattern;

public class k4 {

   public static void main( String args[] ) {
  // Строка для сканирования, чтобы найти шаблон
  String str = "Крещение Руси произошло в 988 году! Не так ли?";
  String pattern = "(.*)(\\d+)(.*)";

  // Создание Pattern объекта
  Pattern r = Pattern.compile(pattern);

  // Создание matcher объекта

  Matcher m = r.matcher(str);
  if (m.find( )) {
     System.out.println("Найдено значение: " + m.group(0));
     System.out.println("Найдено значение: " + m.group(1));
     System.out.println("Найдено значение: " + m.group(2));
  }else {
     System.out.println("НЕ СОВПАДАЕТ");
  }

}
}

A: Давайте разберём данное регулярное выражение :
В интерпретаторе regex джавы пишут \\ вместо \ (как в большинстве языков), я разбиру как в большинстве.
(.*)(\d+)(.*)

. - любой символ | .* - строка из любых символов кроме \n, количество от 0 до бесконечности (жадный отбор строки).
(.*) - скобочки делают из внутреннего выражения группу, т.е. тот участок строки соответствующий подскобочному выражению в match выделится в отдельную группу.
\d - цифра, \d+ - строка из любых цифр, количество от 1 до бесконечности
(\d+) - группа состоящая только из цифр.
А теперь разберём, что мы имеем для (.*)(\d+)(.*):

Крещение Руси произошло в 988 году! Не так ли?

Сначало выражение жадно читает абсолютно все символы, коих может быть от 0 до беск. После этой части  у нас должны быть цифры, коих есть от 1 до беск. и опять символы тупо до конца строки, которые сформируют 3 группу. Учитывая, что первая группа жадная, то она решает, что после неё как минимум должна идти одна цифра, она как истинная жадина забирает всё, что плохо лежит, т.е. 98 и оставляет 1 восьмёрку для 2 группы.
Противоположность жадности - лень (лень забирать, что-нибудь). 1 группа знает, что 2 группа начинается с цифр и встретив их она ленится идти дальше и передаёт бразды правления 2 группе.
Т.е. правильная запись регулярки (.*?)(\d+)(.*).
? - указатель, что набирание элементов ленивое.


text:
Q: Simple JS Refresh Div Not Working I've found a simple JS script that should refresh a div every 1000 milliseconds however it is not working, any help is appreciated.
Here's the script:
window.setInterval("refreshDiv()", 1000);
function refreshDiv(){
    document.getElementById("timer").innerHTML;
}

Here's the div:

    <div class="progress-bar" style="width:
    <?php
        echo (Pot::getTime(1) * 100) / 120;
    ?>%">

The script is within a file called script.js and is loaded at the bottom of the page like so:

Thank you in advance for any responses :-)

A: From the code you've provided it looks like you're not doing anything with the div when refreshDiv is called. If you are trying to change the text with innerHTML it needs to be something like document.getElementById("timer").innerHTML = 'something'
This javascript should work:
window.setInterval(refreshDiv, 1000);
function refreshDiv(){
    document.getElementById("timer").innerHTML = 'example';
}

Note: using no quotes with just the function name in setInterval like refreshDiv instead of "refreshDiv()" is the recommended way.

A: Remove the quotes:
window.setInterval(refreshDiv, 1000);

setInterval expects to get a function, not a string.


text:
Q: Maximizing linear functional. When is the maximum unique Let $F$ be a linear functional over some convex, compact, and closed set $S$ subset of a vector space $X$.
Suppose we want to solve:
\begin{align}
\max_{x \in S} F(x)
\end{align}
I know that the maximum occurs at one of the extreme points of set $S$.
My question:

*

*Under what condition can we claim that the maximum is unique?

*Is it true that the maximum is unique if and only if $F(x)$ is non-constant?

*Are extreme points the only maximizers (if it is not constant)?

A: You can have a non-unique maximum even if $F(x)$ is not constant.  An illustrative example: let $S=[0,1]^2$ and $F(x_1,x_2)=x_1$.  While $F$ is not constant in $S$, it is constant along part of $\partial S$.  This will give you the proper necessary and sufficient condition for uniqueness.

A: *

*If the maximum occurs at only one of the extreme points.

*No.  Consider a triangle in the plane with vertices $[0,0], [1,0], [1,1]$ and $F([x,y]) = x$.

*No.  Convex combinations of maximizers are also maximizers.


text:
Q: Nested objects and ng-models in Angular-JS I am looking for solution for a problem which might not exist the way I am trying to do it. So if anyone can help me with the best way of doing this.
ISSUE:
I have the following input field:
 <input type="text" placeholder="quote" ng-model="person.quotes.quote">
 <input type="text" placeholder="author" ng-model="person.author">
 <input type="text" placeholder="category" ng-model="person.category">

And I have the following object:
$scope.person = {
author: $scope.author,
category: $scope.category,
quotes: [{quote: $scope.quote}]
};

I am trying to get the value person.quote into the array of quotes. But I can't seem to do it.
REASON:
The reason why I am doing this is that when a user fills the input fields and clicks on a button the values are saved into the $scope.person object. And that I push that entire object to my firebase API. I want to maintain the structure of my $scope.person object as I have described in my javascript the same in my firebase API. I can easily push author and category but the nested quotes objects are not being pushed.
THE ERROR I GET:
Error: Firebase.set failed: First argument contains undefined in property 'quotes.0.quote'
Thanks in advance and if this information is not enough please let me know so i can provide with more information.

A: the property quotes from object person is array.
ng-model="person.quotes[0].quote"


text:
Q: On the sum of Double Power Series $\sum\limits_{-\infty}^{+\infty}\space\frac{2^n}{{x}^{2^n}+1}$
Let $\,{x\in\mathbb{C}}\,$, show that:
  $$ S_{\small-}=\sum_{n=1}^{\infty}\space\frac{2^{-n}}{{x}^{2^{-n}}+1}\,=\frac{1}{\log{x}}-\frac{1}{x-1}\qquad\qquad\qquad\tag{1} $$
  $$ S_{\small+}=\sum_{n=0}^{\infty}\space\frac{2^{+n}}{{x}^{2^{+n}}+1}\,=\frac{1}{x-1}\qquad\qquad\qquad\qquad\qquad\tag{2} $$
  $$ S\,\,=\sum_{-\infty}^{+\infty}\space\frac{2^n}{\,{x}^{2^n}\,\,\,+1}\,=S_{\small-}+S_{\small+}=\frac{1}{\log{x}}\qquad\qquad\qquad\tag{3} $$
  And find the convergence range of each sum.

In a similar question, the OP start by introducing $\,{(2)}\,$ as a known identity, and gives a turly remarkable proof in the comment:
$$ \sum_{n=0}^m\log{(x^{2^n}+y^{2^n})} =\log{\prod_{n=0}^m(x^{2^n}+y^{2^n})} =\log{\frac{(x-y)}{x-y}\prod_{n=0}^m(x^{2^n}+y^{2^n})} =\log{\frac{x^{2^{m+1}}-y^{2^{m+1}}}{x-y}} $$
Then differentiate with respect to ${y}$, substitute ${y=1}$, and limit $\,{m\to\infty}\,$ give the result.

Could this approach work to proof $\,{(1)}\,$? notice for ${x=1}$:
$$ S_{\small-}=\sum_{n=1}^{\infty}\frac{1}{2^{n+1}}\,=\frac{1}{2} \qquad=\qquad \lim_{\small x\to1}\left[\frac{1}{\log{x}}-\frac{1}{x-1}\right]=\frac{1}{2} $$
New alternative methods are highly welcomed. Thanks.


text:
Q: How to throw an error if markdown editor left empty in the form? I have used a markdown editor in my angular HTML file form as follows:
        <td-text-editor class="full-width" formControlName="description"></td-text-editor>

In the form, if we leave the description empty, it should throw up an error. Any inputs?

A: Just add a required validator to your formControl then you can show the errors for that formControl on your template
this.myform = new FormGroup({
'description': new FormControl(this.hero.power, Validators.required)
});

On your template
<input id="name" class="form-control"
      formControlName="description" required >

<div *ngIf="description.invalid && (description.dirty || description.touched)"
    class="alert alert-danger">

  <div *ngIf="name.errors.required">
    Description is required.
  </div>


text:
Q: Ajax: load content from post I clicked Why this load whole page HTML, not selected post content?
FUNCTIONS.PHP
function my_action_callback() {
    wp_localize_script('main_js', 'ajax_custom', array(
       'ajaxurl' => admin_url('admin-ajax.php')
    ));
}
add_action( 'wp_enqueue_scripts', 'my_action_callback' );

function my_php_function_name() {
    $the_post_id = $_POST['post_id'];
    $args = array(
        'post_type' => 'offer',
        'post_status' => 'publish',
        'p' => $the_post_id
    );
    global $post;
    $the_query = new WP_Query($args);
    if ($the_query->have_posts()) {
        while ($the_query->have_posts()) { $the_query->the_post();
            the_content();
        } wp_reset_postdata();
    }
}

MAIN.JS
$(".offer .item").click(function () {
    var post_id = $(this).attr("data-id")
    $("#post-container").html("content loading");
    $.ajax({
        url: ajax_custom.ajax_url,
        type: 'post',
        data: {
            action: 'my_php_function_name',
            post_id: post_id
        },
        success: function (data) {
            console.log(data);
            jQuery('#post-container').html(data);
        }
    });
    return false;
});

A: If all you want is the content of one post:
$post   = get_post( $id );

$output =  apply_filters( 'the_content', $post->post_content );

ob_clean();

echo $output;

die();


text:
Q: Implementation of prefix operator i have 2d vector for my hashtable
std::vector<std::vector<std::string> > htable;

and class for iterator.
class myiterator{
    public:
        myiterator();
        myiterator(std::vector<std::vector<std::string> >& v, int ii, int jj) :
            vec(v), i(ii), j(jj) {}
        myiterator& operator++(); // prefix operator
        myiterator& operator--(); // prefix operator
        std::string* operator->();
    private:
        std::vector<std::vector<std::string> >& vec; // the vector we are iterating over
        int i; // the position in the vector (first dimension)
        int j; // the position in the vector (second dimension)
    };
    myiterator begin() {
        int start=0;
        while(htable[start].size()==0){
            start++;
        }
        return (myiterator(htable, start, 0));
    }
    myiterator end(){
        int end=htable.size()-1;
        while(htable[end].size()==0){
            end--;
        }
        return (myiterator(htable, end, htable[end].size()-1));
    }

I've implemented begin and end for iterator, but i have no idea how and what to do with prefix operator. Also, i couldn't google what operator "->" is?
So, please, can you give me a little trick or article about implementation prefix iterators for 2d vectors? Thanks in advance.

A: operator-> is a dereferencing operator.  It allows you to write it->myFunc() (that is, allowing an iterator to behave like a pointer).  Typically, you'll return the type your iterator is pointing to.
Your prefix operators (operator++ and operator--) should move the iterator to the next, and previous elements, respectively.
As a side note, if you are overloading operator->, you should also overload operator*(), and you will probably want to also overload the post-fix operators myiterator operator--(int), and myiterator operator++(int).

A: When you increment your iterator, you basically do the same thing as what you did for begin().
if ( j == htable[i].size() - 1 )  // j is at the end of the inner vector
  // set j to zero
  // increment i until htable[i] is not the end of the outer vector and is not empty
else
  // increment j

As a side, I would recommend using vector's iterators in place of i and j.  For example:
class MyIterator
{
  std::vector< std::vector< std::string > >::iterator i;
  std::vector< std::string >::iterator j;

  // ...
}

MyIterator begin()
{
  std::vector< std::vector< std::string > >::iterator o_iter = htable.begin();
  while ( o_iter != htable.end() && o_iter->empty() )
    ++o_iter;

  // assuming htable wasn't empty...
  return MyIterator( htable, o_iter, o_iter->begin() );
}


text:
Q: Как работает background-size:cover пол дня читаю про значение свойства background-size:cover. Вроде бы в голове отложилась мысль, что оно фон делает по длине и ширине блока, сохраняя пропорции, и если пропорции как то не получаются, то картинка урезанной получается. Но эта ничего не дает мне на практике такая трактовка.  Может я не так понял , потому что я понятие не имею как с таким определением в реальной верстки это использовать?

A: Вот сравните:

.container {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    grid-gap: 10px;
    width: 1020px;
}

.block {
  margin: 5px;
  width: 500px;
  height: 200px;
  border: 2px solid gray;
  background: url(https://i.stack.imgur.com/qQoD4.jpg) no-repeat;
}

.block_one {
  background-size: auto;
}

.block_two {
  background-size: cover;
}

.block_three {
  background-size: contain;
}

.block_for {
  background-size: 100% 100%;
}

background-size: auto;

background-size: cover;

background-size: contain;

background-size: 100% 100%;


text:
Q: What happen when we parallel or series ferrite bead? If I use ferrite with capacitor as pi network. What happen when I series or parallel the ferrite bead? Which one reject emi better?
I known the ferrite bead is not inductance. It act like resistor at high frequency why dissipate energy as heat.
But think about series and parallel really confuse me.

A: If you parallel two the same then the impedance (complex number) will be half, and if you put two the same in series then it will double. The DC current capacity should be higher with two in parallel (ideally it would be doubled, but that may not be a safe assumption in practice).
Ferrite beads are inductive at lower frequencies, and capacitive at very high frequencies. It's possible that using a combination of two different types might be preferable in some particular situation. I can't recall seeing that used in practice.
Anyway, in a pi circuit (2 caps to ground and one series ferrite bead), two beads in series will increase the attenuation.