text:
Q: C# database update overlap I have 2 lists, both containing integers that represent ratings of players in their respective team.
Ex:
team1ListOfRatings: 9,1,4
team2ListOfRatings: 6,2,4

I wish to enter these into an access database that I have. However, when I try to enter them,  if there are any similarities with the numbers in the lists (in the example shown above, this is '4') then the duplicate rating in the first list will be allocated to team 2 in the database.
It would produce this result:
Players in team 1: Ben (rating 9), Will(rating 1)
Players in team 2: Philip(rating 6), Sam(rating 2), Bert(rating 4), Gary(rating 4)

From the example you can see above, it is obvious that Gary needs to be in the first team, however because I use a for loop it reallocates any duplicates to the team that was used in the most recent for loop.
Here is the code that I use for this:
// this adds the players to the database temporarily without a team
for (int i = 0; i < numberOfPlayers; i++)
{
    OleDbConnection connection = new OleDbConnection(CONNECTION STRING HERE);

    OleDbCommand command = new OleDbCommand();

    connection.Open();
    command.Parameters.Add("@name", OleDbType.VarWChar).Value = textBox[i].Text;
    command.Parameters.Add("@rating", OleDbType.Integer).Value = Convert.ToInt32(ratingBox[i].Text);
    command.CommandText = "INSERT INTO TotalPlayerName ([PlayerName], [Team], [Rating],  [Substitute], [Complete], [SportID]) VALUES (@name, null , @rating,  false, false, " + ID + ")";
    command.CommandType = CommandType.Text;
    command.Connection = connection;

    command.ExecuteNonQuery();
    connection.Close();
}

            //list of all ratings:

            List<int> ratingList = new List<int>();

            for (int i = 0; i < numberOfPlayers; i++)
            {
                ratingList.Add(Convert.ToInt32(ratingBox[i].Text));
            }
            ratingList.Sort();
            var count = ratingList.Count();

            // if even number of players, keep aside the one in the middle (as rating)
            int? middle = null;
            if (count % 2 != 0)
            {
                middle = ratingList[count / 2];
                ratingList.RemoveAt(count / 2);
            }

            var ratingListDesc = ratingList.OrderByDescending(i => i).ToList();

            var half = count / 2;
            var take = half % 2 != 0 ? half - 1 : half;

            var team1List = ratingList.Take(take).Where((r, i) => i % 2 == 0).ToList();
            team1List.AddRange(ratingListDesc.Take(take).Where((r, i) => i % 2 == 0));

            var team2List = ratingList.Take(take).Where((r, i) => i % 2 != 0).ToList();
            team2List.AddRange(ratingListDesc.Take(take).Where((r, i) => i % 2 != 0));

            // we just have to redistribute the remaining pair between each team
            if (half % 2 != 0)
            {
                team1List.Add(ratingList[half - 1]);
                team2List.Add(ratingListDesc[half - 1]);
            }

            // this part will add the team numbers to the database
            for (int i = 0; i < (count/2); i++)
            {
                OleDbConnection connection = new OleDbConnection(CONNECTION STRING HERE);

                OleDbCommand command = new OleDbCommand();

                connection.Open();
                command.CommandText = "update TotalPlayerName set Team = 1, Complete = true WHERE Team = null AND Complete = false AND Rating = " + team1List[i];
                command.CommandType = CommandType.Text;
                command.Connection = connection;

                command.ExecuteScalar();
                command.CommandText = "update TotalPlayerName set Team = 2, Complete = true WHERE Team = null AND Complete = false AND Rating = " + team2List[i];
                command.ExecuteScalar();
                connection.Close();

            }

Is there any way to avoid this and add the ratings without them overlapping?
NB: The code is here just as an example of what I am doing, you don't have to read it to get the idea of what I'm trying to do but it may or may not help you to understand.

A: I believe your problem lies both in the fact that there is duplicate information, and that information is in the same location in each list.  If you break between your SQL inserts, and query the DB to look at the data, I expect you would find that your where clause evaluates true for that particular player on both inserts.
In regards to what edits to make to change it, I would recommend dividing your lists of players into lists, one for team 1 and the other for team 2, and running the update query for team 1 ONLY on the team 1 list, and the same for team 2.
A few notes.. You have a lot of opportunities for integer division bugs in the above listed code, or getting players from 1 team transferred into the other team.  I can't exactly provide you a piece of code to fix your problem without rewriting a significant portion of the code snippet.  I would also recommend fully constructing your database row entries and inserting them all at one time, rather than inserting, and then going back and updating.  It adds unneeded load on the database, and introduces another layer of possible errors.
My understanding of the code is as follows:

*

*Combine player ratings

*If odd players, remove middle rating

*Divide players amongst teams such that top rating team 1, second top rating team 2, third top rating team 1 etc etc

*Save data to DB.

The following may be a way of doing that, and avoiding a lot of the possible sources of error.
List<int> ratingsList = new List<int>(); //Presume this is already populated.
List<int> team1 = new List<int>();
List<int> team2 = new List<int>();

ratingsList = ratingsList.Sort();

if(ratingsList.Count() % 2 != 0)
{
    ratingsList.Remove((ratingsList.Count()/2)+2));  //Integer divide intentional
}

for(int i = 0; i < ratingsList.Count() ; i++)
{
    if(i%2 != 0)
    {
        team1.Add(ratingsList[i]);
    }
    else
    {
        team2.Add(ratingsList[i]);
    }
}

foreach(var player in team1)
{
    //Add SQL Insert here
}
foreach(var player in team2)
{
    //Add SQL Insert here
}

The above listed snippet is pseudo-code, so don't expect it to just work.  The biggest problem that I see, is that players are being divided and identified by rating, which is not exclusive to a single player, so you have no way of uniquely identifying players in the code.  Suggestion beyond the purview of the question would be to build a player class to contain the information, and make ratingsList, team1, team2 of type Player.  You can still use OrderByDesc (linq) to order by the rating, and then you don't have to worry about keeping track of what value is assigned to who.


text:
Q: How to do login in Slim API I'm trying to make a function that check if the given username/password is correct in my Slim() API.
I have a authenticate function that I call with:
$app->post('/authenticate', 'authenticate');

I'm trying to first get the password of the user, then use password_verify() to check if the password is correct, than generate a session key that will be put inside the database and finally return that it worked.
For some reason, I really can't figure this out.
Here is what I got so far:
function authenticate($req, $resp, $args) {
    $credentials = json_decode($req->getBody());
    $sql = "SELECT * FROM ict_users WHERE usr_username = ....";
    try {
        $db = DB_Connection();
        .........
    } catch(PDOException $e) {
        echo '{"error":{"text":'. $e->getMessage() .'}}';
    }
}

I'm not even sure if I actually got credentials, even do I know I sent them like this:
function Login(credentials) {
        $http.post(appConfig.apiURL + '/authenticate', credentials)
        .success(function(data) {
            console.log("succes!");
            console.log(data);
        })
        .error(function (data, status){
            console.log("error!");
            console.log(data);
        });
    };

A:
I'm trying to first get the password of the user

What you want is $request->getParsedBody()

I'm not even sure if I actually got credentials, even do I know I sent them like this:

But be careful regarding the content-type of the request you are sending. Check that if it doesn't work automatically

redpajama_set_name: RedPajamaStackExchange


text:
Q: Netlify rewrite country path I am trying to set up rewrites in Netlify.
I have generated directories for each countries, so I can access mydomain.com/fra
Now i want to hiding country path to mydomain.com, but accessing mydomain.com/fra
Can I do that in Netlify?
Thank you in advance.

A: Check this -> https://docs.netlify.com/routing/redirects/redirect-options/#redirect-by-country-or-language
netlify.toml example
[[redirects]]
from = "/*"
to = "/fra/:splat"
status = 200
force = true
conditions = {Country = "fra"}


text:
Q: explain bash variable assignement output Can anyone explain me why
VBB:~ me$ test="zut"; echo $test; echo $test > test2; echo "echo test " $test2

output is :
zut
echo test
VBB:~ me$

and not
zut
echo test zut
VBB:~ me$

A: Because echo $test > test2 writes the output to a file named test2.
this set of commands is does what you would expect:
test="zut"; echo $test; test2=$test; echo "echo test " $test2

A: Addition to first answer you can assign the value in the file a variable.
echo "$var" ; var= more test2

So you can get string after you wrote to file test2


text:
Q: Python populating x and y values incrementally I'm attempting to come up with a for loop to populate a dictionary of lists(don't know if that's the proper way to say that) evenly. I.E. I start with
world = [(0,0,0), (0,0,0), (0,0,0), (0,0,0), (0,0,0), (0,0,0), (0,0,0)...]

repeats as long as needed
And I want to assign the first two values in a fashion like
0,0

0,1

1,0

0,2

2,0

1,2

2,1

2,2

3,0

0,3

1,3

3,1

2,3

3,2

3,3

And so on

Basically I want every x and y value possibly up to a certain value to be used. I've tried several things all day with absolutely no success
As for the third value I just have a noise function that defines it based on the x and y of that list

A: >>> from itertools import product
>>> [(x, y, 0) for x, y in product(range(5), repeat=2)]
[(0, 0, 0), (0, 1, 0), (0, 2, 0), (0, 3, 0), (0, 4, 0), (1, 0, 0), (1, 1, 0), (1, 2, 0), (1, 3, 0), (1, 4, 0), (2, 0, 0), (2, 1, 0), (2, 2, 0), (2, 3, 0), (2, 4, 0), (3, 0, 0), (3, 1, 0), (3, 2, 0), (3, 3, 0), (3, 4, 0), (4, 0, 0), (4, 1, 0), (4, 2, 0), (4, 3, 0), (4, 4, 0)]

this?
To apply the noise function, [(x,y,func(x,y)) for x etc.
BTW, this is "a list of tuples", not "a dictionary of lists".


text:
Q: How can I replace the white rectangle within an image using ImageMagick? Overview:
The first picture is my original image. Here I want to replace the white rectangle shown with another image.

My approach:
I have created a mask image using floodfill and it looks as:

Problem:
Now I would like to get the distance or co-ordinates of the rectangle in the second image so that I can use those co-ordinates to overlay a new image on top of the first (original image) here.
I got a little idea to use ImageMagick's chebyshev morphology operator, but don't know how I can do that.

A: I think you can locate the shape pretty accurately with a simple threshold, like this:
convert image.jpg -threshold 90% result.jpg

and you can then do a Canny edge detection like this:
convert image.jpg -threshold 90% -canny 0x1+10%+30% result.jpg

The next things I would be looking at are, using the -trim function to find the trim box coordinates, like this:
convert result.jpg -format "%@" info:
320x248+152+40

I have marked that on in red below.

If you actually want to do the trim, use this:
convert result.jpg -trim result.jpg

And also, the deskew angle
convert result.jpg -deskew 40 -format "%[deskew:angle]" info:
-0.111906

A Hough line detection may also be effective for you like this:
convert image.jpg -threshold 90% -canny 0x1+10%+30%      \
    \( +clone -background none                           \
              -fill red -stroke red -strokewidth 2       \
              -hough-lines 5x5+80 -write lines.mvg       \
    \) -composite hough.png

And the file lines.mvg contains the 4 lines you are looking for
# Hough line transform: 5x5+80
viewbox 0 0 640 360
line 449.259,0 474.432,360  # 90
line 0,72.5604 640,27.8072  # 143
line 0,293.098 640,248.344  # 187
line 153.538,0 178.712,360  # 153

Being a bit lazy, I didn't feel like solving for the intersections of those lines, so I thought I'd let ImageMagick do that too - by using Morphology to look for Line Junctions like this:
convert image.jpg -threshold 90% -canny 0x1+10%+30%                        \
  \( +clone -background none -fill red -stroke red -hough-lines 5x5+80 \)  \
     -composite -fuzz 50% -fill black -opaque white                        \
     -morphology HMT LineJunctions hough.png


text:
Q: Global scope for actions for scala-oauth2-provider with play2 scala I have trouble dealing with scope (access level, OAuth2) and Scala.
I would like to have these use cases :

*

*define a global scope for the controller. Being able to override this global parameter for some actions.

*don't define a global parameter, but specify for each action the scope

This code is an example of what I want :
package controllers

import scalaoauth2.provider.OAuth2Provider

import scala.concurrent.ExecutionContext.Implicits.global

class MyController extends GlobalAuthController

  // define global scope
  implicit val scope = Scope.User

  // By default, if no parameter, the scope is the implicit value previously defined
  def user = ActionWithAuth { request =>
    Ok("hello user or admin")
  }

  def admin = ActionWithAuth(Scope.Admin) {
    Ok("hello admin")
  }
}

