text:
Q: Erlang and Big Numbers I am trying to store pi to about 200 decimal places, erlang concats it to about 15 digits, how can I keep the original and have it used in further calculations?
1> P = 3.141592653589793238462643383279502884197169399375105820974944592307816406286208998628034825342117067982148086513
282306647093844609550582231725359408128481117450284102701938521105559644622948954930381964428810975665933446128475648233
786783165271201909145648566923460348610454326648213393607260249141273724587006606315588174881520920962829254091715364367
892590360011330530548820466521384146951941511609433057270365759591953092186117381932611793105118548074462379962749567351
885752724891227938183011949129833673362440656643086021394946395224737190702179860943702770539217176293176752384674818467
669405132000568127145263560827785771342757789609173637178721468440901224953430146549585371050792279689258923542019956112
129021960864034418159813629774771309960518707211349999998372978049951059731732816096318595024459455346908302642522308253
344685035261931188171010003137838752886587533208381420617177669147303598253490428755468731159562863882353787593751957781
857780532171226806613001927876611195909216420198938095257201065485863278865936153381827968230301952035301852968995773622
599413891249721775283479131515574857242454150695950829533116861727855889075098381754637464939319255060400927701671139009
848824012858361603563707660104710181942955596198946767837449448255379774726847104047534646208046684259069491293313677028
989152104752162056966024058038150193511253382430035587640247496473263914199272604269922796782354781636009341721641219924
586315030286182974555706749838505494588586926995690927210797509302955321165344987202755960236480665499119881834797753566
369807426542527862551818417574672890977772793800081647060016145249192173217214772350141441973568548161361157352552133475
741849468438523323907394143334547762416862518983569485562099219222184272550254256887671790494601653466804988627232791786
0857843838279679766814541009538837863609506800642251252051173929848960841284886.
3.141592653589793
2> P.
3.141592653589793

A: While Erlang has arbirary big integers, floating point numbers are represented as IEEE 754 doubles.  There is no built-in floating point type with arbitrary precision in Erlang.
If you need floating calculations with arbitrary precision you usually have to resort to languages like Mathematica or MAPLE.
You could build your own arbitrary precision floats in Erlang quite easily however by storing them as tuples of two integers – one for the fraction and one for the exponent.  You then have to write your own arithmetic functions and can't use the normal operators.


text:
Q: SAS - Loop for variable and compare dates from different entries? I'm very new to SAS, trying to learn everything I need for my analytical task. The task I have now is to create a flag for the ongoing application. I think it might be easier to show it in a table, just to illustrate my problem:enter image description here
[Update 2017.10.27] data sample in code, big thanks to Richard :)
   data sample;
    input PeopleID ApplicationID Applied_date yymmdd10. Decision_date yymmdd10. Ongoing_flag_wanted;
format Applied_date Decision_date yymmdd10.;
datalines;
1 6 2017.10.1 2017.10.1 1
1 5 2017.10.1 2017.10.4 0
1 3 2017.9.28 2017.9.29 1
1 2 2017.9.26 2017.9.26 1
1 1 2017.9.25 2017.9.30 0
2 8 2017.10.7 2017.10.7 1
2 7 2017.10.2 .         0
3 4 2017.9.30 2017.10.3 0
run;

In the system, people apply for the service. When a person does that, he gets a PeopleID, which does not change when the person applies again. And also each application gets an applicationID, which is unique and later applications have larger applicationID. What I want is to create an Ongoing flag for each application. The propose is to show that: by the time this application came in, the same person has or does not have an ongoing application (application which has not received a decision). See some examples from the table above:
Person#2 has two applications #8 and #7, by the time he applied #8, #7 has not been decided, therefore #8 should get ongoing flag.
Person#1 applied multiple times. Application #3 and #2 have ongoing application due to App#1. Application #6 and #5 came in at the same date, but according to application ID, we can tell that #6 came in later than #5, and as #5 have not been decided by then, #6 gets ongoing flag.
As you might notice, application with a positive ongoing flag always receives decisions on the same date as it came in. That is because applications with ongoing cases are automatically declined. However, I cannot use this as an indicator: there are many other reasons that trigger an automatic decline.
The ongoing_flag is what I want to create in my dataset. I have tried to sort by 1.peopleID, 2.descending applicationID, 3. descending applied_date, so my entire dataset looks like the small example table above. But then I don't know how to make SAS compare within the same variable (peopleID) but different lines (applicationID) and columns (compare Applied_date with Decision_date). I want to compare, for each person, every application's applied_date with all the previous applications' decision_date, such that I can tell by the time this application came in, whether or not there is an ongoing application from previously in the system.
I know I used too many words to explain my problem. For those who read through, thank you for reading! For those who have any idea on what might be a good approach, please leave your comments! Millions of thanks!

A: Min:
For problems of this type you want to mentally break the data structure into different parts.
BY GROUP
The variables whose unique combination defines the group.  There are one or more rows in a group.  Let's call them items.
GROUP DETAILS
Variables that are observational in nature.  They may be numbers such as temperature, weight or dollars, or, characters or strings that represent some state being tracked.  The details (at the state you are working) themselves might be aggregates for a deeper level of detail.
GOAL
Compute additional variables that further elucidate an aspect of the details over the group.  For numeric the goal might be statistical such as MIN, MAX, MEAN, MEDIAN, RANGE, etc.  Or it might be identificational such as which ID had
highest $, or which name was longest, or any other business rule.
Your specific problem is one of determining claim activity on a given date.  I think of it as a coverage type of problem because the dates in question cover a range.  The BY GROUP is person and an 'Activity' date.
Here is one data-centric approach.  The original data is expanded to have one row per date from applied to decided.  Then simple BY group processing and the automatic first. are used to determine if an application is during one as yet undecided.
data have;
input PeopleID ApplicationID Applied_date yymmdd10. Decision_date yymmdd10. Ongoing_flag_wanted;
format Applied_date Decision_date yymmdd10.;
datalines;
1 6 2017.10.1 2017.10.1 1
1 5 2017.10.1 2017.10.4 0
1 3 2017.9.28 2017.9.29 1
1 2 2017.9.26 2017.9.26 1
1 1 2017.9.25 2017.9.30 0
2 8 2017.10.7 2017.10.7 1
2 7 2017.10.2 .         0
3 4 2017.9.30 2017.10.3 0
run;

data coverage;
  do _n_ = 1 by 1 until (last.PeopleID);
    set have;
    by PeopleID;
    if Decision_date > Max_date then Max_date = Decision_date;
  end;

  put 'NOTE: ' PeopleID= Max_date= yymmdd10.;

  do _n_ = 1 to _n_;
    set have;
    do Activity_date = Applied_date to ifn(missing(Decision_date),Max_date,Decision_date);
      if missing(Decision_date) then Decision_date = Max_date;
      output;
    end;
  end;

  keep PeopleID ApplicationID Applied_date Decision_date Activity_date;
  format Activity_date yymmdd10.;
run;

proc sort data=coverage;
  by PeopleID Activity_date ApplicationID ;
run;

data overlap;
  set coverage;
  by PeopleID Activity_date;

  Ongoing_flag = not (first.Activity_date);

  if Activity_date = Applied_date then
    output;
run;

proc sort data=overlap;
  by PeopleID descending ApplicationID ;
run;

Other approaches could involve arrays, hashes, or SQL.  SQL is very different from DATA Step code and some consider it to be more clear.
proc sql;
  create table want as
  select
    PeopleID, ApplicationID, Applied_date, Decision_date
  , case
      when exists (
        select * from have as inner
        where inner.PeopleID = outer.PeopleID
          and inner.ApplicationID < outer.ApplicationID
          and
            case
              when inner.Decision_date is null and outer.Decision_date is null then 1
              when inner.Decision_date is null then 1
              when outer.Decision_date is null then 0
              else outer.Decision_date < inner.Decision_date
            end
      )
      then 1
      else 0
    end as Ongoing_flag
  from have as outer
  ;

redpajama_set_name: RedPajamaStackExchange


text:
Q: Does Julia have a ternary conditional operator? Python, Java and Scala have ternary operators. What is the equivalent in Julia?

A: You may be referring to this.
a = true
b = 1
c = 2

julia>a ? b : c
1

a = false

julia>a ? b : c
2

A: For inline use, a ? b : c exists, as mentioned by the previous answer. However it is worth noting that if-else-end in Julia works just like (if cond expr1 expr2) in most Lisp dialects which acts both as the if-clause and as the ternary operator. As such, if-then-else returns the return value of the expression that gets executed.
Meaning that you can write things like
function abs(x)
    if x > 0
        x
    else
        -x
    end
end

and this will return what you want. You do not have to use a return statement to break the function block, you just return the value returned by the if-block.
Inline, you can write
if (x > 0) x else -x end

which will return the same thing as the ternary operator expression (x > 0) ? x : -x , but has the benefit of avoiding perl-ish ?: symbols and is generally more readable, but less chainable.
Most languages have a ternary operator separate from if-then-else because if clauses are statements, while in lisp-like languages they are expressions just like everything else and have a return value.

A: Yes! Julia has a ternary operator. Here is a quick example from the Julia documentation:
The so-called "ternary operator", ?:, is closely related to the if-elseif-else syntax, but it is used where a conditional choice between single expression values is required, as opposed to conditional execution of longer blocks of code. It gets its name from being the only operator in most languages taking three operands:
a ? b : c
The expression a, before the ?, is a condition expression, and the ternary operation evaluates the expression b, before the :, if the condition a is true or the expression c, after the :, if it is false. Note that the spaces around ? and : are mandatory: an expression like a?b:c is not a valid ternary expression (but a newline is acceptable after both the ? and the :).
The easiest way to understand this behavior is to see an example. In the previous example, the println call is shared by all three branches: the only real choice is which literal string to print. This could be written more concisely using the ternary operator. For the sake of clarity, let's try a two-way version first:
julia> x = 1; y = 2;

julia> println(x < y ? "less than" : "not less than")
less than

julia> x = 1; y = 0;

julia> println(x < y ? "less than" : "not less than")
not less than


text:
Q: If group G is generated by a subset of commutative elements in G is abelian
Let G be a group that is generated by a subset $A$ where each element in $A$ is commutative to the other. As in, $\forall a,b\in A\colon ab=ba$. Prove that $G$ is abelian.

How can one approach this question?
I tried defining $C_A = \{\,x \in G \mid \forall z \in A\colon xz=zx\, \}$, then trying to prove that $C_A$ is a group and thus $C_A=G$ so every element in $G$ is commutative to all elements in $A$ but I am not sure that $C_A$ is a group as I could not prove it.

A: Good idea. So is $C_A$ a group?

*

*$C_A$ is not empty because $1\in C_A$ (I was tempted to write "because $A\subseteq C_A$", nbut $A$ may be empty!)

*$x\in C_A$ implies $x^{-1}\in C_A$: Indeed for $z\in A$ we have $xz=za$ and hence $zx^{-1}=x^{-1}z$.

*If $x,y\in C_A$ then $xy\in C_A$: Indeed, if $z\in A$ then $xyz=xzy=zxy$.

Hence $C_A$ is indeed a subgroup of $G$ and also contains $A$, hence equals $G$.

