text:
Q: What is a correct way to move directories with TortoiseSVN? If I move a directory to another place inside the same repository by dragging it to the new place in Tortoise, I cannot checkout revisions prior to the move, because the URL to these old revisions is not valid anymore.
How do you move a directory and still be able to access revisions before the move?

Example:
If I move
trunk/folder1/source

to
trunk/folder2/source

then I can see the "source" folder now under folder2, and I can checkout the head revision, meaning the revision that produced the move.
However, if I try to checkout an older revision that was committed before the move, I get an error that the url doesn't exist.
I guess it's because the url of the older revision still points to the old path.
But there must be a way to fix this, otherwise a move would not make sense if you loose access to older revisions.

A: You can move directories several ways.
The easiest way is to right mouse drag the directory and click "SVN Move versioned files here" when you drop.
You can use the rename function to rename a file from "blah.js" to "mydirectory/blah.js".
Lastly, you can use the commit window and drag items within there before you commit.  A small red dot appears beside the checkbox when a file is set to be moved.

A: What wasn't mentioned in the previous answers was the SVN feature called "peg revision".  Use the peg revision when you want to refer to a directory structure which no longer exists.  From the SVN book:

In version 1.1, Subversion introduced
  a way for you to tell it exactly which
  Main Street you meant. It's called the
  peg revision, and it is provided to
  Subversion for the sole purpose of
  identifying a unique line of history.
  Because at most, one versioned object
  may occupy a path at any given
  time—or, more precisely, in any one
  revision—the combination of a path and
  a peg revision is all that is needed
  to refer to a specific line of
  history. Peg revisions are specified
  to the Subversion command-line client
  using at syntax, so called because the
  syntax involves appending an "at sign"
  (@) and the peg revision to the end of
  the path with which the revision is
  associated.

E.g.:
http://svn.example.com/skinproj@148
See the SVN book for details:  http://svnbook.red-bean.com/en/1.5/svn.advanced.pegrevs.html

A: Instead of just drag-and-drop, do the drag-and-drop with the right mouse button, and when you release, in the context menu that pops up choose "SVN Move versioned files here".

A: Open the repository browser, then either drag+drop using the right mouse button (only feels strange the first time you do it), or use the 'Copy to...' menu item.
This will not affect your working copy at all, you can then update your WC to get the new directory, and delete+commit the old directory from your WC.

A: Problem was: I tried to checkout an old revision while looking at the tree of the head revision in the repository browser. In that view, I tried to checkout trunk/folder2/source of an older revision, which didn't exist in that older revision because of the move.
Solution:

*

*Check the log for the revision you need

*switch the whole repository browser
to that revision

*now you can see the folder you need
in it's original path, where it was
back in that revision

*check out this folder

Thanks to all for the hints, which led me into the right direction.

A: Iam not sure if I understand your problem correctly. To mee it sounds a bit like this:
Assuming you have folder

/svn/trunk/folder1

and move it to

/svn/trunk/folder2

then you cannot access folder1 with this url:

/svn/trunk/folder2

you have to use

/svn/trunk/

depending on the revision you would then either see folder1 or folder2.


text:
Q: Не проходит авторизацию пользователь AD пока он в сети Ubuntu Всем доброго времени суток. Поднял Ubuntu 20.04, ввёл в домен.
Однако обнаружилось, что пользователь, после перезагрузки не может войти в систему под доменной учёткой.
НО, если отрубить от сети, то он может зайти в систему.
Подскажите куда копнуть нужно, пжлст.
auth.log
Nov  2 13:21:43 n-03 sshd[123991]: pam_unix(sshd:auth): authentication failure; logname= uid=0 euid=0 tty=ssh ruser= rhost=192.168.121.11  user=iadmin@mydomain.local
Nov  2 13:21:43 n-03 sshd[123991]: pam_sss(sshd:auth): authentication success; logname= uid=0 euid=0 tty=ssh ruser= rhost=192.168.121.11 user=iadmin@mydomain.local
Nov  2 13:21:45 n-03 sshd[123991]: pam_sss(sshd:account): Access denied for user iadmin@mydomain.local: 4 (System error)
Nov  2 13:21:45 n-03 sshd[123991]: Failed password for iadmin@mydomain.local from 10.16.23.11 port 49946 ssh2
Nov  2 13:21:45 n-03 sshd[123991]: fatal: Access denied for user iadmin@mydomain.local by PAM account configuration [preauth]

A: Причиной недоступности было нестандартное размещение ПК в домене. Если перегнать в стандартное, то всё работает. При вводе ПК в домен. Он падает в дэфолтное размещение - Computers. При перемещении в другие, руками созданные, папки (OU если не ошибаюсь), в моём случае, Ubunta не смогла получить данные с АД.

redpajama_set_name: RedPajamaStackExchange


text:
Q: Can the displot function sum the values on the y-axis? I am using seaborn to visualize a distribution.
My data looks something like this:
           0        1
0      295.0  203.389
1      298.0    0.100
2      300.0    1.066
3      309.5    0.322
4      358.0   55.865

The 0 column is supposed to be the x-axis.
sns.displot(df, x=0)

If I run this I get a distribution that only counts the occurrences of the values. I want to use the values in the 1 column as a weight for the values in the x-axis.

A: I think you are looking for sns.kdeplot, or similarly
sns.kdeplot(data = df, x = 0)

EDIT: or similarly sns.displot(data = df, x = 0, kind = 'kde')


text:
Q: Omitting the indefinite article in "The baby has soft skin". What rule applies here? Why are we omitting the indefinite article in

"The baby has soft skin"?

We are not saying

"The baby has a soft skin".

In this case we're talking about a particular baby, not babies in general. I'd really like to know the rule(s) because this is a major problem for many language groups learning English.

A: In this case, you don't say "the baby has a soft skin" in the same way you don't say "this is a bad music", you just say "this is bad music". This is because "skin" and "music" are "uncount nouns". Uncount nouns are nouns that you can't place a number in front of like "5 music" (you would say "5 songs"). The rule is that you never place "a" in front of uncount nouns, but you can put "the" in front of them sometimes, like in "I like the music." You can only put "the" if you are talking about a certain example of something. If music is playing and you like it, then you could say "I like the music", but when you say "I like music" you are just saying that you like music in general.
I used "music" as the example because skin can be an uncount noun and a count noun. In "the baby has soft skin" it is an uncount noun, but it is a count noun in "he bought ten crocodile skins" because it is plural.
This site gives pretty much all the rules regarding articles.


text:
Q: Dynamic SQL - something up with the where clause I have this proc:
Create PROCEDURE [dbo].[myProc]
@TableName nvarchar(100),
@RowID int

AS
BEGIN
    SET @SQLQuery = 'Select * from ' + @TableName + ' where ID = ' + @RowID ;
    EXECUTE(@SQLQuery);
END

I basically want to return the resulting row from this, without a where clause, its all good.

A: You need to be very careful as you've opened yourself up to SQL injection attacks. I'd strongly recommend being very defensive with this and parameterise as much as possible. e.g.
Create PROCEDURE [dbo].[myProc]
@TableName nvarchar(100),
@RowID int
AS
BEGIN
    DECLARE @SQLQuery NVARCHAR(500);
    IF (OBJECT_ID(@TableName) IS NOT NULL)
        BEGIN
            SET @SQLQuery = 'Select * from ' + QUOTENAME(@TableName) + ' where ID = @RowId'
            EXECUTE sp_executesql @SQLQuery, N'@RowId INTEGER', @RowID
        END
END

It would also be worth considering "locking down" what @TableName values are explicitly supported - check against a whitelist before building/executing the dynamic SQL.

A: in case that ID is varchar try this:
Create PROCEDURE [dbo].[myProc]
@TableName nvarchar(100),
@RowID int