I use nulab/scala-oauth2-provider library. According to the doc, I have created this :
trait OAuth2ActionComposition {
  implicit val executionContext: ExecutionContext

  def ActionWithAuth[U](implicit scope: Scope): ActionBuilder[({type λ[A] = AuthInfoRequest[A, User]})#λ] = {
    Logger.info("Scope : " + scope.toString)
    AuthorizedActionFunction(new Users(scope)) compose Action
  }
}

object OAuth2ActionComposition extends OAuth2ActionComposition {
  implicit val executionContext: ExecutionContext = play.api.libs.concurrent.Execution.defaultContext
}

But with that code I get a Compilation error : missing parameter type at line def user = ActionWithAuth { request => see this image
It works when I explicitly pass the implicit parameter (e.g def user = ActionWithAuth(scope) { request =>). WTF ! But it's not handy.
I cannot figure out why this error appears. I've tried some other ways but without success.

A: I "fixed" it thanks to Silhouette built-in com.mohiva.play.silhouette.api.Authorization.
See http://silhouette.mohiva.com/docs/authorization.
Indeed, thanks to Silhouette, it's possible to define an Authorization. E.g. :
case class WithProvider(provider: String) extends Authorization[User, CookieAuthenticator] {
  def isAuthorized[B](user: User, authenticator: CookieAuthenticator)(
    implicit request: Request[B], messages: Messages) = {

    Future.successful(user.loginInfo.providerID == provider)
  }
}

Then, to use this "filter :
def myAction = SecuredAction(WithProvider("twitter")) { implicit request =>
  // do something here
}

These filters can be combined easely.


text:
Q: How many natural transformations in the end $\int_{c\in C}Hom(c,c)$? The end $\int_{c\in C}Hom(c,c)$ is precisely $Nat(Id_C, Id_C)$. $Nat(Id_C, Id_C)$ is a set of natural transformations. That means there are many natural transformations in this set.
But in Haskell, $Nat(Id_C, Id_C)$ is precisely a polymorphism type forall a. a -> a, and there is only one term of this type.
f :: forall a. a -> a
f x = x

So in Haskell, there is only one natural transformation in $Nat(Id_C, Id_C)$, right?
But in general (not in Haskell), there should be many natural transformations in $Nat(Id_C, Id_C)$. But I can hardly imagine other such natural transformations in $Nat(Id_C, Id_C)$...
Could anyone give me an example of this?
Thank you.

A: "That means there are many natural transformations in this set." : well not necessarily, I know a set which doesn't have that many elements ($\{*\}$)
There are two things here : first of all, note that Hask is not an actual category, as has been pointed out many times.
Now, pretending that it is, I interpret your question as "are there examples of categories where $Nat(id_C,id_C)$ is 'big' ?"
The answer is yes ! Take for instance $C= $ the category of $R$-modules, for $R$ a commutative ring. Then $Nat(id_C,id_C)$ is isomorphic (as a set, and actually also as a ring) to $R$ (more generally, if $R$ is not commutative and I take left modules, the set is isomorphic to $Z(R)$, the center of $R$); with each $r\in R$ acting as $M\to M, x\mapsto rx$
Another general example would be : take $C$ any category with a terminal object $*$, and look at the category $C_*$ of pointed $C$-objects, that is, the comma category $*/C$. Then, if $C$ has at least one nontrivial pointed object (that is, an object $c$ with a non-isomorphism $*\to c$), $C_*$ has at least one nontrivial element of $Nat(id,id)$ : for any $\alpha: *\to c$, define $f_\alpha : c\to c$ by the composition $c\to * \to c$. It will clearly be natural and different from the identity. So $Nat(id,id)$ has at least two elements.


text: Q: Control the Mouse and Keyboard from .Net (like java.awt.Robot) I have a Java app that uses Robot to control the mouse and keyboard. I would like to translate this to C#, but I can't seem to find a decent substitute with my limited knowledge of the .Net framework. I have found AutoIt, but that seems to require using their scripting language. I have also seen PostMessage mentioned, but I can't find that on MSDN. Does anyone have ideas/suggestions on what to use?


text:
Q: Why is pointer to generic types not allowed? For example, as an overloaded [] setter-getter,
    public T this[int i]
    {
        get
        {
            unsafe
            {
                T* p = (T*)hArr.ToPointer(); // hArr is a C++ object pointer(IntPtr)
                return *(p + i);
            }

        }
        set
        {
            unsafe
            {
                T* p = (T*)hArr.ToPointer();
                *(p + i) = value;
            }
        }
    }

and compiler complains(underlines) about it "cannot take address of ..." to a managed type T.
I know T will be only float,double,int or byte in runtime but I don't know how to tell this to compiler so it trusts me.
Why can't I use it, all are pointers anyway, I can overflow any type of array if I'm not careful.
How can I achieve this(with a similar way or another) without being much slower than:
    public float this[int i]
    {
        get
        {
            unsafe
            {
                float* p = (float*)hArr.ToPointer();
                return *(p + i);
            }

        }
        set {
            unsafe
            {
                float* p = (float*)hArr.ToPointer();
                *(p + i) = value;
            }
        }
    }

I don't just care about performance here, but also code simplicity too. (one code for all T types) Interfaces can't help here I suppose.

A: C# restricts pointer types to

*

*sbyte, byte, short, ushort, int, uint, long, ulong, char, float, double, decimal, or bool,

*Any enum type,

*Any pointer type,

*Any user-defined struct type that contains fields of unmanaged types only.

That last point is key, because the compiler must be able to verify that the struct to which you are trying to make a pointer is "legal". Otherwise, you would be able to pass T that is a struct with fields referencing managed types (say, a string) which is prohibited.
Since you are interested in providing this behavior for four data types, you should be able to address this problem by providing four overloads:
public int GetInt(int i) {
    unsafe {
        var p = (int*)hArr.ToPointer();
        return *(p + i);
    }
public void SetInt(int i, int val) {
    unsafe {
        var p = (int*)hArr.ToPointer();
        *(p + i) = val;
    }
}
public float GetFloat(int i) {
    unsafe {
        var p = (int*)hArr.ToPointer();
        return *(p + i);
    }
public void SetFloat(int i, float val) {
    unsafe {
        var p = (float*)hArr.ToPointer();
        *(p + i) = val;
    }
}
... // and so on

The run-time efficiency will remain the same, assuming that the compiler has enough information to resolve overloads at compile time.


text:
Q: can't print '\' (single backslash) in Python I am using Python 3 and am trying to find a ways to search for a way to insert a '\' (single backslash) into my program.
I am gettin this error:
SyntaxError: EOL while scanning string literal

A: You have to escape the backslash:
\\

From Python Docs:

The backslash (\) character is used to escape characters that otherwise have a special meaning, such as newline, backslash itself, or the quote character.

Also, as  @Torxed mentioned in his answer, you can use the prefix r or R:

String literals may optionally be prefixed with a letter 'r' or 'R'; such strings are called raw strings and use different rules for interpreting backslash escape sequences.

r"Some string with \ backslash"

A: or use:
print(r'This is \backslash')

But escaping with this \\backslash is recommended.


text:
Q: textarea resizes width but not height, why? Here's what I've tried:
<textarea name='text' spellcheck = "true" style="height: 4em; width: 80%;" id="wider"></textarea>

I've also tried setting height with px or with %, both of which don't work. I also tried the following in my css file (as well as setting height as %, px, or em in the css, which also didn't work):
#wider{
    width: 80%;
    height: auto;
}

I can adjust the width either with the inline style command or with the css no problem. Why should the height be different, and what else might I try?
Thanks for any suggestions.
update: I have also tried setting the rows property in both the in-line and the CSS style. I understand that inline will overrule CSS. I just want one to work. Right now width attribute is always adjusted to reflect my change, but the height always stays the same. Is there something else I should be looking at? Thanks again!

A: In this case it turned out there was a "min-height" property tucked away for textareas in forms. Apparently the inline styling setting of height does not override the min-height property from the CSS file.

A: If you're using an inline style tag, it will take priority over your CSS styling.
The height property works as expected:
JSfiddle here.
You can also set the height by using the rows attribute on the textarea if you have an expected number of lines to be used.
<textarea name='text' spellcheck="true" id="wider" rows="5"></textarea>

A: You can use javascript to resize dimentions of textarea as soon as some parent element changes its own, for instance, height. You are going to call the functios (ES6 Javascript version):
const makeDimensionsEqual = (someTextareaSelector, someParentElementSelector) => {

  document.querySelectorAll(someTextareaSelector)[0].style.height =
    document.querySelectorAll(someParentElementSelector)[0]
    .getBoundingClientRect().height + "px"

}

const someTextareaSelector = '...'
const someParentElementSelector = '...'
makeDimensionsEqual(someTextareaSelector, someParentElementSelector)

A: It's an old one, but if someone still looks for this, try display: inline-table;


text:
Q: Calling java.lang.String .split methode in clojure When i call the .split methode in clojure i get: #object["[Ljava.lang.String;" 0x5aaf6982 "[Ljava.lang.String;@5aaf6982"] #object["[Ljava.lang.String;" 0x18fbbda2 "[Ljava.lang.String;@18fbbda2"].
How can i use this object in my code?

A: You can use vec to convert a Java array into a vector, e.g.
(vec (.split "1,2,3,4,5" ","))
=> ["1" "2" "3" "4" "5"]

But really if you want to split a string into a Clojure collection you should be using clojure.string/split instead:
(clojure.string/split "1,2,3,4,5" #",")
=> ["1" "2" "3" "4" "5"]

A: Assuming that you are using .split method of Java String class, then the result is a Java array.
You can use aget function of Clojure to access the elements.
And depending on your use case, it might be better to convert the array into Clojure sequence, so you can use a vast array of functions that Clojure provides to manipulate sequences.


text:
Q: mysql server doesn't startup The mysql server is running on a newly installed ubuntu 8.04. (I wanted to move the mysql server into KVM. KVM itself is running on ubuntu 10.04. )
/mysql belongs to mysql:mysql and is accessible. all subfiles are also accessible
i've already set the /etc/security/limits.conf to the following value:
*         soft    nofile          65535
*         hard    nofile          65535

when i try to startup i get the following error:
110406 10:34:45 [Warning] Could not increase number of max_open_files to more than 1024 (request: 2858)
110406 10:34:45 [Warning] Can't create test file /mysql/datadir/dbslave3.lower-test
110406 10:34:45 [Warning] Can't create test file /mysql/datadir/dbslave3.lower-test
/usr/sbin/mysqld: File '/mysql/logs/mysql-slow.log' not found (Errcode: 13)
110406 10:34:45 [ERROR] Could not use /mysql/logs/mysql-slow.log for logging (error 13). Turning logging off for the whole duration of the MySQL server process. To turn it on again: fix the cause, shutdown the MySQL server and restart it.
/usr/sbin/mysqld: File '/mysql/logs/mysql-bin.index' not found (Errcode: 13)
110406 10:34:45 [ERROR] Aborting

110406 10:34:45 [Note] /usr/sbin/mysqld: Shutdown complete

when i enter ulimit -n 65535 and then try to startup the server, i get the following error:
  110406 10:41:43 [Warning] Can't create test file /mysql/datadir/dbslave3.lower-test
  110406 10:41:43 [Warning] Can't create test file /mysql/datadir/dbslave3.lower-test
  /usr/sbin/mysqld: File '/mysql/logs/mysql-slow.log' not found (Errcode: 13)
  110406 10:41:43 [ERROR] Could not use /mysql/logs/mysql-slow.log for logging (error 13). Turning logging off for the whole duration of the MySQL server process. To turn it on again: fix the cause, shutdown the MySQL server and restart it.
  /usr/sbin/mysqld: File '/mysql/logs/mysql-bin.index' not found (Errcode: 13)
  110406 10:41:43 [ERROR] Aborting

  110406 10:41:43 [Note] /usr/sbin/mysqld: Shutdown complete

So what's wrong here? when doing a su - mysql -s /bin/bash, i can create the files and open them.
Is it because i've moved the mysql into KVM?
EDIT: I've also changed the disks from /dev/vda (VirtIO) to /dev/sda (IDE). But still the same behaviour. Maybe it's not KVM, just something wrong in the guest itself.
See you,

A: My guess is that this is a permissions or ownership issue in one of the MySQL subdirectories, probably in the datafiles directory.
The error message says "Errcode: 13". You can use perror to check the message related to this specific error and confirm that this is really a permission error somewhere.
shell> perror 13
error code  13:  Permission denied

Make sure that the MySQL user can access the datafiles directory and write inside it. This seems to be the problem.
On the other hand, sometimes logfiles are misleading or not as accurate as they should be.  In this case, strace comes to the rescue. strace is a very powerful system tracer that monitors al system calls made by a process.
Its usage is easy:
strace -f -o strace.output /etc/init.d/mysql.server start

This will print all the system calls made when starting the MySQL server in a file named strace.output.
Hope this helps.

A: Check the read/write permissions on your folder, most of the errors appear to be the result of a write-failure. Ensure that the partition or disk is not in read only mode, and that the mysql folder is writable. Try creating a test file with vi, nano/pico to try and replicate the read/write issues.

A: In Linux, the limits are configured by the PAM (pam_limits) at login time and are applied per process. You have 2 limits one is a hard limit and the other is the soft limit. The soft one can be changed by the process and increased until it reaches the hard limit.
You can find the limits for a running process with:
cat /proc/<PID>/limits

To find the limits for current shell you can use:
ulimit -a    #soft limits
ulimit -Ha   #hard limits

You can also strace the process and see why is opening so many file descriptors (which can be sockets, files, pipes...):
strace -f mysql_start_script 2> strace.log
strace -e 'open,socket,pipe,accept' -f mysql_start_script 2> strace.log    # To have only the calls that generates file descriptors

In the strace.log file search for open, socket, pipe.
For a running process you can see the file descriptors with:
ls -l /proc/<PID>/fd

Make sure you have /mysql/logs/ folder. The logs should be somewhere inside /var/log/
Hope it helps.

A: first, under ubuntu, there are 3 things that can limit the file access:

*

*filesystem access permissions (but you already said, that this is not the case)

*ulimit nofile (but this error message: Can't create test file /mysql/datadir/dbslave3.lower-test appears in the startup, where mysql checks your filesystem for it's case-sensitivity. So mysql hasn't yet created that many handles!)

*apparmor! (this should be your problem. especially, since you have moved your datadir!)

To solve it, you have to configure /mysql/** rwk, in /etc/apparmor.d/usr.sbin.mysqld


text:
Q: Facing Novnc application crash issues in windows server 2019 We have installed novnc from github code integrated with nginx proxy in windows server 2019. Facing novnc application crash issues frequently.
Any suggestions please !
enter image description here
Hi Team
Any suggestions please


text:
Q: How does the Warden know about the kids? At the end of Season 5, Episode 3, the orphans are sent to some kind of foster care house, where The Warden:

 woges and commands the kids to do the same. He already knows they are Wesen.

How does he know that?

A: Perhaps this will be clarified in subsequent episodes,
but it's been indicated that Wesen can recognize each other,
even when not woged — perhaps by scent.
The example that comes to mind is that, when Monroe's parents met Rosalee,
they realized that she wasn't a Blutbad as soon as they touched her.
If the foster care facility is run by a Wesen,
it's a safe bet that much/most/all of the staff are.
Somebody in the intake/admittance process
could have detected that the children were Wesen and alerted Warden Hook.
A related question — which may have the same answer —
is how the four children got together in the first place.
The probability of a random group of four orphans (or any other people)
all being Wesen is very low.
They probably associated with each other because they sensed that they were similar,
even though they didn't understand what they were.


text:
Q: Bulk rename files inside subfolder, removing prefix I have a bunch of MP4 files in random subdirectories. They have random prefixes which I need to remove. An example of this folder structure is:
/
../AFolder/Afolder2/123-01-filename.mp4
../BFolder/Bfolder2/512-01-filname.mp4
../CFolder/Cfolder2/881-01-filename.mp4

Basically I want to remove the 3 digit number before every file name along with the dash, so the end files become:
/
../AFolder/Afolder2/01-filename.mp4
../BFolder/Bfolder2/01-filname.mp4
../CFolder/Cfolder2/01-filename.mp4

I tried to do this by:
for file in ./*/*/*mp4
do
    changeto="(echo $name | cut -c4-)"
    echo $name $changeto
    #mv #name $changeto
done

but that chops off the first 4 of every directory + file, not just the end file.

A: Going with your own suggestion of using a shell loop:
for name in ./*/*/???-*.mp4; do
    filename=${name##*/}         # remove directory path
    filename=${filename#???-}    # remove initial three characters and dash

    # prepend directory path to target filename and rename
    mv "$name" "${name%/*}/$filename"
done

This loops over the names that we want to change. For each pathname, the filename portion of the pathname is extracted into the variable filename using a standard variable substitution.  From that value, the initial three characters and the dash is removed. The original file can then be renamed using this new $filename value.
If you need to be stricter with matching the filenames, ensuring that the first three characters are digits, replace each ? in the patterns above with [0-9] or [[:digit:]].

Using the Perl rename utility:
rename -v 's/...-([^\/]*\.mp4)$/$1/' ./*/*/???-*.mp4

This would apply a Perl substitution to each given filename.  The substitution matches the filename but captures only the bit of the name that we want to keep at the end (a string at the very end containing no / character, preceded by the three characters and a dash that we'd like to remove). The matched portion of the pathname is replaced by the captured string.

A: I like to use mmv, for this kind of thing. It allows you to use the wildcards ? and * while moving files. It treats every wildcard as a regex capture group, that's how I think about it, but it uses # instead of \ to access the groups in the replace syntax.
Here's a demo for this problem:
$ ls *Folder/*folder2/*
AFolder/Afolder2/123-01-filename.mp4  CFolder/Cfolder2/881-01-filename.mp4 BFolder/Bfolder2/512-01-filname.mp4
$ mmv "*Folder/*folder2/???-*" "#1Folder/#2folder2/#6"
$ ls *Folder/*folder2/*
AFolder/Afolder2/01-filename.mp4  CFolder/Cfolder2/01-filename.mp4 BFolder/Bfolder2/01-filname.mp4

The tricky bits are that the first string must basically always be in quotes to avoid invoking the wildcards from the shell itself. Second, remember each ? is its own group, which is how we get up to #6 for the remainder of the filename.

A: You can use find and invoke a shell using -exec
find . -type f -exec sh -c '
  for f; do
    d=${f##*/} d=${d#*[0-9][0-9][0-9]-}
    echo mv -v "$f" "${f%'/'*}/$d"
  done
' _ {} +

*

*The echo is there to tell you how/what is going to be executed, remove it if you think the ouptu is ok

The actual output is like this.
Output
renamed './AFolder/Afolder2/123-01-filename.mp4' -> './AFolder/Afolder2/01-filename.mp4'
renamed './BFolder/Bfolder2/512-01-filename.mp4' -> './BFolder/Bfolder2/01-filename.mp4'
renamed './CFolder/Cfolder2/881-01-filename.mp4' -> './CFolder/Cfolder2/01-filename.mp4'


text:
Q: TensorFlow - FailedPreconditionError using tf.train.match_filenames_once() I'm trying to read some .wav files using tensorflow, using the following code:
import tensorflow as tf

filenames = tf.train.match_filenames_once('audio_dataset/*.wav')
count_num_files = tf.size(filenames)
filename_queue = tf.train.string_input_producer(filenames)
reader = tf.WholeFileReader()
filename, file_contents = reader.read(filename_queue)

with tf.Session() as sess:
    sess.run(tf.global_variables_initializer())
    num_files = sess.run(count_num_files)

    coord = tf.train.Coordinator()
    threads = tf.train.start_queue_runners(coord=coord)

    for i in range(num_files):
        audio_file = sess.run(filename)
        print(audio_file)

I'm running tensorflow in a Python 3.5 environment, using Jupyter notebook.
in order to read audio files, I need to use a dependency, the Bregman Toolkit, which uses Python 2.X.
documentation Bregman Toolkit says that you can set up a python 2.X kernel alongside python 3X, doing:
$ python2 -m pip install ipykernel

$ python2 -m -ipykernel install --user

which I did. Jupyter has now the option of starting either 2.X or 3.X kernels.
but after all setup, when I try to run the code, I get this long Traceback:
---------------------------------------------------------------------------
FailedPreconditionError                   Traceback (most recent call last)
/Users/me/anaconda/envs/py35/lib/python3.5/site-packages/tensorflow/python/client/session.py in _do_call(self, fn, *args)
   1038     try:
-> 1039       return fn(*args)
   1040     except errors.OpError as e:

/Users/me/anaconda/envs/py35/lib/python3.5/site-packages/tensorflow/python/client/session.py in _run_fn(session, feed_dict, fetch_list, target_list, options, run_metadata)
   1020                                  feed_dict, fetch_list, target_list,
-> 1021                                  status, run_metadata)
   1022

/Users/me/anaconda/envs/py35/lib/python3.5/contextlib.py in __exit__(self, type, value, traceback)
     65             try:
---> 66                 next(self.gen)
     67             except StopIteration:

/Users/me/anaconda/envs/py35/lib/python3.5/site-packages/tensorflow/python/framework/errors_impl.py in raise_exception_on_not_ok_status()
    465           compat.as_text(pywrap_tensorflow.TF_Message(status)),
--> 466           pywrap_tensorflow.TF_GetCode(status))
    467   finally:

FailedPreconditionError: Attempting to use uninitialized value matching_filenames_7
     [[Node: matching_filenames_7/read = Identity[T=DT_STRING, _class=["loc:@matching_filenames_7"], _device="/job:localhost/replica:0/task:0/cpu:0"](matching_filenames_7)]]

During handling of the above exception, another exception occurred:

FailedPreconditionError                   Traceback (most recent call last)
<ipython-input-12-a6f1ad8baaa4> in <module>()
      9 with tf.Session() as sess:
     10     sess.run(tf.global_variables_initializer())
---> 11     num_files = sess.run(count_num_files)
     12
     13     coord = tf.train.Coordinator()

/Users/me/anaconda/envs/py35/lib/python3.5/site-packages/tensorflow/python/client/session.py in run(self, fetches, feed_dict, options, run_metadata)
    776     try:
    777       result = self._run(None, fetches, feed_dict, options_ptr,
--> 778                          run_metadata_ptr)
    779       if run_metadata:
    780         proto_data = tf_session.TF_GetBuffer(run_metadata_ptr)

/Users/me/anaconda/envs/py35/lib/python3.5/site-packages/tensorflow/python/client/session.py in _run(self, handle, fetches, feed_dict, options, run_metadata)
    980     if final_fetches or final_targets:
    981       results = self._do_run(handle, final_targets, final_fetches,
--> 982                              feed_dict_string, options, run_metadata)
    983     else:
    984       results = []

/Users/me/anaconda/envs/py35/lib/python3.5/site-packages/tensorflow/python/client/session.py in _do_run(self, handle, target_list, fetch_list, feed_dict, options, run_metadata)
   1030     if handle is None:
   1031       return self._do_call(_run_fn, self._session, feed_dict, fetch_list,
-> 1032                            target_list, options, run_metadata)
   1033     else:
   1034       return self._do_call(_prun_fn, self._session, handle, feed_dict,

/Users/me/anaconda/envs/py35/lib/python3.5/site-packages/tensorflow/python/client/session.py in _do_call(self, fn, *args)
   1050         except KeyError:
   1051           pass
-> 1052       raise type(e)(node_def, op, message)
   1053
   1054   def _extend_graph(self):

FailedPreconditionError: Attempting to use uninitialized value matching_filenames_7
     [[Node: matching_filenames_7/read = Identity[T=DT_STRING, _class=["loc:@matching_filenames_7"], _device="/job:localhost/replica:0/task:0/cpu:0"](matching_filenames_7)]]

Caused by op 'matching_filenames_7/read', defined at:
  File "/Users/me/anaconda/envs/py35/lib/python3.5/runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "/Users/me/anaconda/envs/py35/lib/python3.5/runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "/Users/me/anaconda/envs/py35/lib/python3.5/site-packages/ipykernel_launcher.py", line 16, in <module>
    app.launch_new_instance()
  File "/Users/me/anaconda/envs/py35/lib/python3.5/site-packages/traitlets/config/application.py", line 658, in launch_instance
    app.start()
  File "/Users/me/anaconda/envs/py35/lib/python3.5/site-packages/ipykernel/kernelapp.py", line 477, in start
    ioloop.IOLoop.instance().start()
  File "/Users/me/anaconda/envs/py35/lib/python3.5/site-packages/zmq/eventloop/ioloop.py", line 177, in start
    super(ZMQIOLoop, self).start()
  File "/Users/me/anaconda/envs/py35/lib/python3.5/site-packages/tornado/ioloop.py", line 888, in start
    handler_func(fd_obj, events)
  File "/Users/me/anaconda/envs/py35/lib/python3.5/site-packages/tornado/stack_context.py", line 277, in null_wrapper
    return fn(*args, **kwargs)
  File "/Users/me/anaconda/envs/py35/lib/python3.5/site-packages/zmq/eventloop/zmqstream.py", line 440, in _handle_events
    self._handle_recv()
  File "/Users/me/anaconda/envs/py35/lib/python3.5/site-packages/zmq/eventloop/zmqstream.py", line 472, in _handle_recv
    self._run_callback(callback, msg)
  File "/Users/me/anaconda/envs/py35/lib/python3.5/site-packages/zmq/eventloop/zmqstream.py", line 414, in _run_callback
    callback(*args, **kwargs)
  File "/Users/me/anaconda/envs/py35/lib/python3.5/site-packages/tornado/stack_context.py", line 277, in null_wrapper
    return fn(*args, **kwargs)
  File "/Users/me/anaconda/envs/py35/lib/python3.5/site-packages/ipykernel/kernelbase.py", line 283, in dispatcher
    return self.dispatch_shell(stream, msg)
  File "/Users/me/anaconda/envs/py35/lib/python3.5/site-packages/ipykernel/kernelbase.py", line 235, in dispatch_shell
    handler(stream, idents, msg)
  File "/Users/me/anaconda/envs/py35/lib/python3.5/site-packages/ipykernel/kernelbase.py", line 399, in execute_request
    user_expressions, allow_stdin)
  File "/Users/me/anaconda/envs/py35/lib/python3.5/site-packages/ipykernel/ipkernel.py", line 196, in do_execute
    res = shell.run_cell(code, store_history=store_history, silent=silent)
  File "/Users/me/anaconda/envs/py35/lib/python3.5/site-packages/ipykernel/zmqshell.py", line 533, in run_cell
    return super(ZMQInteractiveShell, self).run_cell(*args, **kwargs)
  File "/Users/me/anaconda/envs/py35/lib/python3.5/site-packages/IPython/core/interactiveshell.py", line 2717, in run_cell
    interactivity=interactivity, compiler=compiler, result=result)
  File "/Users/me/anaconda/envs/py35/lib/python3.5/site-packages/IPython/core/interactiveshell.py", line 2821, in run_ast_nodes
    if self.run_code(code, result):
  File "/Users/me/anaconda/envs/py35/lib/python3.5/site-packages/IPython/core/interactiveshell.py", line 2881, in run_code
    exec(code_obj, self.user_global_ns, self.user_ns)
  File "<ipython-input-12-a6f1ad8baaa4>", line 3, in <module>
    filenames = tf.train.match_filenames_once('audio_dataset/*.wav')
  File "/Users/me/anaconda/envs/py35/lib/python3.5/site-packages/tensorflow/python/training/input.py", line 68, in match_filenames_once
    collections=[ops.GraphKeys.LOCAL_VARIABLES])
  File "/Users/me/anaconda/envs/py35/lib/python3.5/site-packages/tensorflow/python/ops/variables.py", line 197, in __init__
    expected_shape=expected_shape)
  File "/Users/meme/anaconda/envs/py35/lib/python3.5/site-packages/tensorflow/python/ops/variables.py", line 316, in _init_from_args
    self._snapshot = array_ops.identity(self._variable, name="read")
  File "/Users/me/anaconda/envs/py35/lib/python3.5/site-packages/tensorflow/python/ops/gen_array_ops.py", line 1338, in identity
    result = _op_def_lib.apply_op("Identity", input=input, name=name)
  File "/Users/me/anaconda/envs/py35/lib/python3.5/site-packages/tensorflow/python/framework/op_def_library.py", line 768, in apply_op
    op_def=op_def)
  File "/Users/me/anaconda/envs/py35/lib/python3.5/site-packages/tensorflow/python/framework/ops.py", line 2336, in create_op
    original_op=self._default_original_op, op_def=op_def)
  File "/Users/me/anaconda/envs/py35/lib/python3.5/site-packages/tensorflow/python/framework/ops.py", line 1228, in __init__
    self._traceback = _extract_stack()

FailedPreconditionError (see above for traceback): Attempting to use uninitialized value matching_filenames_7
     [[Node: matching_filenames_7/read = Identity[T=DT_STRING, _class=["loc:@matching_filenames_7"], _device="/job:localhost/replica:0/task:0/cpu:0"](matching_filenames_7)]]

can anyone please point me in the right direction?

A: The immediate fix is to add the following line:
sess.run(tf.global_variables_initializer())

...before this line:
threads = tf.train.start_queue_runners(coord=coord)

However, I'd like to show you a new and slightly easier way to write your program using the tf.contrib.data API (available in TensorFlow 1.3, and will become tf.data in TensorFlow 1.4):
import tensorflow as tf

filenames = tf.contrib.data.Dataset.list_files('audio_dataset/*.wav')
name_and_content = filenames.map(lambda x: (x, tf.read_file(x))
iterator = name_and_content.make_one_shot_iterator()
filename, file_contents = iterator.get_next()

with tf.Session() as sess:
  try:
    while True:
      audio_file = sess.run(filename)
      print(audio_file)
  except tf.errors.OutOfRangeError:  # Raised when there are no more files.
    pass


text:
Q: Change ArrayList data in ListView I need to create many alarms, so I need a list view which contains items with a DatePicker, a TimePicker and a Delete Button. I have tried various way but I have not found a solution to this issue:
I want to be able to change the data in the DatePicker or TimePicker, which will change the data in an ArrayList for the corresponding Alarm. To do this however, I will need position, but as it is not final I cannot use it to access the Alarm in the ArrayList from my Adapter.
How would I go about doing this?
Thanks


text:
Q: Java 14 records json serialization Currently experimenting with the Records implements from java 14, everything looks nice but since the accessors are slightly different and jackson is not being able to deserialize and giving the following error:
Caused by: com.fasterxml.jackson.databind.exc.InvalidDefinitionException: No serializer found for class com.x.x.x.xTracking and no properties discovered to create BeanSerializer (to avoid exception, disable SerializationFeature.FAIL_ON_EMPTY_BEANS)

I checked all around the internet, including jackson and gson github to check the jep 359 support but havent found a single comment. Am i missing something really straight forward?
Yes i am aware that the java 14 is still not released and that records is only in preview in this version but would expect some comments at least.

A: Records support was added to Jackson 2.12.0 (https://github.com/FasterXML/jackson-future-ideas/issues/46). It will be released in the next days.

A: For someone else experimenting, i went around, not proudly, with the following:
    @Bean
    public Jackson2ObjectMapperBuilderCustomizer jacksonCustomizer(){
        return builder ->
                builder.visibility(PropertyAccessor.FIELD, JsonAutoDetect.Visibility.ANY);
    }

A: With "pure" Json-B you can do it this way:
public class RecordPropertyVisibilityStrategy implements PropertyVisibilityStrategy {
   @Override
   public boolean isVisible(Field field) {return true;}

   @Override
   public boolean isVisible(Method method) {return false;}
}

Then
@JsonbVisibility(RecordPropertyVisibilityStrategy.class)
public record MyRecord(Long id, String attr) {}

A: I did Jackson dealing with this problem in Spring Boot 2.4.1 application annotating the record with
@JsonAutoDetect(fieldVisibility = JsonAutoDetect.Visibility.ANY)

A: Alternatively, for Spring Boot 2.4.5 and Java 16, it may be enabled via application.properties, like so:
spring.jackson.visibility.field=any
See more on the Spring Boot documentation.


text:
Q: Not able to show block after hiding it through toggle on a different media size I am not a pro at html5 but this what I am trying
I am developing this responsive layout where I am using a toggle to hide and show the left nav of smaller device. It works fine when I am first clicking the trigger [+] from the top nav. But when I am hiding it by clicking the [+] and changing the orientation of the screen I cant show the left nav any more. Any suggestion how to tackle it? For the toggle I am doing a very simple JQuery toggle which looks like this
var topNavInteractive = $('section nav.navLeft ul');

    $('.dropDownTrigger').click(function(){
        topNavInteractive.slideToggle();
    })

Here is the working prototype
http://soumghosh.com/otherProjects/beamtous/

A: This will work ..!!
jQuery
var topNavInteractive = $('.navLeft');

$('.dropDownTrigger').click(function () {
    topNavInteractive.slideToggle();
});

Working Demo http://jsfiddle.net/cse_tushar/UsTMG/


text:
Q: Comparison of RMSE (root mean squared error) values I want to see if my models work better univariate or multiple. But how can I do this? Normally I train the model, calculate the RMSE/MSE on the test data and compare these values. Now I trained the multiple models with PLS (plsr() function in R). Therefore I scaled the X data and centered X and Y. For getting fair comparable RMSE values, I computed the univariate models with PLS too (instead of just a simple linear model). As I understood right, I do not have to scale or center the values for the univariate models, since RMSE is calculated with Y, Y is just centered and centering doesn't influence the RMSE value, right? Is my approach correct or have I overlooked something?
Reason for PLS in multiple case is: the data are correlated, reason for PLS in univariate models is just the fair comparison of RMSE values.
PS: I had a look at the lm RMSE values for the univariate models too and the values are very similar to the univaritae plsr models. Can I learn something from these differences or make a guess? E.g. the differences between the two RMSE values are the normal range of natural variability of the data and I can use this knowledge as approximate benchmark for avoiding overfitting...?


text:
Q: Making floating scroll button So, I made a web page, and in the end I noticed that the user may not see that there is extra information, so he must scroll down. I put a scroll down button, it works perfect, just you need to scroll down in order to see it :) . How can I make my scroll down button visible without scrolling at all? On any screen resolution, the button is one scroll away.

/*------------------here is the code for the button-----------------------------------------------------------------------------------------*/
html, body {
  height: 100%;
}
section {
  position: relative;
  width: 100%;
  height: 100%;
}
section::after {
  position: absolute;
  bottom: 0;
  left: 0;
  content: '';
  width: 100%;
  height: 80%;

}

.demo a {
  position: absolute;
  bottom: 20px;
  left: 50%;
  z-index: 2;
  display: inline-block;
  -webkit-transform: translate(0, -50%);
  transform: translate(0, -50%);
  color: black;
  font : normal 400 20px/1 'Josefin Sans', sans-serif;
  letter-spacing: .1em;
  text-decoration: none;
  transition: opacity .3s;
}
.demo a:hover {
  opacity: .5;
}

#section01 a {
  padding-top: 60px;
}
#section01 a span {
  position: absolute;
  top: 0;
  left: 50%;
  width: 24px;
  height: 24px;
  margin-left: -12px;
  border-left: 1px solid black;
  border-bottom: 1px solid black;
  -webkit-transform: rotate(-45deg);
  transform: rotate(-45deg);
  box-sizing: border-box;
}

/*------------------here is the code for the button-----------------------------------------------------------------------------------------*/

@font-face
{
    font-family: FONT;
    src: url(landing/Montserrat-Regular.ttf);
}

@font-face
{
    font-family: FONT2;
    src: url(home/Debby.ttf);
}

@font-face
{
    font-family: FONT3;
    src: url(home/Beautiful.ttf);
}

/*-------------------------------------------------FONT-URILE-------------------------------------------------------------------------------*/
/*body
{
 margin: 0;
 padding: 0;
}*/

* {
  margin: 0;
  padding: 0;
}
/*-------------------------------------------------BODY-UL----------------------------------------------------------------------------------*/

p.title1
{
 font-size: 2.5em;
 margin: 0;
}

div.surf1
{
 background-position: center;
 background-size: cover;
 display: block;
 background-image: url("landing/surf1.jpg");
 height: 700px;
}

div.surf2
{
        background: #41c3ac;
        height: 600px;
}

div.surfleft
{
 box-sizing: border-box;
 padding-top: 70px;
 padding-left: 50px;
 float:left;
    width: 50%;
    height: 600px;
}

div.surfright
{
 line-height: 600px;
 text-align: center;
 float: right;
    width: 50%
 }

div.surfright img
{
 vertical-align:middle;
 }

div.surf3
{
 background: #ff6b57;
 height: 600px;
}

div.surf4
{
 background: #8C78B1;
 height: 600px;
}

div.text1
{
 padding-top: 100px;
 color: white;
 text-align:center;
 font-size: 2.5em;
}
/*-------------------------------------------------PAGINA DE LANDING CU DIV-URI-------------------------------------------------------------*/
.button
{
  text-align: center;
}

.button a, active
{
  text-decoration: none;
  background-color: rgba(236, 229, 167, 0.2);
  border: 2px solid #e7dd84;
  color: #e7dd84;
  display: inline-block;
  font-size: 1.5em;
  padding: 8px;
  transition: 0.35s;
}

.button a:hover
{
  text-decoration: none;
  background-color: white;
  border-color: white;
  color: black;
}
/*-------------------------------------------------BUTONUL DIN PAGINA DE LANDING------------------------------------------------------------*/
.slider {
  display: block;
  height: 600px;
  min-width: 260px;
  max-width: 1200px;
  margin: auto;
  margin-top: 10px;
  position: relative;
}

.sliderinner {
  width: 100%;
  height: 100%;
  overflow: hidden;
  position: relative;
}

.sliderinner>ul {
  list-style: none;
  height: 100%;
  width: 700%;
  overflow: hidden;
  position: relative;
  left: 0px;
  -webkit-transition: left .5s cubic-bezier(.43,.44,.43,.44);
  -moz-transition: left .5s cubic-bezier(.43,.44,.43,.44);
  -o-transition: left .5s cubic-bezier(.43,.44,.43,.44);
  transition: left .5s cubic-bezier(.43,.44,.43,.44);
}

.sliderinner>ul>li {
  width: calc(100% / 7);
  height: 600px;
  float: left;
  position: relative;
}

.sliderinner>ul>li>img {
  margin: auto;
  height: 100%;
  max-width: 100%
}

.slider input[type=radio] {
  position: absolute;
  left: 50%;
  bottom: 15px;
  z-index: 100;
  visibility: hidden;
}

.slider label {
  position: absolute;
  left: 50%;
  bottom: -45px;
  z-index: 100;
  width: 12px;
  height: 12px;
  background-color: #ccc;
  -webkit-border-radius: 50%;
  -moz-border-radius: 50%;
  border-radius: 50%;
  cursor: pointer;
  -webkit-box-shadow: 0px 0px 3px rgba(0, 0, 0, .8);
  -moz-box-shadow: 0px 0px 3px rgba(0, 0, 0, .8);
  box-shadow: 0px 0px 3px rgba(0, 0, 0, .8);
  -webkit-transition: background-color .2s;
  -moz-transition: background-color .2s;
  -o-transition: background-color .2s;
  transition: background-color .2s;
}

.slider input[type=radio]#control1:checked~label[for=control1] {
  background-color: #333;
}