A: Every element of $G$ has the form $a_1a_2a_3\cdots a_n$ where $a_i\in A$.
It's easy to see that under your assumption,
$$(a_1a_2\cdots a_n)\cdot (a_1'a_2'\cdots a_n') = (a_1'a_2'\cdots a_n')\cdot (a_1a_2\cdots a_n)$$
(Your assumption lets you freely move the $a_i,a_i'$ around however you wish.)


text:
Q: Field not adding to a Mongodb document I am trying to add a new field to a document in a collection in a mongodb database using python. However, I am unable to add the field. Here is my code: -
mng_client = pymongo.MongoClient('localhost', 27017) #Connecting to mongo
mng_db = mng_client['Test'] #Database
collection_name = mng_db["Practice"] #Collection
mng_db.collection_name.update_one({}, {"$set":{'Name' : 'Ron'}}, False, True)

If I set the upsert as true, then a new collection is created in the database. However, if the upsert is false then nothing happens to the existing document. Could someone help me understand what mistake I am making in my code? I apologise in advance if my problem is trivial since I have never using mongodb before.
Edit: Fixed the code a bit


text:
Q: How to connect to a Azure File Store from a .NET Core 3.1 console app in VS2019 I have the task of making a .NET Core 3.1 console app that will run in a linux docker container on the AWS platform, connect to a Azure File Store to read and write files.  I have am a C# programmer but have not had anything to do with the world of containers or Azure as yet.
I have received a Azure connection string in the following format:
DefaultEndpointsProtocol=https;AccountName=[ACCOUNT_NAME_HERE];AccountKey=[ACCOUNT_KEY_HERE];EndpointSuffix=core.windows.net
But following the examples I have seen online like this:
https://learn.microsoft.com/en-us/visualstudio/azure/vs-azure-tools-connected-services-storage?view=vs-2019

*

*Right click on project in VS2019 and add Connected Service.

*Select Azure Storage from the list.

*Connect to you Azure Storage account

For step 3 you need to use an Azure Account login email/pass.
I don't have that, I just have a connection string.
I have found examples like the following:
http://www.mattruma.com/adventures-with-azure-storage-accessing-a-file-with-a-shared-access-signature/
https://www.c-sharpcorner.com/article/implement-azure-file-storage-using-asp-net-core-console-application/
But these both use:
Microsoft.Azure.Storage.Common
and under dependencies it has .NET Standard and .NET Framework.  I don't think these will run in the linux docker container.  Once I have worked out docker containers work I will do a test to confirm this.
Can anyone shed some light on how I can, from a .NET Core 3.1 console app running in a linux docker container on the AWS platform, connect to a Azure File Store to read and write files using the Azure connection string format outlined above?

A: If you focus on how to add service dependencies in Connected Service, then if you don't have the  Azure Account login email/pass you can not add the service.
From your description, seems you just want to read and write files from files share of storage using C# console app. So you don't need to add service of project, just add the code in your console app is ok.
This is a simple code:
using System;
using System.IO;
using System.Text;
using Azure;
using Azure.Storage.Files.Shares;

namespace ConsoleApp4
{
    class Program
    {
        static void Main(string[] args)
        {
            string con_str = "DefaultEndpointsProtocol=https;AccountName=0730bowmanwindow;AccountKey=xxxxxx;EndpointSuffix=core.windows.net";
            string sharename = "test";
            string filename = "test.txt";
            string directoryname = "testdirectory";

            ShareServiceClient shareserviceclient = new ShareServiceClient(con_str);
            ShareClient shareclient = shareserviceclient.GetShareClient(sharename);
            ShareDirectoryClient sharedirectoryclient = shareclient.GetDirectoryClient(directoryname);

            //write data.
            ShareFileClient sharefileclient_in = sharedirectoryclient.CreateFile(filename,1000);
            string filecontent_in = "This is the content of the file.";
            byte[] byteArray = Encoding.UTF8.GetBytes(filecontent_in);
            MemoryStream stream1 = new MemoryStream(byteArray);
            stream1.Position = 0;
            sharefileclient_in.Upload(stream1);

            //read data.
            ShareFileClient sharefileclient_out = sharedirectoryclient.GetFileClient(filename);
            Stream stream2 = sharefileclient_out.Download().Value.Content;
            StreamReader reader = new StreamReader(stream2);
            string filecontent_out = reader.ReadToEnd();

            Console.WriteLine(filecontent_out);
        }
    }
}


text:
Q: openidconnect.server, third party providers & redirection I'm currently building my an openid connect server using https://github.com/aspnet-contrib/AspNet.Security.OpenIdConnect.Server and asp.net core identity as a backing store. I'm aware of the protocols, the flows and the security holes.
The current setup is as follows:
[server] - the authorization server & resource server
[front-end] - an angularJS application
[third-party-provider] - Google
[external-app] - a second application which want to use a token from [server]
Both the [front-end] and the [external-app] are registered as clients for the [server]. So, they are allowed to retrieve tokens. The login page is build in the [front-end].
Keep in mind, that the login page etc is shown by the [front-end] application (instead of returning a AuthView from the AccountController)
Imagine i'd want to login with the [external-app] to get an identity from [server]. The login page is shown by [front-end]. Then the flow will be the following:
1. [external-app] -> http://[server]/account/authorize?client_id=[external-
   app-clientid]&response_type=token&redirect_uri=http://[external-app-
   redirecturi]
2. [front-end] -> matches route -> show login page
3. [front-end] -> user clicks on login with google
4. [front-end] -> redirect to 'http://[server]/account/authorize/connect?
   provider=Google&redirect_uri=http://[front-
   end]/account/thirdparty/authorized&response_type=code&client_id=[front-
   end-clientid]
5. [server] -> no identity found, save request in session and let the user
   login at the [third-party] (using ChallengeResult and also passing in the
   request id which was stored in session)
6. [third-party-provider] user logs in
7. [front-end] -> http://[front-end]/account/thirdparty/authorized recieved
   the code
8. [front-end] -> exchange authcode for token with [server] using
   http://[server]/account/token&grant_type=authorization_code&code=
   [code]&redirect_uri=http://[front-
   end]/account/thirdparty/authorized&client=[front-end-clientid]
9. [server] -> generate claims and return token
10. [front-end] -> token recieved

A thing i'm missing (and it might be an implementation flaw, thought flaw or whatever) is that i need to redirect back to the [external-app] with the given token. Do i need to do that on the [front-end]? It feels off and i'm kinda sure i'm mixing / matching stuff wrong. Can anyone help me out?
Thanks in advance!
PS yes, i know, should be https. Above is for example purpose ;)