AS
BEGIN
    SET @SQLQuery = 'Select * from ' + @TableName + ' where ID = ''' + rtrim(ltrim(str(@RowID))) + '''';
    EXECUTE(@SQLQuery);
END


text:
Q: Approximation of real number to the power of irrational Say I have two numbers, $c\in\Bbb R^+\,,q\in\Bbb{R\setminus Q}$.
Is there a way to approximate the value of $c^q$?
This question bugging me because of how simple it sound in compare to how complicated it is. First I want to understand what a power of irrational number is, when talking about $\Bbb R^+$(I use this domain for sake of simplicity) we have very well defined actions for power a rational number, we can even use some theorems to get $c^{a/b}=\sqrt[b]{c^a}$, but when I am dealing with irrational number I can not do this.
I know that we have some definition for this because the solution of the equation $2^x=3$ is irrational.
So what exactly does it mean to take something to a irrational power and is there a way to approximate a numeric value for this?

A: Before I answer your question, let me ask another question: how do you compute $\pi\times e$? How do you multiply irrational numbers? If multiplication is understood as repeated addition, how can you add a thing $\pi$ times?
I submit that real exponents are no different than real multipliers.
By definition, real numbers are numbers that can be approximated by rationals. For example, $\sqrt{2}$ is the real number defined by successively better approximating rationals $1,1.4,1.41,1.414,\cdots.$ Then the multiplication $\sqrt{2}\times 2$ is defined as the real number approximated by $1\times 2,1.4\times 2,1.41\times 2,1.414\times 2,\cdots,=2,2.8,2.82,2.828,\cdots.$ Hence we conclude that $\sqrt{2}\times 2\approx 2.828,$ by doing the computation on the approximating rationals.
Similarly powers with real exponents are defined as numbers approximated by corresponding powers with rational exponents.
For example, to compute $2^{\sqrt{2}}$, we just raise $2$ to the power of each approximating rational. So our sequence approximating $2^{\sqrt{2}}$ is $2^1,2^{1.4},2^{1.41},2^{1.414},\cdots = 2,2.64,2.657,2.6647,\cdots.$ So we say that $2^{\sqrt{2}}\approx 2.6647.$
For another example, I'll use the proposed example from your question. Let $x$ be the real number represented by the sequence of rationals $1, 1.5, 1.58, 1.584, 1.5849,\dotsc$ seems to converge to a real number. No repeating decimal places, so it's an irrational number.
Let's exponentiate it. Then $2^x$ is the sequence $2^1, 2^{1.5}, 2^{1.58}, 2^{1.584}, 2^{1.5849},\dotsc$ and we get $2, 2.83, 2.99, 2.998, 3.00,\dotsc$
The latter sequence approaches the real number $3$, hence the former sequence $x$ is the real solution to the equation $2^x=3.$ Or in short, $x=\log_23.$
And that's what it means to exponentiate a real. Just as every real may be represented by approximating rationals, the exponential of a real is approximated by the exponentiation of its approximating rationals.
These approximating rationals can either be understood as Cauchy sequences, Dedekind cuts, or plain old strings of decimal expansions.

A: The simplest way to define what it means to take a real power of a real number is to define $$\exp(t)=\sum_{k=0}^\infty \frac{t^k}{k!},$$to define the logarithm of a positive number in any of various ways, and then define $$c^p=\exp(p\log(c))\quad(c>0, p\in\mathbb R).$$
Of course we can approximate this. One way to define $\log(c)$ is $\int_1^c\frac{dt}t$; you can use standard methods for approximating integrals. Then you can approximate $\exp(p\log(c))$ by taking finitely many terms of that power series.


text:
Q: Error when trying to create log axes in R (xyplot) "Math.factor(x,xbase) : 'log' not meaningful for factors TL;DR: I'm getting the above (and below) error. How do I fix it?
Since I'm relatively new to R, this has me stumped. I'm trying to create an xyplot where both the axes are log-transformed. I've gotten this far:
library(lattice)
xyplot(`APC-H7-A`~`PE-Cy5-A`,lymphocytes, smooth=FALSE,
       xlim=c(-100,10000), ylim=c(-100,10000),
       scales=list(x=list(log=10),y=list(log=10)))

And I keep getting an error:

Error in Math.factor(x, xbase) : 'log' not meaningful for factors

I'm guessing that the error means something in my code isn't recognised as a number? but I don't really know where to start looking.
Lymphocytes is an object of flowFrame class, within the flowCore package:
Description. This class represents the data contained in a FCS file or similar data structure. There are three parts of the data:*

*

*A numeric matrix of the raw measurement values with rows=events and columns=parameters

*Annotation for the parameters (e.g. the measurement channels, stains, dynamic range)

*Additional annotation provided through keywords in the FCS file*

A: This is a complex data structure and it is not straightforward to access the raw data. The manual page of flowFrame (see help(flowFrame)) says that we can index this object, and with the exprs method is the way to the raw data. Also this class has its own plotting methods, I assume you have a good reason why you choose lattice instead. With loading the example data the way below I could run your plotting code:
require(flowCore)
require(lattice)
data(GvHD)

xyplot(exprs(GvHD[[1]][, "FL4-H"]) ~ exprs(GvHD[[1]][, "FL2-H"]),
        smooth=FALSE,
        xlim=c(-100,10000),
        ylim=c(-100,10000),
        scales=list(x=list(log=10),
                    y=list(log=10)),
        xlab = "FL2-H",
        ylab = "FL4-H")

I don't know what is FL2-H, FL4-H and index 1 in this data array, but I am sure you will find out quickly as you know your data.


text:
Q: textarea and submit button same height and same line I try to make my textarea and submit button within a form to be the same line(and height), so that the text area takes up 90% of the width and the submit button takes 10%, but what I get is the following:

textarea {
display:inline-block;
width:90%;
resize:none;
}
#submit {
display:inline-block;
width:10%;
margin-bottom:-10px
}
<form>
<textarea cols="30" rows="1" placeholder="Text here"></textarea>
<input id="submit" type="submit" value="Send">
</form>

How to fix it so that the button and textarea are the same line, and take up the same height?
Thanks

A: use  display:flex

form{
  display:flex
}

textarea {
  display:inline-block;
  width:90%;
  resize:none;
}

#submit {
  display:inline-block;
  width:10%;
  margin-bottom:-10px
}
<form>
  <textarea cols="30" rows="1" placeholder="Text here"></textarea>
  <input id="submit" type="submit" value="Send">
</form>

A: The problem is that the border of the elements and also their default margin/padding adds to their size. Therefore they are bigger than 90% or 10%.
A solution would be to either use box-sizing: border-box which prevents margin and padding from adding value to the size or to use a lower percentage like 85% and 8% or something like that.
Edit
Read for further information:
https://www.w3schools.com/css/css_boxmodel.asp

A: You can also touch the height of the submit button to make them equal :)

form{
display:flex
}
textarea {
display:inline-block;
width:80%;
resize:none;
}
#submit {
display:inline-block;
width:15%;
height: 21px;
margin-bottom:-10px
}
<form>
<textarea cols="30" rows="1" placeholder="Text here"></textarea>
<input id="submit" type="submit" value="Send">
</form>

A: Simplest is using display flex. Also you can remove display: inline-block and margin-bottom, and center items with align-items: center.

form {
  display: flex;
  align-items: center;
}

textarea {
  width: 90%;
  resize: none;
}

#submit {
  width: 10%;
}
<form>
  <textarea cols="30" rows="1" placeholder="Text here"></textarea>
  <input id="submit" type="submit" value="Send">
</form>

A: Use display: flex; on the form and remove the `display: inline-block' style from the elements inside
https://jsfiddle.net/zbwv9q97/
form{
  display:flex
}

textarea {
  width:90%;
  resize:none;
}

#submit {
  width:10%;
}

A: By using a combination of the box-model and display: flex.
Both elements are now on the same line and are the same height, as you asked :)

* {
  box-sizing: border-box;
}

form {
 display: flex;
}

textarea {
  display: inline-block;
  width: 90%;
  resize: none;
}

#submit {
  display: inline-block;
  width: 10%;
}
<form>
  <textarea cols="30" rows="1" placeholder="Text here"></textarea><input id="submit" type="submit" value="Send">
</form>


text:
Q: URL rewriting from Apache (.htaccess) to IIS issue I have been working on Php application with Rest Api in Apache environment, which requires URL rewriting, so i have used .htaccess file for writing the rules, which works well in Apache.
Now, i want to use same Php application with Rest Api in IIS enironment, and found that .htaccess is not working in IIS, because it uses different syntax or Method to write the same rules in web.config.
Need assistance, in converting the given rules in IIS environment.
Following are the rules which works fine in apache environment,
<IfModule mod_rewrite.c>
RewriteEngine On

RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-s
RewriteRule ^(.*)$ api.php?x=$1 [QSA,NC,L]

RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^(.*)$ api.php [QSA,NC,L]

RewriteCond %{REQUEST_FILENAME} -s
RewriteRule ^(.*)$ api.php [QSA,NC,L]

RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [QSA,L]

web.config (using online converter from .htaccess):
<rule name="rule 1q" stopProcessing="true">
<match url="^(.*)$"  ignoreCase="true" />
<action type="Rewrite" url="/api.php?x={R:1}"  appendQueryString="true" />
</rule>
<rule name="rule 2q" stopProcessing="true">
<match url="^(.*)$"  ignoreCase="true" />
<action type="Rewrite" url="/api.php"  appendQueryString="true" />
</rule>
<rule name="rule 3q" stopProcessing="true">
<match url="^(.*)$"  ignoreCase="true" />
<action type="Rewrite" url="/api.php"  appendQueryString="true" />
</rule>
<rule name="rule 4q" stopProcessing="true">
<match url="^"  />
<action type="Rewrite" url="/index.php"  appendQueryString="true" />
</rule>

A: Your web.config XML snippet lacks a lot of XML.
There is no supprise IIS URLRewrite doesn't support all settings an .htaccess does. For instance RewriteCond %{REQUEST_FILENAME} !-s, so you have to comment them out before converting. Furthermore, you can use IIS Manager to import the .htaccess to convert .htaccess to web.config.
The reason I'm posting this as an answer is because I just did this converting for you -and need some reply space :)
Here is the .htaccess, with two lines commented out:
RewriteEngine On

RewriteCond %{REQUEST_FILENAME} !-d
# RewriteCond %{REQUEST_FILENAME} !-s
RewriteRule ^(.*)$ api.php?x=$1 [QSA,NC,L]

RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^(.*)$ api.php [QSA,NC,L]

# RewriteCond %{REQUEST_FILENAME} -s
RewriteRule ^(.*)$ api.php [QSA,NC,L]

RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [QSA,L]

And the converted URLRewrite rules in web.config:
<rewrite>
  <rules>
    <!--#RewriteCond %{REQUEST_FILENAME} !-s-->
    <rule name="Imported Rule 1" stopProcessing="true">
      <match url="^(.*)$" />
      <conditions>
        <add input="{REQUEST_FILENAME}" matchType="IsDirectory" ignoreCase="false" negate="true" />
      </conditions>
      <action type="Rewrite" url="api.php?x={R:1}" appendQueryString="true" />
    </rule>
    <rule name="Imported Rule 2" stopProcessing="true">
      <match url="^(.*)$" />
      <conditions>
        <add input="{REQUEST_FILENAME}" matchType="IsDirectory" ignoreCase="false" />
      </conditions>
      <action type="Rewrite" url="api.php" appendQueryString="true" />
    </rule>
    <!--
    # RewriteCond %{REQUEST_FILENAME} -s
    completely disabled, does nothing important anymore since
    %{REQUEST_FILENAME} -s is not supported on IIS
    <rule name="Imported Rule 3" stopProcessing="true">
      <match url="^(.*)$" />
      <action type="Rewrite" url="api.php" appendQueryString="true" />
    </rule>
    -->
    <rule name="Imported Rule 4" stopProcessing="true">
      <match url="^" ignoreCase="false" />
      <conditions>
        <add input="{REQUEST_FILENAME}" matchType="IsFile" ignoreCase="false" negate="true" />
      </conditions>
      <action type="Rewrite" url="index.php" appendQueryString="true" />
    </rule>
  </rules>
</rewrite>

This may require some further tweaking, see iis.net for more information.


text:
Q: Error building webrtc library for iOS I've been trying to build webrtc for iOS following Google's directions at http://www.webrtc.org/native-code/ios (and related links). Although I recall that with similar steps I've been able to build it in the past this is no longer the case.
Here's the steps I did:

*

*Download prerequisites:
$ git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git
$ export PATH=`pwd`/depot_tools:"$PATH"

*Download repo:
$ export GYP_DEFINES="OS=ios"
$ fetch webrtc_ios

*Prepare build:
$ cd webrtc/src
$ export GYP_DEFINES="build_with_libjingle=1 build_with_chromium=0 libjingle_objc=1"
$ export GYP_DEFINES="$GYP_DEFINES OS=ios target_arch=armv7"
$ export GYP_GENERATOR_FLAGS="output_dir=out_ios"
$ export GYP_CROSSCOMPILE=1
$ gclient runhooks

*Build:
$ ninja -C out_ios/Debug-iphoneos AppRTCDemo
Everything is ok, until the last command that fails with /bin/sh: /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/gcc: No such file or directory:
ninja: Entering directory `out_ios/Debug-iphoneos'
[3/1664] CC obj/chromium/src/third_party/boringssl/src/crypto/bio/boringssl.bio_mem.o
FAILED: /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/gcc -MMD -MF obj/chromium/src/third_party/boringssl/src/crypto/bio/boringssl.bio_mem.o.d -DV8_DEPRECATION_WARNINGS -DCLD_VERSION=2 -DDISABLE_NACL -DCHROMIUM_BUILD -DCR_CLANG_REVISION=247874-1 -DUSE_LIBJPEG_TURBO=1 -DENABLE_CONFIGURATION_POLICY -DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE -DDONT_EMBED_BUILD_METADATA -DFIELDTRIAL_TESTING_ENABLED -DDISABLE_FTP_SUPPORT=1 -DV8_USE_EXTERNAL_STARTUP_DATA -DBORINGSSL_IMPLEMENTATION -DBORINGSSL_NO_STATIC_INITIALIZER -DOPENSSL_NO_ASM -DUSE_LIBPCI=1 -DUSE_OPENSSL=1 -DDYNAMIC_ANNOTATIONS_ENABLED=1 -DWTF_USE_DYNAMIC_ANNOTATIONS=1 -Igen -I../../chromium/src/third_party/boringssl/src/include -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS9.0.sdk -O0 -gdwarf-2 -fvisibility=hidden -Wnewline-eof -miphoneos-version-min=7.0 -arch arm64 -Wendif-labels -Wno-unused-parameter -Wno-missing-field-initializers -Wno-selector-type-mismatch -Wheader-hygiene -Wno-char-subscripts -Wno-unneeded-internal-declaration -Wno-covered-switch-default -Wstring-conversion -Wno-c++11-narrowing -Wno-deprecated-register -Wno-inconsistent-missing-override -Wno-shift-negative-value -Wno-bitfield-width -Wno-unused-function -Wno-unused-variable -m32 -arch i386 -pipe -no-cpp-precomp -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator9.0.sdk -I/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator9.0.sdk/usr/include/ -m32 -arch i386 -pipe -no-cpp-precomp -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator9.0.sdk -I/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator9.0.sdk/usr/include/ -std=c99 -Xclang -load -Xclang /Volumes/store/code/webrtc/src/third_party/llvm-build/Release+Asserts/lib/libFindBadConstructs.dylib -Xclang -add-plugin -Xclang find-bad-constructs -fcolor-diagnostics -fstack-protector-all -Wno-undefined-bool-conversion -Wno-tautological-undefined-compare  -c ../../chromium/src/third_party/boringssl/src/crypto/bio/bio_mem.c -o obj/chromium/src/third_party/boringssl/src/crypto/bio/boringssl.bio_mem.o
/bin/sh: /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/gcc: No such file or directory

For some reason ninja thinks we are building for the Simulator, plus even if we did this would not be the right path to get gcc. Notice that my system has XCode 7 installed.
Any ideas what might be wrong or how I could work around this?
Best regards,
Antonis

A: A year ago I also wanted to build library using Google's instructions but I was unable to. Many errors occurred and I ended up googling for some build script. In the end I found this script. Make following steps and you will build it successfully:

*

*Install Command Line Tools but pasting this command in terminal: xcode-select --install

*Clone script: git clone https://github.com/lunastorm/webrtc-ios.git

*Enter git repository in Terminal and run script with following command: make -j4 where j4 marks number of CPU cores (correct me if I'm wrong). This can take a while so prepare your self a cup of coffee

*Build will fail for the first time but don't worry, just delete the folders which script downloaded. I will write which ones in edit

*Find your code signing identity which is valid for building iOS apps. Type security find-identity in terminal. Pick one under Valid identities only

*Open the global configuration file src/build/common.gypi and search for the text 'CODE_SIGN_IDENTITY'. Replace 'CODE_SIGN_IDENTITY[sdk=iphoneos*]': 'iPhone Developer' with your developer information i.e. 'CODE_SIGN_IDENTITY[sdk=iphoneos*]': 'iPhone Developer: Josip Bernat (2V3DKW6SDC)'

*Run the script again using make -j4 and hopefully it will build you WebRTC.framework


text:
Q: design practice: is it good to hide/unhide controls at runtime I have always had a bias against controls appearing/disappearing at runtime. I think that I read this somewhere but google is not forthcoming and I've not been successful in finding anything to support my bias in any of the hard-copies that I have. We're having an internal debate as to the validity of this approach and I wonder if anyone can point me to any reference that discusses the topic.
Thanks!
Bo

A: It probably depends on the situation. In general, controls that magically appear and disappear are probably bad. If they are always present but disabled, the use will know that they can enable them somehow, and they'll look it up int he manual. If the controls are hidden, the user won't even know they're there to look them up. On the other hand, if the UI is already pretty complicated and getting cluttered, and these controls are only used in a very specific context, then it is probably OK to make then appear when necessary, because the user has already started some action which would require them.
The other option to hiding might be to have the controls in floating tool palettes/windows that appear when necessary.
I can't remember an actual refernce to cite though, sorry.

A: If a using a control is going to produce an error, you probably want to at least disable that control.
Whether to hide or disable, depends on the control.  In a standard drop down menu, it probably makes sense to disable, because then all the items are still in the same place.

A: In general I think your design process should dictate this question.  I believe in keeping the interface simple and easy to use. Only the essential information for the next decision should be visible. Disabling controls might be warranted from time to time but definitely not when it complicates what should be the action/decision step.
By creating accurate Use Cases and stepping through the decision process should assist in deciding to hide a control or simply to disable it.


text:
Q: What is the Trinity API I've stumbled upon a job offer that I'm really interested in and one phrase seems to daze me a little.

Must be proficient in C++ and Trinity API (will be tested)

I have some knowledge of C++ and application programming interfaces, but I have no idea what "Trinity" refers to.
I've tried searching the internet but didn't find a decent answer that would really tell me what it actually means, or what knowledge it involves.
Any info would be very much appreciated.

A: This site should explain all you need to know about Trinity and the API:
http://www.trinitydesktop.org/


text:
Q: Subquery returns different number of rows than equivalent JOIN I get different results when I use a subquery or a JOIN.
The query are these:
SELECT
    COUNT(*)
FROM
    table2
WHERE
    table2.id NOT IN (
        SELECT fkfield FROM table1
    )

and
SELECT
    COUNT(*)
FROM
    table2
LEFT JOIN table1 ON table1.fkfield = table2.id
WHERE
    table1.id IS NULL

(table1.fkfield has a FK constraint to table2.id)
First query returns 0 rows, second query returns 396 rows.
I've tried OPTIMIZE TABLE and export/import (with mysqldump) with no luck.
The engine is Innodb.
Thanks in advance.

A: Left join is not exactly as you may expect
"The LEFT JOIN keyword returns all records from the left table (table1), and the matched records from the right table (table2). The result is NULL from the right side, if there is no match"
https://www.w3schools.com/sql/sql_join_left.asp
LEFT JOIN table1 ON table1.fkfield = table2.id

It return's the intersection and all of table2.id values
So
SELECT
    COUNT(*)
FROM
    table2
WHERE
    table2.id NOT IN (
        SELECT fkfield FROM table1
    )

Returns only the intersection of table1 and table2
While
SELECT
    COUNT(*)
FROM
    table2
LEFT JOIN table1 ON table1.fkfield = table2.id
WHERE
    table1.id IS NULL

Returns the intersection of table1 and table2 plus all values of table2.id

A: I guess that means there are some matches in your second query where the table1_id is null. Try checking by addng sum(case when table1_id is null then 1 else 0 end) to your select


text:
Q: Work a Bitwise operation backwards I need to know how to do this backwards so that it will work for all of the options. If I start with shift i can get radix so How would i get shift from starting with radix.
int shift = 4; //3 will give octal base 4 will give Hex base 1 will give binary base
int radix = 1 << shift; // this comes out as 16

So Like i said above how would i get this to go the otherway
int radix = 16;
int shift =(some operation);

Also to make this work for if radix is 8, 2 or 16

A: There's lots of useful methods in the Integer class. Try
int shift = Integer.numberOfTrailingZeros(radix).

A: Try with this method,
public static int radixToShift(int radix){
    int shift = 0;
    for(int i=0;radix >> i >1;i++){
        shift++;
    }
    return shift;
}

Code
int shift = 4;
int radix = 1 << shift;
System.out.println("Radix :: "+radix);
System.out.println("Shift :: "+radixToShift(radix));

Output
Radix :: 16
Shift :: 4


text:
Q: Directional derivative identity Let $f:U\subset\mathbb{R}^n\rightarrow\mathbb{R}^m$ where $U$ is an open set, $p,v \in \mathbb{R}^n$ with $v \neq \vec{0}$. Let's recall the definition of the directional derivative of $f$ at $p$ in the direction of $v$:
$$
\frac{\partial f}{\partial v}(p) = \lim_{t\rightarrow0}\frac{f(p+tv)-f(p)}{t}
$$
Taking in consideration a norm (euclidean for example) in our vector space over the reals ($\mathbb{R}^n,\mathbb{R},|.|_e$), how can I prove the following identity?
$$
\frac{\partial f}{\partial v}(p) = |v|_e\frac{\partial f}{\partial\frac{v}{|v|_e}}(p)
$$
I tried to use the formal ($\epsilon, \delta$) definition of limit but couldn't get much further.
Any kind of advice is going to be highly appreciated. Thanks!

A: After some struggle I can see why this is true... It's just a simple substitution in the limit variable...
$$
\frac{\partial f}{\partial v}(p) = \lim_{t\rightarrow0}\frac{f(p+t v)-f(p)}{t} =  \lim_{t\rightarrow0}\frac{f(p+t \frac{|v|}{|v|}v)-f(p)}{t}=
$$
now let $t' = t|v|$, therefore
$$
=\lim_{t'\rightarrow0}\frac{f(p+t'\frac{v}{|v|})-f(p)}{\frac{t'}{|v|}} = |v|\lim_{t'\rightarrow0}\frac{f(p+t'\frac{v}{|v|})-f(p)}{t'} = |v|\frac{\partial f}{\partial \frac{v}{|v|}}(p)
$$


text:
Q: QML ScrollView does not scroll I need to create a long form using QML. The form will not fit inside the window, so I need for it to be scrollable. However I can't get the scroll view to work. Here is a minimum working example of my problem:
import QtQuick.Window 2.2
import QtQuick 2.9
import QtQuick.Controls 2.3

Window {
    visible: true
    width: 1280
    height: 720
    title: qsTr("Hello World")

    Rectangle{
        anchors.centerIn: parent
        width: parent.width*0.8;
        height: parent.height*0.7;

        ScrollView {
            anchors.fill: parent
            clip: true
            contentHeight: parent.height

            Rectangle{
                id: rect1
                width: parent.width
                height: 200
                color: "#ffff00"
                anchors.horizontalCenter: parent.horizontalCenter
            }

            Rectangle{
                id: rect2
                width: parent.width
                height: 500
                color: "#ff00ff"
                anchors.top: rect1.bottom
                anchors.horizontalCenter: parent.horizontalCenter
            }

            Rectangle{
                id: rect3
                width: parent.width
                height: 500
                color: "#00ffff"
                anchors.top: rect2.bottom
                anchors.horizontalCenter: parent.horizontalCenter
            }

        }

    }

}

As I understand it, this should allow me to scroll in order to see the 3 rectangles. However I only the see the first one and the upper half of the second one and I can't scroll.
Any help would be greatly appriciated

A: Because your ScrollView contains multiple items you need to take care of sizing yourself and set contentHeight explicitly to the combined height of all the items.
For testing, you can set vertical scrollbar always on to see how content height affects the scrollbar.
I commented out horizontal center anchoring because it is not needed (width of your rectangles is scrollview width).
ScrollView {
    anchors.fill: parent
    clip: true
    ScrollBar.vertical.policy: ScrollBar.AlwaysOn
    contentHeight: rect1.height+rect2.height+rect3.height

    Rectangle{
        id: rect1
        width: parent.width
        height: 200
        color: "#ffff00"
        //anchors.horizontalCenter: parent.horizontalCenter
    }

    Rectangle{
        id: rect2
        width: parent.width
        height: 500
        color: "#ff00ff"
        anchors.top: rect1.bottom
        //anchors.horizontalCenter: parent.horizontalCenter
    }

    Rectangle{
        id: rect3
        width: parent.width
        height: 500
        color: "#00ffff"
        anchors.top: rect2.bottom
        //anchors.horizontalCenter: parent.horizontalCenter
    }

}

If you wrap your rectangles with an item and set item implicitHeight to its height ScrollView detects the contentHeight correctly.
ScrollView {
    anchors.fill: parent
    clip: true
    ScrollBar.vertical.policy: ScrollBar.AlwaysOn
    Item {
        width: parent.width
        height: rect1.height+rect2.height+rect3.height
        implicitHeight: height
        Rectangle{
            id: rect1
            width: parent.width
            height: 200
            color: "#ffff00"
        }
        Rectangle{
            id: rect2
            width: parent.width
            height: 500
            color: "#ff00ff"
            anchors.top: rect1.bottom
        }
        Rectangle{
            id: rect3
            width: parent.width
            height: 500
            color: "#00ffff"
            anchors.top: rect2.bottom
        }
    }
}

The default implicit size for most items is 0x0, that's why you have to set implicit height for the item explicitly. However some items have an inherent implicit size, e.g. Image and Text. This means that if you place e.g. TextArea into your ScrollView it will automatically become scrollable if text is long enough.
ScrollView {
    anchors.fill: parent
    clip: true
    TextArea {
        readOnly: true
        text: online ? provider.loadedText : "Offline"
        wrapMode: Text.WordWrap
    }
}

A: Set the height and width of the scrollview to be the total of childs height added together!


text:
Q: One Kubernetes dashboard for multiple selected Namespaces We have multiple Namespaces in our cluster. Admin will have access to all the Namespaces by means of ClusterRole. But, user will be given access to the corresponding namespaces.
Say, user A is given access to namespace B,C & D.
So user A deploys dashboard in Namespace B with service account and RoleBinding. User will be able to see all the applications in Namespaces B. But, how can we give access to this Dashboard so that one dashboard will be listing the 3 Namespaces to see the corresponding applications?

A: In the current version of Kubernetes, it is possible to manage different namespaces by different users.
You need to realize how the RBAC works and how to use it to manage multiple Dashboards.
Draft of the concept: You need to create rules, roles and grant permission (cluster-wide and all namespaces) and then do rolebinding.
It can be used to grant read access to resources in any particular namespace, or across all namespaces.
For example, here is how to bind user "jane" to the default namespace and user "dave" to the development team.
You can provide Dashboard in both namespaces to give individual user access to them.
# This role binding allows "jane" to read pods in the "default" namespace.
kind: RoleBinding
apiVersion: rbac.authorization.k8s.io/v1
metadata:
  name: read-pods
  namespace: default
subjects:
- kind: User
  name: jane # Name is case sensitive
  apiGroup: rbac.authorization.k8s.io
roleRef:
  kind: Role #this must be Role or ClusterRole
  name: pod-reader # this must match the name of the Role or ClusterRole you wish to bind to
  apiGroup: rbac.authorization.k8s.io

   # This role binding allows "dave" to read secrets in the "development" namespace.
kind: RoleBinding
apiVersion: rbac.authorization.k8s.io/v1
metadata:
  name: read-secrets
  namespace: development # This only grants permissions within the "development" namespace.
subjects:
- kind: User
  name: dave # Name is case sensitive
  apiGroup: rbac.authorization.k8s.io
roleRef:
  kind: ClusterRole
  name: secret-reader
  apiGroup: rbac.authorization.k8s.io


text:
Q: Sonata media validation at admin I'm trying to validate image. I saw answer at
 Sonata Media: The file could not be found
How to validate image (width and height).
I need help on that. There is no proper doc in net.

A: To validate image dimensions using sonata media you need to override sonata media's ImageProvider class, sonata uses this class to handle image manipulation.If you already have an extended bundle of sonata media bundle then in services.yml file you can define your own provider as below ,make sure your yml file is included in main config.yml
parameters:
    sonata.media.provider.file.class: Application\Sonata\MediaBundle\Provider\ImageProvider

Now create your provider and extend it with sonata media's ImageProvider overrider validate() function and define your own validation or can override buildCreateForm()/buildEditForm() and define your asserts for binaryContent field
namespace Application\Sonata\MediaBundle\Provider;
//... other uses classes
use Sonata\MediaBundle\Provider\ImageProvider as BaseProvider;

class ImageProvider extends BaseProvider
{

    public function __construct($name, Filesystem $filesystem, CDNInterface $cdn, GeneratorInterface $pathGenerator, ThumbnailInterface $thumbnail, array $allowedExtensions = array(), array $allowedMimeTypes = array(), MetadataBuilderInterface $metadata = null)
    {
        parent::__construct($name, $filesystem, $cdn, $pathGenerator, $thumbnail);

        $this->allowedExtensions = $allowedExtensions;
        $this->allowedMimeTypes = $allowedMimeTypes;
        $this->metadata = $metadata;
    }

    /**
     * {@inheritdoc}
     */
    public function validate(ErrorElement $errorElement, MediaInterface $media)
    {
        if (!$media->getBinaryContent() instanceof \SplFileInfo) {
            return;
        }

        if ($media->getBinaryContent() instanceof UploadedFile) {
            $fileName = $media->getBinaryContent()->getClientOriginalName();
        } elseif ($media->getBinaryContent() instanceof File) {
            $fileName = $media->getBinaryContent()->getFilename();
        } else {
            throw new \RuntimeException(sprintf('Invalid binary content type: %s', get_class($media->getBinaryContent())));
        }

        if (!in_array(strtolower(pathinfo($fileName, PATHINFO_EXTENSION)), $this->allowedExtensions)) {
            $errorElement
                ->with('binaryContent')
                ->addViolation('Invalid extensions')
                ->end();
        }

        if (!in_array($media->getBinaryContent()->getMimeType(), $this->allowedMimeTypes)) {
            $errorElement
                ->with('binaryContent')
                ->addViolation('Invalid mime type : ' . $media->getBinaryContent()->getMimeType())
                ->end();
        }

        if ($media->getWidth() > '1280' || $media->getHeight() > 1280) {
            $errorElement
                ->with('binaryContent')
                ->addViolation('Invalid File Dimension : Please upload 1280px * (1280px) image')
                ->end();
        }
    }

}

A: This code works for me.
Only when using SonataMedia in MyBundle(Here AppBundle). I used the same code in SonataUserBundle(Application\Sonata\UserBundle\Entity). But it failed.
Entity:
<?php
// To reduce code i deleted many lines
namespace AppBundle\Entity;

use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Validator\Constraints as Assert;
use Symfony\Component\Validator\Context\ExecutionContextInterface;
use Gedmo\Mapping\Annotation as Gedmo;

/**

 * FZHomeSlider
 *
 * @ORM\Table(name="fz__home_slider")
 * @ORM\Entity(repositoryClass="AppBundle\Repository\FZHomeSliderRepository")
 * @ORM\HasLifecycleCallbacks()
 * @Assert\Callback(methods={ "isMediaSizeValid" })
 */
class FZHomeSlider {

    const FILE_PATH = 'image';
    const FILE_SIZE = 200; # kb
    const FILE_MIN_WIDTH = 1024;
    const FILE_MAX_WIDTH = 1024;
    const FILE_MIN_HEIGHT = 250;
    const FILE_MAX_HEIGHT = 250;

    /**
     * @var int
     *
     * @ORM\Column(name="id", type="integer")
     * @ORM\Id
     * @ORM\GeneratedValue(strategy="AUTO")
     */
    private $id;

    /**
     * @var string
     *
     * @ORM\OneToOne(targetEntity="Application\Sonata\MediaBundle\Entity\Media" )
     * @ORM\JoinColumns( { @ORM\JoinColumn( referencedColumnName="id", onDelete="CASCADE" ) } )
     * @Assert\NotNull()
     */
    private $image;

    /**
     * Set image
     *
     * @param \Application\Sonata\MediaBundle\Entity\Media $image
     *
     * @return FZHomeSlider
     */
    public function setImage(\Application\Sonata\MediaBundle\Entity\Media $image = null) {
        $this->image = $image;

        return $this;
    }

    /**
     * Get image
     *
     * @return \Application\Sonata\MediaBundle\Entity\Media
     */
    public function getImage() {
        return $this->image;
    }

    /**
     * @param ExecutionContextInterface $context Description
     */
    public function isMediaSizeValid(ExecutionContextInterface $context) {
        $this->fzValidateImage($context, $this->getImage());
    }

    private function fzValidateImage($context, $f) {
        if ($f == NULL) {
            $context->buildViolation('Please select an image.')->atPath(self::FILE_PATH)->addViolation();
        } else if ($f->getSize() > (self::FILE_SIZE * 1024)) {
            $context->buildViolation('The file is too large ( %a% kb). Allowed maximum size is %b% kb.')->atPath(self::FILE_PATH)->setParameters(['%a%' => intval($f->getSize() / 1024), '%b%' => self::FILE_SIZE])->addViolation();
        } else if ($f->getWidth() < self::FILE_MIN_WIDTH) {
            $context->buildViolation('The image width is too small ( %a% px). Minimum width expected is  %b% px.')->atPath(self::FILE_PATH)->setParameters(['%a%' => $f->getWidth(), '%b%' => self::FILE_MIN_WIDTH])->addViolation();
        } else if ($f->getWidth() > self::FILE_MAX_WIDTH) {
            $context->buildViolation('The image width is too big ( %a% px). Allowed maximum width is  %b% px.')->atPath(self::FILE_PATH)->setParameters(['%a%' => $f->getWidth(), '%b%' => self::FILE_MAX_WIDTH])->addViolation();
        } else if ($f->getHeight() < self::FILE_MIN_HEIGHT) {
            $context->buildViolation('The image height is too small ( %a% px). Minimum height expected is  %b% px.')->atPath(self::FILE_PATH)->setParameters(['%a%' => $f->getHeight(), '%b%' => self::FILE_MIN_HEIGHT])->addViolation();
        } else if ($f->getHeight() > self::FILE_MAX_HEIGHT) {
            $context->buildViolation('The image height is too big ( %a% px). Allowed maximum height is  %b% px.')->atPath(self::FILE_PATH)->setParameters(['%a%' => $f->getHeight(), '%b%' => self::FILE_MAX_HEIGHT])->addViolation();
        }
    }

}

In admin :
$formMapper
    ->with('Media')
    ->add('image', 'sonata_type_model_list', ['btn_delete' => false, 'help' => self::$FORM_IMG_HELP, 'required' => false], ['link_parameters' => ['provider' => 'sonata.media.provider.image', 'context' => 'home_slider']])->end()

FINALLY SOLVED & SOLUTIONS:
As per Sonata Admin Doc
UserAdmin
public function getFormBuilder() {
    $this->formOptions['data_class'] = $this->getClass();

    $options = $this->formOptions;
    $options['validation_groups'] = "";

    $formBuilder = $this->getFormContractor()->getFormBuilder($this->getUniqid(), $options);

    $this->defineFormBuilder($formBuilder);

    return $formBuilder;
}
public function validate(ErrorElement $errorElement, $object) {
    // throw new \Exception("bingo");
    $errorElement
            ->with('phone')
            ->assertLength(['min' => 10, 'max' => '14', 'minMessage' => "Phone number must be at least {{ limit }} characters long", 'maxMessage' => "Phone number cannot be longer than {{ limit }} characters"])
            ->end()
    ;
}

Here validation phone is only for reference. You can also validate using validation.yml file.
Application/Sonata/UserBundle/Resources/config/validation.yml
Application\Sonata\UserBundle\Entity\User:
properties:
    phone:
        - Length:
            min:        10
            minMessage: "Phone number must be at least {{ limit }} characters long"
            max:        13
            maxMessage: "Phone number cannot be longer than {{ limit }} characters"
        - Regex:
            pattern:    "/^[\d]{10,13}$/"
    biography:
        - Length:
            min:        5
            minMessage: "Biography must be at least {{ limit }} characters long"
            max:        7
            maxMessage: "Biography cannot be longer than {{ limit }} characters"
#        image:
#            - Image validation is done in Entity

A:  * @Assert\Image(
 *     minWidth = 200,
 *     maxWidth = 400,
 *     minHeight = 200,
 *     maxHeight = 400
 * )

You can add Assert annotation for Entity. Look at : http://symfony.com/doc/current/reference/constraints/Image.html


text:
Q: In ExtJS cant seem to find a way to turn chart axis field label into a hyperlink I am using ExtJS 4 and have a working horizontal bar chart. In the 'axes:' section I need the field labels to be hyperlinks so when you are looking at the chart, all of the labels on the x axis, and also the bars themselves, would be a link to another webpage that describes more about it.
...
axes: [{
  type: 'Numeric',
  position: 'bottom',
  fields: ['field1', 'field2', 'field3', 'field4'],
  title: 'Percentages',
  grid: true
}, {
  type: 'Category',
  position: 'left',
  fields: ['machineName'],
  title: 'Machine Names'
}],
...

It is that 'fields' section of 'Category' that prints out the names of the machines. By default this field only prints out the name as it gets it from JSON. I have created another variable that attempts to take the machine name and surrounds it with ' + name + ' but that just renders it as text, no clickability. All other searches have come up short. Ive seen some stuff on Themes or LabelLinks but couldnt get any of that to work in my particular setup. Any help would be appreciated.

A: This is how I did it. You can attach a 'click' event handler to axis labels by overriding getOrCreateLabel method in Axis.js.
function labelClickHandler(e, t, eopts) {
        console.log('clicked ' + e.text); // do your stuff here
}

// override getOrCreateLabel
Ext.chart.axis.Axis.override({
        getOrCreateLabel: function (i, text) {
        // Copy and paste original getOrCreateLabel body from Axis.js here
        ...
        textLabel = surface.add(Ext.apply({
            group: labelGroup,
            type: 'text',
            x: 0,
            y: 0,
            text: text
        }, me.label));
        surface.renderItem(textLabel);
        textLabel._bbox = textLabel.getBBox();
        // Add event handler after label creation
        textLabel.on('click', labelClickHandler);
        ...
    }
});

A: Here's my solution based on the one by Colombo.
This version allows you to set a handler while declaring your axis. Furthermore, it allows you to retrieve the label index, and only applies the override to Category axes, since we're not interested in clicking on the other types of axes anyway.
The axis declaration:
...
axes: [{
  type: 'Numeric',
  position: 'bottom',
  fields: ['field1', 'field2', 'field3', 'field4'],
  title: 'Percentages',
  grid: true
}, {
  type: 'Category',
  position: 'left',
  fields: ['machineName'],
  title: 'Machine Names',
  handler: function(axis, i, label){
    console.log('Label text: %o',label.text);
    console.log('Label index: %o',i);
    console.log('Axis: %o',axis);
  }
}],
...

The override:
Ext.override(Ext.chart.axis.Category,{
  getOrCreateLabel: function(i, text) {
    var me = this,
        labelGroup = me.labelGroup,
        textLabel = labelGroup.getAt(i),
        surface = me.chart.surface;
    if (textLabel) {
        if (text != textLabel.attr.text) {
            textLabel.setAttributes(Ext.apply({
                text: text
            }, me.label), true);
            textLabel._bbox = textLabel.getBBox();
        }
    }
    else {
        textLabel = surface.add(Ext.apply({
            group: labelGroup,
            type: 'text',
            x: 0,
            y: 0,
            text: text
        }, me.label));
        surface.renderItem(textLabel);
        textLabel._bbox = textLabel.getBBox();
        // add event handler
        if (me.label.handler && typeof(me.label.handler) == 'function') {
          textLabel.on('click',Ext.pass(me.label.handler,[me, i]));
        }
    }
    if (me.label.rotation) {
        textLabel.setAttributes({
            rotation: {
                degrees: 0
            }
        }, true);
        textLabel._ubbox = textLabel.getBBox();
        textLabel.setAttributes(me.label, true);
    } else {
        textLabel._ubbox = textLabel._bbox;
    }
    return textLabel;
  }
});

Note that this was done on ExtJS 4.0.7


text:
Q: Stirling's approximation for Gamma function Is that true for any $x>0$, the gamma function
$
\Gamma(x)\le x^x?
$
I know this is true for integers but am not sure for any $x>0$.

A: Not a real solution, just a strategy: can you use the fact that the inequality holds for integers to show that it holds for rationals? Because then continuity would do it, right?

A: This is not true.  Consider, for example, $\Gamma(1/2)=\sqrt\pi>1>(1/2)^{1/2}$.
However, this is true whenever $x>1$ since
$$\Gamma(x)<\Gamma(1+x)=\int_0^\infty t^xe^{-t}dt\le\int_0^\infty x^xe^{-t}dt=x^x$$


text:
Q: sas output to pdf without overwriting it I want to output some plots to a existing pdf (4 pages). I need to add these plots in page 5 (all in the same page).
ods pdf file="\\path\Ex..pdf" startpage=no;

proc sgplot

ods pdf close;

Ususally I create pdf using above code. But it will delete the previous content then create new things.

A: SAS cannot append to created PDF's currently. If the other PDF was created within SAS it may be possible to use proc document to re-organize output to create a single PDF file.
You can use Adobe Professional or another PDF application to append PDF's. If this needs to be automated a VB script can be created and run from within SAS, but Adobe Professional or the other PDF application will still be required and called externally.
EDIT:
The simplest method is to change where your ODS CLOSE is located so the PDF is written at once.
The second is to wrap each table in ODS document statements to create a document object and then replay it at a later point, aggregating all tables in the same location.
Code from here:
http://support.sas.com/kb/35/375.html
/* Use a LIBNAME statement or directory appropriate for your SAS session */
libname docs "c:\temp";

/* Route the PROC REPORT table to a document item store named FIRST in the DOCS library */
ods document name=docs.first;
proc report nowd data=sashelp.class(obs=10);
   title "first";
run;

/* Close the document itemstore */
ods document close;

/* Create a new document item store in which to save the second PROC REPORT table.
   This ODS DOCUMENT NAME= / ODS DOCUMENT CLOSE logic can be included in
   the original SAS session or a separate SAS session. */
ods document name=docs.second;

proc report nowd data=sashelp.vtable(obs=20);
   title "Second";
   column libname memname nobs nvar crdate;
run;

ods document close;

ods document name=docs.third;

proc report nowd data=sashelp.class;
   title "Third";
run;

ods document close;

/* In the same SAS session or a new SAS session, combine the results
   of the three document item stores with PROC DOCUMENT.  */
libname docs "c:\temp";
ods pdf file="combined_2.pdf";

proc document name=docs.first;
   replay;
run;
quit;

proc document name=docs.second;
   replay;
run;
quit;

proc document name=docs.third;
   replay;
run;
quit;

ods pdf close;


text:
Q: Qt не находит файлы Проблема заключается в том что Qt не замечает файлы, даже те, которые созданы в папках проекта.
Приведу пример:
#include <QtWidgets>
#include <QDebug>

int main(int argc, char **argv)
{
    QApplication app(argc, argv);

    QFile file("text.txt");
    if (!file.open(QIODevice::ReadOnly))
    {
        QMessageBox::critical(0, "Error", "Error: Cannot open file", QMessageBox::Ok, QMessageBox::Ok);
    } else {
        QTextStream stream(&file);
        QString str = stream.readAll();
        qDebug() << str;
        file.close();
    }

    return app.exec();
}

Здесь файл text.txt создан в той же папке что и файл исходного кода. Однако Qt не удается открыть этот файл и выскакивает ошибка QMessageBox::critical. Однако если указать полный путь из корневой папки, то тогда все будет работать нормально.
Можно было бы использовать и так, указывая абсолютный путь к файлу. Однако будет много костылей в большом проекте при его переносе на другое устройство.

A: Вы можете установить рабочий каталог во вкладке Проекты -> Запуск на необходимую вам папку:


text:
Q: How to add a sequential suffix to a pandas Series of strings for matching strings I want to create a new column that appends a sequential numeric suffix to matching values.
If I begin with the following...
d = {'item': ['A', 'A', 'B', 'C', 'C', 'A'],
     'year': [2019, 2019, 2019, 2019, 2020, 2020]}
df0 = pd.DataFrame(d)

    item    year
0   A       2019
1   A       2019
2   B       2019
3   C       2019
4   C       2020
5   A       2020

I want this intermediate step,
    item    item_number year
0   A       1           2019
1   A       2           2019
2   B       1           2019
3   C       1           2019
4   C       2           2020
5   A       3           2020

then this final form.
    numbered_item   item    year
0   A 1             A       2019
1   A 2             A       2019
2   B 1             B       2019
3   C 1             C       2019
4   C 2             C       2020
5   A 3             A       2020

A: Use df.insert() to insert the column in a specific pos and use df.groupby().cumcount():
df0.insert(0,'numbered_item',df0.item+df0.groupby('item').cumcount().add(1).astype(str))
print(df0)

  numbered_item item  year
0            A1    A  2019
1            A2    A  2019
2            B1    B  2019
3            C1    C  2019
4            C2    C  2020
5            A3    A  2020

A: Try:
df0['item_number'] = df0.groupby('item').cumcount()+1

df0['numbered_item'] = df0['item'].astype(str) + ' ' + df0['item_number'].astype(str)

Output:
item    year    item_number numbered_item
0   A   2019    1           A 1
1   A   2019    2           A 2
2   B   2019    1           B 1
3   C   2019    1           C 1
4   C   2020    2           C 2
5   A   2020    3           A 3


text:
Q: Is it possible to create a SURFACE PLOT with this dataset? I am new at software programming and I am starting to program some 3D graphs.
I have this dataset
σA    Leverage   PDPV
18.27%  35.78%  0.04%
3.10%   93.53%  1.07%
12.17%  50.15%  0.03%
2.99%   93.94%  1.56%
7.96%   75.61%  0.08%
18.37%  30.97%  0.00%
15.99%  41.97%  0.05%
8.72%   68.19%  0.27%
2.63%   91.55%  0.13%
16.24%  41.68%  0.02%
9.16%   63.56%  0.02%
21.47%  50.97%  5.16%
18.97%  15.03%  0.00%
8.91%   70.24%  0.14%
7.44%   74.18%  0.08%
8.55%   72.90%  0.32%
13.55%  37.98%  0.00%
21.62%  14.15%  0.00%
9.69%   62.92%  0.02%
14.64%  50.47%  0.16%
17.12%  55.80%  2.64%
14.25%  63.05%  1.15%
10.34%  74.29%  0.67%
10.05%  71.27%  0.55%
16.28%  30.83%  0.00%
9.94%   80.67%  6.47%
31.07%  32.35%  2.69%

I would like to know if it is possible to use a 3D Surface Plot for these three variables. If it is not, can you please give me explain why not and provide a suggestion?
Thanks a lot

A: I supposed that you just want a surface plot using three variables as xyz. I suggest using R (and rgl and geometry packages) to you.
Here is my example in R (I simply just made triangle mesh and painted it):
# reading your data
data <- structure(list(theta_A = c(18.27, 3.1, 12.17, 2.99, 7.96, 18.37, 15.99, 8.72, 2.63, 16.24, 9.16, 21.47, 18.97, 8.91, 7.44,
                                   8.55, 13.55, 21.62, 9.69, 14.64, 17.12, 14.25, 10.34, 10.05, 16.28, 9.94, 31.07),
                       Leverage = c(35.78, 93.53, 50.15, 93.94, 75.61, 30.97, 41.97, 68.19, 91.55, 41.68, 63.56, 50.97, 15.03, 70.24,
                                    74.18, 72.9, 37.98, 14.15, 62.92, 50.47, 55.8, 63.05, 74.29, 71.27, 30.83, 80.67, 32.35),
                       PDPV = c(0.04, 1.07, 0.03, 1.56, 0.08, 0, 0.05, 0.27, 0.13, 0.02, 0.02, 5.16, 0, 0.14, 0.08, 0.32, 0, 0,
                                0.02, 0.16, 2.64, 1.15, 0.67, 0.55, 0, 6.47, 2.69)),
                  .Names = c("theta_A", "Leverage", "PDPV"), row.names = c(NA, -27L), class = "data.frame")

# As far as I see your data, theta_A x PDPV (xz plane)'s sideview is the most simple
# and don't have duplication. So I use 2D (xz) Delaunay triangulation to make your data a tessellation.

library(rgl); library(geometry)

tri <- t( delaunayn(data[,c(1,3)]) )           # making connection information
open3d()                                       # open a RGL device
plot3d(data, type="s", col="red", radius=0.5)  # 3D scatter plot
rgl.triangles(data[tri,1], data[tri,2], data[tri,3], col = "gray", alpha=0.8)  # painting triangle mesh


text:
Q: Run function in app from ms band So I've had a look around and I cant seem to find an answer anywhere so here goes. Is it possible with the MS Band SDK to run a function within my app when the user taps a button?

A: Currently (at the time of writing) there is no way for the user to directly interact with a tile-app and thus pass a response to the application installed on the phone*
Your options are (as I see it):

*

*To use the sensors to define 'gestures'**

*Guide the user to use Cortana to provide speech commands ***
*This might change, but due to the very little storage capacity on the band if this was added I would assume only very basic interaction such as yes/no/cancel dialogos etc. and simpler responses using the keyboard when/if it becomes available for third party tiles.
**There is currently a bug with background work so you might have to prevent the lock screen from locking while receiving and interpreting sensor data on the phone which will impact the battery on the phone. This is expected to be fixed soon.
*** Speech commands are well supported on Windows Phone but I'm unsure how well supported they are on iOS and Android


text:
Q: Is there a standard way to programatically get the dhcp clients table from a router/dhcp server? I work on a projec with several wifi routers. I need to programatically discover the dhcp clients (ip addresses) currently allocated by a router.
Since I have several routers I would like to use SNMP.
Is there a standard SNMP MIB or a combination of them than can be used to retrieve allocated DHCP clients ?

A: The solution was not via snmp but via syslog. Both d-link: DAP2660 access point and d-link DSR-500 have basic efficient syslog support.
For DAP2660 the syslog server config is under status->log->log setting menu. Where one can state the syslog server ip address These syslogs will tell you which clients macs are connecting or disconnecting from the wifi
For DSR-500 syslog configuration is done in two stages: first configure the syslog server under Maintenance->Logs Settings->Remote Logging->Syslog. Then define which data will syslogged under several menu items under Maintenance->Logs Settings. One can determine various categories of events to syslog. among them dhcp messages and even http connections details.


text:
Q: Random values generator bug with OpenMP tasks I'm trying to develop a micro code based on the calculation of Pi by the Monte Carlo method while using OpenMP tasks.
It seems that I have some troubles in that code. Indeed, my application simply crashes and I got a segmentation fault coming from the gomp_barrier function...
I don't know if I am doing wrong things in my code or not, but I spend a little bit time on time to try to debug it and I found nothing. When I simply remove the computation of x and y with random values generator, the code is doing well... But if I add a call to rand_r or srand48_r, I have this segfault. So maybe, my use of these functions is wrong.
Does anyone have an idea please ?
Here is my code :
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <inttypes.h>
#include <time.h>
#include <unistd.h>

#include "omp.h"

#define TRIALS_PER_THREAD 10E6

int main(int argc, char** argv)
{
  uint64_t const n_test = TRIALS_PER_THREAD;
  uint64_t i;
  double pi = 0.;

  int nb_threads = 2;
  #pragma omp parallel shared(nb_threads)
  {
    #pragma omp master
      nb_threads = omp_get_num_threads();

  }
  fprintf(stdout, "Nb threads: %d\n", nb_threads);

  uint64_t* result = (uint64_t*)malloc(sizeof(uint64_t) * nb_threads);
  for(i = 0; i < nb_threads; ++i)
  {
    result[i] = 0;
  }

  int nb_test_per_thread = 20;

  #pragma omp parallel\
  shared(result)\
  firstprivate(n_test,nb_test_per_thread)
  {
    unsigned int seed;
    struct drand48_data randBuffer;

    seed = time(NULL) ^ omp_get_thread_num() ^ getpid();
    srand48_r(seed, &randBuffer);

    for(int k = 0; k < nb_test_per_thread; ++k)
    {
      #pragma omp task shared(result, seed, randBuffer)
      {
        uint64_t local_res = 0;
        double x = 0., y = 0.;
        for(i = 0; i < n_test; ++i)
        {
          drand48_r(&randBuffer, &x);// / (double)RAND_MAX;
          drand48_r(&randBuffer, &y);// / (double)RAND_MAX;

          local_res += (((x * x) + (y * y)) <= 1);
        }
        int tid = omp_get_thread_num();
        result[tid] += local_res;
      }
    }
  }

  for(i = 0; i < nb_threads; ++i)
  {
    pi += result[i];
  }

  fprintf(stdout, "%ld of %ld throws are in the circle !\n", (uint64_t)pi, n_test*nb_test_per_thread*nb_threads);
  pi *= 4;
  pi /= (double)(n_test*nb_test_per_thread*nb_threads);
  fprintf(stdout, "Pi ~= %f\n", pi);

  return 0;
}

Thank you in advance for your help !

A: Your use of drand48_r(&randBuffer, &x); has a race condition because each OpenMP thread shares randBuffer.
Per the Linux drand48_r() man page:

SYNOPSIS
   #include <stdlib.h>

   int drand48_r(struct drand48_data *buffer, double *result);

  ...

...
ATTRIBUTES
For an explanation of the terms used in this section, see
         attributes(7).
   ┌──────────────────────────┬───────────────┬─────────────────────┐
   │Interface                 │ Attribute     │ Value               │
   ├──────────────────────────┼───────────────┼─────────────────────┤
   │drand48_r(), erand48_r(), │ Thread safety │ MT-Safe race:buffer │
   │lrand48_r(), nrand48_r(), │               │                     │
   │mrand48_r(), jrand48_r(), │               │                     │
   │srand48_r(), seed48_r(),  │               │                     │
   │lcong48_r()               │               │                     │
   └──────────────────────────┴───────────────┴─────────────────────┘

Note the MT-Safe race:buffer in the ATTRIUBTES table.
Per the attributes(7) man page:

   `:identifier`

Annotations may sometimes be followed by identifiers, intended
                to group several functions that, for example, access the data
                structures in an unsafe way, as in race and const ...

Multiple parallel calls to drand48_r() can not safely share the same buffer argument due to a data race condition.


text:
Q: How to provision Oracle-to-MySQL replication using synchronous CDC with no downtime? I'm trying to provision Oracle-to-MySQL replication using the parallel extraction method outlined in the Tungsten Replicator documentation.

*

*Setup CDC tables in Oracle using the setupCDC.sh script provided by Tungsten.

*Start the parallel extractor, specifying the starting SCN of the CDC process given by the previous script.

*The parallel extractor will insert all existing data using flaskback queries of the form AS OF SCN ..., performing a point-in-time provisioning with data integrity.

The problem is the setupCDC script prints out an SCN only if the CDC is asynchronous. It's hinted in an official forum thread that this is to "get a single position for the whole schema snapshot."
Due to licensing restrictions, I can only use synchronous CDC. Is it safe to manually read the SCN recorded in the all_capture table and use it for provisioning? What are my options that can achieve both data integrity and minimum downtime?

*

*a. Disable write operations to the master database while provisioning is in progress:

*

*This is non-desirable as my database holds hundreds of gigabytes of data, probably resulting in a long downtime.

*b. Allow write operations during provisioning: any discrepancies will be fixed by re-applying all CDC data through normal replication after parallel extraction has processed all tables. Any errors raised during the re-application will have to be ignored.

*

*Would this be safe, from the viewpoint of data integrity?

A:
Is it safe to manually read the SCN recorded in the all_capture table and use it for provisioning?

For synchronous CDC, there is no entry in the all_capture table, which is for asynchronous capture processes.
Instead, each change table records the SCN at the time of its creation. You can determine the lowest SCN from the change_tables table and provide it as the argument to the provisioning command: trepctrl online -provision <scn>.
SQL> COL scn FORMAT 999999999999999
SQL> SELECT MIN(created_scn) scn FROM change_tables WHERE change_set_name = 'TUNGSTEN_CS_{service_name}';

(Replace {service_name} with your own service name.)


text:
Q: How to get R contour function to plot decimals I am trying to plot the contours of a function made of two gaussians, one centered at (2, 2) and the other centered at (-2, -2). Here is my code.
k1 <- 2
k2 <- 2
mu1 <- rbind(2, 2)
mu2 <- rbind(-2, -2)
sigma1 <- rbind(c(.6, 0), c(0, .6))
sigma2 <- rbind(c(.3, 0), c(0, .3))
det1 <- det(sigma1)
det2 <- det(sigma2)
inv1 <- solve(sigma1)
inv2 <- solve(sigma2)
x <- runif(1000, -5, 5)
y <- runif(1000, -5, 5)
w <- rbind(x, y)
ratio <- function(v){
  quotient <- log((2*pi)^(-k1/2)*det1^(-1/2)*(exp((-1/2)*t(v-mu1)%*%inv1%*%(v-mu1))))/log((2*pi)^(-k2/2)*det2^(-1/2)*(exp((-1/2)*t(v-mu2)%*%inv2%*%(v-mu2))))
  return(quotient)
}

z <- apply(w, 2, ratio)
round.z <- round(z, digits=0)
df <- cbind(x, y, z, round.z)
df <- as.data.frame(df)

grid <- with(df, interp(x, y, z))
contour(grid, levels=0:10, asp=1)

But when I plot these contours I just get the contours with whole number values. It looks like this:

There should be more, similar-looking contours in the first quadrants that have decimal values (because I am taking a ratio) but they do not appear. I can't seem to find how to get contour() to plot decimals. Anyone know how to fix this problem?

A: As user2554330 commented, I can use levels=c((0:10)/10, 2:10). Thank you to them!


text:
Q: create html  element from Tone.js object I am using Tone.js to modify sounds:
audio_url = "/sounds/damncoolbeats.m4a"
player = new Tone.Player(audio_url)
modified_player = <some Tone.js modifications to player>

To play the modified sound I would like to use a web audio element so that I can make use of audio.currentTime and eventlisteners to 'play' 'pause' and 'timeupdate' (which I can't seem to do with Tone.js).
The only way I managed to create an audio element so far is by loading from an url:
audio = new Audio(audio_url)

My current hacky solution is to load the original url twice, once in Tone.js and once as web audio, then I play both players simultaneously while keeping the web audio volume at zero. Loading the same http resource twice really messes with my website speed though...
Is there a way to create the web audio element from a Tone.js object?
audio = new Audio(modified_player) //does not work
audio = new Audio(modified_player.buffer) //does not work
audio = new Audio(URL.createObjectURL(modified_player.buffer)) //does not work


text:
Q: How to block javascript to wait for X seconds Update:
It may look like similar with Sleep in Javascript - delay between actions
But It's actually not .In that question , it's just a simple code which isn't nested in a each loop and doesn't need to block the execution of its code.
But in my case, I need to even block the each loop until the "else" block gets executed and then get back to the each loop.

Here is my code:
function drawNoisesRadars(noises, radars) {

    var noisesInATime = [];
    var timeIndicator = noises[0].get('NoiseTime').trim();

    $.each(noises, function (index, value) {

        if (!value) {
            return true;
        }

        var noiseTime = value.get('NoiseTime');
        if (noiseTime == timeIndicator) {
            noisesInATime.push(noises[index]);
        }
        else {
            //----------------------------------------------
            // wait for a second to draw the next one.
            window.setTimeout(function () {
                drawTimeSpecificNoisesRelatedRadars(noisesInATime, radars, timeIndicator);

                // clear noisesInATime once drawing is finished.
                clearArray(noisesInATime);

                timeIndicator = value.get('NoiseTime');

                noisesInATime.push(value);

            }, 1000 + index * 1000);
            //----------------------------------------------

        }

    });

}

in the else block, I'd like to have 1 second to execute the "else" block. But if I use setTimeout() then it creates asynchronous block which means the "if" block in the next iteration gets executed before the "else" block gets executed.
Update:
The reason why I don't want my "else" block code asynchronous is because I will need the timeIndicator stay same within the scope of "drawTimeSpecificNoisesRelatedRadars()", but because of the setTimeout() makes the block asynchronous, the problem comes ->
the value of timeIndicator is changed before drawTimeSpecificNoisesRelatedRadars() finished.
The reason why I'd like to block the "else" code for X seconds is:
If I don't block it, the animation of a flying aircraft will look like a lightning -> first shown in one place then immediately displayed at its destination without showing the "between" places.
Sorry, it's really hard to explain my code situation.
What I want is just a method which I can simply use it like:
..........
       else {

                drawTimeSpecificNoisesRelatedRadars(noisesInATime, radars, timeIndicator);

                // clear noisesInATime once drawing is finished.
                clearArray(noisesInATime);

                //Need to be put inside a callback method as well.
                //Reset the timeIndicator
                timeIndicator = value.get('NoiseTime');

                noisesInATime.push(value);
                waitXSecond(X); // Synchronous method, it blocks the whole thread for X seconds.

        }

waitXSecond(X); // Synchronous method, it blocks the whole thread for X seconds.

Is it achievable?
Thank you.


text:
Q: How Utility functions can be shared across various classes? I had a class Display with 2 utility functions getDate and getTime like below.
class Display
{
public:
  void getDate(char *pDate); //Utility functions for converting to custom format
  void getTime(char *pTime);
};

Later, In other class called Retriever also, i needed the same Utility functions getDate and getTime. I do not want to make getDate and getTime functions global(Or C like functions), to avoid accidental usage of these functions(which are specific to these 2 classes). Even wrapping them in namespace won't prevent accidental usage.
Display and Retriever are dissimilar classes. Can't use inheritance between them. Can't use Composition and aggregation as the lifetime of the objects of those classes will be different. They do not exist together(at same time).
Is there any good way of moving Utility functions out of Display and use them in both classes Display and Retriever ?
Is it good to put getDate and getTime in seperate class called Utilities and use object of it in classes Display and Retriever ?

A: Based on your additional info in the commentary/discussion, that e.g. getDate doesn't depend on instance data, getDateand getTime should not be non-static member functions. Ideally they should be freestanding functions. Perhaps in a namespace.
Put them, and other related stuff, in its own module.
It can be a pure headerfile module, or a separately compiler module consisting of a headerfile and an implementation file.
Put the functions in a namespace like e.g. timeutil, or the name of a library, whatever.
And I recommend changing them to return std::string instead of taking raw pointer arguments, e.g.
#include <string>

namespace timeutil {
    std::string timeString();
    std::string dateString();
}

Cheers & hth.,

A: I think that using namespace will be most appropriate. You can choose name for that namespace so that everyone be aware of it purpose:
namespace DisplayRetrieverImplementation {
  void getDate(char *pDate); //Utility functions for converting to custom format
  void getTime(char *pTime);
}

A: You could make your functions private static members of another class.  And make Display and Retriever friends of that class.


text:
Q: Link which jumps to specific method in deployed javadoc I want to generate a URL which, when opened, jumps to a specific method in the Javadoc.
I would assume that the standard Javadoc generator also adds the id attribute to some element containing the method. That way it would have been easy. A URL could look like http://example.com/javadoc/some/package/MyClass#specialMethod. Sadly I can't see the id attribute set anywhere in the generated Javadoc files.
Is it possible to pass arguments to the javadoc generator which would also add ids to the methods?
Or do I have to edit the source of the javadoc generator?
Another solution I thought of, was adding html to every method I'm interested in. Something like

, but I wouldn't like to do this for obvious reasons.

A: I found, that there is a  tag surrounding the title of the method with the name attribute set. .
So I just had to add the two dashes at the end of the url:
http://example.com/javadoc/some/package/MyClass#specialMethod--
This may not work in the future as per HTML5 the nameattribute is obsolete on the a tag.


text:
Q: Ubuntu 14.04- Force lower resolution on Macbook Retina Display I am dual-booting Ubuntu 14.04 on my Macbook Pro Retina Display. I have also installed the proprietary Nvidia drivers. Everything works fine, but the problem is that since the screen is such a high resolution, everything is tiny (text, icons, menus, everything). I want to set the display to a lower resolution using the system settings > Displays, but the drop-down menu for 'Resolution' only contains one option: 2880x1800. Before I installed the proprietary Nvidia drivers, I was able to select a lower resolution her.
I apologize in advance, because I do not know what specific information I need to provide. I am very new to Linux, and frankly have no idea what I'm doing.
P.S. I know that there's other ways to solve this problem, namely by tweaking various settings to scale up text, icons, window sizes, etc. individually, but frankly that just sounds like a huge hassle. I'd much rather be able to change the screen resolution so that everything scales uniformly.

A: I have realized that I made a pretty stupid mistake. Rather than trying to change the resolution in System Settings > Displays, I had to run the nvidia-settings command, which let me choose a different resolution.


text:
Q: How does the changepic function in openTBS work? I'm currently trying out the TinyButStrong library with openTBS plugin to edit an OpenOffice writer template.
If I correctly understand, you can change a default picture to something else using this:
[b.number;ope=changepic;from='pic_[val].png';default=current;adjust]

I tried changing the from='pic_[val].png' to from='example.jpg', this didn't change the picture however.
Anyone knows how to get this working? Help will be greatly appreciated.

A: Put a fixed value in parameter "from" should force the image (it worked for me).
If your field has been merged (that is it does not appear in the result file) and you have no error message, then having the image unchanged means that the target file cannot be found.
I think the 'example.jpg' file should be placed in the folder with the script that manages TBS and OpenTBS. Otherwise, you have to specify a path.

A: You don't actually need to the 'from' parameter to just switch a picture out. OpenTBS gets the path of the picture from the first parameter - in your case b.number (which hopefully contains a path to an image). Adjust is also not required, unless you are resizing the picture.
[b.number;ope=changepic;default=current;]

Assuming:
$b->number = '/path/to/image.png'

Also keep in mind, if b.number is a block, you may need to define your block boundary for the data to populate. (If you are able to see the path in the $TBS->PlugIn(OPENTBS_DEBUG_XML_SHOW) mode don't worry about this) Try using [b.number] if you are not sure your data is being processed.


text:
Q: How to merge multiple dataframe columns within a common dataframe in pandas in fastest way possible? Need to perform the following operation on a pandas dataframe df inside a for loop with 50 iterations or more:
Column'X' of df has to be merged with column 'X' of df1,
Column'Y' of df has to be merged with column 'Y' of df2,
Column'Z' of df has to be merged with column 'Z' of df3,
Column'W' of df has to be merged with column 'W' of df4

The columns which are common in all 5 dataframes - df, df1, df2, df3 and df4 are A, B, C and D
EDIT
The shape of all dataframes is different from one another where df is the master dataframe having maximum number of rows and rest all other 4 dataframes have number of rows less than df but varying from each other. So while merging columns need to make sure that rows from both dataframes are matched first.
Input df
A  B  C  D   X    Y    Z    W
1  2  3  4  nan  nan  nan  nan
2  3  4  5  nan  nan  nan  nan
5  9  7  8  nan  nan  nan  nan
4  8  6  3  nan  nan  nan  nan

df1
A  B  C  D   X    Y    Z    W
2  3  4  5  100  nan  nan  nan
4  8  6  3  200  nan  nan  nan

df2
A  B  C  D   X    Y    Z    W
1  2  3  4  nan  50  nan  nan

df3
A  B  C  D   X    Y    Z     W
1  2  3  4  nan  nan  1000  nan
4  8  6  3  nan  nan  2000  nan

df4
A  B  C  D   X    Y    Z    W
2  3  4  5  nan  nan  nan  25
5  9  7  8  nan  nan  nan  35
4  8  6  3  nan  nan  nan  45

Output df
A  B  C  D   X    Y    Z    W
1  2  3  4  nan  50   1000  nan
2  3  4  5  100  nan   nan  25
5  9  7  8  nan  nan   nan  35
4  8  6  3  200  nan  2000  45

Which is the most efficient and fastest way to achieve it? Tried using 4 separate combine_first statements but that doesn't seem to be the most efficient way.
Can this be done by using just 1 line of code instead?
Any help will be appreciated. Many thanks in advance.


text:
Q: Unicorn and copy_on_write_friendly? While researching Unicorn configuration options I came across this snippet..
GC.respond_to?(:copy_on_write_friendly=) and
  GC.copy_on_write_friendly = true

If I undertand correctly, it optimizes how Unicorn handles memory allocation and resource sharing between workers?
I use Unicorn to power my Sinatra application on server with Ruby 1.9.3. Are there any downsides to including the copy_on_write_friendly setting in my unicorn config?

A: That's not a configuration option, it's a Ruby code snippet that tells it to set copy_on_write_friendly if the GC object has that method.  For example, in ruby mainline 1.9.2p290:
1.9.2p290 :003 > GC.copy_on_write_friendly
NoMethodError: undefined method `copy_on_write_friendly' for GC:Module
    from (irb):3
    from /Users/kyle/.rvm/rubies/ruby-1.9.2-p290/bin/irb:16:in `<main>'

The only Ruby interpreter that supports that option to my knowledge is Ruby Enterprise Edition.  There's a bit about it here: http://www.rubyenterpriseedition.com/faq.html


text:
Q: The execute order differ from code order I execute this code snippet in goland IDE but found the output order is NOTthe same as what I expected:
package main

import (
    "fmt"
    "errors"
)

func main() {

    println("===========================")
    println("---------------------------")
    r,_:= div(6,3)
    fmt.Println(r)
}

func div(x, y int) (int, error) {
    defer println("dispose...")
    if y == 0 {
        return 0, errors.New("division by zero")
    }
    return x / y, nil
}

output:

*

*why the out order is differ from code order

*why the output in different color(white & red), I use goland IDE by jetbrain

I could not reproduce in https://play.golang.org/p/2T5LOt7FRDn
My Local env: windows 10 + go1.10.3 windows/amd64 + GoLand 2018.1.4

A: First, note that println() writes to os.Stderr.
https://golang.org/pkg/builtin/#println

...and writes the result to standard error

It seems Jetbrain's IDEs would show you Stderr lines at the end and in a different colour.
This is a smaller program that would let you reproduce the same behaviour:
package main

import (
    "fmt"
    "os"
)

func main() {
    fmt.Fprintln(os.Stderr, "to stderr")
    fmt.Fprintln(os.Stdout, "to stdout")
}

You will see the output inverted, with the to stderr line shown in red.
You cannot reproduce this outside the IDE cause then stderr and stdout ouput will be interleaved.


text:
Q: jQuery UI tabs activate event not functioning correctly I have a div with different tabs each containing a table. Content is going to be dynamically loaded into each table so I need a way to set the height of the th and tr elements of each table equally. For example, if table1 has a th height of 50px than table2 will also need to have a th height of 50px.
The code I am using works but for some reason it added one pixel the height of each element on each tab switch. For example, if I click on the second tab all tr elements will be 50px. If I click to the first tab and then back to the second tab, the tr elements will change to 51px tall. If I click back to the first tab and then the second tab, the tr elements will change to 52px tall etc. etc.
Here is my code:
$( "#new-locations-tabs" ).tabs({
  activate: function(events, ui) {
    var getHeadingHeight = $("#new-locations-tabs .ui-tabs-panel:visible .right-table th").css("height");
    $("#new-locations-tabs .ui-tabs-panel:visible .left-table th").css("height", getHeadingHeight);

    var getRowHeight = $("#new-locations-tabs .ui-tabs-panel:visible .left-table td").css("height");
    $("#new-locations-tabs .ui-tabs-panel:visible .right-table td, #new-locations-tabs .ui-tabs-panel:visible .left-table td").css("height", getRowHeight);
  }
});

http://jsfiddle.net/KFcYS/

A:
"Note that the computed style of an element may not be the same as the value specified for that element in a style sheet."

http://api.jquery.com/css
There's probably some calculation rounding happening. Try using height() or outerHeight() instead.

"The difference between .css( "height" ) and .height() is that the latter returns a unit-less pixel value (for example, 400) while the former returns a value with units intact (for example, 400px). The .height() method is recommended when an element's height needs to be used in a mathematical calculation."

http://api.jquery.com/height


text:
Q: TreeView - clicar no Node e abrir tela especificia Tenho um TreeView, com alguns itens de configurações:

Gostaria de ao clicar duas vezes em um node ele abra um form especifico, o evento de clicar duas vezes e abrir o form, está OK, o problema é como eu distinguo um node do outro?
Exemplo, ao clicar duas vezes em Usuários ele abre a tela Usuários, ao clicar duas vezes em Permissões ele abre a tela de Permissões.
Evento DoubleClick:
this.treeView1.NodeMouseDoubleClick +=
new System.Windows.Forms.TreeNodeMouseClickEventHandler(this.TreeView1_doubleClick);

Metodo que estou utilizando para gerar o doubleclick:
private void TreeView1_doubleClick(Object sender, TreeNodeMouseClickEventArgs e)// clicar em usuarios
{
     Manutencao_usuarios clickmu = new Manutencao_usuarios();
     clickmu.ShowDialog();
}

A: Você pode fazer isso no evento NodeMouseDoubleClick do TreeView:
private void treeView1_NodeMouseDoubleClick(object sender, TreeNodeMouseClickEventArgs e)
{
    string node = e.Node.Text;
    switch (node)
    {
        case "Servidores e Diretórios":
            // Abrir o formulário Servidores e Diretórios
            break;
        case "Usuários":
            // Abrir o formulário Usuários
            break;

        // Restante do código...

        default:
            // Fazer algo se nenhuma das opções acima for clicada
            break;
    }
}


text:
Q: jQuery - Get user id and article id for each article I am trying to save specified article as favorite. So I have a button which should get id of that article, and the id of the user (I will store them into db).
I'm trying to do something like this:
This is a blade...
@foreach ( $results['matches'] as $doc => $docinfo )
.
.
.
    <button  class="bookmark"></button>
    <input type="hidden" id="{{Auth::user()->id}}" value="{{Auth::user()->id}}">
    <input type="hidden" id="{{$docinfo['attrs']['sid']}}" value="{{$docinfo['attrs']['sid']}}">
.
.
.
@endforeach

And I've tried so far to output the values in console:

It only prints to console if the button of the first article is clicked. However, it prints the id of the last article...
For example...
<button  class="bookmark">

    </button>
    <input type="hidden" id="15" value="15">
    <input type="hidden" id="1" value="1">

<button  class="bookmark">

    </button>
    <input type="hidden" id="15" value="15">
    <input type="hidden" id="2" value="2">

<button  class="bookmark">

    </button>
    <input type="hidden" id="15" value="15">
    <input type="hidden" id="3" value="3">

Here I have three buttons. When I press the second and third one, nothing happens. When I press the first one, it doesn't print 15#1 like it should, but it prints 15#3.
I want to print the id and the article id when I click the button of the related article...

A: do something like this bind click on button's class bookmark

$(".bookmark").on("click",function(){
var idUser = $(this).next().val();
var idArticle = $(this).next().next().val();
console.log(idUser + "#" + idArticle);
});

<button  class="bookmark">

    </button>
    <input type="hidden" id="15" value="15">
    <input type="hidden" id="1" value="1">

<button  class="bookmark">

    </button>
    <input type="hidden" id="15" value="15">
    <input type="hidden" id="2" value="2">

<button  class="bookmark">

    </button>
    <input type="hidden" id="15" value="15">
    <input type="hidden" id="3" value="3">

A: You are using same id for all image tags. It's not good. You should use class instead of id.
So your html will look like this
<button  class="bookmark">

    </button>
    <input class="userid" type="hidden" id="125" value="135">
    <input class="articleid" type="hidden" id="1" value="1">

<button  class="bookmark">

    </button>
    <input class="userid" type="hidden" id="135" value="145">
    <input class="articleid" type="hidden" id="2" value="2">

<button  class="bookmark">

    </button>
    <input class="userid" type="hidden" id="165" value="155">
    <input class="articleid" type="hidden" id="3" value="3">

and Script
  $('.bookmark').click(function(){
          var userid=$(this).next('.userid').val();
          console.log(userid);
  });

Working fiddle

A: Maybe this solution will help you.
function addFavourite(userId, articleId) {
    console.log(userId + "#" + articleId)
}

When you render HTML
@foreach ( $results['matches'] as $doc => $docinfo )
.
.
.
    <button  class="bookmark" onClick="addFavourite(Auth::user()->id, $docinfo['attrs']['sid'])" />
.
.
.
@endforeach

A: You can only have one element with the same id - all your buttons have the same id.
Wire up the event handler using classes instead, then you can use this inside the event handler so you know which button has been pressed.
You can then either use DOM navigation $(this).next(), link them using attributes or group them in a parent container.
Using .next():
// wire up to the button, not the image
$('button.bookmark').click(function() {
    var idUser = $(this).next().val();
    var idArticle = $(this).next().next().val();
    console.log(idUser + '#' + idArticle);
});


text:
Q: Angular Material 2 md-input is not focusing when i setValue to the formGroup Something weird is happening with md-input focus:
This is one of the element i have
<md-input-container dividerColor="warn">
        <input md-input placeholder="Code..." formControlName="code">
 </md-input-container>

This is the method i subscribe and set the value to the formGroup:
getOneItem() {
this._objectsService.getOneItem(this.id).subscribe(
  resObjectsData => {
    delete resObjectsData._id;
    this.form.setValue(resObjectsData); // Here i am setting the value
  }, error => this.errorMsg = error
);

The object on the view is loading as excepted but the md-input text field is not focusing. The other types like date,time,select,number are focusing just fine. Here is an screenshot:

A: Just use <md-input formControlName="code" placeholder="Code..."></md-input> without md-input-container

A: I also wasn´t able to set the input focused, so I just get rid of the placeholder and set a fixed label, just a workaround.
<md-input-container floatingPlaceholder="false">
    <label>Name</label>
    <input type="text" md-input formControlName="fieldName">
</md-input-container>


text:
Q: SqlDatasource process records before display I have a database with link urls and their respective display texts. I need to check if they are broken or not before their display string is shown in the gridview.
I am using SqlDatasource, is there a way to process records and use custom HTML markup to show them while using the SqlDataSource?
I am trying to use the OnSelected event of SqlDatasource but cant get how to use it.

A: I believe what you are trying to do is make sure that the hyperlink is valid before it gets put into the datagrid.  To do this, you would need to subscribe to the RowDataBound event on your grid.  From there, you can run code to evaluate your URL.  Here is a quick example that would check to be sure that the URL field is not an empty string:
protected void selectedBookList_RowDataBound(object sender, GridViewRowEventArgs e)
{
    if ((e.Row != null) && (e.Row.RowType == DataControlRowType.DataRow))
    {
        string test = DataBinder.Eval(e.Row.DataItem, "URL").ToString();

        if (test.Length == 0)
        {
            e.Row.Cells[3].Visible = false;
        }
        else
        {
            e.Row.Cells[3].Visible = true;
        }
    }
}

Instead of testing to be sure the length is equal to zero, you could check to see if the link is dead or not.  Once you have evaluated it, you can hide the cell like I am doing here or you could modify the link, put in a generic link, etc.


text:
Q: Is this a common way of implementing a factory pattern in ObjectiveC? I'm studying some ObjC source here and one of the controllers has a property of type NSDictionary that is called "overrideClassNames".
As key it wants the class of an existing interface and as value the class of a subclass of the existing one, like:
controller.overrideClassNames = @{(id)[DefaultType class] : [MySubClassedDefaultType class]};

Whenever an instance of DefaultType is required, it would look up the dictionary and create a more specialized instance if one has been set.
I'm thinking if this is actually a common approach in ObjC? Coming from C# and Java, my idea would have been to create a delegate factory method that is called if an instance of DefaultType is required. The user of the class could then return his more specialized version.
Alternatively (in C#) I would make the class generic and let it have a <T> : DefaultType, new()

A: this has not mainly to do with a factory pattern but with subclassing IMO -- BUT
yes. it is a common way to have a method that returns a class object - in osx for ex. A Control has a CellClass (which it allocs/inits to do the drawing for it)
and in a singleton you often have something like:
_sharedInstance = [[[self class] alloc] init];


text:
Q: Animate jQuery - Cannot set property 'cur' of undefined I am trying to animate an element that is within a iframe.
$("#Browser").contents().find("#mouse").animate({top:"10px"},500)

I seem to be getting this error.
TypeError: Cannot set property 'cur' of undefined

A: You are having a problem with your {top:"10px"} part. If you do this you should try using:
    $("#Browser").contents().find("#mouse").animate({top:10px;},500);


text:
Q: Can I send a OneDrive File Request using Microsoft's Graph API? Microsoft OneDrive allows you to send a "file request" so others can send you very large files without needing a OneDrive account themselves.
I'm wanting to use an API (probably Microsoft Graph API)) to automatically create file requests on a user's behalf, and delete them later too.
Is it possible to create a OneDrive file request via an API? If so, where is that documented?
Thanks for your time!

A: Looks like that feature is not available yet. I see a feature request for the same in MS Graph user voice page. Please upvote/comment on the same so that the feature team will get better visibility.


text:
Q: Hyperledger Fabric: peer chaincode instantiate error: "could not assemble transaction " "msg chaincode registration failed" We are trying to instantiate the sample chaincode github.com/chaincode/chaincode_example02/go/ in a sample network, and we get the following error message... any suggestions where to look at?
CLI logs:
Error: could not assemble transaction, err proposal response was not successful, error code 500, msg chaincode registration failed: container exited with 0

Peer Logs:
2020-10-29 15:20:31.341 UTC [gossip.comm] sendToEndpoint -> DEBU 5ed1 Exiting
2020-10-29 15:20:31.397 UTC [chaincode] Launch -> DEBU 5ed2 stopping due to error while launching: container exited with 0
github.com/hyperledger/fabric/core/chaincode.(*RuntimeLauncher).Launch.func1
        /opt/gopath/src/github.com/hyperledger/fabric/core/chaincode/runtime_launcher.go:63
runtime.goexit
        /opt/go/src/runtime/asm_amd64.s:1333
chaincode registration failed
2020-10-29 15:20:31.397 UTC [container] lockContainer -> DEBU 5ed3 waiting for container(mycc-1.0) lock
2020-10-29 15:20:31.397 UTC [container] lockContainer -> DEBU 5ed4 got container (mycc-1.0) lock
2020-10-29 15:20:31.417 UTC [container] unlockContainer -> DEBU 5edb container lock deleted(mycc-1.0)
2020-10-29 15:20:31.417 UTC [chaincode] Launch -> DEBU 5edc launch complete
2020-10-29 15:20:31.417 UTC [chaincode] Deregister -> DEBU 5edd deregister handler: mycc:1.0
2020-10-29 15:20:31.417 UTC [endorser] callChaincode -> INFO 5ede [mychannel][502c46f0] Exit chaincode: name:"lscc"  (35376ms)
2020-10-29 15:20:31.417 UTC [endorser] SimulateProposal -> ERRO 5edf [mychannel][502c46f0] failed to invoke chaincode name:"lscc" , error: container exited with 0
github.com/hyperledger/fabric/core/chaincode.(*RuntimeLauncher).Launch.func1
        /opt/gopath/src/github.com/hyperledger/fabric/core/chaincode/runtime_launcher.go:63
runtime.goexit
        /opt/go/src/runtime/asm_amd64.s:1333
chaincode registration failed
2020-10-29 15:20:31.417 UTC [endorser] SimulateProposal -> DEBU 5ee0 [mychannel][502c46f0] Exit
2020-10-29 15:20:31.417 UTC [lockbasedtxmgr] Done -> DEBU 5ee1 Done with transaction simulation / query execution [502c46f068a775e5966ee76e646b9444410e582877e12bd2b69aa89102061299]
2020-10-29 15:20:31.417 UTC [endorser] func1 -> DEBU 5ee2 Exit: request from 192.168.0.6:50290

A: The problem was caused by having a docker-compose network name which was not the default name (byfn).
It was fixed by adding the environ variable CORE_VM_DOCKER_HOSTCONFIG_NETWORKMODE to the right name