.slider input[type=radio]#control2:checked~label[for=control2] {
  background-color: #333;
}

.slider input[type=radio]#control3:checked~label[for=control3] {
  background-color: #333;
}

.slider input[type=radio]#control4:checked~label[for=control4] {
  background-color: #333;
}

.slider input[type=radio]#control5:checked~label[for=control5] {
  background-color: #333;
}

.slider input[type=radio]#control6:checked~label[for=control6] {
  background-color: #333;
}

.slider input[type=radio]#control7:checked~label[for=control7] {
  background-color: #333;
}

.slider label[for=control1] {
  margin-left: -54px
}

.slider label[for=control2] {
  margin-left: -36px
}

.slider label[for=control3] {
  margin-left: -18px
}

.slider label[for=control5] {
  margin-left: 18px
}

.slider label[for=control6] {
  margin-left: 36px
}

.slider label[for=control7] {
  margin-left: 54px
}

.slider input[type=radio]#control1:checked~.sliderinner>ul {
  left: 0
}

.slider input[type=radio]#control2:checked~.sliderinner>ul {
  left: -100%
}

.slider input[type=radio]#control3:checked~.sliderinner>ul {
  left: -200%
}

.slider input[type=radio]#control4:checked~.sliderinner>ul {
  left: -300%
}