A: With interactive flows like the implicit flow, the important thing to remember is that you have to redirect the user to the identity provider's authorization endpoint so it has a chance to prepare an authorization response.
You're free to decide what happens between the moment your identity provider receives the authorization request and the moment it returns an authorization response, but you can't redirect the user from your "front-end" application directly to the "external application" because it has no way to generate an authorization response (it's not its role).
Consider reworking your flow so your front-end app redirects your users to the authorization server, that will itself redirect them to your external app.


text:
Q: Can I sync with my iOS4 device such as iPhone 4 and iPad? If Ubuntu can't do this natively, are there any workarounds?

A: *

*Open up the Synaptic Package Manager

*Go to the Repositories (Under Settings)

*Add this source -  ppa:pmcenery/ppa

*Click Close and then click the 'Reload' button at the top left of the Synaptic Package Manager

*After it's finished reloading search for - libimobiledevice1

*You will see two package in the list, install both of them

*Now click the 'mark all upgrades' button and click 'mark' when the popup appears then click the 'Apply' button of the Synaptic Package Manager.

*The software packages will then be downloaded and installed.

*Restart your computer and login back in.

*The 1st time you connect you ipod/iphone/ipad with rhythmbox open it will unmount. Just close rhythmbox then disconnect and reconnect you ipod/iphone. You should now see your ipod/iphone/ipad listed under Devices in rhythmbox.
Notes -  Always best not to have rhythmbox open before you connect your ipod/iphone/ipad
Rhythmbox is only supported, rhythmbox may say the songs are transferred but the 'Sync in Progress' is usually shown on the ipod/iphone/ipad after so just wait till you no longer see this displayed.
For a more detailed how to, see hee - http://forums.linuxmint.com/viewtopic.php?f=42&t=53489

A:
Lucid natively supports both iPhone
  and iPod Touch 1G, 2G, 3G and 3GS
  models (iPad should also work) running
  up to firmware 4.0 without the need to
  jailbreak.

If you want to use you iPhone for USB tethering check out this blog post.
More information can be found at https://help.ubuntu.com/community/PortableDevices/iPhone.

A: I have actually had success in syncing my iPhone 4 (iOS 4.2.8), with Rhythmbox on Ubuntu 11.04. I still however, cannot get Banshee to work (and that is by far my favorite player, it feels MUCH more polished). Read the all the steps before you begin, some steps are more than one procedure and require information to complete. Here is what I did:

*

*Installed all the libraries/applications indicated above (libmobiledevice, iFuse etc).

*Then, as you are Jailbroken, Download iFile (easy) or SSH to your iphone (pain) and locate and edit  /System/Library/Lockdown/Checkpoint.xml. Find the DBVersion key, and change its value from 5 to 4. Save and reboot your iPhone.

*Then, you can use this page (http://ihash.marcansoft.com/) to generate a HashInfo file for your device and manually copy it to your phone. There will be instructions on that link above, that tell you where the hashinfo file goes after you create it. Note* You will need to have your UIDID.
It is a PAIN to get the UIDID from your phone unless you have iTunes, obviously we are using Linux (no iTunes), BUT there is a simple command to find it on your Linux machine: in the terminal with your iPhone connected, type:
lsusb -v

It prints a TON of text that seems to repeat, but keep scrolling down until you see "iSerial: (40 letters and numbers in random sequence)" Copy that serial/uidid info into the website hashgenerator above, and copy it to itunes_control/Device as per the sites' instructions. After all is done above, open Rythmbox, and you're set!
If it still does not work, I can try to clarify the steps further. It was a ROYAL PAIN for me to hunt these down until it worked, but it works flawlessly in Rhythmbox. (Banshee would be better.... but beggars cant be choosers! :)

A: Banshee and Rhythmbow don't work with an iPad 2 at this point. I did not try the step above though ( https://askubuntu.com/a/62479/35622 ).
But it is possible to copy mp3 (m4b not supported, don't know about other formats) to Good Reader with Ubuntu and play them.
AVPlayerHD is even better ( http://itunes.apple.com/en/app/avplayerhd/id407976815?mt=8 ), this supported m4b and it is easy to copy files with file browser or via wifi.

A: Here's an easy way to connect an Iphone or Ipad to Ubuntu:

*

*Open up the Synaptic Package Manager

*Go to the Repositories (Under Settings)

*Add this source - ppa:pmcenery/ppa

*Click 'Close', and then click the 'Reload' button at the top left of the Synaptic Package Manager


text:
Q: Compiling in cygwin with new mingw binaries I updated my mingw binaries to support c++11 and now I can't compile my code.
I am working with a cygwin and including the binaries in the PATH enviroment variable.
This is my includes and first lines in main:
#include "icm/icmCpuManager.hpp"
#include "Instruction.hpp"
#include "MicroblazeInstruction.hpp"
#include "CpuManager.hpp"
#include "File.hpp"
#include "Utils.hpp"

#include <iostream>
#include <fstream>
#include <string>
#include <iomanip>
#include <sstream>
#include <cstdint>

Which take me to my first lines in File.hpp
#ifndef FILE_HPP
#define FILE_HPP

#include <iostream>
#include <fstream>
#include <string>
#include <iomanip>
#include <sstream>
#include <cstdint>

This is my makefile:
IMPERAS=$(IMPERAS_HOME)
ifndef IMPERAS
  IMPERAS := $(error "IMPERAS paths not defined")
endif

SUFFIX=.cpp
CC=g++
CFLAGS=-O2 -Wall -c -I $(IMPERAS_HOME)/ImpPublic/include/host/ -std=c++11
LDFLAGS=-m32 -L$(IMPERAS_HOME)/bin/$(IMPERAS_ARCH) -lRuntimeLoader

EXECUTABLE=./faith.exe
SRC=./main.cpp ./CpuManager.cpp ./Instruction.cpp ./File.cpp ./Utils.cpp
OBJS=$(SRC:.cpp=.o)
DEPS=

#SHAREDOBJ=$(SRC:.c=.so)

.PHONY: all
#all: $(EXECUTABLE) $(SHAREDOBJ)
all: $(EXECUTABLE)

# platform
$(EXECUTABLE): $(OBJS)
    @    echo "# Linking Platform $@"
    $(V) $(CC) $(OBJS) $(LDFLAGS) -o $@

# platform objects
%.o: %.cpp $(DEPS)
    @    echo "# Compiling Platform source: $@"
    $(V) $(CC) $(LDFLAGS) $(CFLAGS) $< -o $@

# dynamic lib
#$(SHAREDOBJ): $(OBJS)
#   @    echo "# Host Linking Platform object $@"
#   $(V) $(CC) -shared -o $@ $^ $(LDFLAGS)

.PHONY: clean
clean:
    $(V) - rm -f $(EXECUTABLE) $(OBJS)

This is my compiling error:
$ make
# Compiling Platform source: main.o
g++ -m32 -LC:\Imperas/bin/Windows32 -lRuntimeLoader   -O2 -Wall -c -m32 -I C:\Imperas/ImpPublic/include/host/ -std=c++11 main.cpp -o main.o
In file included from c:\mingw\mingw64\bin\../lib/gcc/x86_64-w64-mingw32/4.7.0/include/c++/bits/ios_base.h:43:0,
                 from c:\mingw\mingw64\bin\../lib/gcc/x86_64-w64-mingw32/4.7.0/include/c++/ios:43,
                 from c:\mingw\mingw64\bin\../lib/gcc/x86_64-w64-mingw32/4.7.0/include/c++/ostream:40,
                 from c:\mingw\mingw64\bin\../lib/gcc/x86_64-w64-mingw32/4.7.0/include/c++/iostream:40,
                 from File.hpp:4,
                 from main.cpp:5:
c:\mingw\mingw64\bin\../lib/gcc/x86_64-w64-mingw32/4.7.0/include/c++/bits/locale_classes.h:45:1: error: expected unqualified-id before 'namespace'
In file included from c:\mingw\mingw64\bin\../lib/gcc/x86_64-w64-mingw32/4.7.0/include/c++/cwctype:52:0,
                 from c:\mingw\mingw64\bin\../lib/gcc/x86_64-w64-mingw32/4.7.0/include/c++/bits/locale_facets.h:41,
                 from c:\mingw\mingw64\bin\../lib/gcc/x86_64-w64-mingw32/4.7.0/include/c++/bits/basic_ios.h:39,
                 from c:\mingw\mingw64\bin\../lib/gcc/x86_64-w64-mingw32/4.7.0/include/c++/ios:45,
                 from c:\mingw\mingw64\bin\../lib/gcc/x86_64-w64-mingw32/4.7.0/include/c++/ostream:40,
                 from c:\mingw\mingw64\bin\../lib/gcc/x86_64-w64-mingw32/4.7.0/include/c++/iostream:40,
                 from File.hpp:4,
                 from main.cpp:5:
c:\mingw\mingw64\bin\../lib/gcc/x86_64-w64-mingw32/4.7.0/../../../../x86_64-w64-mingw32/include/wctype.h:15:32: error: expected '}' before end of line
c:\mingw\mingw64\bin\../lib/gcc/x86_64-w64-mingw32/4.7.0/../../../../x86_64-w64-mingw32/include/wctype.h:15:32: error: expected unqualified-id before end of line
c:\mingw\mingw64\bin\../lib/gcc/x86_64-w64-mingw32/4.7.0/../../../../x86_64-w64-mingw32/include/wctype.h:15:32: error: expected declaration before end of line
makefile:29: recipe for target 'main.o' failed
make: *** [main.o] Error 1

A: You are missing a semicolon at the end of your file "CpuManager.hpp"
That missing semicolon is triggering an error in the code that immediately follows it, which is identified in your compiler error.


text:
Q: Cumulative total should start from base value with different starting date I am using running total to calculate dollar values over the course of two years. The problem is there are some dollar values prior to two years and not reflecting in the final value. I want to use dates for only two years but want to get the dollar values in the rolling total that are before two years. I am stuck up pretty bad, any help will be much appreciated. So far I have tried this, but still not able to proceed.
RunningTotalExecuted =
CALCULATE(FORMAT(SUM(Procurement_Schedule[Awarded Contract Sum ($)]),"#,,M"),
FILTER(ALLSELECTED(Date_Table),
Date_Table[Date] <= MAX(Date_Table[Date]))
)

A: Replace ALLSELECTED with ALL in the filter of your date table.


text:
Q: Why can't I print %c after %s in my code? I'm new to C programming, and I'm learning to get string input. I try to use malloc:
#include <stdio.h>
#include <string.h>
#include <stdlib.h>

int main() {

    char *s;
    s = malloc(1024 * sizeof(char));
    scanf("%[^\n]", s);
    s = realloc(s, strlen(s) + 1);

    printf("%s ",s[2]);
    printf("%c",s[2]);
    return 0;
}

When I run this, nothing is printed. But when I put the %c printf before the %s printf:
#include <stdio.h>
#include <string.h>
#include <stdlib.h>

int main() {

    char *s;
    s = malloc(1024 * sizeof(char));
    scanf("%[^\n]", s);
    s = realloc(s, strlen(s) + 1);
    printf("%c",s[2]);
    printf("%s ",s[2]);

    return 0;
}

It runs and shows the result of printf("%c",s[2]);. Why is this happening? Does printf clear memory in char s?

A: In C, a string is just an array of char, which we save as a char *: a location in the computer's memory where we have stored our array of char's (a memory address , or, a pointer).
The %c flag tells printf to process a single character (i.e. s[2]).
The %s flag, however, tells printf to process an entire string at the memory address stored at s[2]. If, for example, s[2] = 'A', then printf will try to access a string stored at memory location 'A'. In ASCII, the letter 'A' is just the integer 65, which is not a valid memory location and thus, the program will error.
In the first instance, the program is probably exiting (due to the error in using %s) before the printf using %c outputs, whereas in the second instance, the printf using %c outputs before the error occurs.


text:
Q: Can't set chart Axis title (.caption) I have a script that sets some ranges, then creates a chart.  All goes well until .Axes(xlCategory, xlPrimary).Caption = "Time from Sent to Rec'd" where I get the error "Run-time error '438': Object doesn't support this property or method".
Here's my code:
Sub CreateChart()
dim avgWS as worksheet: set avgWS = activesheet
...[code here, setting the ranges and such]....

        ''' TIME TO CREATE THE CHART!!
        with avgws
           Dim newChart As Chart
      '   Set newChart = Charts.Add
        Set newChart = Charts.Add.Location(xlLocationAsObject, avgWS.name)
        With newChart
            .ChartType = xlLineMarkers
            .SeriesCollection.NewSeries
            With .SeriesCollection(1)
                .name = chartName
                .Values = thePeopleChartValues
            End With
            .SeriesCollection.NewSeries
            With .SeriesCollection(2)
                .name = avgWS.Cells(1, dayLimitCol).Value
                .Values = dayLimitValues
            End With
            .SeriesCollection.NewSeries
            With .SeriesCollection(3)
                .name = avgWS.Cells(1, overalltheAvgCol).Value
                .Values = theAverages
            End With
            .HasTitle = True

            .Axes(xlCategory).CategoryType = xlCategoryScale
            .SetElement (msoElementPrimaryValueAxisTitleRotated)
            .Axes(xlCategory, xlPrimary).Caption = "Time from the Sent to Shares Rec'd"  '''' ERROR HERE!!
            .SetElement (msoElementPrimaryCategoryAxisTitleAdjacentToAxis)
            .Axes(xlCategory).Caption = "the Date"
            .SetElement (msoElementChartTitleCenteredOverlay)
            .Axes(xlCategory).Caption = "='CY 2014-15B Averages'!R1C2"
            .SetElement (msoElementLegendRightOverlay)
            .SetElement (msoElementLegendBottom)
        End With

I've only included the Chart part, but if you would like/need more of the code just let me know.  I have ranges and such set up, and get no errors there.  It's only when I try to create the .Captions.  If I walk through the code, via F8 and skip the three .caption lines, the chart gets created like I want....just how do I set those Axis captions? The macro recorder isn't much help (that's how I got to where I am now).
edit: Hm, if I use
.Axes(xlCategory, xlPrimary).HasTitle = True
.Axes(xlCategory, xlPrimary).AxisTitle.Characters.Text = "whatever whatever"

it sets the horizontal axis caption to "Whatever whatever".  I guess I'm making progress, but I want that to be the vertical title, not horizontal and can't figure out how to do so.

A: Before you start formatting the axis title, create it:
.Axes(xlCategory, xlPrimary).HasTitle = True

Then to access the caption make sure you go through the AxisTitle object:
.Axes(xlCategory, xlPrimary).AxisTitle.Caption = ""

Then use
.Axes(xlCategory, xlPrimary).AxisTitle.Orientation = xlVertical

Hope that helps.


text:
Q: Position Images/Background Images Relative to Mouse I would like to know what an efficient way is to animate positions of images (or background images) in relation to the mouse. Take Github, for example:
https://github.com/thispagedoesntexist
This is one hella sexy 404 page.
I want to make an impact on my users, and this surely does so in my opinion.
Questions
1) How can this be done?
2) Just CSS? CSS & JS?
3) Lastly, any libraries for stuff like this?

A: This was made with a jQuery plugin called Plax.


text:
Q: How can people submit a form but not have access to full list? We have a form that does all the things that stated in the blog below:

*

*Form closes and thanks individual for submission

*User gets an email to a link to their application

*Approver gets an email to the actual form

But I  realized recently that the users can, if the wish, go to 'Site Actions' then 'View all site content' and view ALL applications.
Would anyone know how we can set the permissions to restrict this?

A: I have handled this in a couple diff ways
1 (this will most closely do what you want). Set document approval for that library...may take some modifications and new permissions for certain users.
2.Use the current library to create a library template and then deploy that template to the site under a new name. Then create a workflow that will copy anything newly submitted to the other library and then delete the orginal from the first. When they finish even if they pick apart the link to snoop they will see nothing.
I have used both methods and they work fairly well.

A: If you used a list instead of a library, there's just an option to restrict users to only their own items. But that option doesn't exist in a library.
If you can't rework the solution and you're stuck with a library, you can use a SharePoint designer based 2010 workflow to modify the permissions of any new list items.


