text:
Q: Book about a girl raised by a computer I have been looking for years, on and off, for a book that I can only assume is Fantasy/SciFi.
The story starts out with a young girl in an empty facility with no other beings to interact with other then a computer system. You begin with her growing up and asking the computer questions and exploring the facility. Even in the book, the description is a bit vague about when and where this is, which is what drove me the most about what was going on.
Anyways, the girl goes through puberty and such, oh also, she is described as naked throughout the series, I don't recall why I remember that point, but I remember it was something to do with noticing her changes. Anyways, she starts to explore the empty facility and finds a door that the main systems tells her not to go through, something or the other. Well she finds a way and discovers a male about her age in that side of the facility.
I don't recall much of what happens next but I know that they spend time trying to understand what is going on in the facility and why they are similar but different. Well, thinking on it it sounds like a book about puberty in sexual urges in a sterile and innocent futuristic environment. I do remember the ending is them leaving the facility that they thought was maybe in space, but turns out they are on a planet.
I know I read this between 2003-2008, but is seemed a bit old when I grabbed it from my local library. It had a hard cover, was definitely over 200 pgs about an inch thick. I feel strongly about it being in the fantasy section of the library, was not in the young readers or teen reads. This was adult themed with some mild sexual interaction. (Them discovering what sex is and learning about who and what they are). I think the computer program was a colonization program that restarted and produced a male and female in hopes to restart the human race again. It purposely kept to two unaware of each other and of the outside would I think.
Well it's late at night here and I just wish I knew the name of that book. I still remember what it was like visualizing the world it was in. It was a good book. In effort to try and find it I always end up at dead ends or revisiting some books I have already read. This one means a lot to me though. If you know anything about this book or something similar please contact me. Anything would help and if you want me to clarify on something then let me know, I will do my best to remember.

A: This is similar to Alien Child
Note: This is not the answer, but it is sufficiently similar that someone using the same keywords might find it. I was therefore encouraged to post it.

As indicated in the reviews, this features a

*

*girl

*raised partly by computers

*who encounters another human, a boy

*and has some sexual interaction with him.

Unfortunately, it may diverge in other respects, such as the manner in which the girl finds the other human; the protagonist saw the other human on an intercom, not by wandering into a forbidden part of the facility.
Although, from comments:

Goodreads review says something about a forbidden part of the facility: "And what is Llipel's companion, Llare, occupied by, in the parts of the complex that have been forbidden to Nita?" –
Malady - Feb 9, 2017 at 2:40
It is the book. As she grows older, she begins to wonder if there are any people who look like her. Then she discovers that a boy her age, Sven, lives in another wing of the building with a creature called Llare. –
Kinzle B - Feb 9, 2017 at 6:02

And the OP believes it may be the right book:

I went searching for the book again and was actually pleasantly surprise to find that my post was the first link on Google search. I believe you two may have found the book I have been looking for for years!!! The cover triggered me and I currently purchased the book to read it as soon as possible. I can't wait to read it. I want to thank you guys so much!!! I truly hope it is. –
Guzman - Jun 14, 2017 at 8:08


text:
Q: Activate microtype-Protrusion for superscript old style numbers with LuaLaTex I've been playing around with microtype's protusion-capabilities and LuaLaTeX, but faced a problem regarding old-style superscript numbers. The regular numbers protrude. This code
\documentclass{scrbook}

\usepackage{fontspec}
\usepackage[protrusion=true,final]{microtype}
\usepackage{libertinus}
\usepackage{blindtext}

\SetProtrusion{encoding={*}}
    {1={ ,1000},2={ ,1000},3={ ,500},4={ ,500},5={ ,500},
     6={ ,1000},7={ ,1000},8={ ,1000},9={ ,500},0={ ,500}}

\begin{document}
\setcounter{footnote}{100}
Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Etiam lobortis facilisis sem. Nullam nec mi et neque pharetra sollicitudin. Praesent imperdiet mi,
nec ante. Donec, ullamcorper, felis non sodales commodo, lectus velit ultrices
augue, a dignissim nib lectus placerat pede.\footnote{\blindtext} Vivamus nunc nunc, molestie
\end{document}

yields this:

(value 1000 is set for the sake of clarity; it's a bit too large). However, if I change the option to old-style numbers
\usepackage[osf]{libertinus}

they don't protrude anymore. (They do with pdfLaTeX, though.)

Is it possible to change that?

A: microtype in combination with LuaTeX (and XeTeX) is able to reference font-specific glyph-names with the prefix »/«. The case described in the documentation is the ligature »fl« which can be addressed with »/f_l«
In the case of oldstyle-number for »1«, this is done by
\SetProtrusion{encoding={TU},family=LibertinusSerif}{/one.taboldstyle={,1000}}
This yields:

The font-specific glyph-names can be retrieved e.g. by searching the font-file with FontForge:

The solution was provided by Robert in a comment.

redpajama_set_name: RedPajamaStackExchange


text:
Q: passing JSONGenerator apex value to javascript giving error I am trying to pass JSONGenerator value to javascript , but in vf page its appearing as new line due to which its erroring out "Uncaught SyntaxError: Invalid or unexpected token" . Why in javascript its showing as new line, not as a one line string. The same in apex debug , its displaying as new line. How can I make it in a new line.

Apex -
 global static String getRelationshipMap(){
        lstWrap = new  List<wrapper>();
        List<Stakeholder__c> lstStakeHolders = [Select Id, Reporting_To__c,Reporting_To__r.Name,
                                                External_Stakeholder__c, External_Stakeholder__r.Name  , Role__c
                                                FROM Stakeholder__c WHERE Id = 'a1g0E000005eLXpQAM'];
        JSONGenerator jsonGen = JSON.createGenerator(true);
       // jsonGen.writeStartObject();
        jsonGen.writeStartArray();
        for(Stakeholder__c stk: lstStakeHolders) {
            jsonGen.writeStartObject();
            jsonGen.writeStringField('id',stk.Id);
            jsonGen.writeStringField('name',stk.External_Stakeholder__r.Name);
            if(stk.Reporting_To__c == null) {
                jsonGen.writeNullField('pid');
            }else{
                jsonGen.writeStringField('pid',stk.Reporting_To__c);
            }
            if(stk.Role__c == null) {
                jsonGen.writeNullField('title');
            }else{
                jsonGen.writeStringField('title',stk.Role__c);
            }
            jsonGen.writeEndObject();
        }
        jsonGen.writeEndArray();
        //jsonGen.writeEndObject();
        jsonData = jsonGen.getAsString();
        System.debug('Json Data - ' + jsonData);
        return jsonData;
    }

VF page -
<apex:page doctype="html-5.0" standardStylesheets="false" controller="orgchartcontroller">
<script>

    var helloWord = "{!jsonData}"
</script>
</apex:page>

A: Merge fields just do a literal string replacement. There's no syntax awareness. You must use functions to correctly escape your data for the context in which you are merging it. In this case, you'll want JSENCODE().


text:
Q: Extracting the coefficient of $x^n$ from a fraction I need help extracting the coefficient of $x^n$ from a $\frac{1-x}{1-2x}$.
So far I have that
\begin{align}
\frac{1-x}{1-2x} &= \frac{1}{1-2x} - x\frac{1}{1-2x}\\
&= \sum\limits_{k=0}(2x)^k - x\sum\limits_{k=0}(2x)^k
\end{align}
would it then be correct to say that
\begin{align}
[x^n]\frac{1-x}{1-2x} = 2^n - 2^{n-1}?
\end{align}

A: Indeed.
Why ? For the two series you consider are of positive radius, hence you can identify the coefficients, as in any equality between integer series of positive radius.
And for your 'correct' answer, it's the same : $2^n - 2^{n-1} = 2^{n-1}(2-1)$... so, that's it.


text:
Q: I get the following error: ModuleNotFoundError: No module named The error that I get after the command "python manage.py runserver":
from LoginAPI.LoginApp.views import register_view, login_view, logout_view
ModuleNotFoundError: No module named 'LoginAPI.LoginApp'

My urls.py:
from django.conf.urls import url
from django.contrib import admin

from LoginAPI.LoginApp.views import register_view, login_view, logout_view

urlpatterns = [
    url(r'^admin/', admin.site.urls),

    url(r'^register/', register_view, name='register'),
    url(r'^login/', login_view, name='login'),
    url(r'^logout/', logout_view, name='logout'),
]

Django version: 2.1.1
I am not very experienced in python yet and would love to here your feedback, I have searched for solutions but couldn't seem to find any. Maybe that I missed something small but can't seem to find the problem.
EDIT:
The file hierarchy is as displayed:
You have the folder: "LoginAPI"
which contains the two folders: "LoginAPI" and "LoginApp"
The folder "LoginAPI" contains the file "urls.py"
The folder "LoginApp" contains a file "views.py"

A: If your project root directory is LoginAPI then you don't add it to call the modules.
Assuming then from what you specify as folder structure
# project root directory
LoginAPI/
    # app directories
    LoginAPI/
        urls.py
    LoginApp/
        views.py

So you should call
from LoginApp.views import register_view, login_view, logout_view


text:
Q: Why can't we apply L'Hospital's rule to sequences? I am reading this from my text and I don't really understand why we can't apply L'Hospital's rule directly to sequences?

I read this theorem and I get it:

A: I guess the idea of proposing to use L'Hopital's rule for sequences is based on the belief that if $f(n)\rightarrow L$ then $f(x) \rightarrow L$.
This doesn't hold true actually, see this counter-example:
$$f(n)=cos(2n\pi)$$
Trivially we can see that $f(n)=1$ $\forall n$, so $f(n) \rightarrow 1$ when $n \rightarrow \infty$.
This doesn't hold true for $f(x) = cos(2x\pi)$ since it doesn't converge when $x\rightarrow \infty$


text:
Q: Ubuntu 20.04 LTS Focal apt-get update not working So, here is my problem. I know it has been reported a lot, but somehow, it is kinda different.
I'm using Linux Ubuntu 20.04 LTS on a VM, and was able to successfully install the image with no problems.
syspass@syspass:~$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 20.04 LTS
Release:        20.04
Codename:       focal

Now, I'm trying to update the repo to be able to install some packages that I need to be able to deploy some systems on the the machine. However, I'm not able to due to a Connection Error
syspass@syspass:~$ sudo apt-get update
Err:1 http://archive.ubuntu.com/ubuntu focal InRelease
  Connection failed [IP: 91.189.88.152 80]
Err:2 http://archive.ubuntu.com/ubuntu focal-updates InRelease
  Connection failed [IP: 91.189.88.152 80]
Err:3 http://archive.ubuntu.com/ubuntu focal-backports InRelease
  Connection failed [IP: 91.189.88.152 80]
Err:4 http://archive.ubuntu.com/ubuntu focal-security InRelease
  Connection failed [IP: 91.189.88.152 80]
Reading package lists... Done
W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/focal/InRelease  Connection failed [IP: 91.189.88.152 80]
W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/focal-updates/InRelease  Connection failed [IP: 91.189.88.152 80]
W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/focal-backports/InRelease  Connection failed [IP: 91.189.88.152 80]
W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/focal-security/InRelease  Connection failed [IP: 91.189.88.152 80]
W: Some index files failed to download. They have been ignored, or old ones used instead.

So, I did some digging, and found that the IP Address is indeed reachable from the VM (Note: ping is blocked over the network for security purposes)
syspass@syspass:~$ nslookup archive.ubuntu.com
Server:         127.0.0.53
Address:        127.0.0.53#53

Non-authoritative answer:
Name:   archive.ubuntu.com
Address: 91.189.88.142
Name:   archive.ubuntu.com
Address: 91.189.88.152
Name:   archive.ubuntu.com
Address: 2001:67c:1360:8001::23
Name:   archive.ubuntu.com
Address: 2001:67c:1360:8001::24

syspass@syspass:/var/tmp$ tracepath -4 -b archive.ubuntu.com
 1?: [LOCALHOST]                      pmtu 1500
 1:  _gateway (10.8.4.254)                                 1.047ms
 1:  _gateway (10.8.4.254)                                 1.068ms
 2:  10.8.6.1 (10.8.6.1)                                   1.030ms
 3:  10.8.5.2 (10.8.5.2)                                   1.446ms
 4:  10.2.240.254 (10.2.240.254)                           2.673ms
 5:  no reply
 6:  no reply
 7:  197.246.5.49 (197.246.5.49)                          11.161ms pmtu 1492
 7:  no reply
 8:  no reply
 9:  no reply
10:  no reply
11:  no reply
12:  no reply
13:  no reply
14:  actiontoad.canonical.com (91.189.88.152)            131.035ms reached
     Resume: pmtu 1492 hops 14 back 14

So, I decided to do a bit of further digging, and found that the required resource is indeed reachable!
syspass@syspass:~$ wget http://archive.ubuntu.com/ubuntu/dists/focal/InRelease
--2020-12-08 09:39:29--  http://archive.ubuntu.com/ubuntu/dists/focal/InRelease
Resolving archive.ubuntu.com (archive.ubuntu.com)... 91.189.88.152, 91.189.88.142, 2001:67c:1360:8001::24, ...
Connecting to archive.ubuntu.com (archive.ubuntu.com)|91.189.88.152|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 264892 (259K)
Saving to: 'InRelease'

InRelease                          100%[=============================================================>] 258.68K   345KB/s    in 0.8s

2020-12-08 09:39:30 (345 KB/s) - 'InRelease' saved [264892/264892]

syspass@syspass:~$ curl -vvv http://archive.ubuntu.com/ubuntu/dists/focal/InRelease --HEAD
*   Trying 91.189.88.142:80...
* TCP_NODELAY set
* Connected to archive.ubuntu.com (91.189.88.142) port 80 (#0)
> HEAD /ubuntu/dists/focal/InRelease HTTP/1.1
> Host: archive.ubuntu.com
> User-Agent: curl/7.68.0
> Accept: */*
>
* Mark bundle as not supporting multiuse
< HTTP/1.1 200 OK
HTTP/1.1 200 OK
< Date: Tue, 08 Dec 2020 09:42:06 GMT
Date: Tue, 08 Dec 2020 09:42:06 GMT
< Server: Apache/2.4.29 (Ubuntu)
Server: Apache/2.4.29 (Ubuntu)
< Last-Modified: Thu, 23 Apr 2020 17:34:17 GMT
Last-Modified: Thu, 23 Apr 2020 17:34:17 GMT
< ETag: "40abc-5a3f8a874d840"
ETag: "40abc-5a3f8a874d840"
< Accept-Ranges: bytes
Accept-Ranges: bytes
< Content-Length: 264892
Content-Length: 264892
< Cache-Control: max-age=0, proxy-revalidate
Cache-Control: max-age=0, proxy-revalidate
< Expires: Tue, 08 Dec 2020 09:42:06 GMT
Expires: Tue, 08 Dec 2020 09:42:06 GMT

<
* Connection #0 to host archive.ubuntu.com left intact

My /etc/apt/sources.list file is below as well in case it can help:
# See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to
# newer versions of the distribution.
deb http://archive.ubuntu.com/ubuntu focal main restricted
# deb-src http://archive.ubuntu.com/ubuntu focal main restricted

## Major bug fix updates produced after the final release of the
## distribution.
deb http://archive.ubuntu.com/ubuntu focal-updates main restricted
# deb-src http://archive.ubuntu.com/ubuntu focal-updates main restricted

## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
## team. Also, please note that software in universe WILL NOT receive any
## review or updates from the Ubuntu security team.
deb http://archive.ubuntu.com/ubuntu focal universe
# deb-src http://archive.ubuntu.com/ubuntu focal universe
deb http://archive.ubuntu.com/ubuntu focal-updates universe
# deb-src http://archive.ubuntu.com/ubuntu focal-updates universe

## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
## team, and may not be under a free licence. Please satisfy yourself as to
## your rights to use the software. Also, please note that software in
## multiverse WILL NOT receive any review or updates from the Ubuntu
## security team.
deb http://archive.ubuntu.com/ubuntu focal multiverse
# deb-src http://archive.ubuntu.com/ubuntu focal multiverse
deb http://archive.ubuntu.com/ubuntu focal-updates multiverse
# deb-src http://archive.ubuntu.com/ubuntu focal-updates multiverse

## N.B. software from this repository may not have been tested as
## extensively as that contained in the main release, although it includes
## newer versions of some applications which may provide useful features.
## Also, please note that software in backports WILL NOT receive any review
## or updates from the Ubuntu security team.
deb http://archive.ubuntu.com/ubuntu focal-backports main restricted universe multiverse
# deb-src http://archive.ubuntu.com/ubuntu focal-backports main restricted universe multiverse

A: After deeper investigation, I found that the apt-get was blocked on a perimeter firewall. After allowing the traffic for apt-get application, everything worked fine.


text:
Q: Source control keeps sidebar opening automatically I am fairly new to VS Code. I really like it, but there is one thing that is extremely annoying and if I cant fix it, I might switch back to vim.
Every time I click into a editor tab (In my case I use a split layout and click into the other split) the source control side bar opens itself. It is really annoying, because it almost takes a quarter of my screen.
How can I disable it fully and only open the bar when I need it?
EDIT 1:
The moment I posted this yesterday it stopped happening. Now it happens again. I have no idea why.
It might be related to the split layout. I just closed the split and reopened it and it stopped happening.


text:
Q: VBA email multiple columns I am trying to get data from the spreadsheet to be displayed in an email.  If it was all in a row, this would be easy.  What I want is for the data:
DspG   DspN   Comp   PriSMTP   Owner   OwnerE
A       M_N     C_N    u@c.com    O_N     o@c.com
A       R_N     D_N    v@l.com    O_N     o@c.com
A       N_N     E_N    w@e.com    O_N     o@c.com
B       F_N     T_N    q@d.com    Dif_N   i@dd.com
B       G_N     K_N    a@p.com    Dif_N   i@dd.com
C       V_N     B_N    j@d.com    Oth_N   b@333.com

to display DspG, Owner, and OwnerE only once but get the 3 rows of data from DspN, comp, PriSMTP.  Repeat this where DspG is equal to B, then C. All the way down column A.
Thank You in advance for any help/advice.
If your interested, the email routine I'm using is for the email is at http://www.globaliconnect.com/excel/index.php?option=com_content&view=article&id=170:automate-outlook-using-vba-sending-email-from-excel-using-outlook&Itemid=473

A: In the example you linked to, I believe you should be able to use:
With miOL
    .Subject = "Financial Analysis - 2012"
    .Body = Range("A1:F7").Value 'Use the value of the range instead of explicitly stating a string

If that enters it as one line or has weird formatting, you should be able to use a For loop and enter each row at a time followed by a line feed and carriage return.


text:
Q: Given two hermitian matrices of signature (2,1) there exists a Cayley transform between them? Given a matrix $A\in M_{k\times l}(\mathbb{C})$ we define the hermitian transpose of $A$ as the matrix $A^*=\overline{A}^t\in M_{l\times k}(\mathbb{C})$. We say a matrix $H\in M_k(\mathbb{C})$ is hermitian if $H=H^*$. In particular, we can show easily that all eigenvalues of an hermitian matrix are real. We say that a $3\times 3$ hermitian matrix is of signature (2,1) if it has two positive eigenvalues and one negative eigenvalue. Given two hermitian matrices $H$ and $H'$, if $C$ is a matrix such that
$$H'=C^*HC,$$
we say $C$ is a Cayley transform.
I'm reading the Notes on Complex Hyperbolic Geometry
 by John Parker, and at the page 8 of it he says (at least it seems so) that if $H$ and $H'$ are hermitian matrices of signature (2,1) then such a $C$ always exists. Is that so? How can one show it?
I've tried to solve it by system of equations, but it's not so simple... :(

A: This is a special case of Sylvester's law of inertia. By the way, the term Cayley transform usually refers to something else.


text:
Q: MP4 STSD structure I doubt in one thing. As described in ISO-14496-12 moov/mvhd/trak/mdia/minf/stbl/stsd should contain format specific box e.g. avc1 box described in ISO-14496-15 or mp42 described in ISO-14496-14. But it also contains  fields in VideoSampleDescription from QuickTime Format specification such as 'version', 'revision_level','vendor', etc.
Could anyone explain this issue?

A: The stsd (Sample Description Box) can be treated like a box that contains other boxes. Each Sample Entry is also just a normal box:
 4 bytes - length in total
 4 bytes - 4 char code of sample description table (stsd)
 4 bytes - version & flags
 4 bytes - number of sample entries (num_sample_entries)
 [
    4 bytes - length of sample entry (len_sample_entry)
    4 bytes - 4 char code of sample entry
    ('len_sample_entry' - 8) bytes of data
 ] (repeated 'num_sample_entries' times)
(4 bytes - optional 0x00000000 as end of box marker )


text:
Q: How to continue looping through DataInputStream? I am reading a binary file and I have to parse through the headers in this file.
I have a DataInputStream set up and I need to get it to continue looping through the file until the end. I am new to Java so not sure how I would carry this over from my C# experience. At the moment I have the following code:
while (is.position != is.length) {
    if ( card == Staff) {
        System.out.print(card);
    } else if ( card == Student ) {
        System.out.print(card);
    } else if (card == Admin) {
        System.out.print(card);
    } else {
        System.out.print("Incorrect");
    }
}

is is the input stream I created, the only error I have is in the first line where the while loop starts under position and length it says they cannot be resolved or is not a field.

A: Looking at the docs it doesn't look like DataInputStream has a position field. You could possibly use one of the other methods to check whether there is more data available, but it's not clear from your code sample what you're trying to do.
At present there are a number of issues I can see with your code:

*

*If card, Staff, Student and Admin are of type String, then you need to compare them using the equals(String s) method, not the == reference equality (ie. card.equals(Staff) rather than card == Staff)

*You don't seem to iterate in your loop. If you don't do anything to change the value of is.position (I know this doesn't actually exist, but hypothetically speaking...) then if you can enter the loop you'll never leave it.

*You don't change the value of card. If you do iterate some fixed number of times, you're going to just have identical output printed over and over again, which probably isn't what you intended.


text:
Q: ORA 907: faltan paréntesis derecho. CREATE TABLE AS Buenas, por favor alguien podría ayudarme en esta sentencia?
Está bien de acuerdo a la estructura pero me sale que faltan los paréntesis derecho. Muchas gracias.
CREATE TABLE HIST_CLIN_REPETIDAS_POR_APP
AS
(
SELECT COUNT(*),
    NUM_HIST_CLIN,
    AP_PAT,
    AP_MAT,
    PRIMER_NOMBRE,
    COD_APP
from USRCRPWRK.CDI_PERSONA
WHERE NUM_HIST_CLIN <> 0
GROUP BY NUM_HIST_CLIN ,
    AP_PAT,
    AP_MAT,
    PRIMER_NOMBRE,
    COD_APP
HAVING COUNT(*) > 1
ORDER BY COD_APP, count(*) desc
)

A: Este es uno de esos casos dónde Oracle te lanza un mensaje de error imposible de entender.
Contrario a lo que dice el error, el problema es que no le gusta la presencia de la claúsula ORDER BY en el subquery. En efecto, en algunos tipos de subqueries, Oracle no permite la claúsula ORDER BY, y este es uno de esos casos.
Puedes solucionar el error de 2 maneras:

*

*Quitar la claúsula ORDER BY:
En realidad, siendo que estás creando una tabla, y por definición, una tabla no mantiene los registros en orden, probablemente el ORDER BY está de más de todas maneras y no te ayuda mucho.

*Quitar las paréntesis:
Si de verdad necesitas el ORDER BY para optimizar el orden físico de los registros al momento de crear la tabla, se puede hacer. Aunque parezca raro, es solo cuestión de modificar la sintaxis para no usar paréntesis. O sea, en vez de:
create table HIST_CLIN_REPETIDAS_POR_APP as (select ... order by ...)

...puedes hacer:
create table HIST_CLIN_REPETIDAS_POR_APP as select ... order by ...

... y aunque es extraño, de esta forma, Oracle sí acepta la claúsula ORDER BY.

Una vez que corrijas este error, notarás que vas a recibir otro error diferente. Esto es porque para poder crear una tabla a partir de una consulta, todas las columnas devueltas por la consulta deben tener un nombre asignado. En tu caso, no le va a gustar que estés devolviendo COUNT(*) sin asginarle un alias. Vas a tener que corregir eso también:
SELECT COUNT(*) AS escoge_un_alias,


text:
Q: UITableView - How to update array on + and - click? I was trying to achieve below requirement :
Condition : first row is compulsory with only + button rest of all below are dynamic with
+ and - button.
i.e. i can add from any row and delete any row
e.g. Suppose i have 4 rows, when i click + button from 2nd row there will be one more
row added after 4th row  and suppose i click on - button from 3rd row that row need to be removed.
My attempts :
First Attempt
Here is my code snip :
ViewDidLoad
 dataArray = [[NSMutableArray alloc] init];
 for (int i = 0; i < 1; i++)
 {
    int value = i;
    [dataArray addObject: [NSNumber numberWithInt:value]];
 }

cellForRowAtIndexPath
 - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath

{
     [cell.serviceAdd addTarget:self action:@selector(onAddServiceButtonClicked:) forControlEvents:UIControlEventTouchUpInside];
     [cell.serviceRemove addTarget:self action:@selector(onRemoveButtonClicked:) forControlEvents:UIControlEventTouchUpInside];
     cell.serviceAdd.tag = indexPath.row;
     cell.serviceRemove.tag = indexPath.row;
}

    -(void)onAddServiceButtonClicked:(UIButton*)sender
    {
       //NSLog(@"%ld", (long)sender.tag);
       NSNumber *myNum = dataArray.lastObject;
       NSNumber *bNumber = [NSNumber numberWithInt:[myNum intValue] + 1];
       NSLog(@"%lu", (unsigned long)dataArray.count);
       [dataArray addObject:bNumber];
       NSLog(@"%lu", (unsigned long)dataArray.count);
       [_serviceListTableview reloadData];
    }

    -(void)onRemoveButtonClicked:(UIButton*)sender
    {
        NSLog(@"%ld", (long)sender.tag);
        NSInteger mySenderValue = sender.tag;
        NSNumber *myNum = @(mySenderValue);
        NSLog(@"%lu", (unsigned long)dataArray.count);
        [dataArray removeObject:myNum];
        NSLog(@"%lu", (unsigned long)dataArray.count);
        [_serviceListTableview reloadData];
    }

Issue with above code :
My dataArray having (these are added by clicking on any row of +  button. The list will be in sorted
order only )
        (
            0,
            1,
            2,
            3,
            4
        )
After this i clicked on 2nd row of - Button i.e sender tag is 1
now dataArray
        (
        0,
        2,
        3,
        4
        )

Now i clicked (price 200) 2nd row again , tag is 1
but that entry not going to be deleted because that is not in array.
Second Attempt :
    -(void)onAddServiceButtonClicked:(UIButton*)sender

in this method if
    NSNumber *myNum = dataArray.lastObject;

this line replaced with sender.tag (like implemented in onRemoveButtonClicked )
then entries in dataArray are duplicate as a result when i click - button 2 entries are going to be deleted
Any suggestion would be a great help for me.

A: I believe instead of considering your button tags as direct data in the array you should consider them row indexes because that is what actually they mean. So, you should not use removeObject: to update your data model, instead use removeObjectAtIndex: by passing the tag value.

A: Replace the code in your methods: onAddServiceButtonClicked and onRemoveButtonClicked with the following code:
-(void)onAddServiceButtonClicked:(UIButton*)sender
{
   NSInteger count = dataArray.count;
   NSInteger last = count - 1;
   NSInteger newObject = last + 1;

   NSLog(@"Count before adding: %lu", (unsigned long)dataArray.count);
   [dataArray addObject:[NSNumber numberWithInteger:newObject]];
   NSLog(@"Count after adding: %lu", (unsigned long)dataArray.count);

   [_serviceListTableview reloadData];
}

-(void)onRemoveButtonClicked:(UIButton*)sender
{
    NSInteger position = sender.tag;

    NSLog(@"Count before removing row: %lu", (unsigned long)dataArray.count);
    [dataArray removeObjectAtIndex:position];
    NSLog(@"Count after removing row: %lu", (unsigned long)dataArray.count);

    [_serviceListTableview reloadData];
}

Hope it helps.

A: Using index paths in tags is inherently difficult because as you renumber rows (as a side-effect of deleting rows) the tags stored in cells become incorrect; so you need to refresh the remaining rows.
A better approach than coupling an action from your cell button to your table view controller is to use a delegate pattern from your cell to your tableview controller.
I would suggest something like
In YourCell.h
@class YourCell;

@protocol YourCellDelegate <NSObject>

@optional -(void) didTapAddInCell:(YourCell *)cell;

@optional -(void) didTapDeleteInCell:(YourCell *)cell;

@end

@interface YourCell : UITableViewCell

@property (weak,nonatomic) id<YourCellDelegate> delegate;

@end

In YourCell.m
- (IBAction)addTapped:(UIButton *)sender {
    if ([self.delegate respondsToSelector:@selector(didTapAddInCell:)]) {
        [self.delegate didTapAddInCell:self];
    }
}
- (IBAction)deleteTapped:(UIButton *)sender {
    if ([self.delegate respondsToSelector:@selector(didTapDeleteInCell:)]) {
        [self.delegate didTapDeleteInCell:self];
    }
}

Note.  Set addTapped and deleteTapped as the action handler for the buttons either in the prototype cell if you are using one or in the cell initialiser
Then in your table view controller, set the delegate when you dequeue the cell and implement the delegate methods (you will also need to change the class definition to indicate that it implements the protocol)
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath

{
    ...
    cell.delegate=self;
    ...
}

#pragma mark - YourCellDelegate methods

-(void) didTapAddInCell:(YourCell *)cell {
   NSIndexPath *newPath=[NSIndexPath indexPathForRow:dataArray.count inSection:0];
   NSNumber *myNum = dataArray.lastObject;
   NSNumber *bNumber = [NSNumber numberWithInt:[myNum intValue] + 1];
   NSLog(@"%lu", (unsigned long)dataArray.count);
   [dataArray addObject:bNumber];
   NSLog(@"%lu", (unsigned long)dataArray.count);
   [_serviceListTableview addRowsAtIndexPaths:@[newPath] withRowAnimation:UITableViewRowAnimationAutomatic];
}

-(void) didTapDeleteInCell:(YourCell *)cell {
    NSIndexPath *deletedPath=[_serviceListTableView indexPathForCell:cell];
    if (deletedPath != nil) {
        [dataArray removeObjectAtIndex:deletedPath.row];
        [_serviceListTableView deleteRowsAtIndexPaths:@[deletedPath] withRowAnimation:UITableViewRowAnimationAutomatic];
    }
 }

A: Fill dataArray with your data, not your index. Looks like you are trying to create some kind of NSDictionary, with index and value. In your case it's not neccessary at all. Use dataArray for data, and element index will be your tag. BTW you can use these functions for one row update:
- (void)insertRowsAtIndexPaths: withRowAnimation:
- (void)deleteRowsAtIndexPaths: withRowAnimation:


text:
Q: Merge 2 nested objects / overwrite selectively in ES6 I'm looking for a way to merge 2 nested objects in ES6, so that one object selectively overwrites only the properties it defines. Let me explain by example:
baseObject = {
  style = {
    background: 'yellow',
    text: {
      color: 'black',
      fontSize: 20,
    }
  }
}

overwritingObject = {
  style: {
    text: {
      fontSize: 12,
    }
  }
}

The desired outcome is this:
mergedObject = {
  style = {
    background: 'yellow',
    text: {
      color: 'black',
      fontSize: 12 <---- only this was overwritten
    }
  }
}

I've looked at native JS' object.assign and lodash's extend, assign, and merge methods, but none of them seem to fit the bill (if I'm not mistaken).

A: Lodash's merge looks like it should do exactly what you're looking for:
mergedObject = _.merge(baseObject, overwritingObject);

https://lodash.com/docs/4.17.15#merge

A: This just follows up on frodo's answer with an image of it in action, confirming the solution.

A: You can use lodash.merge function as mentioned above or you can write your own deep merge function

function mergeDeep(target, source) {
  if (target && source) {
    Object.keys(source).forEach(key => {
      if (typeof source[key] === 'object') {
        if (!target[key]) Object.assign(target, { [key]: {} });
        mergeDeep(target[key], source[key]);
      } else {
        Object.assign(target, { [key]: source[key] });
      }
    });
  }
  return target;
}

const baseObject = {
  style: {
    background: 'yellow',
    text: {
      color: 'black',
      fontSize: 20,
    }
  }
}

const overwritingObject = {
  style: {
    text: {
      fontSize: 12,
    }
  }
}

console.log(mergeDeep(baseObject, overwritingObject))


text:
Q: SQL Server 2008 Express insertion delay appearing in Management Studio I have a system being build with SQL Server 2008 Express, running on an Atom processor machine, and I'm experiencing a strange problem.  The app uses Microsoft Entity Framework 4.0, and commits an insert using SaveChanges to store data in a table.
When I run my app on a desktop machine, the code runs fine, and the record appears in the table fairly quickly (in about 1 second), when viewing the table using Management Studio.  I have Select Top 1000 rows selected, and refreshing it finds the inserted row.
When I try the same thing on the Atom based processor, and I perform the same steps, it can often be 20-30 seconds before I am able to see the inserted record in the table.  Also, it appears that if I close the query window and open a new one, I am then able to see it.
Questions:

*

*Is there any type of caching results [with Express] which could be
causing this problem?

*Is there any known performance issue like this known in any form?

*Any potential known issues running on an Atom processor?

*I might have the full SQL Server version of Management Studio on the machine (the machine may have previously had SQL Server 2008
standard on it, which was uninstalled and then Express installed),
with the standard installed Management Studio being run against the
Express database.  Any gut feeling or known issues about this
arrangement?  [I thought Management Studio for SQL 2008 and SQL 2008
Express is the same, but not 100% sure].

*Is there any known reason with Express why closing a query window and then re-opening it would show the records when run re-running the
same query would not?

NOTE: The table in question has only a handful of records in it (0 to 5 typically), so it isn't a table size issue.  It is a fairly small database, and there is plenty of memory available, disk space available, and the processor isn't heavily taxed during this operation.


text:
Q: How to create a Shared object(.so) file in Xcode6? I am creating an app using Swift Language in Xcode 6.1 Beta. How to create a .so file? Will the Xcode create a .so file automatically? If yes where can I find it?

A: Darwin, the OS that iOS (and OS X) use, doesn't use ELF shared objects (.so). Instead, it uses Mach-O dynamic libraries (.dylib). Apple recently added support for frameworks, which includes a dynamic library inside of a directory structure, which can include headers and resources that the framework, or an app linking to the framework, might use.


text:
Q: Localization in the hmc structure I have a problem.
I have this part of hmc.xml structure:
<type name="Order" mode="append"> <!-- LOLLO -->
        <organizer>
            <search mode="append">
                <condition attribute="versionID" operator="is null" />
            </search>
            <editor mode="append">
                <tab name="positions_and_prices" position="0" mode="append">
                    <section name="original_totals" position="1" mode="append">
                        <listlayout>
                            <attribute name="subTotalOriginal" descriptionattribute="currency" labelwidth="530" width="124">
                                <doubleeditor>
                                    <parameter key="align" value="right"/>
                                </doubleeditor>
                            </attribute>
                            <attribute name="totalDiscountsOriginal" descriptionattribute="currency" labelwidth="530" width="124">
                                <doubleeditor>
                                    <parameter key="align" value="right"/>
                                </doubleeditor>
                            </attribute>

I would translate the section original_totals.
I tried adding a code like

section.original_totals=OriginalTotals

but nothing happens.
How can I reference this section?
Here there is a screenshot of the structure:

A: In your hmc.xml you reference original_totals this should be section.original_totals leading to: name="section.original_totals". If you overwrite/extend existing functionality and you are not sure how to declare your code it is always a good habit to look for the original files, in this case the hmc.xml in the hmc extension.


text:
Q: Call method and pass data from view controller B to view controller A in Xamarin.iOS I have a view controller A where I retrieve some values. Under certain circumstances the user has to select a value if multiple are available. So I present another view controller B (UITableView) where I let the user select the entry. How can I call a method from A when I'm currently on B? (to avoid duplicate code) And how can I pass some params in that method?
I read about delegates/protocols, events (.NET style), and notification center. What is the best way to pass a string and call the method from A? Could you provide an example? In the example from Xamarin there is no example of how to define a custom protocol.
Or should I make a field from A public and pass this field to view controller B where I work with the data?

A: Events
I managed to get the event approch working. My information was based on the following links:

*

*PresentViewController and pass data back

*Communicate Between Master and Detail Controllers

*A better UITableViewSource in Xamarin iOS

*Event Handling UITableViewSource for iOS with Monotouch
In my UITableViewController (view controller B) I added the following:
// class variable
public event EventHandler<BLevelSelectedEventArgs> BLevelSelected;

// event handler
public class BLevelSelectedEventArgs : EventArgs
{
    public BLevelItem bLevel { get; set; }

    public BLevelSelectedEventArgs(BLevelItem bLevel) : base()
    {
        this.bLevel = bLevel;
    }
}

Here the event as well as the custom event handler is defined. You can define the properties you want to transport the data with the event e.g. string. Here a custom BLevelItem is used. The name of the event handler and the name of the event should be changed for your application. In this UITableViewController class I also have the UITableViewSource defined.
public override void RowSelected (UITableView tableView, NSIndexPath indexPath)
{
    tableView.DeselectRow (indexPath, true); // iOS convention is to remove the highlight

    if (this.controller.BLevelSelected != null) {
        this.controller.BLevelSelected (this, new BLevelSelectedEventArgs (controller.bLevelList[indexPath.Row]));
    }

}

Here the event is raised and the parameter are passed with the event. Now only one listener is missing which reacts on the event. This goes on view controller A:
bLevelController.BLevelSelected += (object sender, BLevelController.BLevelSelectedEventArgs e) => {
    System.Diagnostics.Debug.WriteLine(e.bLevel.bLevelName);
};

bLevelController is an instance of my view controller B. You can access the defined event as seen above, but you have to be aware that you use the class name (BLevelController) to access BLevelSelectedEventArgs.
It would be nice if one you could also add the other possibilities to pass the data between view controllers (Notification center, Protocol/Delegates, ...).

Delegate
A kind of delegate method is used Part 5 - Working with Tables in the iOS Designer. You define a Delegate in your UITableViewController:
public MasterViewController Delegate {get;set;} // will be used to Save, Delete later

When you instantiate the DetailViewController in the MasterViewController you set the Delegate property. Example:
public override void PrepareForSegue (UIStoryboardSegue segue, NSObject sender)
{
    base.PrepareForSegue (segue, sender);

    var detailViewController = segue.DestinationViewController as DetailViewController;

    if (detailViewController != null) {
        detailViewController.Delegate = this;
    }
}

In the DetailViewController you can call any method from the MasterViewController:
public override void RowSelected (UITableView tableView, NSIndexPath indexPath)
    {
    tableView.DeselectRow (indexPath, true); // iOS convention is to remove the highlight
    if (this.controller.Delegate != null) {
        this.controller.Delegate.SetItems (this.controller.items[indexPath.Row]);
    }
}

// a method in MasterViewController
public void SetItems(string items){
    this.items = items;
    this.NavigationController.PopViewControllerAnimated (true);
    // do something here
}

This works because I pass the DetailViewController to the DetailViewSource:
// in ViewDidLoad of DetailViewController
this.TableView.Source = new DetailViewSource (this);

// in the constructor of DetailViewSource
private CostCentreController controller;

public CostCentreListSource (CostCentreController controller)
{
    this.controller = controller;
}

NSNotificationCenter
My information are based on xamarin/monotouch-samples and Xamarin NSNotificatioCenter: How can I get the NSObject being passed?.
Simple example without data transfer:
// class level variable
NSObject observer;

// register as observer
public override void ViewWillAppear (bool animated)
{
    base.ViewWillAppear (animated);
    observer = NSNotificationCenter.DefaultCenter.AddObserver ((NSString)UIDevice.OrientationDidChangeNotification, OrientationChanged);
}

// deregister as observer
public override void ViewDidDisappear (bool animated)
{
    base.ViewDidDisappear (animated);
    if (observer != null) {
        NSNotificationCenter.DefaultCenter.RemoveObserver (observer);
        observer = null;
    }
}

// function which should do something when notification is received
public void OrientationChanged(NSNotification notification){
    Console.WriteLine ("test");
    // perhaps you can do the following as in the linked SO question: NSObject myObject = notification.Object;
}


text:
Q: Set the background colour of cells via formula in Excel In Excel:

*

*Cell B1: Hoe goed ken je God?

*Cell C1: HOE GOED KEN JE GOD?

*Cell D1: =AND(B1=C1)
The macro works and shows TRUE or FALSE
What I would now like this formula to do is set the background colour of cells A1:E1 to cyan if the return value was false, else leave with white background.
Can this be done?


text:
Q: Реклама на Qt. выходит ошибка Решил добавить рекламу в приложение на андроид созданное на Qt, но добавить рекламу тут составляет огромную проблему. По этой инструкции (https://habrahabr.ru/post/261425/), я старался внедрить рекламу, но компиляция останавливается и появляется такое сообщение:

C:\Users\PC\Documents\build-Tests-Android_for_armeabi_v7a_GCC_4_9_Qt_5_8_0-Debug\android-build\AndroidManifest.xml:51:13 Error:
      Missing 'name' key attribute on element meta-data at AndroidManifest.xml:51:13
  :processDebugManifest
  C:\Users\PC\Documents\build-Tests-Android_for_armeabi_v7a_GCC_4_9_Qt_5_8_0-Debug\android-build\AndroidManifest.xml:85:5 Warning:
      Element uses-permission#android.permission.INTERNET at AndroidManifest.xml:85:5 duplicated with element declared at AndroidManifest.xml:76:9
  C:\Users\PC\Documents\build-Tests-Android_for_armeabi_v7a_GCC_4_9_Qt_5_8_0-Debug\android-build\AndroidManifest.xml:86:5 Warning:
      Element uses-permission#android.permission.WRITE_EXTERNAL_STORAGE at AndroidManifest.xml:86:5 duplicated with element declared at AndroidManifest.xml:77:5
  C:\Users\PC\Documents\build-Tests-Android_for_armeabi_v7a_GCC_4_9_Qt_5_8_0-Debug\android-build\AndroidManifest.xml:0:0 Error:
      Validation failed, exiting
  :processDebugManifest FAILED
FAILURE: Build failed with an exception.

*

*What went wrong:
  Execution failed for task ':processDebugManifest'.
  Manifest merger failed with multiple errors, see logs

*Try:
  Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
BUILD FAILED
Total time: 1 mins 18.122 secs
  Building the android package failed!
    -- For more information, run this command with --verbose.
  18:47:27: Le processus "C:\Qt_folder\x\Qt\5.8\android_armv7\bin\androiddeployqt.exe" s'est terminé avec le code 14.
  Erreur lors de la compilation/déploiement du projet Tests (kit : Android for armeabi-v7a (GCC 4.9, Qt 5.8.0))
  When executing step "Build Android APK"


text:
Q: Trash file inaccessible through Terminal? Having come from a Linux environment, I am accustomed to using the command line, as in MacOS's "Terminal". In particular, I know about permissions, "sudo" and such.
But I am unable to perform any operations whatsoever via the command line on the .Trash file in my home directory. (I do have admin privileges on the machine.) I can "ls -al" my home directory...
However, I can see (and copy, deleted, etc.) the contents of my .Trash file via Finder, and could apparently manipulate its permissions. But, seemingly, nothing I can do with finder makes .Trash accessible via Terminal.
Can anyone explain?

A: Googling about how to "give Terminal full disk access", led me to another answer on this site, Is there command to grant Full Disk Access for specific application?
The wording was not obvious to me. :)
To repeat that other answer: under System Preferences > Security and Privacy, one of the sub-headings is Full System Access, with a list of potential parent processes that may or may not be granted this. So I added "Terminal.app" there (did not have to figure out how to type in a suitable format, but, rather, could choose from a list).
Testing: this does allow me (without sudo but as user with admin privileges), to ls .Trash, remove files, etc.
EDIT: "problem" solved, though I could already manipulate nearly every other file on the machine via sudo, so the recalcitrance of .Trash was one-of-a-kind (according to my expectations, anyway).


text:
Q: How to navigate from a screen to another in Jetpack Compose using navController? I have this structure:
val navController = rememberNavController()
NavHost(
    navController = navController,
    startDestination = "auth"
) {
    composable(
        route = "auth"
    ) {
        AuthScreen(
            navController = navController
        )
    }
    composable(
        route = "profile"
    ) {
        ProfileScreen(
            navController = navController
        )
    }
}

When I first time open the app, I display a screen according to the authentication state:
if (!viewModel.isUserAuthenticated) {
    AuthScreen(navController = navController)
} else {
    ProfileScreen(navController = navController)
}

Which works fine. The problem comes, when I try to sing-in in the AuthScreen:
when(val response = authViewModel.signInState.value) {
    is Response.Loading -> CircularProgressIndicator()
    is Response.Success -> {
        if (response.data) {
            navController.navigate("profile")
            Log.d(TAG, "Success")
        }
    }
    is Response.Error -> Log.d(TAG, response.message)
}

The log statement prints "Success" but it doesn't navigate to the next ProfileScreen. How to solve this?

A: You can remove that if-else from the setContent. Instead, make ProfileScreen as the home destination and inside it you can check whether user is authenticated or not. If he is not, navigate to the AuthScreen
@Composable
fun ProfileScreen(navController: NavController) {
    LaunchedEffect(Unit) {
        if(!viewModel.isUserAuthenticated) {
            navController.navigate("auth")
        }
    }
}

If user can logout from this screen (i.e. auth state can change), then instead of Unit use viewModel.isUserAuthenticated as the key for LaunchedEffect (assuming that isUserAuthenticated is a State)

A: Here is a much more detailed answer with code and demo if someone is looking

Code:
ComposeNavigationActivity.kt
class ComposeNavigationActivity : ComponentActivity() {

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContent {Navigation()}
    }
}

Composables
@Composable
fun MainScreen(navController: NavController) {
    var inputFieldText by remember { mutableStateOf("") }
    Column(
        modifier = Modifier
            .fillMaxSize()
            .background(Color.Red),
        verticalArrangement = Arrangement.Center,
        horizontalAlignment = Alignment.CenterHorizontally
    ) {
        TextField(
            value = inputFieldText,
            onValueChange = {
                inputFieldText = it
            },
            modifier = Modifier.fillMaxWidth().padding(30.dp)
        )
        Spacer(modifier = Modifier.height(20.dp))
        Button(
            modifier = Modifier.padding(5.dp),
            onClick = {
                navController.navigate(Screen.DetailScreen.withArgs(inputFieldText))
            }) {
            Text(
                text = "Navigate",
                color = Color.White,
                textAlign = TextAlign.Center,
                fontSize = 20.sp
            )
        }
    }
}

@Composable
fun DetailScreen(name: String?) {
    Column(
        modifier = Modifier
            .fillMaxSize()
            .background(Color.Green),
        verticalArrangement = Arrangement.Center,
        horizontalAlignment = Alignment.CenterHorizontally
    ) {
        name?.let {
            Text(
                text = it,
                color = Color.White,
                textAlign = TextAlign.Center,
                fontSize = 30.sp
            )
        }
    }
}

A Sealed class to track routes
sealed class Screen(val route:String){
    object MainScreen : Screen(route = "main_screen")
    object DetailScreen : Screen(route = "detail_screen")

    fun withArgs(vararg args:String) : String {
        return buildString {
            append(route)
            args.forEach { arg ->
                append("/$arg")
            }
        }
    }
}

Navigation
@Composable
fun Navigation() {
    val navController = rememberNavController()
    NavHost(navController = navController, startDestination = Screen.MainScreen.route) {
        composable(route = Screen.MainScreen.route) {
            MainScreen(navController = navController)
        }
        composable(
            route = Screen.DetailScreen.route + "/{name}",
            arguments = listOf(
                navArgument("name") {
                    type = NavType.StringType
                    defaultValue = "Some Default"
                    nullable = true
                }
            )
        ) { entry ->
            DetailScreen(name = entry.arguments?.getString("name"))
        }
    }
}

Output


text:
Q: Consider a quadratic equation $az^2+bz+c=0$ where a,b,c are complex numbers. Prove that the equation has one purely imaginary root is given ... Problem :
Consider a quadratic equation $az^2+bz+c=0$ where a,b,c are complex numbers. Prove that the condition such that the equation has one purely imaginary root is given by $(b\overline{c}+c\overline{b})(a\overline{b}+\overline{a}b)+(c\overline{a}-a\overline{c})^2=0$
I am not getting any clue on this how to proceed such equation in complex numbers. Please suggest thanks a lot.

A: Let $r$ be the purely imaginary root, so that $\overline{r} = -r$. We have these conjugate equations:
$$a r^2 + b r^1 + c = 0 \qquad \text{and} \qquad \overline{a} r^2 - \overline{b} r^1 + \overline{c} = 0$$
Here's a neat trick: Move the exponents on $r$ to subscripts ...
$$a r_2 + b r_1 + c = 0 \qquad \text{and} \qquad \overline{a}r_2 - \overline{b} r_1 + \overline{c} = 0$$
... and solve the linear system for them ...
$$
r_1 =  \frac{a\overline{c}-\overline{a}c}{a\overline{b}+\overline{a}b} \qquad\qquad
r_2 = -\frac{b\overline{c}+\overline{b}c}{a\overline{b}+\overline{a}b}
$$
(Dealing with the case of $a\overline{b}+\overline{a}b=0$ is left as an exercise to the reader.) Now, return the subscripts to their positions as exponents ...
$$
r^1 =  \frac{a\overline{c}-\overline{a}c}{a\overline{b}+\overline{a}b} \qquad\qquad
r^2 = -\frac{b\overline{c}+\overline{b}c}{a\overline{b}+\overline{a}b}
$$
... and simply observe the deep algebraic truth, $r^2 = (r^1)^2$ ...
$$\left(\;\frac{a\overline{c} -\overline{a}c}{a\overline{b}+\overline{a}b}\;\right)^2 = -\frac{b\overline{c}+\overline{b}c}{a\overline{b}+\overline{a}b}$$
Squaring and clearing fractions, we have
$$(a\overline{c} -\overline{a}c)^2 = -(a\overline{b}+\overline{a}b)( b\overline{c}+\overline{b}c)$$


text:
Q: Как спарсить информацию за скрывающимся элементом? С помощью cURL получается спарсить только первые 5 элементов на сайте, остальные элементы закрыты под кнопкой "Показать всё".

Пытаюсь спарсить информацию с Яндекса https://yandex.ru/web-maps/covid19 слева во фрейме информацию.
Подскажите пожалуйста, как можно спарсить информацию, которая закрыта и для её появления нужно нажать на элемент ?


text:
Q: How to keep application data when synchronizing iPhone with new iTunes? I want to enable app-synchronization between the iPhone and iTunes on a new computer.
I already transferred the apps from the iPhone to iTunes but when checking the box for synchronizing apps, iTunes still displays the warning message that the phone apps will be replaced by the iTunes apps.
The last time I did this, I still had all my apps but the in-app purchases got lost as well as any saved progress in my games.
This meant that I had to re-download the maps of my navigation app (skobbler). I'd like to avoid this as my monthly data volume is currently very limited.
Is there a way to synchronize without losing the application data?

A:
The last time I did this, I still had all my apps but the in-app purchases got lost as well as any saved progress in my games.

To avoid this occasion, you have to save the app data manually. You can do it with any iOS file manager on PC (with i-FunBox for example).
There's one more way to backup the application data: the DataDeposit app from Cydia store uploads all the data of an application to Dropbox and is able to restore it automatically (jailbreak is required).

A: This problem is solved with iTunes version 11.
It simply offers a checkbox to synchronize new apps automatically and that just works as expected.
I did this on 2 different Windows machines (Win7 and Win8) with the same iPhone and no application data got lost. It seems to me like this means that an iPhone no longer has to be app-synchronized with one iTunes installation.


text:
Q: Two matrices side by side I'm trying to typeset two matrices side by side, somewhat like:
A = (matrix)    B = (matrix)

I tried to next the matrices inside an align environment:
\begin{align*}
  A &= \begin{pmatrix} ... \end{pmatrix} &
  B &= \begin{pmatrix} ... \end{pmatrix}
\end{align*}

but I get when compiling:

Package amsmath Error: Erroneous nesting of equation structures

Presumably the way I'm trying to do it isn't the right way; how should I be doing this?

A: The error has been caused by accidentally nesting align* and equation, as Ben informed.
Displayed math environments cannot be nested. However, there are environments such as aligned and split which work inside an equation environment.
This answer has been posted and marked as community wiki, in the hope that after an upvote this question isn't marked as "unanswered" by the site any more.


text:
Q: Error when reading in a .txt file and splitting it into columns in R I would like to read in a .txt file into R, and have done so numerous times.
At the moment however, I am not getting the desired output.
I have a .txt file which contains data X that I want, and other data that I do not, which is in front and after this data X.
Here is a printscreen of the .txt file

I am able to read in the txt file as followed:
read.delim("C:/Users/toxicologie/Cobalt/WB1", header=TRUE,skip=88, nrows=266)

This gives me a dataframe with 266 obs of 1 variable.

But I want these 266 observations in 4 columns (ID, Species, Endpoint, BLM NOEC).
So I tried the following script:
read.delim("C:/Users/toxicologie/Cobalt/WB1", header=TRUE,skip=88, nrows=266, sep = " ")

But then I get the error
Error in read.table(file = file, header = header, sep = sep, quote = quote,  : more columns than column names

Using sep = "\t" also gives the same error.
And I am not sure how I can fix this.
Any help is much appreciated!

A: Try read.fwf and specify the widths of each column. Start reading at the Aelososoma sp. row and add the column names afterwards with
something like:
df <-  read.fwf("C:/Users/toxicologie/Cobalt/WB1", header=TRUE,skip=88, n=266,widths=c(2,35,15,15))

colnames(df) <- c("ID", "Species", "Endpoint", "BLM NOEC")

Provide the txt file for a more complete answer.


text:
Q: HTML 5 CSS 3 @viewport mediaquery So i was browsing the web to see if there was any solution to lock orientation. I have found this:

http://www.w3.org/TR/css-device-adapt/

It states that with @viewport you should be able to lock orientation but i can't find any information on support or whatever. I just tried
 @viewport{
orientation: portrait;
}

But it does nothing, any toughts about this?

A: You need to add vendor prefix.
Example:
IE10
@-ms-viewport {
  width: 1024px;
  height: 768px;
}

Read more http://msdn.microsoft.com/en-us/library/ie/hh708740(v=vs.85).aspx
Opera
@-o-viewport {
  width: 1024px;
  height: 768px;
}

Read more http://dev.opera.com/articles/view/an-introduction-to-meta-viewport-and-viewport/
http://docs.webplatform.org/wiki/css/atrules/@viewport

A: @viewport all and (max-width: 480px) {
 orientation:portrait;
}

Can't test, but I believe this behaves the same as the @media CSS.


text:
Q: How to create a inherited usercontrol from a mustinherit usercontrol I've created a class ctl_000 thats inherits System.Windows.Forms.UserControl using the IDE in VS 2015 "Create new Item >> Inherited User Control" Function.
Now I want to create another usercontrol ctl_001 that inherits from ctl_000. However, when I change the definition in ctl_000 to MustInherit I cannot select ctl_000 from the "Inheritance Picker" dialog.
How can I create an inherited usercontrol using the "Inheritance Picker" dialog?

A: You can't.  The designer provides the WYSIWYG view of a control by creating an instance of the base class at design time.  So the inherited properties can be displayed in the Properties window and you can change them and, optionally, their value have a visible effect in the designer.  Most easily seen for BackColor and Font, etcetera.
When you use MustInherit then that can no longer work, that makes the class abstract with no option to create an instance.  You must therefore omit the keyword to support designable inherited controls.
Channeling why you are trying to do this, presumably you really want to hide the base class from the toolbox.  Give it the <ToolboxItem(False)> attribute.


text:
Q: Cakephp Upload Plugin 2.0 how do I store the name of a file without the extension? I'm using the Upload Plugin 2.0 ( https://github.com/josegonzalez/upload ) and I'm having a little trouble with populating the name field.
My form has a hidden input field for the name field.
<?php echo $this->Form->create('Image', array('type' => 'file')); ?>
    <fieldset>
        <legend><?php echo __('Add Image'); ?></legend>
    <?php
        echo $this->Form->input('animal_id');
        echo $this->Form->input('name', array('type' => 'hidden'));
        echo $this->Form->input('attachment', array('type' => 'file'));
        echo $this->Form->input('dir', array('type' => 'hidden'));
        echo $this->Form->input('type', array('type' => 'hidden'));
        echo $this->Form->input('size', array('type' => 'hidden'));
        echo $this->Form->input('active', array('type' => 'hidden'));
    ?>
    </fieldset>
<?php echo $this->Form->end(__('Submit')); ?>

And I'm using the fields behavior in the maodel's $actAs array:
'fields' => array(
    'dir' => 'dir',
    'name' => 'name',
),

The documentation recommends creating the "name" field, but as it isn't being populated automatically like the size/type field I have to be missing something. I just want it to be the name of the file without the extension at the end (i.e jpg, .gif).

A: In your controller you can use pathinfo
public function add(){

   //...
   $path = $this->request->data['Image']['name'];
   $file_info = pathinfo($path);
   if(isset($file_info['filename'])){
      $this->request->data['Image']['name'] = $file_info['filename'];
   }
   //....
}


text:
Q: How to Set up Google Analytics / google Tag Manager for Payment referral sites I have just changed my sites payment gateway from embedded ( inside my site ) to redirect to the payment gateway site.
The problem now is that all my conversions are coming from the bank secure site - and there are a LOT of them it's not just one URL.  If it was just one URL I could put that URL into the referral exclusion list. but I don't think that is the correct way to do this.
What is the correct way to implement a payment that goes off to another site and then returns so that it registers the correct starting point ( in most cases adwords )
thanks
Martin

A: You have to use Referral Exclusion list by entering the domain to exclude, not the entire URL. If there are several third levels of the same domain you have to enter the main domain.


text:
Q: PCIe PIC_INTERRUPT_PIN (0x3c) is 0 I write my pcie driver for a custom board. I am going to use an interrupt.
if(request_irq(dev->irq, pci_dma_irq, IRQF_SHARED | IRQF_TRIGGER_HIGH,
            "PCIe sol_dma", dev)){
    unit_err("request irq %d\n", dev->irq);
   ret = 1;
}

# cat /proc/interrutps
           CPU0       CPU1
 16:          0          0   OpenPIC    16 Level     [EDAC] L2 err
 19:          2          0   OpenPIC    19 Level     fsl-lbc
 20:          0          0   OpenPIC    20 Level     fsldma-chan
 21:          0          0   OpenPIC    21 Level     fsldma-chan
 22:          0          0   OpenPIC    22 Level     fsldma-chan
 23:          0          0   OpenPIC    23 Level     fsldma-chan
 24:          0          0   OpenPIC    24 Level     [PCI] PME, PCIe PME, [EDAC] PCI err
 25:          0          0   OpenPIC     8 Level     PCIe sol_dma
 26:    4174986          0   OpenPIC     3 Level     phy_interrupt
 29:          0          0   OpenPIC    29 Level     eth0_g0_tx
 30:          0         32   OpenPIC    30 Level     eth0_g0_rx
 34:          0          0   OpenPIC    34 Level     eth0_g0_er

The interrupt handler doesn't be called. Register PCI_INTERRUPT_LINE (0x3c) is 0.
In ORELLY chapter 12

By the time Linux boots,
  the computer's firmware has already assigned a unique interrupt number to the
  device, and the driver just needs to use it. The interrupt number is stored in configu-
  ration register 60 (
  PCI_INTERRUPT_LINE
  ), which is one byte wide.

But I doesn't have any BIOS, only u-boot and dts. How can I set PCI_INTERRUPT_LINE register in the boot time?

A: You don't need to set that. It has no effect on the device. It is an old way for the BIOS to let the OS driver know how it configured the interrupt.

A: The problem was in dtb. Interrupt-map of pci interface for my processor had an incorrect value for mapping. I corrected it as in documentation. It works now.


text:
Q: Multiple Runnable in Gridview with Handler Slow down timer after some minutes I am Developing an application. Token number displaying in each Grid with timer. i have 5 status 1.not started, 2.started, 3.pause, 4.stop, 5.cancel Any time i can start,pause and stop timer through broadcastreceiver i use to refresh grid by notifydatasetchange(). once i started,pause and stop timer is working fine after sometimes(15 min) running timer seconds is skips 3 to 5 seconds. Anyone can guide me whether i am doing right one only or any mistakes help me on this. Thanks in advance Attached Snippets below Adapter,class and layouts
public class CountdownAdapter extends ArrayAdapter<Orders> {

private LayoutInflater lf;
public Context ctx;
private List<Runnable> updateTimerThread;

public CountdownAdapter(Context context, List<Orders> objects) {
    super(context, 0, objects);
    ctx = context;
    lf = LayoutInflater.from(context);
    updateTimerThread = new ArrayList<Runnable>();
}

@Override
public View getView(final int position, View convertView, ViewGroup parent) {
    ViewHolder holder = null;
    if (convertView == null) {
        holder = new ViewHolder();
        convertView = lf.inflate(R.layout.list_item3, parent, false);

        holder.status = (TextView) convertView.findViewById(R.id.status);
        holder.tvProduct = (TextView) convertView.findViewById(R.id.tvProduct);
        holder.tvRunningTime = (TextView) convertView.findViewById(R.id.tvTimeRemaining);
        convertView.setTag(holder);
    } else {
        holder = (ViewHolder) convertView.getTag();
    }

    final ViewHolder finalHolder = holder;
    Runnable singlTimerThread = new Runnable() {

      public void run() {
        getItem(position).setTimeInMilliseconds(SystemClock.uptimeMillis() - getItem(position).getStartTime());
        getItem(position).setUpdatedTime(getItem(position).getTimeSwapBuff() + getItem(position).getTimeInMilliseconds());

        int secs = (int) (getItem(position).getUpdatedTime() / 1000);
        int mins = secs / 60;
        secs = secs % 60;

        finalHolder.tvRunningTime.setText("" + mins + ":" + String.format("%02d", secs));// + ":"+ String.format("%03d", milliseconds));

        getItem(position).setRate((long) (mins * getItem(position).getIntervaltime()));

        MeterActivity.mHandler.postDelayed(this, 1000);
      }
    };

    holder.tvProduct.setText("Token : " + getItem(position).getTableno());
    updateTimerThread.add(singlTimerThread);

    //0 means not started
    if (getItem(position).getStatus() == 0) {
        holder.status.setText("Status : Not Started");
    }
    //1 means intialized
    else if (getItem(position).getStatus() == 1) {
        holder.status.setText("Status : Ready to Start");
    }
    //2 means start
    else if (getItem(position).getStatus() == 2) {
        getItem(position).setStartTime(SystemClock.uptimeMillis() - getItem(position).getUpdatedTime());
        MeterActivity.mHandler.postDelayed(updateTimerThread.get(position + 1), 1000);
        holder.status.setText("Status : Started");
    }
    //3 means pause
    else if (getItem(position).getStatus() == 3) {
        holder.status.setText("Status : Paused");
        MeterActivity.mHandler.removeCallbacks(updateTimerThread.get(position + 1));
    }
    //4 means stop
    else if (getItem(position).getStatus() == 4) {
        MeterActivity.mHandler.removeCallbacks(updateTimerThread.get(position + 1));
        holder.status.setText("Status : Stopped");
    }
    return convertView;
}

class ViewHolder {
    TextView tvProduct, status;
    TextView tvRunningTime;
}}

`
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
    android:orientation="vertical"
    android:layout_width="match_parent"
    android:background="#565555"
    android:layout_height="wrap_content">

<TextView
    android:id="@+id/tvProduct"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:layout_centerHorizontal="true"
    android:layout_marginTop="2dp"
    android:paddingRight="10dp"
    android:gravity="right|center"
    android:background="@color/gray"
    android:textColor="#203020"
    android:text="Token"
    android:visibility="visible"
    android:layout_gravity="right"
    android:textStyle="bold"
    android:textSize="15sp" />

<TextView
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:gravity="left|center"
    android:textStyle="bold|italic"
    android:text="Status"
    android:id="@+id/status"
    android:padding="5dp"
    android:textColor="@color/white"
    android:textSize="13sp" /><FrameLayout
    android:layout_width="match_parent"
    android:layout_height="85dp">

<LinearLayout
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical">

    <RelativeLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:background="@color/cardbackground"
        android:elevation="4dp"
        android:orientation="vertical"
        android:padding="10dp">

    <LinearLayout
        android:orientation="vertical"
        android:layout_width="match_parent"
        android:background="@color/cardbackground"
        android:id="@+id/itemlayout"
        android:layout_height="wrap_content">

        <View
            android:layout_width="match_parent"
            android:layout_height="2dp"/>

        <TextView
            android:id="@+id/tvTimeRemaining"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:visibility="visible"
            android:textSize="40sp"
            android:layout_margin="5dp"
            android:textStyle="bold|italic"
            android:textColor="@color/redglow"
            android:gravity="center"
            android:text="00:00:00 " />

    </LinearLayout>
   </RelativeLayout>
</LinearLayout>

`
Attached Screenshot
I have referred below stackoverflow link also
How to handle multiple countdown timers in ListView?

A: It appears that the Runnables keep accumulating in the updateTimerThread list which would make the ui less responsive. It's not visible in the code where or how the status of your adapter items gets changed but it seems to be 0 for a bigger amount of time than it is 4 thus more callbacks are added to the list and the handler's message queue than are removed.
Check with a log if this is the problem and move the Runnables creation in the ViewHolder at least. Ideally you should have only one runnable which you would initialize in the adapter's constructor and the runnable would keep a list of the views/view holders to update.
Here is a code example:
public class MeterActivity extends Activity {

//...
private CountDownAdapter adapter;
private Timer timer;
private boolean inScroll = false;

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    //...

    adapter = new CountDownAdapter(this, new ArrayList<Orders>());
}

@Override
protected void onStart() {
    super.onStart();

    //...

    list.setOnScrollListener(new AbsListView.OnScrollListener() {
        public void onScroll(AbsListView view, int firstVisibleItem, int visibleItemCount, int totalItemCount) {

        }

        public void onScrollStateChanged(AbsListView view, int scrollState) {
             inScroll = scrollState != SCROLL_STATE_IDLE;
        }
    });
    //create a timer to execute tasks in a background thread
    timer = new Timer();
    //schedule a task to start in and repeat every 1000 ms
    CountdownTask task = new CountdownTask();
    adapter.setTask(task);
    timer.schedule(task, 1000, 1000);
}

@Override
protected void onStop() {
    super.onStop();

    //...

    //stop timer while the activity is in background
    timer.cancel();
    timer = null;
}

class CountdownTask extends TimerTask {

    public Map<Integer, CountDownAdapter.ViewHolder> itemHolders = new ConcurrentHashMap<>();

    @Override
    public void run() {
        Orders item;
        if (inScroll) {
            return;
        }
        //loop through all started items and update their runningTime
        List<CountDownAdapter.ViewHolder> holders = new ArrayList<>();
        List<String> texts = new ArrayList<>();
        for (Integer position : itemHolders.keySet()) {
            item = adapter.getItem(position);
            item.setTimeInMilliseconds(SystemClock.uptimeMillis() - item.getStartTime());
            item.setUpdatedTime(item.getTimeSwapBuff() + item.getTimeInMilliseconds());

            int secs = (int) (item.getUpdatedTime() / 1000);
            int mins = secs / 60;
            secs = secs % 60;

            item.setRate((long) (mins * item.getIntervaltime()));
            holders.add(itemHolders.get(position);
            texts.add("" + mins + ":" + String.format("%02d", secs)); // + ":"+ String.format("%03d", milliseconds

        }
        runOnUiThread(new UpdateRunnable(itemHolders.get(position), texts));
    }

    class UpdateRunnable implements Runnable {
        CountDownAdapter.ViewHolder[] holders;
        String[] texts;

        public UpdateRunnable(CountDownAdapter.ViewHolder[] holder, String[] text) {
            this.holders = holders;
            this.texts = texts;
        }

        @Override
        public void run() {
            for (int i = 0; i < holders.length; i++) {
                holders[i].tvRunningTime.setText(texts[i]);
            }
        }
    };
}
}

`
public class CountDownAdapter extends ArrayAdapter<Orders> {

private MeterActivity.CountdownTask task;

public CountDownAdapter(Context context, List<Orders> objects) {
    super(context, 0, objects);
}

public void setTask(MeterActivity.CountdownTask task) {
    this.task = task;
}

@Override
public View getView(final int position, @Nullable View convertView, @NonNull ViewGroup parent) {
    ViewHolder holder = null;
    if (convertView == null) {
        holder = new ViewHolder();
        convertView = View.inflate(getContext(), R.layout.list_item3, parent, false);
        holder.status = (TextView) convertView.findViewById(R.id.status);
        holder.tvProduct = (TextView) convertView.findViewById(R.id.tvProduct);
        holder.tvRunningTime = (TextView) convertView.findViewById(R.id.tvTimeRemaining);
        convertView.setTag(holder);
    } else {
        //remove the holder from the TimerTask's map to disable updates
        // when the view & holder are recycled; it will be updated only if the status is 2
        task.itemHolders.remove(position);
        holder = (ViewHolder) convertView.getTag();
    }

    holder.tvProduct.setText("Token : " + getItem(position).getTableno());
    //0 means not started
    if (getItem(position).getStatus() == 0) {
        holder.status.setText("Status : Not Started");
    }
    //1 means intialized
    else if (getItem(position).getStatus() == 1) {
        holder.status.setText("Status : Ready to Start");
    }
    //2 means start
    else if (getItem(position).getStatus() == 2) {
        getItem(position).setStartTime(SystemClock.uptimeMillis() - getItem(position).getUpdatedTime());

        //add the holder to the TimerTask's map to enable updates if the item is started
        task.itemHolders.put(position, holder);
        holder.status.setText("Status : Started");
    }
    //3 means pause
    else if (getItem(position).getStatus() == 3) {
        holder.status.setText("Status : Paused");
    //MeterActivity.mHandler.removeCallbacks(updateTimerThread.get(position + 1));
    }
    //4 means stop
    else if (getItem(position).getStatus() == 4) {

    //MeterActivity.mHandler.removeCallbacks(updateTimerThread.get(position + 1));
        holder.status.setText("Status : Stopped");
    }
    return convertView;
}

class ViewHolder {
    public TextView tvProduct, status;
    public TextView tvRunningTime;
}

}


text:
Q: Eclipse Out of Memory I have a ATG Dust Application. To test my ATG application, i linked my ATG App to Dust Application by Right clicking on Dust App -> Build Path -> Link Source -> Select my ATG App.  ATG app is a big application. When i try to clean build the DUSt App, i get the exception like "An out of memory exception has occurred. Consult the " Running Eclipse"section....."
In the eclipse .log file has the following exception logged,
// From the Log File
    !ENTRY org.eclipse.core.jobs 4 2 2014-03-27 06:56:26.549
    !MESSAGE An internal error occurred during: "Launching SampleTest".
    !STACK 0

// Exception
 java.lang.OutOfMemoryError: Java heap space
        at java.util.Arrays.copyOfRange(Unknown Source)
        at java.lang.String.<init>(Unknown Source)

A: just right-click on your file in eclipse and select as Run as -> Run configuration .
It will open Run Configurations Dialog Box .Click on Arguments Tab
Enter this value
                    -Xms1024m -Xmx3072m -XX:MaxPermSize=1024M

In Vm Arguments and press run

A: The Out of Memory issue is something that occurs due to the improper handling of Heap. You must optimise the code to avoid that. As a temporary fix you can increase the heap space.
-XX:MaxPermSize=512m
-Xms512m
-Xmx1024m

A: Like Dileep said, the problem is possibly an improper handling of heap space.
Increased heapsize might not solve the problem, but work around it for a while. You can set the parameter -XX:+HeapDumpOnOutOfMemoryError in your eclipse.ini. This will write a heapdump out, which can be analzed by tools like Eclipse Memory Analyzer. Try to make sure that you don't have a memory leak before using up more space.
in your case java.util.Arrays.copyOfRange is copying parts of Arrays around. you could start with checking what size they are.


text:
Q: azure ADF - Get field list of .csv file from lookup activity context: azure - ADF  brief process description:
Get a list of the fields defined in the first row of a .csv(blobed) file. This is the first step, detect fields
then 2nd step would be a kind of compare with actual columns of an SQL table
3rd one a stored procedure execution to make the alter table task, finishing with a (customized) table containing all fields needed to successfully load the .csv file into the SQl table.
To begin my ADF pipeline, I set up a lookup activity that "querys" the first line of my blobed file, "First row only" flag = ON.As a second pipeline activity, an "Append Variable" task, there I would like to get all .csv fields(first row) retrieved from the lookup activity, as a list.
Here is where a getting the nightmare.
As far I know, with dynamic content I can get an array with all values (w/ format like {"field1_name":"field1_value_1st_row", "field2_name":"field2_value_1st_row", etc })
with something like @activity('Lookup1').output.firstrow.
Or any array element with @activity('Lookup1').output.firstrow.<element_name>,
but I can't figure out how to get a list of all field names (keys?) of the array.
I will appreciate any advice, many thanks!

A: I would save the part of LookUp Activity because it seems that you are familiar with it.
You could use Azure Function HttpTrigger to get the key list of firstrow JSON object. For example your json object like this as you mentioned in your question:
{"field1_name":"field1_value_1st_row", "field2_name":"field2_value_1st_row"}

Azure Function code:
module.exports = async function (context, req) {
    context.log('JavaScript HTTP trigger function processed a request.');
    var array = [];
    for(var key in req.body){
        array.push(key);
    }
    context.res = {
        body: {"keyValue":array}
    };
};

Test Output:

Then use Azure Function Activity to get the output:
@activity('<AzureFunctionActivityName>').keyValue

Use Foreach Activity to loop the keyValue array:
@item()

Still based on the above sample input data,please refer to my sample code:
dct = {"field1_name": "field1_value_1st_row", "field2_name": "field2_value_1st_row"}
list = []
for key in dct.keys():
    list.append(key)

print(list)
dicOutput = {"keys": list}
print(dicOutput)

A: Have you considered doing this in ADF data flow? You would map the incoming fields to a SQL dataset without a target schema. Define a new table name in the dataset definition and then map the incoming fields from your CSV to a new target table schema definition. ADF will write the rows to a new table using that file's schema.


text:
Q: New VM can't use unassigned Static Internal IP GCP The guide Reserving a static internal IP address includes instructions for reserving a new static internal IP address and assigning the address when creating the VM.
Here is a static internal IP address in us-central1 on the default network and default subnet:

This is how I assign the new Static Internal IP to a new vm:

Somehow, my Static Internal IP is in use by another resource.

The In Use By column of my Static Internal IP shows None. Is it possible that this refers only to a subset of GCP resources? Is there a cool-down period between IP reservation and assignment?
The plot thickens
When I promote the Internal IP address of an existing vm, I learn that the Specified IP address is not allocated to the project or does not belong to the specified scope.
This must be a scope or subnet issue. I'll keep poking.

A: I think you need to have the VPC network and the IP address in the same us-central1 data-center. All I can tell is that the first one screenshot is that it doesn't have any VPC assigned. Disabling DHCP on the default network might cause issues, when spinning up new containers without an IP address.


text:
Q: Existence of $L^{1}(\mathbb{R}^{n})$ Function Defined via Functional Equation Perhaps, I'm reading the problem statement wrong, and it's not asking for existence, only uniqueness; but in any case...

Problem. Let $g\in L^{1}(\mathbb{R}^{n})$, $\|g\|_{L^{1}}<1$. Prove that there is a unique $f\in L^{1}(\mathbb{R}^{n})$ such that
  $$f(x)+(f\ast g)(x)=e^{-|x|^{2}}, \quad x\in\mathbb{R}^{n} \enspace\text{a.e.}$$

The uniqueness isn't hard to show. Suppose such an $f\in L^{1}(\mathbb{R}^{n})$ exists. Then taking Fourier transforms under the convention
$$\widehat{f}(\xi)=\int_{\mathbb{R}^{n}}f(x)e^{-2\pi i x\cdot\xi}dx,\quad\xi\in\mathbb{R}^{n}$$
we obtain
$$\widehat{f}(\xi)+\widehat{f}(\xi)\widehat{g}(\xi)=Ce^{-c|\xi|^{2}}$$
where $C,c$ are some constants that don't matter. Since $\|\widehat{g}\|_{\infty}\leq\|g\|_{L^{1}}<1$, $(1+\widehat{g}(\xi))^{-1}$ is a bounded, positive continuous function. Hence, we can write
$$\widehat{f}(\xi)=C\frac{e^{-c|\xi|^{2}}}{1+\widehat{g}(\xi)},\quad\forall \xi\in\mathbb{R}^{n} \tag{*}$$
Fourier inversion then completes the proof of uniqueness.
Regarding existence, since the RHS of * is rapidly decaying, we can take the inverse Fourier transform of both sides of * to obtain a $C_{0}$ $f$. And by approximating $g$ by Schwartz functions, we probably get by distribution theory that $f$ satisfies the functional equation (the convolution is well-defined since $f\in L^{\infty}$). But since the only regularity for $\widehat{f}$ is continuity, it's not clear to me that $f\in L^{1}(\mathbb{R}^{n})$. Any thoughts?

A: Hint: Note that $$\frac{1}{1+\hat g}=1-\hat g+\hat g^2\dots.$$ Since $||g||_1<1$, the series $$h=-g+g*g-g*g*g...$$converges in $L^1$.

This is actually a special case of something about linear operators: If $||T||<1$ then $I-T$ is invertible. (Which is a special case of something about Banach algebras...)


text:
Q: Application does not close on release mode I have a windows form application on .net 3.5 C#.
Problem is when I run my application in debug mode and close the form , vs debugger also stopped, but when I run the same application in release mode and close the form, VS debugger does not stop.
Does someone has a clue about what is happening?

A: You can just add an Event(FormClosing) with the code:
private void Form1_FormClosing(object sender, FormClosingEventArgs e)
{
    Application.Exit();
}

Maybe there were some Threads behind that didn't Abort correctly or those threads caused an unhandled exception.
Hope it helps.


text:
Q: Compute annual mean of overlapping cells using daily rasters I am stuck at somewhat simple looking calculation. I have daily temperature rasters from 2001 to 2014 with following name format:
`2001001`
`2001002`
 |
 |
 `2014365`

I want to compute annual mean rasters using overlapping cells of same years. How do I insert all rasters from same year as a list of rasters into the numpy.mean at the end of following? Any suggestions to get annual mean rasters would be appreciative.
import arcpy
import numpy as np
import datetime

# Define time duration to handle leap years
#**************************************************
time = []
start_date = datetime.datetime(2001,1,1)
end_date = datetime.datetime(2012,12,31)
step = datetime.timedelta(days = 1)
while start_date < end_date:
    time.append(start_date.strftime('%Y%j'))
    start_date += step

time = [int(i) for i in time]

# Convert rasters to numpy array and compute mean
#**************************************************
annual = numpy.zeros((1200,1200))
for ii in time:
    ras = arcpy.RasterToNumPyArray(file_path + str(ii))
    tt = time[ii]
    if ii == 0:
        year_old = tt[0:4]
        index_start = ii
    else:
        year = tt[0:4]
        if year != year_old:
            year_mean = np.mean([index_start:ii],axis=0)

A: here's some untested code that should give you close to what you're after.
two main things...
-make big empty numpy array and fill it one raster at a time
EDIT...no surprise...big array didn't fit.
-also store a year numpy array for easy masking of years.
some suggestions in comments as I went.
import arcpy
import numpy as np
import datetime

# Define time duration to handle leap years
#**************************************************
times = []    ####change! time is a bad variable name!
years = []    # a list to store just the year, same order as times.
start_date = datetime.datetime(2001,1,1)
end_date = datetime.datetime(2012,12,31)
step = datetime.timedelta(days = 1)
while start_date < end_date:
    times.append(start_date.strftime('%Y%j'))
    years.append(int(start_date.strftime('%Y'))  #store the years in a list
    start_date += step

###time = [int(i) for i in time]  ## keep as string
times = np.array(times)
years = np.array(years)  ##make into numpy arrays for easy masking

# Convert rasters to numpy array and compute mean
#**************************************************

#now loop through unique years that you have
for yr in np.unique(years):
    year_times = times[years == yr] #mask only times you need

    #your 'big' raster is now just a year's worth of data
    year_rasters = numpy.zeros((year_times.shape[0], 1200, 1200))
    for count in range(year_times.shape[0]):
        f_name = file_path + year_times[count]
        year_rasters[count,:,:] = arcpy.RasterToNumPyArray(f_name)

    yr_mean = np.mean(year_rasters, axis=0)
    np.save('mean_temp_' + str(yr) + '.npy', yr_mean)

another small suggestion if the only files you have in your raster folder are the ones you want to load, use glob and parse the file names. This would guard against the possibility of missing a file and throwing an error (which I didn't account for...but you should!).


text:
Q: Java -- The return type of a function is "String" but it can return both String and int data types class Student {
    String name;
    int age;

    public void setInfo(String n, int a) {
        this.name = n;
        this.age = a;
    }

    public String getInfo() { // Notice the "String" data type in this function
        return (this.name + " " + this.age);  // "this.age" is a "int" data type but the function is supposed to be returning only "String" data type, right?
    }
}

public class OOPS {
    public static void main(String args[]) {
        Student s1 = new Student();

        s1.setInfo("John", 24);
        System.out.println(s1.getInfo());
    }
}

Here is the output: Click me to see the output
The next thing I tried to do was replace "String" with "int" in the function.
Like this:
public int getInfo() {
     return (this.name + " " + this.age);
}

It throws this error: Click me to see the error
The question is why is it so?

A: The string concatenation in your code:
return ( this.name + " " + this.age );

… implicitly generates a string from your int member field, this.age.
That is equivalent to a call to String.valueof:
return ( this.name + " " + String.valueOf( this.age ) );

See Converting Numbers to Strings in the Java Tutorials provided by Oracle free of cost.


text:
Q: How is state persisted between function invocations in a functional programming language? I have just started my foray into the functional paradigm from an OO background. I'm confused how state is persisted between function invocations in a functional programming language.
Consider an example of a game that you are creating that you intend to release as a library for others to use.  Others will use your game code as the domain of their game, and hook it up to their own UI.  Using an OO approach, one might expect the client to use your game code like so:
main() {
    Game game = new Game();

    while(userHasNotQuit()) {
        // respond to user input
        // call some method that mutates the internal data of the game object
            // ex: game.increaseScore();
        // get the data out of the game object
        // display it on screen
    }
}

Here, the internal data structure of the Game type is hidden from the client and the Game type can expose a public api that defines exactly how the client may interact with the game.  It can achieve data and function hiding because of OO access modifiers.
I can't seem to figure out how a functional style would work in this situation.  Would the client code need to hold a reference to a data structure and pass that data structure to free functions?  Something like:
main() {
    GameData gameData = createGame(); // structure of data with no methods.

    while(userHasNotQuit()) {
        // respond to user input
        // call some function that returns a transformed gameData
            // ex: gameData = increaseScore(gameData);
        // get the data out of the game object
        // display it on screen
    }
}

How would you achieve only exposing certain functions that define your public api, or only exposing certain data from your game data structure?

A: FP does not do away with state, that would make it rather hard to do anything useful with it. What it does eschew is non-local mutable state, because it breaks referential transparency.
This is not hard to do. You just take all that state you would access and mutate in the imperative version, and put it in a data structure that you thread through all the iterations of your game loop. Which is what I think you allude to. Here's an example of a straightforward F# translation of how such a game loop could be structured.
 let rec loop
         (exitCondition: UserInputs -> GameState -> bool)
         (update: UserInputs -> GameState -> GameState)
         (draw: GameState -> unit)
         (state: GameState) =
     let inputs = getUserInputs()
     if exitCondition inputs state
         then ()
         else
             let updated = update inputs state
             draw updated
             loop exitCondition update draw updated

It's a higher order function that you give an initial state together with a function to update the state on each step, a draw function that has a side effect of drawing a frame of the game on the screen and one more function to check the exit condition.
This gives you a well-defined interface for updating the game state - all the updates happen as part of update function and you can be sure that nothing you do in exitCondition or draw interferes with that.
As for data hiding, this is typically less of a concern in FP - as the state is not mutable and all the changes a function makes are explicit in the return value, there's less of a fear around giving access to data to the users of your API. It's not like they can break something inside by mutating it at will. You could however split that state into two separate parts and only pass in the "public" one to the update function (by making it an update: UserInputs -> PublicGameState -> PublicGameState instead).
While the above example is rather simplistic, it shows that as far as expressive power goes, you can write a game in an FP language. Here's a nice read about applying a similar functional approach to games.
A separate topic is functional reactive programming, which has a bit of a different flavour to it. Here's Yan Cui's talk about writing a simple game in ELM, which you might also find interesting.

A: As a really simple example, you can do something like
// pseudocode
function main() {

  function loop(gameState) {
   // whatever in the loop
   // ...
   // loop with new state
   loop({a: (gameState.a+1) }); // {a: 2}, {a: 3}, {a: 4}, ...
  }

  // initialize with some state
  loop({a: 1});
}

Also see State Monad
Here's a Haskell example from their docs

Simple example that demonstrates the use of the standard Control.Monad.State monad. It's a simple string parsing algorithm.

module StateGame where

import Control.Monad.State

-- Example use of State monad
-- Passes a string of dictionary {a,b,c}
-- Game is to produce a number from the string.
-- By default the game is off, a C toggles the
-- game on and off. A 'a' gives +1 and a b gives -1.
-- E.g
-- 'ab'    = 0
-- 'ca'    = 1
-- 'cabca' = 0
-- State = game is on or off & current score
--       = (Bool, Int)

type GameValue = Int
type GameState = (Bool, Int)

playGame :: String -> State GameState GameValue
playGame []     = do
    (_, score) <- get
    return score

playGame (x:xs) = do
    (on, score) <- get
    case x of
         'a' | on -> put (on, score + 1)
         'b' | on -> put (on, score - 1)
         'c'      -> put (not on, score)
         _        -> put (on, score)
    playGame xs

startState = (False, 0)

main = print $ evalState (playGame "abcaaacbbcabbab") startState

A: Your example presupposes that there is some sort of global game data outside of the game object.  This is quite antithetical to functional programming.  "Fixing" it makes your example quite uninteresting and uninformative; but also, in many ways, better:
main() {
    GameState gameState = createGame();

    while(gamestate.userHasNotQuit()) {
        // respond to user input
        // call some function that transforms gameData
            // ex: gameData.increaseScore();
        // make the gameData object
        // display the game on screen
    }
}

As a matter of fact, this is probably a better way to do it in the OOP world, too.  The game state is what the program manipulates, and so the last inch of this change would be to simply call gameData.main() instead of having the external program know anything about its internals or state changes.


text:
Q: Drawable layout on listview with ArrayAdapter How can I set one drawable in my layout to use listview?
this is my code and funcion normally but i can't click on item:
public class ListMobileActivity extends Activity {

static final String[] Ristoranti = new String[] { "Osteria Mingot", "Cecchini", "Barrique", "Mediterraneo"};

ListView listView1;

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.list);

    ListView listView1 = (ListView) findViewById(R.id.listView);

    ArrayAdapter<String> adapter = new ArrayAdapter<String>(this, R.layout.list_mobile, R.id.label, Ristoranti);

    listView1.setAdapter(adapter);

}

A: If I extends Activity I can set my drawable, if I extends ListActivity I can Click on the Item but the drawable appear in every item
protected void onItemClick(ListView l, View v, int position, long id)  {

    //get selected items
//  String selectedValue = (String) getListAdapter().getItem(position);
    //Toast.makeText(this, selectedValue, Toast.LENGTH_SHORT).show();

}


text:
Q: Airflow tasks are scheduled but does not run In recent times, we are observing significant execution time spikes for our pipelines.
Upon investigation, I found Airflow tasks remain in scheduled state for longer times. Most of the times, I see only 6-8 workers executing tasks.
Environment: Airflow 2.2.1 on AWS EC2(Linux)
Aiflow.cfg:
executor = LocalExecutor
parallelism = 32
max_active_tasks_per_dag = 16
max_active_runs_per_dag = 16

Pool Status

Worker status:

A few failed attempts:

*

*Moving some jobs to different pool

*Restarting Airflow.

Can someone help me configuration is causing this?
How can I make sure, we are using all workers properly?


text:
Q: Passing variables to functions with variable length input arguments blkdiag uses varargin to construct a block diagonal matrix from the input arguments (each matrix which needs to be inserted into the diagonal).

out = blkdiag(a,b,c,d,...), where a, b, c, d, ... are matrices,
  outputs a block diagonal matrix of the form

Suppose I had a cell array of matrices (or some other data structure) ; how would I feed this to a function like blkdiag?

A: Use {:} to expand it for the function:
blocks = cell(2);
blocks{1} = rand(2);
blocks{2} = rand(2);
out = blkdiag(blocks{:})

Answer:
out =

0.6787    0.7431         0         0
0.7577    0.3922         0         0
     0         0    0.6555    0.7060
     0         0    0.1712    0.0318