.slider input[type=radio]#control5:checked~.sliderinner>ul {
  left: -400%
}

.slider input[type=radio]#control6:checked~.sliderinner>ul {
  left: -500%
}

.slider input[type=radio]#control7:checked~.sliderinner>ul {
  left: -600%
}

.description {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  font-family: Archivo Narrow;
  z-index: 1000;
}

.description-text {
  background-color: rgba(0, 0, 0, .8);
  padding: 10px;
  top: 0;
  size: 55px;
  font-family: FONT3;
  font-size: 19px;
  z-index: 4;
  -webkit-transition: opacity .2s;
  -moz-transition: opacity .2s;
  -o-transition: opacity .2s;
  transition: opacity .2s;
  color: #fff;
}

p.Text-Slider {
  color: #333;
  font-size: 50px;
  font-family: FONT2;
  margin: 40px;
  text-align: center;
}

/*-------------------------------------------------SLIDER-UL CU IMAGINI--------------------------------------------------------------------*/

#nav {
    background-color: #e26a63;
    padding: 0;
    margin: 0;
    font-family: FONT;
    font-size: 20px;
}
#wrap {
    padding-left: 60px;
    height: 100px;
    width: 100%;
    margin: 0 auto;
    display: table-cell;
    vertical-align: bottom;
}
#nav ul {
    list-style-type: none;
    padding: 0;
    margin: 0;
    position: relative;
    min-width: 225px;
}
#nav ul li {
    display: inline-block;
}
#nav ul li:hover {
    background-color: #cb5f59;
}