text:
Q: Adding python to /usr/bin/env python variable The #!/usr/bin/env python hashbang isn't working on my Ubuntu install.
I tried the following:
root@x# python=/usr/bin/python
root@x# PATH=$PATH:/usr/bin/python

A: If you're using bash (which you probably are in a default Ubuntu install) you need to use export to set an environment variable on the command line.
export PATH=$PATH:/usr/bin

See @chaos's comment as well. Make sure env is showing your proper $PATH, eg:
bash-3.2$ env | grep PATH
PATH=/usr/bin:/bin:/usr/sbin:/sbin
bash-3.2$ echo $PATH
/usr/bin:/bin:/usr/sbin:/sbin


text:
Q: JavaScript equivalent of C#'s Windows.UI.Xaml.Application.OnActivated event? Universal Windows applications can be launched with arguments.
I'd like to obtain a reference said arguments.
In C# code examples, the function usually subscribes to Windows.UI.Xaml.Application.OnActivated and obtains arguments as part of the Event object. What is the equivalent way to do this in JavaScript?

A: You should look for Windows.UI.WebUI.WebUIApplication.onactivated.


text:
Q: how change a part of image color no the entire image what I want to do is change only the black color of my original image to another color, and keep for example white color of my image
what I have tried is:
       cell.iconeEcoute?.image =     cell.iconeEcoute?.image!.imageWithRenderingMode(UIImageRenderingMode.AlwaysTemplate)
       cell.iconeEcoute?.tintColor = colorHexIcone

But this code change the entire image color, and I want to keep green color and replace only black color in the image
any help would be appreciated

A: You can achieve it by taking separate View. Then give different color and alpha as you want. and you will see that part in different color.


text:
Q: Google maps event listener dragend I am adding an event listener to my marker, the function for the marker is:

function setupMarkerWaypoint() {
  console.log('setting waypoint marker');
  waypointMarker = new google.maps.Marker({
    position: default_latlng,
    map: mapBooking,
    icon: "http://maps.google.com/mapfiles/ms/micons/blue.png"
  });

  waypointMarker.setVisible(true);

  function geocodePosition(pos) {
    geocoder.geocode({
      'latLng': pos
    }, function(responses) {
      if (responses && responses.length > 0) {
        updateMarkerAddress(responses[0].formatted_address);
      } else {
        updateMarkerAddress('Cannot determine address at this location.');
      }
    });
  }

  function updateMarkerAddress(str) {
    document.getElementById('AddWaypoint').innerHTML = str;
  }

  // Update current position info.

  geocodePosition(latLng);

  // Add dragging event listeners.

  google.maps.event.addListener(waypointMarker, 'dragend', function() {
    updateMarkerStatus('Drag ended');
    geocodePosition(waypointMarker.getPosition());
  });

}

But I am unable to drag my marker on google maps. what necessary changes should I make?

A: To make the marker draggable, set its draggable property to true.
Google Maps Javascript API Reference: MarkerOptions
waypointMarker = new google.maps.Marker({
    position: default_latlng,
    map: mapBooking,
    draggable: true,
    icon:"http://maps.google.com/mapfiles/ms/micons/blue.png"
});

working fiddle
code snippet:

var geocoder;
var mapBooking;
var default_latlng

function initialize() {
  mapBooking = new google.maps.Map(
    document.getElementById("map_canvas"), {
      center: new google.maps.LatLng(37.4419, -122.1419),
      zoom: 13,
      mapTypeId: google.maps.MapTypeId.ROADMAP
    });
  geocoder = new google.maps.Geocoder();
  default_latlng = mapBooking.getCenter();
  setupMarkerWaypoint();

}
google.maps.event.addDomListener(window, "load", initialize);

function setupMarkerWaypoint() {
  console.log('setting waypoint marker');
  waypointMarker = new google.maps.Marker({
    position: default_latlng,
    map: mapBooking,
    draggable: true,
    icon: "http://maps.google.com/mapfiles/ms/micons/blue.png"
  });

  waypointMarker.setVisible(true);

  function geocodePosition(pos) {
    geocoder.geocode({
      'latLng': pos
    }, function(responses) {
      if (responses && responses.length > 0) {
        updateMarkerAddress(responses[0].formatted_address);
      } else {
        updateMarkerAddress('Cannot determine address at this location.');
      }
    });
  }

  function updateMarkerAddress(str) {
    document.getElementById('AddWaypoint').innerHTML = str;
  }

  // Update current position info.

  geocodePosition(waypointMarker.getPosition());

  // Add dragging event listeners.

  google.maps.event.addListener(waypointMarker, 'dragend', function() {
    // updateMarkerStatus('Drag ended');
    geocodePosition(waypointMarker.getPosition());
  });

}
html,
body,
#map_canvas {
  height: 500px;
  width: 500px;
  margin: 0px;
  padding: 0px
}


text:
Q: How and when does 'of' mean 'among'?
In his Commentaries on the Laws of England, William Blackstone contended that the distinction between private wrongs and crimes was:

... As if I detain a field from another man, to which the law has given him a right, this is a civil injury, and not a crime; for here only the right of an individual is concerned, and it is immaterial to the public, which of us is in possession of the land: but treason, murder and robbery are properly marked among crimes; since besides the injury done to individuals, they strike at the very being of society; which cannot possibly subsist, where actions of this sort are suffered to escape with impunity.

Source: P138-139, How the Law Works, Gary Slapper
User Josh61 writes that 'of' = 'are among'. I know that William Blackstone lived from 1723 to 1780.

*

*Yet there's no verb in which of us? Where's the are from?

*How and when does 'of' mean 'among'?

*Is the use of which exceptional and rare? Is the cited explanation in that link right?

A: Answering these out of order:
"Of" can mean "among" when it refers to a set (plurality) of nouns. In this case, "us" refers to the set ["I", "another man"].  It does not matter to the public which among [this set] is in possession of the land.
Your inclusion of the word "are" is divorced from the context of Josh61's statement; in his sentence it does make sense, but that does not mean that you would include "are" here.

which of us refers to [those who are] [among us] ( in possession of the land).

In other words, "are" is used in its infinitive sense of "to exist".

"... refers to [those who exist within the set] [us]."

I would actually argue that Josh61's conclusion (in your linked question/answer) is wrong - this seems to match the very first, standard definition of "which".  From a set, you are identifying a particular one. In other words, from ["I", "another man"], only one can be in possession of the land.


text:
Q: error (type=Not Acceptable, status=406) while calling the api I am getting below error, when i execute the api with this url. I searched this got few answers as well but in all those questions they have used explicitly headers which i have not given.
http://localhost:8290/dataengine/api/program/ff808081657a701801660aa6c6160001/customer/username/muddassir91@gmail.c

Whitelabel Error Page This application has no explicit mapping for /error, so you are seeing this as a fallback.
  Thu Apr 25 16:29:23 IST 2019
  There was an unexpected error (type=Not Acceptable, status=406).
  Could not find acceptable representation

But when I execute the api with these values it works fine.
http://localhost:8290/dataengine/api/program/ff808081657a701801660aa6c6160001/customer/username/muddassir91@gmail.co
OR
http://localhost:8290/dataengine/api/program/ff808081657a701801660aa6c6160001/customer/username/muddassir91@gmail.com
This is my api
@CrossOrigin
@ResponseStatus(HttpStatus.OK)
@RequestMapping(value = "/api/program/{programId}/customer/username/{username}", method = RequestMethod.GET)
public ApiResponse<Customer> getCustomerByUsername(@PathVariable("username") String username, @PathVariable("programId") String programId) {

    return new ApiResponse<Customer>(APIResponseKey.ALL_GOOD, customerService.getCustomerByUserName(username, programId), null);
}

POM.XML
    <dependency>
        <groupId>com.fasterxml.jackson.core</groupId>
        <artifactId>jackson-databind</artifactId>
        <version>2.8.4</version>
    </dependency>


text:
Q: MySQL: Does REPLACE statement cause data unavailability I have a requirement to keep a local database in sync with a production server. I have  created and updated timestamps to find out which are the records that need to inserted, updated and skipped. Now, generating the insert scripts looks straightforward with mysqldump. But I want a similar efficient way to generate the update scripts.
One of the options is generating REPLACE statements with mysqldump & sed.
mysqldump -u DATABASE_USER -p DATABASE_NAME |sed -e "s|INSERT INTO|REPLACE INTO|" > dump.sql

But I read that REPLACE deletes and inserts the row. Since it is a production server, will it cause momentary data unavailability (of the synced record)? Will the constraints be disabled?
Please let me know even if there is any other efficient method! Thanks!!


text:
Q: How to search for Member in AD security group using PHP I am currently developing a noticeboard app using PHP. I would now like to only allow staff to add to it, so I need to find out what Security group the current user is (In AD), for instance staff have their own group and so do students. I would like to use the Windows based authentication to get their username and query that in the AD group. I have tried all the answers I find but none help.
I have the following code so far:
<?php
//Declare Vars
$domain = 'doamin.local';
$username = 'admin';
$password = "";
$ldapconfig['host'] = 'hostname';
$ldapconfig['port'] = 389;
$ldapconfig['basedn'] = 'dc=domain,dc=local';
$dn = 'dc=domain,dc=local';
//Connect to AD
$ds=ldap_connect($ldapconfig['host'], $ldapconfig['port']);
ldap_set_option($ds, LDAP_OPT_PROTOCOL_VERSION, 3);
ldap_set_option($ds, LDAP_OPT_REFERRALS, 0);
$bind=ldap_bind($ds, $username .'@' .$domain, $password);
    if ($bind) {
        echo "LDAP bind successful...";
        //Query for group membership
              $search = ldap_search($ds, $dn, "(samaccountname=w10student)", ['memberOf']);
              $enr = ldap_get_entries($ds, $search);

    } else {
        echo "LDAP bind failed...";
    }

      print_r($enr);

?>

It now prints all groups to an array, I need to have an if statement for if the array contains one of the groups to then set a variable
Any help is appreciated
Many thanks,
Conor


text:
Q: Error getting middle of android studio installation I am trying to Install Android Studio 2.1.1 in my system but at the middle of installation getting some error like"Error opening file for writing". I have attached screen shot, please help me.

A: Try downloading the other version. I doubt that will help but you never know. If not try to run the installer as admin

A: Download latest version Here
your copy is corrupted or some files are missing.


text:
Q: c# sending html email template include css not working i trying to send html email template, it works perfect, but when i put css internal styles it gives error : input string was not in correct format,
my html template that works good:

data

        data
        {0}

        data
        {1}

        data
        {2}

        data
        {3}

        data
        {4}

        data
        {5}

        data
        {6}

my html template that gives  Input string was not in a correct format error :

data

        data
        {0}

        data
        {1}

        data
        {2}

        data
        {3}

        data
        {4}

        data
        {5}

        data
        {6}

my c# code that read and send:
C_GeneralSettings settings = db.C_GeneralSettings.SingleOrDefault();
S_ResidencesReservations item = db.S_ResidencesReservations.SingleOrDefault(x => x.ReserveId == entity.ReserveId);
string subject = "data";
string message = System.IO.File.ReadAllText(Server.MapPath("~/EmailTemplates/ReservationDetails.html"));
message = string.Format(message, entity.ReserveId, entity.IsApproved ? "yes" : "no", entity.PayementPeriodEndDate, entity.ReservationDate.ToString("MM/dd/yyyy"), entity.Name, entity.Email, entity.CellPhone);