#nav ul li:after {
  content: "";
  font-size: 0;
  display: block;
  height: 5px;
}
#nav ul li:hover:after {
  background: #9e4a45;
}
#nav ul ul li:hover:after {
  background: transparent;
}
#nav ul li a, visited {
    color: white;
    display: block;
    padding: 15px;
    text-decoration: none;
}
#nav ul li:hover ul {
    display: block;
}
#nav ul ul {
    display: none;
    position: absolute;
    background-color: #e26a63;
    border-top: 0;
    margin-top: 5px;
}
#nav ul ul li {
    display: block;
}
#nav ul ul li a:hover {
    color: white;
}

/*-------------------------------------------------MENIUL DROP-DOWN------------------------------------------------------------------------*/
<!doctype html>

<meta charset="utf-8">
<title>Home</title>
<link rel="stylesheet" href="style.css" type="text/css">

Home

        Study

        Games

Riddles

                Flip card game

                Spot the mistake

                Multiple choice

        Read

        Contact

        About Us

"Why Should I Learn English?" - 7 Compelling Reasons for EFL Learners

        <input type="radio" id="control1" name="controls" checked="checked"/>

        <input type="radio" id="control2" name="controls"/>

        <input type="radio" id="control3" name="controls"/>

        <input type="radio" id="control4" name="controls"/>

        <input type="radio" id="control5" name="controls"/>

        <input type="radio" id="control6" name="controls" />

        <input type="radio" id="control7" name="controls"/>