HelperMethods.SendEmail(message, entity.Email, subject, settings);

and my send mail method:
public static void SendEmail(string messageContent, string toEmail, string subject, C_GeneralSettings emailEntity)
{
    //Check if email service is allowed
    bool allowEmailService = emailEntity.AllowEmailService;
    if (!allowEmailService)
        return;

    //Construct mail message
    string from = emailEntity.Email;
    string displayName = emailEntity.DisplayName;
    string to = toEmail;

    MailMessage message = new MailMessage();
    message.From = new MailAddress(from, displayName);
    message.To.Add(new MailAddress(to));
    message.Subject = subject;
    message.IsBodyHtml = true;
    message.Body = messageContent;

    //Get mail settings from config file
    string host = emailEntity.Host;
    string username = emailEntity.Email;
    string password = emailEntity.Password;
    int port = emailEntity.Port;
    bool enableSsl = emailEntity.EnableSSL;

    //Send the message
    SmtpClient smtp = new SmtpClient();
    smtp.Host = host;
    smtp.Port = port;
    smtp.Credentials = new System.Net.NetworkCredential(username, password);
    smtp.EnableSsl = enableSsl;

    smtp.Send(message);
}

A: The error occurs when i use internal CSS, because i used string.format to bind data,
Internal CSS using curly brackets, so it causes such like this errors,
so if you need to use internal CSS with dynamic html email templates, you can use string.replace, for example
you html template will be like :

data

        data
        #name#

and to bind it in c#
string message = System.IO.File.ReadAllText(Server.MapPath("~/EmailTemplates/Template.html"));
message = message.Replace("#name#", name);

A: That should not be a case by using

that is another thing that it will not apply any borders if you view in gmail but in outlook you can view the borders.
But you can give a try by using.
message.BodyEncoding = System.Text.Encoding.UTF8
If that does not work you may have some inputs which are not converting correctly.

A: There are a solution that to put css in inline way, but its tired way,
example :

this way is working good and not gives me the previous error, but if someone know a way to write css in internal way, it will be better than this


text:
Q: Why are there two sink input index generated by pulseaudio? I'm planning to spawn a thread as I detect a new sink input index in pulseaudio. But when I run some application, I find out that a second sink index for same client is created.
The system spawns a thread and closes the first thread, which has nothing to do with the current running program. I am tracing this as a reference which is generated by running my code, which detects new sink input index as generated when I run the openarena game.