English is one of the most widely spoken languages

Although it comes second to Mandarin in the total number of speakers, English is the language you'll be able to use most widely, as it's spoken in more countries than any other language. That means that English is the language that will give you the best return for your efforts; after all, intellectual challenge aside, there's little point putting a huge amount of time and effort into learning a language that you'll hardly ever have the opportunity to use.

As well as the UK, a whopping 60 of the world's 196 countries have English as their official language:  the USA, Australia, Canada, New Zealand, to name but a few. It's the language of diplomacy and the official language of the European Union, the United Nations, NATO and the European Free Trade Association, not to mention many Commonwealth countries. What's more, English is the commonly adopted second language of people in a great many more countries, including Norway, Sweden, Denmark, Germany and Holland. In total, around 1.5 billion people speak English worldwide - and another billion are in the process of learning it. Will you make this number even bigger by learning it yourself?

English will open up more opportunities for you

Being able to speak English allows you to communicate effectively in numerous countries, and this opens up lots of possibilities for you in terms of the countries you could choose to seek work in one day - not to mention travel to as a tourist. You won't have to worry about getting lost when you travel to an English-speaking country, as you'll easily be able to ask for directions, and taking guided tours, ordering food and chatting to the locals will no longer be a source of stress.

What's more, careers that involve lots of travel or international exposure, such as the airline, tourism and film industries, use English as their official language, and many employers in these sectors are likely to require evidence of a certain level of proficiency in English before they will consider employing you. This means that if you can speak English, you'll find that you have a greater number of possible careers to choose from after you finish at university.

English gives you access to some of the world's best universities

English is widely regarded as the language of higher education. Oxford, Cambridge, Harvard and MIT are just a few of the famous universities that occupy the lofty heights of the top of the world education league tables, and you'll need to speak English fluently for access to any of these, as they're all English-speaking. It goes without saying that if you are able to study at one of these institutions, you'll start your career with an illustrious name on your CV - and the benefits of that speak for themselves. If English isn't your native language, you'll need to take an English test during the admissions process to prove that your level of English is up to scratch for the demands of the academic environment. If you have your sights set on a top university, the effort you put in to study English as early as possible in your school years will be rewarded when it comes to the choice of universities to which you can apply.

English is the language of some of the world's greatest literature

If you learn English, you'll be able to enjoy works by some of the world's most famous writers, in the language in which they were intended to be read or heard. The works of Shakespeare will take on a new meaning when you're able to speak English, and you can look forward to enjoying such influential classics as Emily Bronte's Wuthering Heights and her sister's Jane Eyre, George Orwell's 1984 and Animal Farm, Jane Austen's Pride and Prejudice and many, many more. Translation rarely does a writer true justice, so the only way to appreciate a classic literary work properly is to read it in its original language. Even better, through doing so, you'll deepen your knowledge of English by enriching it with new words and sentence structures.

English gives you wider access to knowledge

Did you know that 55% of the world's webpages are written in English? This absolutely dwarfs that of any other language, with the next most widely used language on the internet being Russian (which constitutes just 6% of pages). Knowledge of English therefore allows you to tap into far more of the world's intellectual resources.

English is also the language of science. If you learn English, you won't just have access to a greater proportion of the vast amount of knowledge available on the web; you'll be able to educate yourself still further by being able to read scientific books and papers. English is, of course, essential if you intend to pursue a scientific career. Within the Science Citation Index, compiled by the Institute for Scientific Information, an estimated 95% of articles are written in English despite only around half being from English-speaking countries. According to the Open University, "At Oxford University two thirds of post-graduate students come from outside the UK. The students in the university's chemistry research lab admit that working in English is a key attraction.

English is a fantastic intellectual challenge!

English is undoubtedly one of the harder languages to learn. Full of nuances, unexpected pronunciations, odd rules and infuriating exceptions to rules, it takes dedication and perseverance to reach a good level of fluency. If you're on the lookout for a new challenge, learning English may be just what you're after. Not only that, but because it's so widely spoken, it opens you up to a huge number of new cultural experiences, which will help you develop life skills, meet new people and grow your confidence in handling new situations.

Have we convinced you yet? If you've been inspired to learn English, consider enrolling on one of our English as a Foreign Language (EFL) courses (for students aged 13-15 or 16-18) and develop your English skills in the company of like-minded students in the beautiful city of Oxford.

English allows you to get more from popular culture

The world's highest-grossing movies are made in Hollywood, and needless to say, they are made in English. How many times have you been to see an American blockbuster and been frustrated by having to keep up with fast-paced subtitles? And how many times have you hummed a favourite pop song, but not been able to sing along because it's in English and you don't know the words? There's a solution... Kiss those annoying cinema subtitles goodbye and get more out of the music you enjoy by learning English.

        Scroll

In countries marked with green english is used among 90-100 % of the population
whereas red means 0-10 % use it

Scroll


text:
Q: LT3761 LED driver explodes I am designing a boost LED driver using LT3761
Using the datasheet examples I designed and ordered PCBs, assembled them, but every time I connect the power one of four things explode: fuse, driver, boost MOSFET or sense shunt. I tried many different LEDs, calculated and populated different sets of components, but the result is the same. I tried the exact values from the datasheet's first example, boost driver for 1A led, the result is the same.
I do not know what is wrong here.
For explode part of the question, I understand, that I give the energy from my battery which is sufficient for explosion and if I would use current limited power supply it would behave differently. But, the IC has all possible protections. How it goes into drawing so much energy for explosion...
I am designing the driver to be used from 20V to 50V. Tried 24V and 48V, both do same damage. Tried to power with a 24V battery and 48V power supply. Wires from source to the load are 20cm.
When I limit the power using a series resistor it does not blow. I do not have current limiting power supply.
Please see the attached schematic and the PCB.
It is in boost mode.
The Inductor is 10uH.
I tried MOSFETS FDMS86201, NVMFS6B14NLT1G, FDMT800150DC
All parts sourced from Arrow.com
Thank you.

This is top layer from official evaluation board design. Usual design with small gaps and copper regions.

A: That must be very frustrating.
I don't see any test results especially those that should be non-destructive attempts to characterize sections of the design.
Can you test the Boost FET path alone  by injecting external voltage pulse at equiv Rs?  The path in red is the current path of destruction. (pun intended)
I believe when Rs fuses open, then the IC fails 2nd with OV then avalanche failure.  The avalanche diode may not be fast enough for recovery time. (?) Then the FET overheats.  So FET specs and all other related datasheets are important to include in question..
The Gate pulse and current pulse sense ought to reveal your problem from resistance and Q charge effects.  High quality measurement methods need to be done with calibrated spring probes. ( meaning flat mV traces on ground signal with current pulses flowing under it.)

A: I am not sure if this is the issue, but it is the first thing that jumped at me when I saw your schematic.
You are using large ceramic capacitors in conjunction with paralleled Tantalum or Electrolythics for your bulk supply capacitance, although at first glance this might seem like a good idea, the input characteristics of a switching power supply are very likely to create unstable conditions at their inputs if some precautions are not taken.
The reason can be gleaned from this answer and the exact reason for your specific problem is very probably the exact same one that is shown here.
There is such thing as too little ESR to adequately compensate for the negative impedance presented by a switching power supply. When using ceramics or too low of an ESR for this type of application, you are likely to introduce an undamped resonances that can multiply the input voltage until it reaches destructive levels.
You have to pay attention to the ESR and provide enough dissipation elements (e.g., intentional series resistance) to dampen any oscillation that can be elicited by the circuitry. The combination of your inductor, wiring, and capacitance create a resonant tank that can be excited by the switcher and interacts with its negative impedance. If there is not enough resistance to dampen this oscillation an unstable condition arises which can multiply the input voltage by a large factor.
In your case assuming 50W load with an input of 50V your switcher could present a negative input impedance of -50Ω!!! At 25V it would be -12.5Ω!!! (this of course is a linearized over-simplification, but it illustrates the magnitude of the problem). If I only consider your ceramics, I get a resonant frequency of just 10kHz if I add your electrolytics it goes down to just 1kHz, either of those is below the operating frequency of your switcher which suggests that the linearized approximation would apply!!!
The cause of the negative impedance, your switcher feedback loop, will try to compensate for the oscillating input voltage which will interact non-linearly with the oscillations, very likely making it worse.
You should reconsider the amount of bulk decoupling you are using and test by looking at the input voltage (the lowest you can apply) with enough series resistance in your supply to avoid the whole system from blowing up. If you see large sustained oscillations at the input you would have found the problem.
This can be solved/improved by:

*

*Adding some series resistance to your bulk capacitance. In most cases less than 1Ω should suffice, but given the large values of negative resistance that might be present, you should analyze the circuit in more detail to be sure.

*Reducing the ceramic capacitors to place the resonance well above the switching frequency, so that it does not interact with your switcher.

*Reducing the overall bulk capacitance, so as the resonance does not interact negatively with your switcher.

*Increasing the wire gauge of the supply, reducing their length, and twisting them to reduce their parasitic inductance.

*Changing the switching frequency. Given the chaotic aspects of the feedback it is likely you would be able to find a stable region of parameter space.

*Modifying the switcher feedback loop, for the same reasons as above.


text:
Q: Why should the past simple tense be used in this case? In the following sentences, the past simple tense is used after the present perfect tense. Both sentences are connected with each other:

I have been hit by a baseball bat in the past. It felt awful!

My question is: Why is the past simple ("felt") used instead of the present perfect ("has felt")?


text:
Q: UITableViewCell object deinit never called the problem is in my project. But I also tried in new xcode draft project that Master-Detail Application one.
I have created base Cell class and mapped the cell on storyboard. After delete operation deinit never called. There is no strong or weak any reference to cell.
class Cell:UITableViewCell {
    deinit{
        print("Deinit Called")
    }
}

override func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell {
    let cell = tableView.dequeueReusableCellWithIdentifier("Cell", forIndexPath: indexPath) as! Cell

    let object = objects[indexPath.row] as! NSDate
    cell.textLabel!.text = object.description
    return cell
}

A: UITableViewCells work as a lazy var, they are initialized on the first use and are kept alive as long the UITableView that initialized them is alive, that happens on the moment the register:forIdentifier: is called. If you're using the Storyboard that's is done for you.
Why it's done? Every cell can be reutilized using dequeueReusableCellWithIdentifier, so the UITableView keep a instance alive to be utilized if needed.
If you need to clear up some data, just call prepareForReuse on the UITableViewCell


text:
Q: Vagrant 1.2.2 Not Running Puppet Manifest The vm resulting from vagrant up seems to work fine.  But I can't seem to get vagrant to add apache (the webserver) to it, in the simplest of configurations. I'm using Puppet.
I've made sure to vagrant destroy and then vagrant up.  Upon vagrant ssh, apache isn't there (no apachectl, no httpd).
Details below:
Environment:
bash-3.2$ vagrant --version
Vagrant version 1.2.2
bash-3.2$ uname -a
Darwin foo.com 12.3.0 Darwin Kernel Version 12.3.0: Sun Jan  6 22:37:10 PST 2013; root:xnu-2050.22.13~1/RELEASE_X86_64 x86_64
bash-3.2$
bash-3.2$ pwd
/Users/bar/cbalz
bash-3.2$ ls -ail
total 24
1500058 drwxr-xr-x   7 bar  staff   238 Aug  6 16:27 .
 379691 drwxr-xr-x+ 37 bar  staff  1258 Aug  6 11:29 ..
1500065 drwxr-xr-x   3 bar  staff   102 Aug  6 11:23 .vagrant
1500631 -rw-r--r--   1 bar  staff  4948 Aug  6 16:25 Vagrantfile
1500619 -rw-r--r--   1 bar  staff    33 Aug  6 13:34 index.html
1500107 drwxr-xr-x   3 bar  staff   102 Aug  6 16:28 manifests
1500704 drwxr-xr-x   2 bar  staff    68 Aug  6 14:24 www
bash-3.2$

foo:cbalz bar$ ls -ail manifests
total 8
1500107 drwxr-xr-x  3 bar  staff  102 Aug  6 16:28 .
1500058 drwxr-xr-x  7 bar  staff  238 Aug  6 16:27 ..
1500806 -rw-r--r--  1 bar  staff  405 Aug  6 16:28 precise64.pp
foo:cbalz bar$

Vagrantfile :
foo:cbalz bar$ more Vagrantfile
# -*- mode: ruby -*-
# vi: set ft=ruby :

Vagrant.configure("2") do |config|
# ...
config.vm.box = "precise64"
# ...
# Customization:
Vagrant::Config.run do |config|
  config.vm.box = "precise64"

  # Enable the Puppet provisioner
  config.vm.provision :puppet do |puppet|
     puppet.manifests_path = "/Users/bar/cbalz/manifests"
     puppet.manifest_file  = "precise64.pp"
     puppet.options = "--verbose --debug"
  end
end
# ...
end

Puppet Manifest File:
foo:cbalz bar$ cat manifests/precise64.app
# Basic Puppet Apache manifest

class apache {
  exec { 'apt-get update':
    command => '/usr/bin/apt-get update'
  }

  package { "apache2":
    ensure => present,
  }

  service { "apache2":
    ensure => running,
    require => Package["apache2"],
  }
  # ...
 }

Set-up:
$ vagrant destroy; vagrant up
Are you sure you want to destroy the 'default' VM? [y/N] y
[default] Forcing shutdown of VM...
[default] Destroying VM and associated drives...
Bringing machine 'default' up with 'virtualbox' provider...
[default] Importing base box 'precise64'...
[default] Matching MAC address for NAT networking...
[default] Setting the name of the VM...
[default] Clearing any previously set forwarded ports...
[default] Fixed port collision for 22 => 2222. Now on port 2203.
[default] Creating shared folders metadata...
[default] Clearing any previously set network interfaces...
[default] Preparing network interfaces based on configuration...
[default] Forwarding ports...
[default] -- 22 => 2203 (adapter 1)
[default] Booting VM...
[default] Waiting for VM to boot. This can take a few minutes.
[default] VM booted and ready for use!
[default] Configuring and enabling network interfaces...
[default] Mounting shared folders...
[default] -- /vagrant

Run:
$ vagrant ssh
Welcome to Ubuntu 12.04 LTS (GNU/Linux 3.2.0-23-generic x86_64)

 * Documentation:  https://help.ubuntu.com/
Welcome to your Vagrant-built virtual machine.
Last login: Fri Sep 14 06:23:18 2012 from 10.0.2.2
;vagrant@precise64:~$ apachectl
The program 'apachectl' is currently not installed.  You can install it by typing:
sudo apt-get install apache2.2-common
vagrant@precise64:~$ httpd
No command 'httpd' found, did you mean:
 Command 'xttpd' from package 'xtide' (universe)
httpd: command not found
vagrant@precise64:~$

A: Try removing
Vagrant::Config.run do |config|
  config.vm.box = "precise64"
from the Vagrantfile so that the configuration looks like below:
# -*- mode: ruby -*-
# vi: set ft=ruby :

Vagrant.configure("2") do |config|
# ...
  config.vm.box = "precise64"

  # Enable the Puppet provisioner
  config.vm.provision :puppet do |puppet|
    puppet.manifests_path = "/Users/bar/cbalz/manifests"
    puppet.manifest_file  = "precise64.pp"
    puppet.options = "--verbose --debug"
  end
# ...
end


text:
Q: Zombie process during start My laptop (12.04 and W7) will not start in Ubuntu any more. The login screen (black) appears after Grub.
It says. When I enter my name and password I enter "a terminal" and I can't get any further. The message I get sometimes is that there is a Zombie process running. As I try to kill that (which i can't) and terminate the child (never thought I would write this down) nothing happens.
Can anyone help me out?

A: It worked: booted an older kernel and then installed video drivers, problem fixed


text:
Q: ActiveRecord equivalent to this Short version
What's the SQL-only equivalent to
Workable.includes(:job_types)
        .where(job_types: {id: nil})

(answer of the form Workable.includes(:job_types).where('SQLHERE', nil)
Long version
I'm trying to 'OR' these two queries:
workables.includes(:job_types)
         .where('job_types.id = ?', params[:job_type])
         .references(:job_types)

and
Workable.includes(:job_types).where(job_types: {id: nil})

Longer version, to clarify David's question below
Workables have_and_belong_to_many job_types
I'm looking to find Workables where either the id matches the search parameter, or the Workable has no job_types at all.

A: If params[:job_type] is an integer, perhaps you could instead use:
workables.includes(:job_types)
         .where(:job_types => {:id => [params[:job_type], nil]})

Or are you looking for a situation where there is no corresponding job_type record at all?


text:
Q: JACL : Is there a way to delete all files on a certain directory folder? I am trying to find a way to delete all files on a certain folder using JACL Script. I have tried to use
$AdminConfig deleteDocument *directory*

but it doesn't work. It only deletes a specific file given the file name. Is there a way to delete all of the files at the same time rather than reiterating this and deleting it one by one?
Already tried to use deleteDocument function of $AdminConfig
$AdminConfig deleteDocument directory
Expected result is to delete everything on the temp folder.
Output is an error saying that it is not found since I didn't specify a file


text:
Q: "combat sports lesson" (sports with s) or "combat sport lesson"? what is the right way to say?
"combat sports lesson" (sports with s) or "combat sport lesson"?
It should not mean a specific style of combat sport like wrestling or karate.
It should mean combat sport in general.
Thank you.

A: I would definitely prefer sports. You would say "sports lesson" as a general term, combat just specifies it to a certain field of sports (still in general). Since you want to express the general term, the better word is sports. If you would only speak of wrestling, the word sport would be used.
For example:
The general term:

I really enjoy the (combat) sports lessons.

The specific term:

Wrestling is my favorite combat sport.

A: FOLLOW-UP-QUESTION
The words combat sport(s) & lesson(s) are not part of a sentence!
They should be a headline!
"Combat sport" is what it is about. And "lesson(s)" should be an addition just to make it more descriptive.
Im free to style it, for example:
a) Combat sport - lesson
b) Combat sport (lesson)
c) Combat sports - lesson
d) Combat sports (lesson)
e) Combat sport - lessons
f) Combat sport (lessons)
g) Combat sports - lessons
h) Combat sports (lessons)

*

*Are these options gramatically correct?

*And what is your feeling, opinion about these options. Which one would you prefer spontaneously without thinking?


text:
Q: Woocommerce Product Page edit "from" text Is there a way to change the "From:" text that denotes the lowest available price for each particular product within the shop?
I'm asking this as, on our shop we offer A4 samples within the Wallpaper sections, and the program sees this as the lowest available price. However this is somewhat misleading.
So, is it possible to change this text to "A4 Sample:" Alternatively, is there away to add text. Either before the "From:" text, or to the end of the field, after the price?
If none of this is possible, is there a way to get the default price of products in the Wallpaper section to be that of the Rolls of Wallpaper?

A: You can use a filter to change the text or the min price, this will affect all variable products.
add_filter('woocommerce_variable_price_html', 'custom_price_text', 10, 2);

function custom_price_text( $price, $product ) {

         $price = '';
         $price .= '<span class="from">' . _x('A4 Sample', 'min_price', 'woocommerce') . ' </span>';
         $price .= woocommerce_price($product->get_price());

         return $price;

}


text:
Q: MySQL Transpose (Pivot) Variation: move all combinations of columns into new rows any idea how to make this happen in MySQL:
Have Data:
Item, class, x, y, z, A, B, C
1,     new,  1, 0, 0, 1, 1, 0
2,     red,  1, 1, 0, 0, 1, 1
3,     new,  0, 0, 1, 1, 0, 1

(Data is also be in form 1, new, X, AB or 2, red, XY, BC if that is an easier point of departure...)
Need:
1, new, X, A
1, new, X, B
2, red, X, B
2, red, X, C
2, red, Y, B
2, red, Y, C
3, new, Z, A
3, new, Z, C

Any help would be awesomely appreciated. Thanks.

A: Try using nested case statements like this:
 select t.item, t.class,
 Case when t.X = 1 then 'X' else
      case when t.Y = 1 then 'Y' else
           case when t.Z = 1 then 'Z' end
      end
 end ,
 Case when t.A = 1 then 'A' else
      case when t.B = 1 then 'B' else
           case when t.C = 1 then 'C' end
      end
 end
 from YourTableName t

A: For few "xyzABC..." columns you can use this:
SELECT item,class,'x','A' FROM `test_pivot` WHERE x=1 AND a=1 UNION
SELECT item,class,'x','B' FROM `test_pivot` WHERE x=1 AND b=1 UNION
SELECT item,class,'x','C' FROM `test_pivot` WHERE x=1 AND c=1 UNION
SELECT item,class,'y','A' FROM `test_pivot` WHERE y=1 AND a=1 UNION
SELECT item,class,'y','B' FROM `test_pivot` WHERE y=1 AND b=1 UNION
SELECT item,class,'y','C' FROM `test_pivot` WHERE y=1 AND c=1 UNION
SELECT item,class,'z','A' FROM `test_pivot` WHERE z=1 AND a=1 UNION
SELECT item,class,'z','B' FROM `test_pivot` WHERE z=1 AND b=1 UNION
SELECT item,class,'z','C' FROM `test_pivot` WHERE z=1 AND c=1


text:
Q: Related Rate Does Not Stay Constant If a right triangle with hypotenuse of length $26$ has a leg of length $10$; and this leg (of length 10) is constantly incremented at a speed of $4$ units per second (let "seconds" be considered as another variable t) such that the hypotenuse and right angle are kept constant, at what speed will the remaining leg decrease?
First of all, the remaining leg would, by the Pythagorean Theorem, be of length $24$.
If I solve this as a related rates problem, I would get that, since $x^2 + y^2 = z^2$ (let $x = 10$, $y = 24$, $z = 26$), taking the derivative of both sides with respect to $t$ we have: $2x$$dx\over dt$$ + 2y$$dy\over dt$$ = $$2z$$dz\over dt$. Since $z$ is to be kept constant, we have, algebraically: $dy\over dt$$ = –$$x\over y$$dx\over dt$. Substituting $dx\over dt$$ = 4$ and the given intial $x = 10$, $y = 24$ we get $dy\over dt$$ ≈ –1.667$.
Now, to put this to the test, I decided to see if this speed stays constant. Let one unit of $t$ be incremented. Then, $x$ shall be incremented by $4$, and $y$ by approximately $–1.667$. So $x$ shall become $14$, and $y$ approximately shall be $22.334$. However, when I substitute the $x$ and $y$ to our previous equation  $dy\over dt$$ = –$$x\over y$$dx\over dt$. I get, approximately, $dy\over dt$$ = 2.51$. What is going on here? What flaw am I permitting? I believe the speed in which $y$ decreases is supposed to stay constant, but this is not at all what I am observing. Could anyone please point out where I'm making a fallacy? Thank you im advance.