****Sink input Playback Stream with index 0 is detected hello****
=======[ Sink Input# 0 ]=======
Name: Playback Stream
client:11
sink:0
sample format:3
sample rate:44100
sample channels:2
owner module:7
buffer usec:160068
sink usec:210498
Driver:protocol-native.c
client name :Warzone 2100

****Removing sink input 0****

****Sink input Playback Stream with index 1 is detected hello****
=======[ Sink Input# 1 ]=======
Name: Playback Stream
client:11
sink:0
sample format:3
sample rate:44100
sample channels:2
owner module:7
buffer usec:346689
sink usec:23883
Driver:protocol-native.c
client name :Warzone 2100

****Removing sink input 1****

****Sink input Playback Stream with index 2 is detected hello****
=======[ Sink Input# 2 ]=======
Name: Playback Stream
client:13
sink:0
sample format:3
sample rate:44100
sample channels:2
owner module:7
buffer usec:160068
sink usec:210488
Driver:protocol-native.c
client name :torcs-bin

****Removing sink input 2****

****Sink input Playback Stream with index 3 is detected hello****
=======[ Sink Input# 3 ]=======
Name: Playback Stream
client:13
sink:0
sample format:3
sample rate:44100
sample channels:2
owner module:7
buffer usec:347052
sink usec:23997
Driver:protocol-native.c
client name :torcs-bin

****Removing sink input 3****

****Sink input Playback Stream with index 4 is detected hello****
=======[ Sink Input# 4 ]=======
Name: Playback Stream
client:20
sink:0
sample format:3
sample rate:44100
sample channels:2
owner module:7
buffer usec:160068
sink usec:210464
Driver:protocol-native.c
client name :ioquake3

****Removing sink input 4****

****Sink input Playback Stream with index 5 is detected hello****
=======[ Sink Input# 5 ]=======
Name: Playback Stream
client:20
sink:0
sample format:3
sample rate:44100
sample channels:2
owner module:7
buffer usec:346507
sink usec:23980
Driver:protocol-native.c
client name :ioquake3

****Removing sink input 5****
****Sink input Simple DirectMedia Layer with index 6 is detected hello****
=======[ Sink Input# 6 ]=======
Name: Simple DirectMedia Layer
client:24
sink:0
sample format:0
sample rate:11025
sample channels:1
owner module:7
buffer usec:265147
sink usec:105270
Driver:protocol-native.c
client name :Test stream

****Removing sink input 6****

****Sink input Playback Stream with index 7 is detected hello****
=======[ Sink Input# 7 ]=======
Name: Playback Stream
client:26
sink:0
sample format:3
sample rate:44100
sample channels:2
owner module:7
buffer usec:91133
sink usec:209540
Driver:protocol-native.c
client name :MegaGlest

****Removing sink input 7****

****Sink input Playback Stream with index 8 is detected hello****
=======[ Sink Input# 8 ]=======
Name: Playback Stream
client:26
sink:0
sample format:3
sample rate:44100
sample channels:2
owner module:7
buffer usec:347233
sink usec:22750
Driver:protocol-native.c
client name :MegaGlest

****Removing sink input 8****

The only difference between this sink index 0 and 1 is the buffer usec and sink
usec, which is the one I found.
I want to know what the reason behind this is. Why does it create 2 sink input index every time I run this game or any other game (I also tried on other games and I got same result).


text:
Q: Where am I archiving my documents too? I set up a retention policy for a document library, so that 30 days after a document is uploaded or created it moves it to a storage folder. My question is, where is this storage folder?

A: I found it, they go to the drop off folder.


text:
Q: Verificar se existe valor dupliado no while Estou a meio dia tentando fazer isso.
Tenho esse loop
if(@mysqli_num_rows($sql_es_1_aux) == 1){
   echo "";
}else{
   $sql_es_1 = mysqli_query($config, "SELECT peso FROM tb_sub_agrupamento
                                      WHERE id_ctr IN ($id_ctr_ok) AND
                                       peso <> ''") or die(mysqli_error($config));

  if(@mysqli_num_rows($sql_es_1) <= '0'){
    echo "";
  }else{

       while($r_sql_es_1 = mysqli_fetch_array($sql_es_1)){

           $peso_sel_es1 = $r_sql_es_1[0];
        }
    }
}

$peso_sel_es1 pode vir repetido.
Existe alguma forma de verificar se está repetido fora do while?
Se eu transformar ela em array (colocando []) ajuda?
Preciso determinar que, se for repetido, não mostre o peso.

A: Você pode resolver na sua consulta agrupando os pesos. E contando quantos do mesmo existem. Ai no PHP você compara se a repetição é maior que 1.
SELECT
    peso,
    COUNT(peso) AS repeticoes
FROM
    tb_sub_agrupamento
WHERE
    id_ctr IN ($id_ctr_ok)
    AND
    peso <> ''
GROUP BY
    peso

Ou se você não quiser mostrar os pesos repetidos, somente os que forem únicos. A consulta assim também resolve. Não tendo necessidade de regra de negócio no fonte.
SELECT
    peso,
    COUNT(peso) AS repeticoes
FROM
    tb_sub_agrupamento
WHERE
    id_ctr IN ($id_ctr_ok)
    AND
    peso <> ''
GROUP BY
    peso
HAVING
    repeticoes = 1


text:
Q: Proportional Resize of Splitpanes When I resize a window with split panes inside, my splitpanes are resized in what appears to be unpredictable ways. Sometimes the left pane is given more space, sometimes the right one. Sometimes the extra room is spread out, sometimes it is given entirely to one pane.
For example, maximizing and restoring the window will change the layout of the split panes -- before the process they'll be setup a certain way, afterwards they'll have completely different positions.
I would like instead for the splitpanes to always maintain the same ratio. So if before resize one is 30% of the width and the other is 70% of the width, i'd like for them to continue to be 30% / 70% afte the resize is complete.
Any suggestions on how to accomplish this?

A: Glad you answered your own question. I advise to use Platform.runLater instead of setResizableWithParent to deal with the clever code you had issues with. See my answer there.

A: I was able to solve this problem by setting all of the top-level items in the UI to not resizable with parent:
    SplitPane.setResizableWithParent( libraryPane, Boolean.FALSE );
    SplitPane.setResizableWithParent( artSplitPane, Boolean.FALSE );
    SplitPane.setResizableWithParent( currentListSplitPane, Boolean.FALSE );
    SplitPane.setResizableWithParent( primarySplitPane, Boolean.FALSE );
    SplitPane.setResizableWithParent( currentPlayingPane, Boolean.FALSE );

I don't know how it works or why, but I stumbled upon it and it does exactly what I want: Four Panes expand linearly while maintaining a basic ratio (library, primary split, current list, art) and one pane does not change size (current playing).
Here is a really badly annotated image:

My best guess is there is some clever code trying to intelligently resize content on window resize, and by setting ResizableWithParent to false the clever code turns off and some basic code kicks in.
However it works, this worked perfectly for me, and I hope it helps others.


text:
Q: build scripts that can create the WARs for my Talend jobs using Ant or Maven I am trying to have a build scripts that can create the WARs for my Talend jobs using Ant or Maven based build scripts that can be run from command line and eventually be integrated into a continuous integration system like Hudson. There are ways to integrate Ant/Maven scripts in the Talend Enterprise edition 5.2.1 , however I am trying to achieve this using the community edition. Any suggestions?

A: You can export jobs to WAR (or ZIP, or whatever you want) by using the command line export tool. Are you aware of this?


text:
Q: Trying to make a Windows 7 USB with UNetBootin, getting error "Failed to load COM32 file menu.c32" Pretty much what it says on the tin.
I looked around a bit, someone told me to press "Tab" to see a list of options, this is what it yielded.
Verifying DMI Pool Data ....................
Failed to load COM32 file menu.c32
boot:
 unetbootindefault

So, I selected that option, even though the OP of the fix said there would be several others.  This was the result,
boot: unetbootindefault
Loading /ubnkern. . . failed: No such file or directory

This was in the pre-boot screen, not in a terminal/command prompt anywhere.
Idk what to do at this point.  The installation went fine.  why am I getting this error?  How can I fix it?

A: I have recently answered similar question using Unetbootin. Hope it help! Try, comment and vote


text:
Q: Git merge two repositories I was a question regarding merging two git repositories.
The one git repository, let's name it X, is being hosted on GitHub and is lead by one team member. While the other on BitBucket and being lead by myself.
You must be asking yourself why exactly are we doing so? The main reason is that we are migrating to BitBucket, while some work was still done in the meantime on both repositories.
To cut the story short, I want to merge these two repositories - without having to handle conflicts.
I've ran onto numerous posts on StackOverflow that explain how to do this, but unfortunately, none of them helped.
Any advice or references?

A: You will certainly have conflict to resolve.
You can create a new git repository ans make an initial commit:
mkdir newRepository
git init
touch .gitignore
git add .gitignore
git commit .gitignore -m 'init'

Then fetch and merge the first repo (let's say github)
git remote add first pathTo/first
git fetch first
git merge first/master

Then fetch and merge the second (bitbucket):
git remote add second pathTo/second
git fetch second
git merge second/master

Then push all of it to a new bitbucket repo.


text:
Q: Best way to determine if a database has been changed? I'm working on architecting a sqlite database for a gallery application. I would like to know if using a time stamp to check if the db has been updated is good practice, or if there is a better way to do this.
Here's what I have...three tables:
buildings
  buliding_id PK
  code
  name
  description
  timestamp

building_album
 album_id PK
 building_id FK (reference to buildings->building_id)
 album_url
 timestamp

building_images
 image_id PK
 album_id FK (reference to building_album->album_id)
 image
 timestamp

As of now I would have the application check against the server's db to see if any time stamps have changed, and if they have change those fields.

A: I'd start here for a broader discussion on the topic: How to Sync iPhone Core Data with web server, and then push to other devices?.
But if you wanted to do some simple, one-way synchronizing of information from the server to the mobile device, one "simple" approach would be:

*

*modifying that server database to introduce the concept of some unique identifier (whether a transaction id or version id) that is used across all of the tables;

*making sure that the server is modified to record any creations, updates, and deletions to the "master" tables with that identifier which is automatically incremented/updated; this transaction/version identifier could either in the tables themselves or using some shared transaction log;

*writing a routine on the server so the client can retrieve the current identifier;

*have the app keep track of the last identifier for which it successfully received and completed synchronization/replication;

*write some server routine that the client can call with its "last successful" identifier, for which the server will return all records that have changed since that identifier; and

*write some mobile device code to take the response from the prior step and update its internal database accordingly.
If you want to also synchronize changes on the mobile and send them back to the server, or if you have constraints upon what changes you can make in the server database, then this all becomes significantly more complicated.


text:
Q: Why won't my php form work submitting to my sql database

      <title>Add a New Open Mic</title>

      <?php
         if(isset($_POST['add'])) {
$servername = "localhost";
$username = "*";
$password = "*";
$dbname = "mlcarelo_wrdp2";

// Create connection
$conn = new mysqli($servername, $username, $password, $dbname);

// Check connection
if ($conn->connect_error) {
    die("Connection failed: " . $conn->connect_error);
            }

            if(! get_magic_quotes_gpc() ) {
   $State= addslashes ($_POST['State']);
   $City= addslashes ($_POST['City']);
   $Place= addslashes ($_POST['Place']);
   $Address= addslashes ($_POST['Address']);
   $Day= addslashes ($_POST['Day']);
   $Time= addslashes ($_POST['Time']);
   $Host= addslashes ($_POST['Host']);
   $Contact= addslashes ($_POST['Contact Information']);

            }else {
   $State= addslashes ($_POST['State']);
   $City= addslashes ($_POST['City']);
   $Place= addslashes ($_POST['Place']);
   $Address= addslashes ($_POST['Address']);
   $Day= addslashes ($_POST['Day']);
   $Time= addslashes ($_POST['Time']);
   $Host= addslashes ($_POST['Host']);
   $Contact= addslashes ($_POST['Contact Information']);
            }

            $sql = "INSERT INTO 'responses' (State,City, Place,
               Address, Day, Time, Host, Contact Information)VALUES('$State','$City','$Place', '$Address', '$Day', '$Time', '$Host', '$Contact');

            mysql_select_db('mlcarelo_wrdp2');
            $retval = mysql_query( $sql, $conn );

            if(! $retval ) {
               die('Could not enter data: ' . mysql_error());
            }

            echo "Entered data successfully\n";

            mysql_close($conn);
         }else {

            }
               <form method = "post" action = "<?php $_PHP_SELF ?>">

                        State
                        <input name = "State" type = "text"
                           id = "State">

                        City
                        <input name = "City" type = "text"
                           id = "City">

                        Place
                        <input name = "Place" type = "text"
                           id = "Place">

                        Address
                        <input name = "Address" type = "text"
                           id = "Address">

                        Day
                        <input name = "Day" type = "text"
                           id = "Day">

                        Time
                        <input name = "Time" type = "text"
                           id = "Time">

                        Host
                        <input name = "Host" type = "text"
                           id = "Host">

                        Contact Information
                        <input name = "Contact Information" type = "text"
                           id = "Contact Information">

               </form>

            <?

How can I get my form to work so users may input information and submit it to enter into the sql database? I don't realy understand Form= action. I am using wordpress. I have successfully pulled tables to display from my database so I know that my beginning of php coding is correct and the query should be correct.

A: You are mixing mysql_ and mysqli_. Use mysqli_ only:
$sql = "INSERT INTO responses (State, City, Place, Address, Day, Time, Host, ContactInformation) VALUES ('$State', '$City', '$Place', '$Address', '$Day', '$Time', '$Host', '$Contact')";
$retval = mysqli_query($conn, $sql);
if(! $retval ) {
    die('Could not enter data: ' . mysqli_error());
}
echo "Entered data successfully\n";
mysqli_close($conn);

Also there are several syntax errors in your query, e.g. table names aren't enclosed by ' '. Note that you don't need to use mysqli_select_db, you are doing this within you connection string already. I'm sure your column Contact Information doesn't have a whitespace in your table, so you'll need to correct this, too. I've used ContactInformation, make sure this is correct.
SIDENOTE:
Inserting data this way is wide open to sql-injection. Use prepared statements instead!!


text:
Q: Talk to telegram user from node-red How to send a message to telegram user from node-red if it's not a reply to a previous message sent by the user?
(I am using telegram bot as a chatbot with users)

A: The main thing in sending a telegram message from Node-Red is you need a way to capture every user 'Telegram ID'.
There is already a nice tutorial about sending messages on iotwithus.
The short story is you will need a Function node before Telegram sender node that will contain:
msg.payload = {}
msg.payload.chatId = your-id-here
msg.payload.type = 'message'
msg.payload.content = 'hello from node-red!'
return msg;

Keep in mind to save your users Telegram ID as an integer, not a string, as you can see, we set payload.chatID without the quotes.


text:
Q: How to edit the display of date & time on order note of woocommerce? https://imgur.com/a/BOuuHWt
The date / time display on the order detail page is displayed differently from the woocommerce setting.
I want to change the displayed date / time like this.
e.g.) Tuesday 28th 2019 May, 02:37 pm -> 2019-05-28 14:37
I think it would be nice to have a fix in the functions.php in the child theme.
Could you help me?
Best,
<p class="woocommerce-OrderUpdate-meta meta">
    <?php echo date_i18n( __( 'l jS \o\f F Y, h:ia', 'woocommerce' ), strtotime( $note->comment_date ) ); ?>
</p>

A: You need to replace your time format l jS \o\f F Y, h:ia to Y-m-d Hi


text:
Q: PHP Laravel Presto escaping I have a command created in Laravel to execute a query on presto. Should I be escaping the plus(+) symbol and the 'and' here in my LEFT JOIN? You will see I am already escaping the single quotes here as required
public function handle()
    {
        // Run Athena query and fetch CSV file
       $start = time();

    $csv = AthenaService::runQueryCSV('SELECT
  *
FROM
  table1 t1
  LEFT JOIN table2 t2 ON t1.id = t2.id
  AND lower(t2.creditor_name) LIKE \'%vehicle and asset finance%\'
  OR lower(t2.creditor_name) LIKE \'%vehicle + asset finance%\'');


text:
Q: Accessing map values in a vector in Lemon Graph Library i have the following code
typedef ListDigraph::NodeMap<string> Node_names;
vector<ListDigraph::Node> initial_state;
vector<Node_names*> P_names;
//some loop
{
   Node_names name;
   ListDigraph::Node state = graph.addNode();
   initial_state = state;
   name[state] = "state1";
   P_names.push_back(&name);
}

void printin()
{
    cout<<P_names[0][initial_state[0]]
}

In printin i get the error :
error: no match for 'operator[]' in '((Translator*)this)->Translator::Process_state_name.std::vector<_Tp, _Alloc>::operator[] [with _Tp = lemon::DigraphExtender<lemon::ListDigraphBase>::NodeMap<std::basic_string<char> >*, _Alloc = std::allocator<lemon::DigraphExtender<lemon::ListDigraphBase>::NodeMap<std::basic_string<char> >*>, std::vector<_Tp, _Alloc>::reference = lemon::DigraphExtender<lemon::ListDigraphBase>::NodeMap<std::basic_string<char> >*&, std::vector<_Tp, _Alloc>::size_type = unsigned int](0u)[((Translator*)this)->Translator::Process_initial_state.std::vector<_Tp, _Alloc>::operator[] [with _Tp = lemon::ListDigraphBase::Node, _Alloc = std::allocator<lemon::ListDigraphBase::Node>, std::vector<_Tp, _Alloc>::reference = lemon::ListDigraphBase::Node&, std::vector<_Tp, _Alloc>::size_type = unsigned int](0u)]'

how do i access the names for the states....

A: You probably want to display P_names[0][...] or something like that. Your Node_names is a define, you probably cannot use the angle brackets like that. Think of it like if you removed your typedef, you would have to write it like that: ListDigraph::NodeMap<string>[0][P_names[0]]. Would that make sense?
We can't really help you more if you don't provide more information I'm afraid...
Edit: try (*P_names[0])["test"], maybe that would do it (providing you have all necessary elements).
One thing you can do though is using as many temp variables as you want. You really need to understand what types are P_names[0], *P_names[0], (*P_names[0])[...] etc. Try to compile the code, write class names on a paper, have a look at some diagrams in the documentation, draw diagrams (with a pencil on paper), anything that could help you understand what is going on.
You are using a library that is not well known and even if people here are trying to help you it is really hard, especially without the code or even worse with a code which is not the actual code...


text:
Q: Build script of package.json I have the below folder structure
-src
--module
---some.js
---another.js
--server.js

I am using parceljs transpile the .js files
The script in package.json looks like this
"build": "parcel src/*/*.js --target=node"

When I run npm run build, server.js is not transpiled.
If I change the build script to the below, files in module folder don't get transpiled
"build": "parcel src/*.js --target=node"

Any guidance so what I could transpile .js files in the src level as well as all nested files?

A: You could run the both commands in a single line, using the logical operator &&:
"build": "parcel src/*.js --target=node && parcel src/*/*.js --target=node"

A: as per @Jeremy' suggestion
parcel src/**/*.js --target=node


text:
Q: Is there a translation API service for Chinese to English? I have a list of product names in Chinese. I want to translate these into English, I have tried Google AJAX language API, but it seems that translation is not good, it would be great if someone could give me some advice about or point me towards a better choice.
Thank you.

A: Eh, Google is certainly a great translation service, but if you're looking for reliable translations you probably need to go human - machine translation can be sketchy at best. myGengo has an API to facilitate machine translation; your question is tagged with "python", so I've thrown some sample code below, but you can get a more extensive walkthrough if you so desire.
The cool thing is that you can get a machine translation while you wait for your human translation to be done, so if you need something in the time between you're not high and dry. ;)
First, install the mygengo API library for Python:
pip install mygengo

Then, request translations like below:
# -*- coding: utf-8 -*-
from mygengo import MyGengo

gengo = MyGengo(
    public_key = 'your_mygengo_api_key',
    private_key = 'your_mygengo_private_key',
    sandbox = False, # possibly False, depending on your dev needs
)

translation = gengo.postTranslationJob(job = {
    'type': 'text', # REQUIRED. Type to translate, you'll probably always put 'text' here (for now ;)
    'slug': 'Translating Chinese to English with the myGengo API', # REQUIRED. For storing on the myGengo side
    'body_src': '我們今天要去那裏嗎', # REQUIRED. The text you're translating. ;P
    'lc_src': 'zh', # REQUIRED. source_language_code (see getServiceLanguages() for a list of codes)
    'lc_tgt': 'en', # REQUIRED. target_language_code (see getServiceLanguages() for a list of codes)
    'tier': 'standard', # REQUIRED. tier type ("machine", "standard", "pro", or "ultra")
})

# This will print out a machine translation; for your human translation, you can
# poll and check often, or set up a URL for it to post the results to.
print translation['response']['job']['body_tgt']

A: I think Google are probably one of the best web based automatic translation services.


text:
Q: How to Join four Tables? I need to join three tables into the sale table, I tried left join but it does not join properly. can you guys plz give a solution.

Sale Tabel
MSISSND    Agent_ID    Connection_Date   District
3455         22           22-Jan-2020      abc
1222         22           12-Feb-2020      abc
4562         25           23-Feb-2020      zxy
8907         23           12-Mar-2020      rty

Agent Tabel
Agent_ID  Agent_name  Distributor_ID   Distributor_name
22         nikon          12              A-Z
23         cannon         13              tech
25         hp             14              hp-tech

Customer Tabel
MSISSND     Name     Address
3455        nilak    adcd
4562        suman    sdfg
8907        nizar    ewrt
1222        rowan    fgsk

Target Tabel
Distributor_ID    District    Month     Target
12                  abc       Jan_2020    10
12                  abc       Feb_2020    15
13                  rty       Feb_2020    20
14                  zxy       Mar_2020    24

Output_final table will be
MSISSND   Agent_Id  Agent_name   Conection_Date  Connection_MON_YEAR  District  Distributor_ID  Distibutor_name  Target   Name    Address
3455       22         nikon        22-Jan-2020       Jan-2020            abc    12                     A-Z         10      nilak      adcd

A: You have not given us anything about the data types or the constraints you are using.  You may also want to look at the normalization and the business rules again.  (But maybe that's something to ask in another question)
However, you could do something like:
select
  S.msissnd
, A.agentid, A.agentname
, to_char( S.connectiondate, 'DD-Mon-YYYY' ) as Connection_Date
, to_char( T.month_, 'Mon-YYYY' ) as Connection_MON_YEAR
, T.district, T.distributorid
, A.distributorname
, T.target
, C.name_, C.address
from sale S
  join agent A on S.agentid = A.agentid
  join customer C on S.msissnd = C.msissnd
  join target T on A.distributorid = T.distributorid
    and to_char( S.connectiondate, 'MM' ) = to_char( T.month_, 'MM' )
;

-- result
   MSISSND    AGENTID    AGENTNAME    CONNECTION_DATE    CONNECTION_MON_YEAR    DISTRICT    DISTRIBUTORID    DISTRIBUTORNAME    TARGET    NAME_    ADDRESS
__________ __________ ____________ __________________ ______________________ ___________ ________________ __________________ _________ ________ __________
      3455         22 nikon        22-Jan-2020        Jan-2020               abc                       12 A-Z                       10 nilak    adcd
      1222         22 nikon        12-Feb-2020        Feb-2020               abc                       12 A-Z                       15 rowan    fgsk

DBfiddle here.
If the "Month" in your TARGET table is a VARCHAR2() type, you could add a virtual column containing a date, so you don't need to write an explicit conversion into your query.
-- eg
SQL> alter table target
  2  add when_ date generated always as (
  3    to_date( Month, 'MON_YYYY')
  4  ) virtual ;


text:
Q: Schedule a stored procedure to run periodically? I need to run a task to update a table, periodically, using a stored procedure. Could you let me know if it is possible to schedule periodic tasks and to run any system command within stored procedure?

A: You can use SQL Server Agent to create jobs that run at regularly-scheduled intervals. One of the job step types is executing a stored procedure.

A: I use a 3rd party tool for my schedules. To be honest, it's not a great deal better than Sql Server Agent, but there are few perks to it. It's called
System Scheduler.


text:
Q: SSIS - Validation phase is taking too long I have an XML file and based on it I am looking to insert some information into my database. But first I need to split each node from the XML, to a source destination in SSIS. So far so good.
When I tried to execute the steps to see if I haven't missed something, I noticed that the XML Source step is taking too long, way too long, for at least 20 minutes before asking for help here. And each time I execute the package, a command prompt window pops up and quickly disappears.
I added some print screen below:
Package quick review:

Data flow task review:

Progress review

Does anyone know what might be the issue?

A: I've had this before with an export column transform. It may be a visual studio issue. Try "Start without Debugging" (Ctrl+F5), if it works fine there then it'll work once deployed.


text:
Q: Differences in license names between Prod and Scratch orgs I'm trying to automate our development process by using scratch orgs and pushing the converted metadata into them.
I have an existing codebase already, my production org was created in March 2015 and currently has the following license types:

*

*Force.com - App subscription

*Salesforce

*Chatter free

*Chatter External

A brand new scratch org, created with the "ForceComPlatform" feature in its config, has the following license types:

*

*Salesforce

*High Volume Customer portal

*Chatter Free

*Chatter External

*Company Communities

*Salesforce Platform

When I push the metadata extracted from our prod org into the scratch, it fails to create the profiles since some of them are assigned to the "Force.com - App Subscription" license.
A quick and dirty (and wrong) way to "fix" this would be to replace the Force.com kind of licenses for the "Salesforce Platform" ones, but i'm not sure about how different they are and I want to use a scratch as similar to my production and sandbox orgs as possible.
My scratch definition file for reference:
"orgName": "myOrg",
"edition": "Enterprise",
"language": "es_CL",
"features": [
    "MultiCurrency",
    "AuthorApex",
    "ServiceCloud",
    "PersonAccounts",
    "ForceComPlatform"
],
"orgPreferences" : {
    "enabled": [
        "AnalyticsSharingEnable",
        "ChatterEnabled",
        "DisableParallelApexTesting",
        "EnhancedEmailEnabled",
        "OfflineDraftsEnabled",
        "S1EncryptedStoragePref2",
        "S1OfflinePref",
        "SelfSetPasswordInApi"
    ]
}

A: In my knowledge "Force.com App Subscription" License types are subset of "Salesforce Platform" Licenses. Both have similar functionality/features to offer.
Salesforce Platform License :
Designed for users who need access to custom apps but not to standard CRM functionality. Users with this user license are entitled to use custom apps developed in your organization or installed from Force.com AppExchange. In addition, they are entitled to use core platform functionality such as accounts, contacts, reports, dashboards, documents, and custom tabs. However, these users are not entitled to some user permissions and standard apps, including standard tabs and objects such as forecasts and opportunities. Users with this license can also use Connect Offline.
Note:
Users with this license can only view dashboards if the running user also has the same license.
Users with a Salesforce Platform user license can access all the custom apps in your organization.
Each license provides additional storage for Enterprise and Unlimited Edition users.
-Salesforce

A: It might be worth your time trying to get on the Scratch Org Shape Pilot that was introduced in Winter '18 - Get Your Scratch Orgs in Shape (Pilot).
Then when the Scratch Org is created it will have the same "Shape" as the production org. This would ideally include the license types. However, this is a pilot, so your results may vary.

You can also see this with the org:shap:create (Pilot) command.

Creates a snapshot of org edition, features, and licenses to use for scratch org creation, allowing your scratch org to look like another org for testing.


text:
Q: Using Google oauth in a deployment I've set up an ASP.Net Core project to use Google OAuth signin from this tutorial
I created a client ID & secret using the settings 'Web server' with address 'https://localhost:5001/signin-google' and exposed the secrets to the app as described in the tutorial. I have a basic view which is just the minimum required HTML & JS to show a 'Sign in with Google' button and allow authentication (verified working on localhost).
I created a deployment in a docker container on a Raspberry Pi on the local network. When I navigate to the view with the Google sign in button and click it, I get an error of
Error: invalid_request

Permission denied to generate login hint for target domain.

In the error details it specifies the redirect URL as:
redirect_uri=storagerelay://http/x.x.x.x:8000?id=auth572720

where  x.x.x.x is the address of the Pi on our local network
I am assuming this is because the client expects a redirect URL of 'https://localhost..etc' but is getting 'http://x.x.x.x'.
I am unsure how to solve this, it seems like I may need to create another token to enable authentication on my Raspberry Pi (e.g. create another 'web server' OAuth sign in using the re-direct address 'http://x.x.x.x.etc/signin-google' but when I try this I get an error of 'Must be a top private domain'.
All in all this is very frustrating, and I would appreciate any help.

A: There is no need to create a new credential, just add the new redirect URL to the existing credential.
The redirect URL domain must be a TLD. Choose something like localhost.mydomain.com and then add an entry in your /etc/hosts file to resolve localhost.mydomain.com to x.x.x.x


text:
Q: Issue adding children to grid system I am fairly new to AS3. I have been wracking my brain trying to figure this out. I have a grid system laid out. Each grid block is instanced row1, row2, etc.
I have some code repeatedly adding children using for (var i:int = 0; i < 81; i++).
Within that for block in the end, it adds row.addChild(item); Isn't there a way to make the row + i so it will automatically name that row and add the child into it? Both books I have don't even mention it, although they use some sort of [i] or (i) for some other stuff.
Any help would be truly appreciated, as I have been stuck on this problem for days now, and my internet searches are just not working for this issue.
Here is my code:
for (var i:int = 0; i < 81; i++) {
        var item:MovieClip = new MovieClip();
        //item.fnumber = i;
        item.ftype = Math.round(Math.random() * 5 + 1);

                        if (item.ftype == 1) {
                        var item:MovieClip = new item(); item.fnumber = i; item.fcolor = ""; item.ftype = 1}
                        if (item.ftype == 2) {
                        var item:MovieClip = new item2(); item.fnumber = i; item.fcolor = ""; item.ftype = 2}
                        if (item.ftype == 3) {
                        var item:MovieClip = new item3(); item.fnumber = i; item.fcolor = ""; item.ftype = 3}
                        if (item.ftype == 4) {
                        var item:MovieClip = new item4(); item.fnumber = i; item.fcolor = ""; item.ftype = 4}
                        if (item.ftype == 5) {
                        var item:MovieClip = new item5(); item.fnumber = i; item.fcolor = ""; item.ftype = 5}
                        if (item.ftype == 6) {
                        var item:MovieClip = new item6(); item.fnumber = i; item.fcolor = ""; item.ftype = 6}

                    row.addChild(item);
                    item.flevel = 1;

A: var rows:Array = [];
var mcs:Array = [item, item2, item3, item4, item5, item6];

for(var n:int = 0; n<10; n++) {
    var row:Sprite = new Sprite();
    for (var i:int = 0; i < 81; i++) {

        var ftype = Math.round(Math.random() * 5 + 1);
        var item:MovieClip = new mcs[ftype]();
        item.fnumber = i;
        item.fcolor = "";
        item.ftype = ftype;
        item.flevel = 1;

        row.addChild(item);

    }
    addChild(row);
    rows.push(row);
 }

Now you can access rows with rows[i].

A: If you are to address a component which name is computed, use this[computedName] approach. Make sure, however, that you won't end up with null or undefined querying this, which can happen if you mis-name your components. Altering code of Baris:
var rows:Array = [];
var mcs:Array = [item, item2, item3, item4, item5, item6];

for(var n:int = 1; n<10; n++) {
    var row:MovieClip=this["row"+n]; // <-- this is the trick
    for (var i:int = 0; i < 81; i++) {

        var ftype = Math.round(Math.random() * 5 + 1);
        var item:MovieClip = new mcs[ftype]();
        item.fnumber = i;
        item.fcolor = "";
        item.ftype = ftype;
        item.flevel = 1;

        row.addChild(item);

    }
    // addChild(row); this is not needed, as you have your rows already on screen
    rows.push(row);
 }

Baris had there a couple of tricks for you to learn and master too, like creating an array of classes to randomly select from.


text:
Q: How to change "add to cart" in WooCommerce? I wanna use

 instead of <select> <option>
I enter this code in function.php but doesn't work:
function wc_dropdown_variation_attribute_options( $args = array() ) {
.
.
.
    $html  = '

اندازه:

';

    if ( ! empty( $options ) ) {
        if ( $product && taxonomy_exists( $attribute ) ) {
            // Get terms if this is a taxonomy - ordered. We need the names too.
            $terms = wc_get_product_terms(
                $product->get_id(),
                $attribute,
                array(
                    'fields' => 'all',
                )
            );

            foreach ( $terms as $term ) {
                if ( in_array( $term->slug, $options, true ) ) {
                    $html .= '
slug ) . '" ' . selected( sanitize_title( $args['selected'] ), $term->slug, false ) . '>' . esc_html( apply_filters( 'woocommerce_variation_option_name', $term->name, $term, $attribute, $product ) ) . '
';
                }
            }
        } else {
            foreach ( $options as $option ) {
                // This handles < 2.4.0 bw compatibility where text attributes were not sanitized.
                $selected = sanitize_title( $args['selected'] ) === $args['selected'] ? selected( $args['selected'], sanitize_title( $option ), false ) : selected( $args['selected'], $option, false );
                $html    .= '
' . esc_html( apply_filters( 'woocommerce_variation_option_name', $option, null, $attribute, $product ) ) . '
';
            }
        }
    }

    $html .= '

';

    echo apply_filters( 'woocommerce_dropdown_variation_attribute_options_html', $html, $args ); // WPCS: XSS ok.
}

How can I change woocommerce HTML codes to my own HTML codes?
this is more detail for post this question

A: To override the default themes of WooCommerce you better have a "woocommerce" sub-directory on your theme folder.
for example:
/wp-content/themes/mytheme/woocommerce/
There you can specify exactly which of the themes you want to change.
Learn more about it here.
Also, you can hook to actions and filters. In the example you sent, you can hook to this filter: woocommerce_dropdown_variation_attribute_options_html to change it's final output.
Learn more about it here and here.


text:
Q: Password RegEx - Minimum 12 char, Should contain 1 Uppercase & Lowercase & Number & Special Char and should not contain more than 2 repeated char I am looking for an password regEx. which should cover the following conditions

*

*1 Uppercase

*1 Lowercase

*1 Number

*1 Special Char

*should not contain more than 2 repeated char (Eg: SaaC - allowed, Saaac - Not allowed)

A: Can you try this?
/^(?!.*([A-Za-z0-9])\1{2})(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[!@#\$%\^&\*])(?=.{12,})/.test('some-text-here')


text:
Q: Javascript object multiple loop, same order? I know, that not every browser will output object items in the order they were added when you loop through.
But if I loop through an object a second time, can I be sure, that it will output the items in the same order as before, keeping in mind, that it must not be in the order as they were added?

A:
But if I loop through an object a second time, can I be sure, that it will output the items in the same order as before...

Not if you modify the object in any way. And even if you don't, then you're relying on undocumented behavior, since there are no guarantees about the order that properties are visited, including no guarantee they'll be visited in the same order subsequent times.
If you need something reliable, consider using Object.keys and sort:
Object.keys(theObject).sort().forEach(function(key) {
    // The order here will reliably be alphabetical
});

Note that Object.keys is in all modern browsers, but not in older ones like IE8. It can easily be polyfilled, though.
Live Example:

var obj1 = {};
obj1.a = 1;
obj1.b = 2;
obj1.c = 3;
Object.keys(obj1).sort().forEach(function(key) {
  snippet.log(key);
});

var obj2 = {};
obj2.c = 3;
obj2.b = 2;
obj2.a = 1;
Object.keys(obj2).sort().forEach(function(key) {
  snippet.log(key);
});
<!-- Script provides the `snippet` object, see http://meta.stackexchange.com/a/242144/134069 -->
<script src="http://tjcrowder.github.io/simple-snippets-console/snippet.js"></script>

A: Not sure, I think it will but you can make sure that it will do that if you use a sorted keys array like so:
var keys = Object.keys(myObject).sort();

keys.forEach(function (key) {
  // Access the value
  myObject[key]
});


text:
Q: Still have to recycle bitmaps in Android 4+? My Activity has an ImageView that takes up roughly half of the screen in portrait and a little less in landscape.  I load the Bitmap using inSampleSize to be frugal with my memory, but I wasn't doing anything to explicitly clean up the memory either.  I used to go crazy with recycling my Bitmaps prior to Gingerbread, but I've been more relaxed since Bitmap data was apparently moved into the Dalvik VM.  Without having any cleanup code, things worked in normal use cases, but I noticed that I'd run out of memory if I rotated this Activity a bunch of times.  So, I added the kind of aggressive memory cleanup code that you'd see prior to Gingerbread and it no longer crashes.  I'm wondering if this is overkill at this point though.  Is all of this code just equivalent to setting my Bitmap and ImageView to null in onDestroy, or is all of this extra work of tracking down underlying Bitamp objects and recycling them still valid and necessary?  Here's my code that fixed my OOME crashes:
Bitmap thumbnail;
@InjectView(R.id.thumbnail) ImageView image;

@Override
protected void onDestroy() {
    cleanupImageMemory();
    super.onDestroy();
}

private void cleanupImageMemory() {
    if (thumbnail != null) {
        thumbnail.recycle();
        thumbnail = null;
    }
    if (image != null) {
        Drawable d = image.getDrawable();
        if (d != null && d instanceof BitmapDrawable) {
            BitmapDrawable db = (BitmapDrawable) d;
            if (db.getBitmap() != null) {
                db.getBitmap().recycle();
            }
        }
        d = null;
        image = null;
    }
    System.gc();
}

A: Please see Stackoverflow : trying-to-use-a-recycled-bitmap-android-graphics-bitmap
And use :
if (db.getBitmap() != null && ! db.getBitmap().isRecycled()) {
            db.getBitmap().recycle();
}


text:
Q: Zipped java files appear as a single line I'm being sent some java code as Zip files, however, when I unzip them, it's a giant, illegible line of code.
I've tried sending the Zip via different mediums

A: This probably means the Java source file has a different line ending convention (LF vs. CRLF) than your local computer. If you use a decent text editor it will pick that up and display it correctly. Otherwise you can run a line-end converter to fix it up.

A: The software you use for reading the file might not handle correctly the original text format of the file causing line breaks to get lost. Depending on the operative system and the software used to create the file line breaks might be generated using only one LF (line feed) character (i.e. Linux) or in other cases it might need a combination of CR (carriage return) plus LF characters (i.e. windows) to represent the line break.
Try opening it with a more advanced text editor and you might be able to recover the missing line breaks.


text:
Q: Change Wiki content into clear text I am doing a project in which I want to extract the text of wiki page. The output I get is:

Processor - Wikipedia, the free encyclopedia Processor From Wikipedia,
  the free encyclopedia Jump to: navigation, search This disambiguation
  page should be converted into a broad-concept article, describing the
  primary meaning of the term. Additional meanings linked to this term
  should be moved to a separate page with "(disambiguation)" in the
  title. Look up processor in Wiktionary, the free dictionary.
  Processor, Processor unit or Processing unit may refer to: Contents 1
  Computing 2 Other 3 See also Computing [edit] Central processing unit
  Processing unit, in Von Neumann computer architecture, contains an
  arithmetic logic unit (ALU) and processor registers Microprocessor, a
  CPU on one silicon chip as part of a microcomputer
  Application-specific instruction-set processor, a component used in
  system-on-a-chip design Graphics processing unit (GPU / VPU), a
  dedicated graphics rendering device for a personal computer or game
  console Physics processing unit (PPU), a dedicated microprocessor
  designed to handle the calculations of physics Digital signal
  processor, a specialized microprocessor designed specifically for
  digital signal processing Network processor, a microprocessor
  specifically targeted at the networking application domain Front end
  processor, a helper processor for communication between a host
  computer and other devices Coprocessor Floating-point unit Data
  processing system, a system that translates or converts between
  different data formats Word processor, a computer application used for
  the production of printable material Audio processor, used in studios
  and radio stations Other [edit] Food processor, an appliance used to
  facilitate repetitive tasks in the preparation of food See also [edit]
  Process (disambiguation) Data processing (disambiguation) This
  disambiguation page lists articles associated with the same title. If
  an internal link led you here, you may wish to change the link to
  point directly to the intended article. Retrieved from
  "http://en.wikipedia.org/w/index.php?title=Processor&oldid=556083828"
  Categories: Disambiguation pages to be converted to broad concept
  articlesDisambiguation pagesHidden categories: All article
  disambiguation pagesAll disambiguation pages Navigation menu Personal
  tools Create accountLog in Namespaces Article Talk Variants Views Read
  Edit View history Actions Search Navigation Main page Contents
  Featured content Current events Random article Donate to Wikipedia
  Interaction Help About Wikipedia Community portal Recent changes
  Contact Wikipedia Toolbox What links here Related changes Upload file
  Special pages Permanent link Page information Cite this page
  Print/export Create a book Download as PDF Printable version Languages
  Espa ol Nederlands Norsk bokm l Portugu s Sloven ina Edit links This
  page was last modified on 21 May 2013 at 10:31. Text is available
  under the Creative Commons Attribution-ShareAlike License; additional
  terms may apply. By using this site, you agree to the Terms of Use and
  Privacy Policy. Wikipedia is a registered trademark of the Wikimedia
  Foundation, Inc., a non-profit organization. Privacy policy About
  Wikipedia Disclaimers Contact Wikipedia Mobile view Array

But I've expected the content as below...

Pollution is the introduction of contaminants into the natural
  environment that cause adverse change.Pollution can take the form of
  chemical substances or energy, such as noise, heat or light.
  Pollutants, the components of pollution, can be either foreign
  substances/energies or naturally occurring contaminants. Pollution is
  often classed as point source or nonpoint source pollution.

Is it possible to do from php or any other language, preserving the links?

A: Yes it is possible with PHP and also with many other languages.


text:
Q: writing onchange function in rails 3.2 I want to handle event for selected value changed in select box.
<%=  select_tag "vehicle", options_from_collection_for_select(@vid,"id","id"), :prompt => "Select vehicle" %>

Since remote_function is deprecated in rails 3.1, I wish to know how to write :onchange event and I want to write in ruby and not in JavaScript.

A: Just change your code to this
<%=  select_tag "vehicle", options_from_collection_for_select(@vid,"id","id"), :prompt => "Select vehicle", :onchange => "my_function();" %>

This will do the job