A: Your intuition that the rate of change of $y$ should be constant when $x$ changes at a constant rate is wrong.
To see why, imagine the extreme cases. When $x$ is very small, $y$ is just a little less than the hypotenuse. The leg of length $x$ is nearly perpendicular to hypotenuse, so when it moves it hardly drags the far vertex towards it at all, and the other leg $y$ decreases slowly.
When $x$ is nearly as long as the hypotenuse that leg and the hypotenuse are nearly parallel. Changing $x$ at a constant rate shortens  the other leg rapidly. In fact that rate of decrease increases without bound.


text:
Q: How to perform multiple regression analysis with a small sample size? (n=20) I have a sample of 20 years, I want to perform multiple regression analysis to estimate economic growth. I have 9 independent variables, but because my sample is small i get insignificant results. I do not have data to maken it a sample of 100 years or anything near that. What can I do? Can I incorporate the sample size into my problem? How do I enter a sample size in SPSS?

A: In principle, you cannot make your results significant when the amount of your data is limited. The calculation of your p-value has taken into account your sample size n. One thing you can try is model selection, in which you assume you don't need all 9 independent variables .A small portion of them will explain the majority of the variability in your response.
  It is the kind of techniques used when n << p i.e when the number of observations < the number of covariates. There are different type of model selection methods such as Lasso and Elastic Net, which are implemented in recent version of SPSS.
http://en.wikipedia.org/wiki/Least_squares#Lasso_method
http://en.wikipedia.org/wiki/Elastic_net_regularization

A: you don't enter sample size into SPSS, it'll know it when you enter you data: it's the number of observations.
with N=20, and 9 variables you need to estimate 9+intercept+error variance=11 parameters. you can barely have one parameter in the model. often the rule of thumb is 20 observations per parameter. unless you're dealing with a very stable physical phenomenon, there's no way you're going to get help from statistics alone in such a model.
example of a very stable physical model: you got 20 packs of eggs, each with 10 eggs. your dependent variable is the weight of a egg pack, 10 independent variables are weights of each egg starting from the one on top left corner. i bet that if you run this experiment all betas will be $beta_i=1$, they'll be significant, as well as the intercept too. So, the intercept would be the weight of the packaging.

So, the hope is not lost if you're not in social sciences, but in manufacturing or natural sciences.


text:
Q: Is there a flavour of ubuntu for an orange pi 3? I know of Ubuntu IOT. It supports raspberry pi but doesn't say anything about the orange pi. There is a link on the orange pi website that takes you to a download you can get from google drive but I want to know if there is an official version of Ubuntu that is compatible with orange pi.

A: You can try the Raspberry image on Orange Pi, as these microcomputers are compatible. But you can get issues with not working USB ports, WiFi. Better to download an image for your model of orange from http://www.orangepi.org/downloadresources/.


text:
Q: Axios complete event I'm using Axios for API services and just curious if there's any official way to handle a "complete" event as we have used in Ajax call.
So like
axios.get('/v1/api_endpoint?parameters')
  .then((res) => { .. })
  .catch((err) => { .. })
  .complete(() => {})     //  <== is there any way to handle this complete event?

A: Following the axios documentation here, the secondary .then() is the one that I'm looking for.
Here's a good example of how to handle that axios complete event which will always be executed whether it has succeeded or failed.
axios.get('/v1/api_endpoint?with_parameters')
  .then((res) => { // handle success })
  .catch((err) => { // handle error })
  .then(() => { // always executed })        <-- this is the one

A: If you have to check whether an API call is a success or not, then you can use below code:
const response = await axios.post(
      "http://localhost:8000/xyz",
      { token, user }
    );
    const status = response.status
    if (status == 200) {
      console.log('Success')
      toast("Successful Transaction", { type: "success" });
    } else {
      console.log('Falure')
      toast("Falure", { type: "error" });
    }

You can also use finally to check if the event is completed or not. Attaching the link for your reference:
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise/finally


text:
Q: The "learn more" explanation for Voting Correction does not cover all scenarios The wording of the learn more for Voting corrected refers specifically and exclusively to multiple votes:

When a single user continually votes (up or down) on many of your posts within a short period of time, the system considers these votes to be invalid and removes them. This could happen for a variety of reasons, such as a user finding a user's great answer and visiting all of their posts to upvote them, or a user getting into an argument with another user and downvoting their posts indiscriminately in revenge. No matter the cause, this sort of systematic targeted voting is not considered normal behavior and the system will not allow it.

However on 19/10/21 I had just one upvote corrected, which does not fit this explanation or the definition of serial voting (abuse).

*

*Should the wording be amended to reflect that corrections can be as a result of singular as well as multiple votes?

Related (and a possible duplicate?):  Non-serial voting corrected which is tagged "status-by-design", and the accepted answer concludes with:

If we choose to continue using this process to invalidate mass voting sprees like this, we will find a way to clarify this possible case in the help center.


text:
Q: Rails Validations and the DRY principle I have 9 different models, all with a column called 'name'. In each model I have the following validation:
validates :name, presence: true, uniqueness: true

To adhere to the DRY principle, should that validation go in a parent class and have my models that use that validation inherit from the parent class?

A: You could try using a name validation concern instead. That way if you ever want to change the validation you only have to do it in one place, without having to create subclasses of something with model behaviour that isn't actually a model.
You can read how to use Concerns here http://api.rubyonrails.org/classes/ActiveSupport/Concern.html


text:
Q: Excel Addin -> Custom Pane -> Not clickable while cell editing I've created a custom pane in my Excel Addin using winforms control with WebView2 to host an html page.
I've noticed that when user is editing a cell, the html page within the form is not responding.
I have a function from a script inside the html which calls back to the form on events.
function toWindows(msg) {
    window.chrome.webview.postMessage(msg);
}

On the WebView2 side, however, I do not get any event on the CoreWebView2.WebMessageReceived callback.
I've noticed pane is not responsive also with a basic form.
I would like to receive callbacks to WebView2 on html clicks however, since Ribbon buttons are responsive on cell editing, and I would like to have the same behavior.
Any ideas?


text:
Q: Structuring an eclipse project containing multiple git repositories I'm using Eclipse CDT and egit and I need to construct a single project from multiple repositories. One contains the main body of the source code and the other contains utility scripts used as part of the build process (which are also used when building several other projects).
I'm struggling to understand if I can make egit work sensibly with this setup. I can't work out how to associate a CDT project with more than one git repository and that means that I can't perform VCS operations for some of the files in the project.
I'd like to be able to right click on any file in the workspace and have egit work out which repository it is in and so perform operations (history, blame...) correctly. Has anybody managed to do this or can you point me at documentation I can't find because of the huge number of "Multiple projects in a single repo" guides.

A: EGit can only have 1 repository associated with a project, and the project needs to be inside that repository. For example, the following are valid layouts.
On the same level as the project:
.git
.project
src
...

Containing more than one project:
.git
project-a
    .project
project-b
    project

It's not possible to have something like this and have EGit know about the repository for this project:
.project
foo
    .git

The above would also mean that project files (.project, .classpath, etc) are not in the repository – and they should be.
So I recommend having multiple projects, one (or more than one) for each repository.

A: In April 2016, EGit 4.3 introduced support for nested repositories. Eclipse 4.6 Neon, introduced on June 2016, includes EGit 4.4.
Nested repositories are detected automatically; just use the Team->Share Project contextual menu in the project tree node.


text:
Q: moving a opencv visual studio project I have been working on a opencv project with visual studio 2013 and the version of opencv is 2.4.8. The problem I am having is when I move the .exe file that is produced from the visual studio to another location it complains about not finding the .dll files from the opencv library, which are located in C:\opencv directory. Here is the error message:
    System error: The Program can't start because opencv_core248d.dll is missing from your
    computer. Try reinstalling the program to fix this problem.

thank you in advance for your help.

A: You either need to add the directory that contains all those dlls to your system PATH, or put all those needed dlls in the same directory as the executable(or your executable where your dlls are located). They are DYNAMIC libraries, so the program needs access to them when it tries to execute.


text:
Q: Issue in finding the lat and long in samsung S3 I am not getting the lat and long in samsung S3.In other devices my code is working fine and getting the proper lat and long.Below is my code to get the lat and long.
public class MainActivity extends Activity {
TextView textView1;
Location currentLocation;
double currentLatitude,currentLongitude;

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);
    textView1 = (TextView) findViewById(R.id.textView1);

    findLocation();

}

 public void findLocation() {

        LocationManager locationManager = (LocationManager) this
                .getSystemService(Context.LOCATION_SERVICE);

        LocationListener locationListener = new LocationListener() {

            public void onLocationChanged(Location location) {

                updateLocation(location,currentLatitude,currentLongitude);

                Toast.makeText(
                        MainActivity.this,
                        String.valueOf(currentLatitude) + "\n"
                                + String.valueOf(currentLongitude), 5000)
                        .show();

                }

            public void onStatusChanged(String provider, int status,
                    Bundle extras) {
            }

            public void onProviderEnabled(String provider) {
            }

            public void onProviderDisabled(String provider) {
            }
        };

        locationManager.requestLocationUpdates(
                LocationManager.NETWORK_PROVIDER, 0, 0, locationListener);

    }

    void updateLocation(Location location,double currentLatitude,double currentLongitude) {
            currentLocation = location;
            this.currentLatitude = currentLocation.getLatitude();
            this.currentLongitude = currentLocation.getLongitude();

            textView1.setText(String.valueOf(this.currentLatitude) + "\n"
                    + String.valueOf(this.currentLongitude));

        }
}

In above code the onLocationChanged() method is not executing in S3 and the same code is not working in Samsung S3 device.In other devices it working fine.I am getting the correct lat and long in other devices.Please help me to sort out this problem..


text:
Q: How do you truncate columns from a matrix with algebraic operations? I have a matrix of dimension $n \times m$ and want to truncate a column left or right side, to get the remaining $n \times m-1$ matrix (one column removed). How can I do this using standard algebraic notation?

A: Let $\mathrm{M}$ be the $n \times m$ matrix and $\mathrm{N}$ be the truncated $n \times m-1$ matrix. Then define:
$\mathrm{R}
=
\begin{bmatrix}
    \mathrm{I}_{m-1} \\
    0_{1,m-1}
\end{bmatrix}
$ as an $m \times m-1$ right truncating matrix
$\mathrm{L}
=
\begin{bmatrix}
    0_{1,m-1}\\
    \mathrm{I}_{m-1}
\end{bmatrix}
$ as an $m \times m-1$ left truncating matrix
then truncate the right column as follows:
$\mathrm{N}$ = $\mathrm{M}\mathrm{R}$
and truncate the left column as follows:
$\mathrm{N}$ = $\mathrm{M}\mathrm{L}$
Uses only standard matrix multiplication and nomenclature commonly found and well documented as here:
which uses only standard notation from:

*

*https://en.wikipedia.org/wiki/Identity_matrix

*https://en.wikipedia.org/wiki/Zero_matrix

*https://en.wikipedia.org/wiki/Block_matrix