text:
Q: Can C*/W*-algebras be realized as (involutive?) monoid/co-monoid objects? I would like to know how close one can get to realizing the category of C*-algebras as a category of monoid objects.  Related (almost, but not quite, duplicate) questions are:

*

*"Recovering a monoidal category from its category of monoids" (second half of question); see Yemen Choi's answer.

*"Which W*-algebras are the duals of C*-coalgebras?". In particular Dmitri Pavlov's Comment.
J.M. Egger attempted to do this in the category of operator spaces using the Haagerup tensor product: http://www.mscs.dal.ca/~jegger/ioa.pdf (also available at: http://cheng.staff.shef.ac.uk/pssl85/egger.pdf) .  The $*$-operation complicates things a bit; one must deal with "involutive monoids".  He writes down a nice category of involutive monoids that C*-algebras are are included in, but not every such involutive monoid is C*-algebraic (c.f. example 4.6).
This reference is from 2007, and I'm not familiar with the operator systems literature, so perhaps someone else has something written down.  Here is a subquestion:
 Is it possible to reproduce what Egger does in the category of operator systems and completely positive maps instead of operator spaces and completely bounded maps?
My superficial understanding of operator spaces is of even higher degree in superficiality when it comes to operator systems; so I don't even know if that question makes sense.  However, Egger's counterexample is not a concrete operator system, and I feel like working with operator systems may rid of the complications of involutive monoids as, roughly speaking, the involution is already implicit in the data of an object of the underlying category.
However, I also believe the question as stated in the title is a pipe-dream: getting the C*-identity on the nose doesn't seem likely, so it's probably a better to ask if one can realize the category of C*-algebras  as a reflective subcategory of some category of monoid objects: e.g. consider the full subcategory $\mathbf{A}^{*}$ of the category of Banach algebras and $*$-homomorphisms given by those Banach spaces that admit faithful $*$-homomorphisms into $B \mathcal{H}$ for some Hilbert space $\mathcal{H}$ (Takesaki calls these A*-algebras---an ungooglable term---in Def 9.19 of Op. Algs. I).  There is a universal enveloping C*-algebra functor $\mathcal{C}: \mathbf{A}^{*} \rightarrow \mathbf{C}^{*}$ into the category $\mathbf{C}^{*}$ of C*-algebras, which explicitly realizes $\mathbf{C}^{*}$ as a reflective subcategory.
In this sense perhaps its more realistic to ask if $\mathbf{A}^{*}$ can be realized as a category of monoid objects. (Egger's counterexample doesn't appear to be an $A^{*}$-algebra either, but I might be missing something).
I imagine if one understands the situation for C* algebras, then the W* algebra case could be understood with the proper modifications and decorations with the prefix "co".

 Optional Motivation : The question is interesting in its own right, but I'll supply some motivation for why I care: I'm working with a construction where the natural output involves cosimplicial W*-algebras; for various reasons I much rather deal with something like (non-negatively supported) "cochain dg"-objects by applying a dual version of the normalized Moore complex functor and using the Alexander-Whitney map to define multiplication.  Of course, to make sense of these sorts of things I need to realize $W^{*}$-algebras as monoid (or comonoid if working with the predual) objects in some sufficiently nice category.
In finite dimensions everything is straightforward: the category of finite-dimensional W*-algebras (forget the $\dagger$-category structure) is equivalent to the category of semisimple finite-dimensional $\mathbb{C}$-algebras.
Of course I can probably just find a "hack" for my particular problem without understanding monoidal structures, but I don't think that gives a very deep understanding.


text:
Q: Double axis chart in jqplot Is it possible to have double axis chart using jqplot
Can anyone please share the example for the same

A: It is possible.

Code example :
$(document).ready(function(){
    $.jqplot('chart1', [
            [54551.94,15192.79,37937.26,11417.67,11799.59,18377.53,49207.82,168235.42,16654.29,62145.78],
            [132.19,2.99,6.09,50.38,1.44,4.41,25.25,3.37,68.60,2.14]
        ], {
        seriesDefaults : {
            renderer : $.jqplot.BarRenderer,
            rendererOptions : {
                highlightMouseOver : true,
                barWidth : 10
            }
        },
        legend : {
            show : true,
            placement : 'outsideGrid'
        },

        axes : {
            xaxis : {
                renderer : $.jqplot.CategoryAxisRenderer,
                tickOptions : {
                  angle : 45
                },
                ticks : ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J']
            },
            yaxis : {
                label : 'axis1',
                renderer : $.jqplot.LogAxisRenderer
            },
            y2axis : {
                label : 'axis2'
            }
        },
        series : [{
            yaxis : 'yaxis',
            label : 'dataForAxis1'
        }, {
            yaxis : 'y2axis',
            label : 'dataForAxis2'
        }]
    });
});

JSFiddle example :
EXAMPLE

Documentation :
See here for the reference.
Look the third example from the top.

A: Yes it is possible. A starting example can be :
var yaxis_data = [1,2,3,4];
var y2axis_data = [2,4,6];
var myjqplot = $.jqplot('chart1', [yaxis_data, y2axis_data], {
  series: [
   { yaxis: "yaxis" },
   { yaxis: "y2axis" }
  ]
});

Edit : See here for further explanations about Series

redpajama_set_name: RedPajamaStackExchange


text:
Q: How do you tell the Rails version inside of a Rails app? Up to Rails 2.3.8, there is a constant:
RAILS_GEM_VERSION   "2.3.8"

but Rails 3.0.0 doesn't have it.  Is there other ways?

A: Use Rails.version.
Most environment information that you might need from Rails should be accessible from that class.
The documentation.


text:
Q: Deriving of an addition formula of $\sin$ from a second order differential equation How to derive the addition formula of $\sin$:
$$
\sin(t+s)=\sin(t)\cos(s)+\sin(s)\cos(t)
$$
from the following differential equation
$$
y''+y=0.
$$

A: Define $\phi(t)=\sin(t+s)$ and $\psi(t)=\sin t\cos s+\sin s\cos t$ and show that they are solutions of the given differential equation. Show then $\phi(0)=\psi(0)$ and $\phi'(0)=\psi'(0)$ and argue with uniqueness.


text:
Q: What is the formula for me to get a value at a certain point? I have a two linear points : 400 and 1000.
At 400, the value is 150. But for 1000, I want the value to be 100.
So in 600 steps (1000-400), the value has to go down by 50(150-100). I'm not really sure where I should go from here and what to do with these values.

A: You need the two-point form of a linear equation.  If $x$ is your input and $y$ is your output you have $$y-150=-50\cdot\frac{x-400}{1000-400}$$  Plug your points in and see that it works.  I left it unsimplified so you can see where the numbers come from if you read the article.


text:
Q: Session start time displayed in HTML and PHP I'm trying to display a session start time on a page in this format

"Today you started work at: 00:00"

I found a session start time if statement but it doesn't seem to work for what I'm trying to do - either that or my syntax is wrong.
print "Today you started work at: " ;
if (!isset($_SESSION['started'])){
  $_SESSION['started'] = $_SERVER['REQUEST_TIME']
  print $_SESSION['started'];
};

A: Never forget to add the ; at the end of the line instruction.
$_SESSION['started'] = $_SERVER['REQUEST_TIME']

This code will only show a value if the session starts for the first time. because isset($_SESSION['started'])) will be false.
In this case, it will only display the timesamp of the the request time.
$_SERVER['REQUEST_TIME']

You must use the date() function for time formatting
date("H:i",$_SESSION['started'])

where H is for hour, and i is for minute.
Never forget also to add the session_start() function before any printing.
Always close an open HTML tag
print "Today you started work at: " ;
...
print "	" ;

Here is a correction:
session_start();
print "Today you started work at: " ;
if (!isset($_SESSION['started'])){
    $_SESSION['started'] = $_SERVER['REQUEST_TIME'];
}
print date("H:i",$_SESSION['started']);
print "	" ;


text:
Q: AWS SAM and the changes in resource ARNs with each deployment I see that one SAM deployment over another, that the previous resources are deleted, and new resources are created. Now, the new resources that are created are actually not the same resources, and have a different ARN than before.
This causes some problems that I am facing right now. Say that we have non SAM resources which require set for for the SAM resources.
Like for example, we have an SNS which is subscribed by our API gateway. Now after the deployment the ARN of the API gateway changes, and we'd require to subscribe again.
There are more problems like this that I am facing, but this is the gist of it.
Any help appreciated!

A: The ARN of the resource can remain same if the name of the resource is specified in the template. Since the name now remains the same, the ARN too will remain the same, even after multiple deployments.


text:
Q: StackExchange.Redis Timeout Handling I've built a basic Redis adapter which works for the most part.
The adapter itself is lightweight
public RedisAdapter(string connectionString, int database)
{
  _redisConnection = ConnectionMultiplexer.Connect(connectionString);
  _db = _redisConnection.GetDatabase(database);
}

public async Task<string> ListLeftPopAsync(string key)
{
  var result = await _db.ListLeftPopAsync(key);
  return result;
}

with a simple usage being:
var redisAdapter = new RedisAdapter("localhost:6379,password=12345,syncTimeout=3000,abortConnect=false", 1);
var request = await redisAdapter.ListLeftPopAsync(RedisKeys.MyKey);

I've noticed that I'm getting occasional timeouts like the error below:
Timeout awaiting response (outbound=0KiB, inbound=0KiB, 3703ms elapsed, timeout is 3000ms), command=LPOP, next: LPOP PriorityEmailSenderList, inst: 0, qu: 0, qs: 1, aw: False, rs: DequeueResult, ws: Idle, in: 0, in-pipe: 5, out-pipe: 0, serverEndpoint: Unspecified/localhost:6379, mgr: 9 of 10 available, clientName: WIN-JN03113EBLE, IOCP: (Busy=0,Free=1000,Min=1,Max=1000), WORKER: (Busy=1,Free=32766,Min=1,Max=32767), v: 2.0.601.3402

Everything other than syncTimeout and abortConnect are default. For the time being, I've changed syncTimeoutto 5000 since the error appears to say the operation was taking 3703ms (703ms over the threshold), however some errors show operations that took 9500ms which seems a bit long to me. Other suggestions are welcomed!
Any advice on making this a bit more robust for handling timeouts?


text:
Q: What to do without copper? So the latest update to Starbound has kind of left me in a very awkward spot.  Exploring my first planet's surface, I've found an absolute abundance of Iron, a surprising smattering of silver, and an unheard-of abundance of gold!  And all of this would be great...except that I am completely understocked in Copper.
This lack of copper is not insignificant.  While I can handily make nice weapons for myself with my collection of iron, and I maybe have enough copper to construct a pick, I don't have nearly enough to create armor.
This is a problem, because every other type of metal armor relies on copper armor first.
I don't yet have enough pixels to create an iron bow to hunt very well (because the monsters are constantly killing me), so I'm in a bit of a bind.
How do I deal with this lack of essential copper early in the game?

A: After you manage to get pixels to hunting bow, hunt animals and make leather armor set, it have same defenses as copper armor.
Use dirt blocks to make cover and hunt with bow from it.
If you have coal(in current version coal is pretty rare too), try travel to desert planet, fine sand is very easy to mine, and you can find copper ore often near surface of planet.

A: Assuming you're not also unable to find coal to use as fuel in your ship, your best bet is to simply seek another planet in the hopes that it has some richer copper deposits, particularly if you've already done a pretty good job exploring and exploiting the resources of the starting planet. There's really no reason to limit yourself to your starting planet.
However, as of the latest patch, silver armor no longer requires copper armor to be created first. It does, however, require you to have upgraded your ship with the Starmap Upgrade Mk2. The penguin mothership (which drops the molten core, which you need to create the metalworking station, which you need to make the starmap) is pretty easy to kill now and I'm certain you could do it without copper armor so long as you bring along a few bandages instead. Once that's done, skip straight to Silver armor.


text:
Q: Maps(Mapbox) resulting in too much output process 10-17 15:55:19.865 28132-28132/com.D/mbgl: [JNI]: nativeGetZoom
10-17 15:55:19.875 28132-28132/com. D/mbgl: [JNI]: nativeGetMetersPerPixelAtLatitude
10-17 15:55:19.885 28132-28132/com.D/mbgl: [JNI]: nativePixelForLatLng
10-17 15:55:19.885 28132-28132/com. D/mbgl: [JNI]: nativeGetZoom
10-17 15:55:19.885 28132-28132/com. D/mbgl: [JNI]: nativeGetMetersPerPixelAtLatitude
10-17 15:55:19.895 28132-28132/com.D/mbgl: [JNI]: nativePixelForLatLng
10-17 15:55:19.905 28132-28132/com. D/mbgl: [JNI]: nativeGetZoom
10-17 15:55:19.905 28132-28132/com. D/mbgl: [JNI]: nativeGetMetersPerPixelAtLatitude
10-17 15:55:19.915 28132-28132/com.r D/mbgl: [JNI]: nativePixelForLatLng
10-17 15:55:19.915 28132-28132/com. D/mbgl: [JNI]: nativeGetZoom
10-17 15:55:19.915 28132-28132/com.D/mbgl: [JNI]: nativeGetMetersPerPixelAtLatitude
10-17 15:55:19.935 28132-28132/com. D/mbgl: [JNI]: nativePixelForLatLng
10-17 15:55:19.935 28132-28132/com. D/mbgl: [JNI]: nativeGetZoom
10-17 15:55:19.935 28132-28132/com. D/mbgl: [JNI]: nativeGetMetersPerPixelAtLatitude
10-17 15:55:19.945 28132-28132/com.D/mbgl: [JNI]: nativePixelForLatLng

My logcat is filled with these lines, I'm using Maps from MapBox.
Its hard to check logs because its filled with these lines.
Is there any way to fix this?

A: We've been working on reducing the log output of our SDK. One of the ideas we have is using Timber (see this issue). You can try upgrading to either the latest 4.2.0-beta.3 or SNAPSHOT (built nightly) which has removed some of this output.


text:
Q: 3 tables MySQL join with non-shared atributes I have three tables, with the following (hypothetical) columns:

*

*student(name_id,time,pers)

*job(name_id,work_id,salary)

*departament(work_id,project)
Now let's say I want to request the value of "pers", contained in the table student that matches with a certain project from the table department. I see that I first have to join department with job, and then the result with student to finally select the column I am interested in; but I'm not really sure how to do it, and everything I've tried has failed.
Could you guys give me any hint on how to solve this problem?
Thanks.

A: You have the right starting idea, you want to do a join between the department and job and the student. Perhaps you don't know how to do joins in mysql? It should look something like this:
SELECT *
FROM department d
JOIN job j USING(work_id)
JOIN student s USING(name_id)
WHERE d.project = 'project'

This might not give you the exact results you are looking for as there could be many relationships to one student.


text:
Q: preventing repetitive number combinations. Java I have a list of random numbers. Since its random, I want to iterate through that list and prevent any direct (following) repetition of the previous combination of only two numbers. For ex:

*

*I have this list = 7, 4, 3, 7, 1, 6...

*I will set the first two numbers as first comparison pairs (7 4)

*Now I am at index 2 and the number is 3, so does 3 exist in the previous combination (7 4)?

*no, so I will save it for the next comparison, until it become pair with another number

*Then, is 7 exist on (7 4)?

*yes, then loop through the list and look for a number that doesn't exist in (7 4)

*I found in index 4 number 1, so now take that number and swap it with 7, and since you have a unique two numbers, change the comparison to (3 7)

*and it keeps repeating until, i get a list of combined numbers of which no two combination would have the same numbers that the one before it already have.

*eventually, I should get something like, 7  4  3  1  7  6...

But my result show the following: 7, 4, 3, 1, 6, 2, 1, 6, 10, 4, 4, 7
the 2nd 7 is not on the right place!!
My code looks fine to me, but the output is not what I quite expects! I don't want a complete non-duplicate ordered set (Hash-set)! I need it to be the way I explained!!

public static void main(String[] args) {
  int[] list = {7, 4, 3, 7, 1, 6, 2, 4, 1, 6, 4, 10};
  int[] lastCombination = {-1, -1}; //initial var
  int[] currentCombination = new int[2]; //temp

  int currentIndex = 0;
  for (int i = 0; i < list.length; i++) {
    if (lastCombination[0] == -1 && lastCombination[1] == -1) {
      lastCombination[0] = list[i];
      lastCombination[1] = list[++i];

    } else {
      if (list[i] != lastCombination[0] && list[i] != lastCombination[1]) { //i is not used
        if (currentIndex == 1) {
          currentCombination[currentIndex] = list[i];
          currentIndex = 0;
        } else {
          currentCombination[currentIndex] = list[i];
          currentIndex++;
        }

      } else { //i is used
        boolean isNotUnique = true;
        int next = i + 1;

        while (isNotUnique) {
          if (next <= (list.length - 1)) {
            if (list[next] != lastCombination[0] && list[next] != lastCombination[1]) {
              int temp = list[i];
              list[i] = list[next];
              list[next] = temp;
              i = i - 1;
              isNotUnique = false;
            } else {
              next++;
            }
          } else {
            System.out.println("REACHED THE END");
            isNotUnique = false;
          }
        }
      }
    }
  }
  System.out.println("");
  System.out.println("Original: 7, 4, 3, 7, 1, 6, 2, 4, 1, 6, 4, 10");
  System.out.print("Modified; ");
    for (int i : list) {
    System.out.print(i + ", ");
  }
}


text:
Q: Problems with encoding my php array to show in my javascript code I'm trying to use a php array in my JavaScript part of my Website by encoding it to Json and sending it over an echo but compiling the website and visiting it over chrome gives me a broken website with a Json file that stops halfway through start of file end of file
the website works fine when I'm not encoding my Json and Json file is only 265 kb big so I guess the website should be able to handle that under normal conditions.
Also here is the relevant part of the code if this helps:
 <script type="javascript">
            function confirmSelection(i) {

                if (confirm("Sure you want to load new Song?")) {
                    let tags = {"'id'", "'number'", "'name'", "'slug'", "'way'",
                        "'language'", "'category'", "'year'", "'lyrics_author'",
                        "'melody_author'", "'position'", "'url'", "'update_time'", "'paragraphs'"};

                    let currentTags = {"'currentId'", "'currentNumber'", "'currentName'",
                        "'currentSlug'", "'currentWay'", "'currentLanguage'",
                        "'currentCategory'", "'currentYear'", "'currentLyrics_author'",
                        "'currentMelody_author'", "'currentPosition'", "'currentUrl'",
                        "'currentUpdate_time'", "'currentParagraphs'"};

                    <?php $json = json_encode($editor->lieder); ?>
                    let lieder = <?php echo $json;  ?>;
                    for (let j = 0; j < tags.length; j++) {
                    document.getElementById(currentTags[j]).value = lieder[i][tags[j]];
                    }
                }
            }
    </script>

A: check with value of > $editor, is there any special charector that preventing further URL text >>>

check URL/FileName formates, Replace Song 1.mp3 with Song-1.mp3
replace spaces/astreaks/plus signs with hyphen (in directory).

do same with loading URL structures, may be single quotes making code messy, eg : K'pop songs


text:
Q: Как показать только часть бэкграунда? Есть див#1 у него задан бэкграунд и размер (к примеру 100%).
Есть див#2 у него background: inherit а размер 100px на 100px. Задача состоит в том, чтобы див#2 отображал туже часть бэкграунда что и закрывает собой находясь в диве#1.
A: див#2 {

background: transparent;
}


text:
Q: DW01 2s protection I want to protect 2 18650 batteries with single DW01.
The problem is how to increase the protection voltage on DW01 .
I have read that I should use voltage divider on VCC pin. I just want to make sure 18650 wont turn into hand grenade.
HERE IS MY SCHEMATIC

A: Long story short: The DW01 is, according to its datasheet (first line, first two words; emphasis mine) a

One Cell Lithium-ion/Polymer Battery Protection IC

If it had the capability to really protect two cells in series, they would've marketed it that way.
So, while you can certainly sense a situtation that is definitely overvoltage for both, you won't be able to sense the (likely) situation that one cell failed and you're now overloading the second.
So, your approach is inherently bad, and you should not use a DW01 to protect two cells. Simple as that. Wrong tool for the job.


text:
Q: Adjustable LDO's - Voltage Input, Output, & Potentiometer Use I am looking to use an LDO with a negative adjustable output voltage. I have found two products sold by TI that have similar schemes for setting the output through external resistors.
I am slightly confused though, as one of the resistors in each scheme is illustrated as a potentiometer. Why is this so? Can a fixed value resistor be selected instead?
Also, the first regulator series (LM79XXAC) have fixed negative outputs but external circuitry can be configured to make it adjustable. For instance, take the -5-V fixed LDO in adjustable output configuration.

If this was instead the -12 V fixed output version, would the output equation change such that 12 V is substituted for 5 V in the above?
The external circuitry for the second LDO (LM337LM) is much the same as the other LDO series as shown below.

However, the output equation varies from that of the first LDO series, not including a current term. Is there a reason for this?

Finally, both datasheets do not seem to provide an input voltage range. Is there something I am missing? I need to figure out how to select a value of Vin for a given Vout.
Here are links to the Datasheets:
LM79XXAC
LM337LM
Thanks, everyone

A: Of course you can select fixed resistors instead of a potentiometer to make it non-adjustable.
The 79xx regulators are intended to be used as fixed regulators, but can be made adjustable, and the actual voltage of the regulator just sets the minimum voltage, it can be adjusted higher.
The output voltage term always includes the ground or adjust pin current, the LM337 output voltage also has the pin current in the formula - the LM337 just has about 10x smaller current, and due to the LM337 already typically has an adjustment divider current of 5mA, the adjust pin current can be ignored because it does not have much effect on the output voltage.
The datasheets do contain the formula for the resistors. For 7905 the minimum voltage will be -5V and it needs at least -2 volts more than the output voltage to work properly. The LM337 can go down to the -1.25V reference voltage, and it needs -3 volts more on the input than on the output.


text:
Q: Change pseudoclass before position with js or jQuery smoothly I have in site left side tab with onclick show or hide smoothly.
Click the arrow and look  to show & hide this left side panel.
And you will see the yellow image  in left side of the tab
I  wondering is it possible to move bottom image   with the tab?
Like the tab move's smoothly this image must be move with this tab
I need to when slides hide it must be in right side when show it must be in left

$(function(){
 $('.slider-arrow').click(function(){
        if($(this).hasClass('show')){
     $( ".slider-arrow, .panel" ).animate({
          left: "+=300"
    }, 700, function() {
            // Animation complete.
          });
    $(this).html('«').removeClass('show').addClass('hide');
        }
        else {
     $( ".slider-arrow, .panel" ).animate({
          left: "-=300"
    }, 700, function() {
            // Animation complete.
          });
    $(this).html('»').removeClass('hide').addClass('show');
        }
    });

});
.panel {
 width:300px;
 float:left;
 height:100px;
 background:#d9dada;
 position:relative;
 left:-300px;

}
.panel:before {
    background: url(https://image.ibb.co/jD3m2o/Summerbuble.png);
    content: "";
    position: absolute;
    width: 55px;
    height: 44px;
    bottom: -44px;
    left: 0;
    background-repeat: no-repeat;
    background-size: contain;
}
.slider-arrow {
  height:90px;
 padding:5px;
 width:10px;
 float:left;
 background:#d9dada;
 font:400 12px Arial, Helvetica, sans-serif;
 color:#000;
 text-decoration:none;
 position:relative;
 left:-300px;
  background:yellow;
}

      »

A: You can't directly manipulate the :before pseudo-element, but you can manipulate the position of the :before element using class(es) on the .panel. For example (see *** lines):

$(function(){
 $('.slider-arrow').click(function(){
        if($(this).hasClass('show')){
     $( ".slider-arrow, .panel" ).animate({
          left: "+=300"
    }, 700, function() {
            // Animation complete.
            $(this).filter(".panel").addClass("showing"); // ***
          });
    $(this).html('«').removeClass('show').addClass('hide');
        }
        else {
     $( ".slider-arrow, .panel" ).animate({
          left: "-=300"
    }, 700, function() {
            // Animation complete.
            $(this).filter(".panel").removeClass("showing"); // ***
          });
    $(this).html('»').removeClass('hide').addClass('show');
        }
    });

});
.panel {
 width:300px;
 float:left;
 height:100px;
 background:#d9dada;
 position:relative;
 left:-300px;

}
.panel:before {
    background: url(https://image.ibb.co/jD3m2o/Summerbuble.png);
    content: "";
    position: absolute;
    width: 55px;
    height: 44px;
    bottom: -44px;
    right: -44px;        /* *** */
    background-repeat: no-repeat;
    background-size: contain;
}
.panel.showing:before {  /* *** */
    left: 0px;           /* *** */
    right: auto;         /* *** */
}                        /* *** */
.slider-arrow {
  height:90px;
 padding:5px;
 width:10px;
 float:left;
 background:#d9dada;
 font:400 12px Arial, Helvetica, sans-serif;
 color:#000;
 text-decoration:none;
 position:relative;
 left:-300px;
  background:yellow;
}

      »

I'm sure that's not exactly what you want to do (which remains a bit unclear to me), but that's how you can adjust the position of the yellow triangle.
Otherwise, you'll have to change it from being a pseudoelement to being a real element.
You might look at using CSS transitions instead, which let you move that pseudo-element much more smoothly:

$(function(){
 $('.slider-arrow').click(function(){
    $(".slider-arrow, .panel").toggleClass("show hide");
  });
});
.panel {
 width:300px;
 float:left;
 height:100px;
 background:#d9dada;
 position:relative;
 left:-300px;
}
.panel.show {
    transition: left 700ms;
}
.panel.hide {
    left: 0px;
    transition: left 700ms;
}

.panel::before {
    background: url(https://image.ibb.co/jD3m2o/Summerbuble.png);
    content: "";
    position: absolute;
    width: 55px;
    height: 44px;
    bottom: -44px;
    right: 300px;
    background-repeat: no-repeat;
    background-size: contain;
}
.panel.show::before {
    transition: right 700ms;
}
.panel.hide::before {
    /*transition: left 700ms;*/
    transition: right 700ms;
    /*left: auto;*/
    right: -44px;
}

.slider-arrow {
  height:90px;
 padding:5px;
 width:10px;
 float:left;
 background:#d9dada;
 font:400 12px Arial, Helvetica, sans-serif;
 color:#000;
 text-decoration:none;
 position:relative;
 left:-300px;
  background:yellow;
}
.slider-arrow.show {
  transition: left 700ms;
}
.slider-arrow.hide {
  left: 0px;
  transition: left 700ms;
}
.slider-arrow.show::after {
  content: '»';
}
.slider-arrow.hide::after {
  content: '«';
}


text:
Q: Stop other videos after lazyload new one - jQuery and youtube API My Scenario - Codepen (Don't forget to scroll down)
Im using the lazyframe plugin to lazyload my youtube iframe videos. Each video gets added to the DOM after a click on the play button. There is a onAppend function included wich gets triggerd after a new video iframe is created (please have a look at the pen i created).
How can i stop the other vids after starting a new one?
I put a alert into the onAppend function to check if it works fine. The onAppend part looks like
    onAppend: function(e) {
        alert('onAppend after Lazyframe Function');
    }

I also managed to include the following scripts
    <script src="http://www.youtube.com/player_api"></script>
    <script src="http://www.youtube.com/iframe_api"></script>

The part at the end of the embed youtube url to enable the API is also inclulde
    &enablejsapi=1

Each Iframe gets a unique id
    <iframe id="lazyframe-6hgVihWjK2c" src="https://www.youtube.com/embed/6hgVihWjK2c/?autoplay=1" allowfullscreen="" class="test-vidx" frameborder="0"></iframe>

Any help would be appreciated.

A: I take from what you have said, that you are loading your page with many players at the same time. If so, you are finding out that they are independent from each other.
If this is so, you are then wanting to have only one play at any one time.
Only thing I can think of is to set up a dynamic variable that you load the ID of the currently selected player into. Then when you select to play a different video, you send a stop command to the old video using the variable for ID. Then update the variable with the new video players ID . However I am not sure how you will grab the ID as the imbedded players from the api call don't seem to have one.
Best is to use a stand alone player which you can give ID's to.
Here is the relevant link

A: If it's anything like the old lazyYT, I just added these two lines inside the click event of the lazyYT js code and it seems to be working pretty well :)
        $(<loaded-video-class-name>).lazyYT();
        $(<loaded-video-class-name>).removeClass(<loaded-video-class-name>);

Basically, onclick it'll reload the video thumbnail inside any element that was previously loaded with a video, and reset the element by removing the added class upon initial click to return to its initial state.


text:
Q: Defining and initialize a class property in PHP Laravel controller I try defined property for some controller and i get error :

Symfony \ Component \ Debug \ Exception \ FatalErrorException (E_UNKNOWN)
Constant expression contains invalid operations

This my controller code :
namespace App\Http\Controllers...;
use Illuminate\Http\Request;
use App\Http\Controllers\Controller;
use App\Customer;
use App\City;
use Illuminate\Database\Eloquent\Builder;
use Carbon\Carbon;

use Illuminate\Support\Facades\Auth;

class CatalogController extends Controller
{
    protected $user = Auth::user();

    function user() {
       $user = optional(Auth::user())->load(['city']);
       return $user;
    }
}

In php.net I read this:
Class member variables may be initialized, but this initialization must be a constant value--that is, it must be able to be evaluated at compile time and must not depend on run-time information in order to be evaluated.
I assume that this rule is not executed in my code. Am I right?

A: Retrieving the user in a controller method is fine because it is only executed once for the request. There is no need to advantage to storing it as instance property because a new instance of the controllers is made for every request.
You could use the following code:
public function index()
{
    $user = Auth::user()->with('city')->get();
    $articles = $this->getArticlesForUser($user);

    return view('home', [
        'user' => $user
    ]);
}

public function getArticlesForUser(User $user){
  // Do something with $user
  return [];
}

public function delete()
{
    $user = Auth::user();
    $user->delete();

    return view('home');
}

If the goal is to have calculate the values once and use them at various places a singleton can be used:
<?php

class Settings {
    private $accessToken = '';
    private $items = [];

    private static $instance = null;

    protected function __construct(){}

    public static function getInstance(){
        if(static::$instance == null){
            static::$instance = static::buildInstance();
        }

        return static::$instance;
    }

    private static function buildInstance(){
        $instance = new Settings();
        $instance->accessToken = md5(rand(1,1000));
        $instance->items = [1,2,3];

        return $instance;
    }

    public function getToken(){
        return $this->accessToken;
    }
}

$settings = Settings::getInstance();
// Both return the same token because the instance is the same
var_dump($settings->getToken());
var_dump(Settings::getInstance()->getToken());

A: You should assign your properties in constructor like this
protected $user;

public function __construct()
    {
        $this->user = Auth::user();
    }

or through setters...
Edit
However in your case it's not a good idea please see https://laravel.com/docs/5.3/upgrade#5.3-session-in-constructors


text:
Q: trouble compiling my flipbookr Xaringan deck I am having trouble compiling my {flipbookr} deck. I'm able to run the template without problems, but I'm getting a blank file that will not advance when I knit my own.

If I remove the call to chunk_reveal() it works.
r chunk_reveal("cars", break_type = "auto")
As far as I can tell, the only thing I'm doing differently from the template (aside from shortening it), is to get external data in the setup chunk, and then working with that data in the chunk still named cars.
FYI, I posted an issue on the package github repo, but it's not clear to me whether something like this is a coding problem that a SO user could help me solve or a package issue the developer should see.
Here is an example based on the template that should reproduce the issue.
---
title: "The art of flipbooking"
subtitle: "With flipbookr and xaringan"
author: "Gina Reynolds, December 2019"
output:
  xaringan::moon_reader:
    lib_dir: libs
    css: [default, hygge, ninjutsu]
    nature:
      ratio: 16:10
      highlightStyle: github
      highlightLines: true
      countIncrementalSlides: false
---

```{r setup, include = F}
# This is the recommended set up for flipbooks
# you might think about setting cache to TRUE as you gain practice --- building flipbooks from scracth can be time consuming
knitr::opts_chunk$set(fig.width = 6, message = FALSE, warning = FALSE, comment = "", cache = FALSE, fig.retina = 3)
library(flipbookr)
library(tidyverse)

covid <- read.csv("https://raw.githubusercontent.com/nytimes/covid-19-data/master/us-counties.csv",
                  stringsAsFactors = FALSE)
```

# Using `flipbookr::chunk_reveal()`

You will use the `chunk_reveal()` function [inline](https://rmarkdown.rstudio.com/lesson-4.html) to generate the derivitive code chunks, rather than inside of a code chunk, so that the text that is generated is interpreted correctly when rendered.  The inline code will look something like this:

<!-- The above is for the html output version, just look at the examples below if you are in the source! -->
```markdown
``r "r chunk_reveal(chunk_name = \"cars\", break_type = \"user\")"``
```

There are several modalities that you might be interested in using for "flipbookifying" your code and the next section is dedicated to demoing some of them below.

- **break type** -- *which lines of code should be revealed when*, `break_type` defaults to "auto"
- **display type** -- *display code and output, or just output, or just code?*, `display_type` defaults to "both"
- **assignment type** -- *does code chunk use left assignment?*, `left_assign` defaults to FALSE

---

At first we'll apply our flipbooking to the below input code - the code chunk is named "cars".  For now I set echo = TRUE for this code chunk, so you can see the code content but sometimes you might like to set echo to FALSE. This code uses tidyverse tools, so we loaded that too in the "setup" code chunk at the beginning of the template.

```{r cars, include = FALSE}
covid %>%
  filter(state!="District of Columbia" &
           state!="Puerto Rico" &
           state!="Hawaii" &
           state!="Alaska") %>%
  select(date, fips, cases, deaths) %>%
  mutate(date = lubridate::ymd(date)) %>%
  mutate(fips = stringr::str_pad(fips, width=5, pad="0")) %>%
  mutate(month = lubridate::month(date,
                                  label=TRUE,
                                  abbr=TRUE),
         day = lubridate::day(date),
         monthDay = paste(month, day, sep=" "))
```

---

# `break_type`

Notice the regular comments and the special #BREAK comments, these will be used for a couple of the different "break type" modalities.

```{r, code = knitr::knit_code$get("cars"), eval = FALSE, echo = TRUE}
```

<!-- Also notice how we've created a new code chunk with the code from the previous chunk by calling knitr::knit_code$get("cars"). -->
<!-- This slide is also about giving you some intuition about how flipbooking works in the background. -->
<!-- (more on this [here](https://emitanaka.rbind.io/post/knitr-knitr-code/)) -->

---

## break_type = "auto"

One parameter of flipbooking is the break_type.  The default is "auto", in which appropriate breakpoints are determined automatically --- by finding where parentheses are balanced.

<!-- display the user input code as a refresher -->
```{r, code = knitr::knit_code$get("cars"), eval = FALSE, echo = TRUE}
```

---

`r chunk_reveal("cars", break_type = "auto")`

---

```{css, eval = TRUE, echo = FALSE}
.remark-code{line-height: 1.5; font-size: 80%}
```

A: The package developer suggested I try adding tibble() %>% after covid %>% in the "cars" chunk because the covid dataset is large. It still failed with:
covid %>%
tibble() %>%
...

but worked with
covid %>% tibble() %>%
...


text:
Q: Некорректно работает parse_dates в pd.read_excel() Открываю Excel файл следующим образом:
with gzip.open('new.xlsx.gz') as a:
    excel_file = pd.read_excel(a, sheet_name = 'Sheet', skiprows=range(0,2), parse_dates=["Unnamed: 0"])
excel_dates = pd.to_datetime(excel_file["Unnamed: 0"],errors="coerce").dt.floor("D").unique()
print(excel_dates)
print(excel_file.head(10))
print(excel_file.info())

Результат print(excel_dates):
    ['2020-11-14T00:00:00.000000000']
# и это все, строчек должно быть 100K +

Ожидаемый результат такой:
 2020-11-14
 2020-11-14
 2020-11-14

Результат print(excel_file.head(10)):
 Unnamed: 0
0 2020-11-14 00:00:00
1 2020-11-14 00:00:00
2 2020-11-14 00:00:00

Результат print(excel_file.info()):
0   Unnamed: 0                      234374 non-null  datetime64[ns]

Как правильно парсить даты? Их нужно сравнивать на совпадение с такими датами:
 2020-08-09
 2020-08-15
 2020-10-25
 2020-08-29
 2020-10-11

Вот фрагмент данных, который скопирован c реальных данных.
Дополнение: При таком коде:
with gzip.open('new.xlsx.gz') as a:
            excel_file = pd.read_excel(a, sheet_name = 'Sheet', skiprows=[0,2], parse_dates=[0])
            excel_dates = pd.to_datetime(excel_file["Название столбца"],errors="coerce").dt.floor("D").unique()

И когда хочу напечатать print(excel_dates.info()):
Выходит ошибка:
print(excel_dates.info())
AttributeError: 'numpy.ndarray' object has no attribute 'info'

A: Судя по примеру данных, строки с индексами 0 и 2 нужно пропустить:
df = pd.read_excel("/path/to/test.xlsx", skiprows=[0,2], parse_dates=[0])

результат:
In [165]: df
Out[165]:
  Period start time    Name_2    Name_3  Name_4  Name_5  Name_6  Name_7  Name_8  Name_9  Name_10  Name_11  Name_12  ...  Name_21  Name_22  Name_23  Name_24  Name_25  Name_26  Name_27  Name_28  Name_29  Name_30  Name_31  Name_32
0        2020-11-14  dgdt68bg  edrt5464  rte544    0.64    0.65    0.46    0.49    0.57     0.96     0.20     0.92  ...     0.15     0.94     0.53     0.13     0.80     0.57     0.56     0.36     0.35     0.30     0.69     0.13
1        2020-11-14   sfsfe35     ew454  st43wt    0.24    0.48    0.37    0.05    0.87     0.94     0.28     0.41  ...     0.91     0.28     0.50     0.46     0.11     0.68     0.01     0.46     0.03     0.74     0.29     0.34
2        2020-11-14  sget4454  35353wfe  et3453    0.33    0.67    0.04    0.25    0.57     0.54     0.75     0.84  ...     0.07     0.19     0.05     0.61     0.62     0.27     0.99     0.15     0.10     0.48     0.25     0.01

[3 rows x 32 columns]

In [166]: df.info()
<class 'pandas.core.frame.DataFrame'>
RangeIndex: 3 entries, 0 to 2
Data columns (total 32 columns):
 #   Column             Non-Null Count  Dtype
---  ------             --------------  -----
 0   Period start time  3 non-null      datetime64[ns]
 1   Name_2             3 non-null      object
 2   Name_3             3 non-null      object
 3   Name_4             3 non-null      object
 4   Name_5             3 non-null      float64
 5   Name_6             3 non-null      float64
 6   Name_7             3 non-null      float64
 7   Name_8             3 non-null      float64
 8   Name_9             3 non-null      float64
 9   Name_10            3 non-null      float64
 10  Name_11            3 non-null      float64
 11  Name_12            3 non-null      float64
 12  Name_13            3 non-null      float64
 13  Name_14            3 non-null      float64
 14  Name_15            3 non-null      float64
 15  Name_16            3 non-null      float64
 16  Name_17            3 non-null      float64
 17  Name_18            3 non-null      float64
 18  Name_19            3 non-null      float64
 19  Name_20            3 non-null      float64
 20  Name_21            3 non-null      float64
 21  Name_22            3 non-null      float64
 22  Name_23            3 non-null      float64
 23  Name_24            3 non-null      float64
 24  Name_25            3 non-null      float64
 25  Name_26            3 non-null      float64
 26  Name_27            3 non-null      float64
 27  Name_28            3 non-null      float64
 28  Name_29            3 non-null      float64
 29  Name_30            3 non-null      float64
 30  Name_31            3 non-null      float64
 31  Name_32            3 non-null      float64
dtypes: datetime64[ns](1), float64(28), object(3)
memory usage: 896.0+ bytes

A: Если исходить из дополнительной информации, полученной из комментариев, основная проблема в том как преобразовать Numpy вектор в Pandas.Series:
excel_dates = pd.to_datetime(excel_file["Unnamed: 0"],errors="coerce").dt.floor("D").unique()
excel_dates = pd.Series(excel_dates)


text:
Q: Why my function doesnt work I have a link in to the title attribute in a div like this -
<div class="tooltip" title="send"><img src="<?php echo "admin/".$item['img'] ?>" width="70" height="70"  />

and I have a function in jquery that name is ersal()

but when I click to link send my function doesn't work why?

A: Your HTML code should be like this-

  <img src="<?php echo "admin/".$item['img'] ?>" width="70" height="70"  />

For handling click event, you should use onclick property and the value for it can be javascript code or any javascript function call. The syntax can be given like this -
<element onclick="Somejavascriptcode">

A: For handling hover event, you should use this code:
HTML CODE:

  <img src="<?php echo "admin/".$item['img'] ?>" width="70" height="70"  />

JS CODE:
$(document).ready(function() {
 var c = $(document);
 c.on("mouseenter",".tooltip",function(){ alert("Clicked!"); });
});

A: You can't add an url in the title attribute.
Try like that, for example :

  <img src="<?php echo 'admin/'.$item['img'] ?>" width="70" height="70" />

And your jQuery should be :
$('#my-link').click(function(){
    alert('clicked');
});

Or :
$('#my-link').click(function(){
    ersal();
});

function ersal(){
    alert('clicked');
}


text:
Q: Comparison of Global and Local object in jQuery In jQuery, I am comparing two objects. One is global and the other is local objects. If both are not same then and then I want to update UI otherwise not. I am comparing these two at every 3 second interval. The data in the object are coming from file written by firmware program at unknown interval.
In normal case(firmware program is started first and then I open UI window), I have compared these two and getting result what I want, tested well. The problem is coming when The UI is open in chrome already and then I start/restart firmware program. Its every time giving "not same". I manually varified, both are same.
var prev_status = $();   //global object

function load_ui(){
    //some code here
}

function ReadFile(){
    //some ajax code
}

function WriteFile(){
    //some ajax code
}

setInterval(function(){
    ReadFile(devPublishedUrl, function(status){
        console.log(prev_status, status);      //local object: status
        if (JSON.stringify(prev_status) === JSON.stringify(status)){
            console.log('same');
        }
        else{
            console.log('not same');
            load_ui();
            for(var index in status){
                prev_status[index] = status[index];
            }
        }
    });
},  3000);

What's wrong here? I don't want to update UI at every 3 second without change. The data in local object is given below.
{
    "schedule":0,
    "sys":[
        0,
        0,
        0
    ],
    "temp":[
        106,
        32,
        33,
        1645,
        30,
        33,
        1642,
        33,
        30,
        104,
        33
    ],
    "end":[
        0,
        0
    ],
    "fault":[
        0,
        0
    ],
    "ssb":[
        0,
        0
    ],
    "sse":[
        0,
        0
    ],
    "fuel":[
        158,
        193
    ],
    "temp_th":[
        120,
        98
    ]
}


text:
Q: Using "could" for future events We use could to show that something is possible in the future, but not certain:

If we don't hurry we could be late. (i.e., perhaps/maybe we will be late)

Why is it incorrect to say this:

I couldn't be present tomorrow'? (i.e., Perhaps I won't be here tomorrow).

A: Firstly, it's correct to say I couldn't be present tomorrow, but only if the pragmatic context makes sense for the listener. It will not fly as an example sentence in an English class because these tend to have "out of the blue" background information, and some modal expressions require background information to be felicitous.
When the modal verb is in its preterite form, it expresses remoteness rather than past time. The only different in meaning between I can't be present tomorrow and I couldn't be present tomorrow is that in the first case, the speaker's presence is not negotiable. In the second case, it could be that they are open to incentives, or that they are trying to dissuade the listener from formally asking them to be present.

A: Consider using "might not":
"I might not be present tomorrow."
"could not" is almost always found in sentences in the past tense with a completely different meaning to the verb:
"I could not complete the task."as a substitute for:"I was not able to complete the task."

A: In normal circumstances, people will say "I won't be able to be present tomorrow."
"I couldn't be present tomorrow" can only be interpreted as "I wouldn't be able to be present tomorrow(due to an implied condition).


text:
Q: Xcode distribution: Getting The operation couldn't be completed. (OSStatus error -67028.) This is what I get when trying to distribute with AdHoc profile.  (Xcode 5.1.1)
I cannot find what this code stands for.
Any help?

A: I've found a simple solution.
i don't know the very reason, but in my case, the HockeyApp SDK was the culprite of the issue.
The cure consist of removing the reference from the project explorer and to "Add files…" again: don't copy files as they already exist, and check the create groups (not create folders).
Clean and Archive again, and voilà!


text:
Q: ejs - include a file from a subfolder file My main template folder is views. Inside of that I have another folder called _layouts where I have header.ejsand admin_header.ejs.
so if i have a file inside the views folder, say index.ejs, I can easily include the files from _layouts by doing e.g.
<% include _layouts/header %>

But now I have made another subfolder inside of the views folder called admin, and I have admin.ejs in there, but I can't include files from _layouts anymore.
I've tried <% include _layouts/admin_header %> and <% include ../_layouts/admin_header %>
In both cases I get:
failed to open views\admin\_layouts\admin_header.ejs

is there a way to include files from _layouts in a file that is in another subfolder?

A: Maybe you have to  setting some paths in your route file. Try this, works for me:
app.set('views', [path.join(__dirname, 'views'),
                  path.join(__dirname, 'views/your_another_folder/')]);

So, inside your template you can call your files, like this:
'<%- include partials/folter/file %>'


text:
Q: Diretiva não funciona com propriedades dinâmicas Opa, galera. Estou desenvolvendo umas diretivas customizadas por aqui, e elas precisam ter propriedades adicionadas de forma flexível (tipo um ng-class). Consegui desenvolver o mecanismo para fazer isso, contudo, me deparei com um problema bizarro: ele adiciona a propriedade mas a mesma não faz efeito algum
Estou testando com as libs angular-input-masks e ui-mask. A minha diretiva adiciona corretamente os atributos, porém, os mesmos não fazem efeito.
Particularmente, acredito que isso é algum problema de tempo de script ou algo do gênero. O que reforça esse meu pensamento é que quando eu adiciono os atributos direto no template html, funciona.
Já tentei usar $scope.$apply(), mas deu ruim :(.
Teste: https://plnkr.co/edit/Ae7oABrzAACjr9NDYLhK?p=preview
Desde já agradeço.
Diretiva de propriedades dinâmicas
app.directive('mdiAttrs', function() {
    return {
        restrict: 'A',
        replace: true,
        link: (scope, elem) => {
            let attrs = scope.mdiCustomProperties || {};

            Object.keys(attrs).forEach(attrKey => elem.attr(attrKey, attrs[attrKey]));
        }
    };
});

Diretiva do Input
app.directive('mdiInput', () => {
    return {
        restrict: 'E',
        replace: true,
        templateUrl: 'templates/mdi-input.html',
        scope: (() => {
            const inputScope = angular.copy(directiveScopeModel);

            inputScope.mdiType = '@?';
            inputScope.mdiPlaceholder = '@?';
            inputScope.mdiTitle = '@?';

            return inputScope;
        })(),
        controller: $scope => {
            $scope.isLoading = false;
            $scope.mdiType = $scope.mdiType || 'text';
        }
    }
});

Template

    {{mdiLabel}}
    <input type="{{mdiType}}"
        class="mdi-component"
        ng-model="mdiModel"
        ng-click="mdiClick(this)"
        ng-blur="mdiBlur(this)"
        ng-class="{'loading': isLoading}"
        ng-disabled="isLoading"
        placeholder="{{mdiPlaceholder}}"
        ng-required="mdiRequired"
        title="{{mdiTitle}}"
        mdi-attrs="mdiCustomProperties">

Chamada da diretiva
<mdi-input mdi-model="mdiInputModel"
        mdi-blur="doRequest"
        mdi-label="MDI Input Directive"
        mdi-custom-properties="{'ui-mask': '(999) 999-9999'}"
        mdi-required="true">
 </mdi-input>


text:
Q: Permission Denial: getCurrentUser() from pid=31277, uid=10259 requires android.permission.INTERACT_ACROSS_USERS Manifest File
<manifest
xmlns:android="http://schemas.android.com/apk/res/android" package="__PACKAGE__" android:versionCode="10000" android:versionName="1.0.0">
<supports-screens android:smallScreens="true" android:normalScreens="true" android:largeScreens="true" android:xlargeScreens="true" />
<uses-sdk android:minSdkVersion="21" android:targetSdkVersion="__APILEVEL__" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
<application android:name="com.tns.NativeScriptApplication" android:allowBackup="true" android:icon="@drawable/icon" android:label="@string/app_name" android:theme="@style/AppTheme">
    <activity android:name="com.tns.NativeScriptActivity" android:label="@string/title_activity_kimera" android:configChanges="keyboardHidden|orientation|screenSize" android:theme="@style/LaunchScreenTheme">
        <meta-data android:name="SET_THEME_ON_LAUNCH" android:resource="@style/AppTheme" />
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />
            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>
    <activity android:name="com.tns.ErrorReportActivity" />
</application>

device
Galaxy s9 plus
Steps to reproduce
rm -rf platforms
tns run android --bundle
when the application launch it gives the following error
*issue**
System.err: java.lang.SecurityException: Permission Denial: getCurrentUser() from pid=31277, uid=10259 requires android.permission.INTERACT_ACROSS_USERS
System.err:     at android.os.Parcel.readException(Parcel.java:1967)
System.err:     at android.os.Parcel.readException(Parcel.java:1913)
System.err:     at android.sec.clipboard.IClipboardService$Stub$Proxy.isEnabled(IClipboardService.java:757)
System.err:     at com.samsung.android.content.clipboard.SemClipboardManager.isEnabled(SemClipboardManager.java:1008)
System.err:     at android.widget.TextView.getSecClipboardEnabled(TextView.java:16134)
System.err:     at android.widget.EditText.onFocusChanged(EditText.java:250)
..........


text:
Q: How to design a foreach(){...} not to fail on a "could not find function readWave" error? I am trying to read multiple .WAV files, using a readWave() function, for processing.
It was all working fine, till I imported each .WAV file sequentially, and then processed them one by one. But, while trying to make it run in a parallel mode of execution, I tried to use foreach(){...} and ran the code. It says

Error in { : task 1 failed - "could not find function "readWave""

Can anyone help here please?
There was no other change than for changing to foreach.
foreach ( i = 1:nfiles, combine = cbind ) %dopar% {
                               input_file_name = filist[1]
   input_wave_file = readWave( input_file_name )
   Preprocessing(              input_file_name ) # this is my later defined fun()
}

A: This kind of error message nearly always means that you need to use the foreach .packages option (to make the workers load a package) or the .export option (to send a local function to the workers). In this case, the workers probably need to load the tuneR package which defines the readWave function:
foreach (i=1:nfiles, combine=cbind, .packages='tuneR') %dopar% {
  input_file_name = filist[1]
  input_wave_file = readWave(input_file_name )
  Preprocessing(input_file_name)
}


text:
Q: jquery shorthand for find() statement I have a super simple question, instead of doing something like this:
$(".one").click(function() {
    $(this).find('.two').find('.three').css...
});

with this HTML:

is there a short hand where you can skip the word find in some way?

A: $('#one #two #three')

But remember that ID in a page is supposed to be unique
So $('#three').css() should be sufficient
It makes sense when the elements are either class elements or tagNames
$('.one .two .three') <--
$('div span p')       <--  These are fine

All these should work
// Using find to target the class
$(this).find('.two').find('.three').css('border', '1px dashed red');
// Using find to target the class
$(this).find('.two .three').css('border', '1px dashed red');
// Using the this context
$('.two .three',this).css('border', '1px dashed red');
// Using the this context and immediate children
$('> .two > .three',this).css('border', '1px dashed red');

> will only get the immediate children . The other 2 are using this as a context
Check Fiddle

A: Use the selector context http://api.jquery.com/jQuery/#jQuery1
$(".one").on('click', function() {
    $('.three', this).css...
});

Its the simplest way to go about it.

also
$(".one").click(function() {
    $(this).find('.three').css...
});

would work fine, you don't have to traverse every step.


text:
Q: Beraha numbers and zeros of the chromatic polynomial of planar graphs Question: What is the largest Beraha number known to be an accumulation point of real zeros of the chromatic polynomial of planar graphs?
Background:
The Beraha numbers $B_n=2+2cos(2\pi/n), n=2,3,\ldots$ are well known in the study of the chromatic polynomial of planar triangulations, and more generally of planar graphs. Early results in the subject are due to W.T. Tutte: "On chromatic polynomials and the golden ratio" (J. Combinatorial Theory 9 (1970) 289–296) gave a bound on the value of the chromatic polynomial at $B_5={\phi}+1$, where $\phi$ is the golden ratio; "More about chromatic polynomials and the golden ratio" (1970 Combinatorial Structures and their Applications, 439–453) established the famous Tutte's golden identity.
My question concerns the observation of S. Beraha ("Infinite non-trivial families of maps and chromials", Thesis, Johns Hopkins University, 1975) that zeros of the chromatic polynomial of large planar graphs seem to accumulate to the numbers $B_n$. (The special role played by the Beraha numbers was also illustrated in the paper http://arxiv.org/abs/0711.0016 which gave a local relation satisfied by the chromatic polynomial of planar graphs at each $B_n$.)
There are different ways to interpret Beraha's conjecture; my question concerns accumulation points of real zeros.
In "Limits of chromatic zeros of some families of maps" (J. Combin. Theory Ser. B 28 (1980), 52–65) S. Beraha, J. Kahane and N.J. Weiss gave examples of (periodic) graphs where $B_5$ and $B_7$ are accumulation points.
I am wondering whether there are higher Beraha numbers that are also known to be accumulation points of real zeros. A more precise question concerns periodic graphs, like the ones considered by Beraha-Kahane-Weiss. Is there a conjecture one way or another?
[It is known (G.F. Royle, "Planar triangulations with real chromatic roots arbitrarily close to four", Ann. Comb. 12 (2008), 195–210) that there are graphs for which real zeros accumulate to 4, although I believe these examples are not "periodic". Also, the chromatic polynomial has been studied for various families of planar graphs in the context of statistical mechanics; I do not know whether this exhibited $B_n$, $n>7$ as accumulation points.]

A: I don't think that there are known families of graphs with (real) chromatic roots converging to particular Beraha numbers.
Alan Sokal and Jesus Salas wrote a series of papers, the first of which is titled "Transfer Matrices and Partition-Function Zeros for Antiferromagnetic Potts Models I. General Theory and Square-Lattice Chromatic Polynomial" (http://arxiv.org/abs/cond-mat/0004330) where they claim evidence that certain families have roots converging to $B_2$, $B_3$, $\ldots$, $B_5$.
One intriguing leftover from their paper is that they can show that despite the likelihood that they are accumulation points of roots, no Beraha numbers are actually chromatic roots themselves - except possibly $B_{10}$. (I've looked quite hard to find a chromatic polynomial with $B_{10}$ as a root, but with no luck.)
The graphs that I used in the paper of mine that you quoted were actually just modifications of the original family of graphs used by Beraha-Kahane in their famous paper "Is the four-color conjecture almost false?" So while I am not sure what you mean by periodic, I'm pretty sure that if the graphs they used are periodic, then so are the graphs that I used.
(One problem is that statistical physicists working with strips of lattices have to make some decision about the "edges" of their lattice; if they "wrap-round" so that the left-hand edge is identified with the right-hand edge, then they call that "periodic boundary conditions." But I don't think that that is the meaning you had in mind?)

A: It has recently been shown by Harvey and Royle (https://research-repository.uwa.edu.au/en/publications/chromatic-roots-at-2-and-the-beraha-number-bsub10sub) that $B_{10}$ is the largest Beraha number that appears as a root of a chromatic polynomial. $B_{10}$ is the largest Beraha number whose minimal polynomial has no roots in the forbidden intervals. Harvey and Royle found a couple examples of graphs with chromatic polynomials that have $B_10$ as a root. I am not sure if larger ones can appear as accumulation points however.


text:
Q: Pthread scheduling FIFO, RR mixed results We are trying to analyze the effect of different schedule algorithms on a Ubuntu system for Pthreads. We create several (1,2, 4) threads and let them run on 1, 2 or 4 CPU's. Each thread is a for loop with 1 mathematical operation. 1 threads takes several seconds to finish.
When starting 2 threads on 1 CPU with FIFO they finish a great amount of time apart (logical, FIFO finishes the first created thread first). For RR they finish closer together (half a second difference in some cases). This is al as expected. Now we run each test 10 times and about 1/3rd of the measurements takes half as long as other. We measure the time for all threads to finish. So on 1 CPU we wait for 2 threads to finish. RR or FIFO makes little difference. But running the test multiple times can give you about 6s for 2 or 3 times and about 12s for 5 or 6 times. The extraordinary thing is that there are no occasions where the program finished around 9 or 10 seconds. Its or between 5 and 6 or between 11 and 13. We did these measurements for 4,2,1 threads on 4, 2 ,1 CPU('s). FIFO and RR. Priority has been set both to 0 and to 99 (real-time). No heavy application was using the CPU. on the used core more than 97% of the CPU time went to threads spawned by our program.
When using SCHED_OTHER we have no such phenomenon.
Has anyone got an explanation for this behavior?
It's hard to see how many context switches happen. For FIFO the amount of context switches should be close to 0 and for RR this should be a lot larger but still hardly affecting the total execution time. For SCHED_OTHER I'm guessing the most context switches but I'm not entirely sure.
Another interesting fact is that the total execution time for OTHER is more or less the same as the short time for FIFO with the same amount of threads and CPU's. So FIFO is sometimes as fast as OTHER but sometimes takes double the time.
Regards,
Roel Storms


text:
Q: Is it possible to automate Cypress with Microsoft Login Authentication? I'm currently attempting to automate our webpage, however before accessing our page the user is redirected to www.login.microsoftonline.com to enter a username, password and authentication token sent my SMS. Once entered successfully, the user is redirected to our webpage.
I've read multiple articles although struggling to find any help or strong code references.
E.g. of our workflow:

*

*User visits www.example.com

*User is redirected to www.login.microsoftonline.com

*User enters username, password and authentication token

*User is redirected to www.example.com

Currently when trying to execute the following code, cypress shows:
login.microsoftonline.com refused to connect

describe('Test', function() {
  it('My Test', function() {
    cy.request('POST', 'https://login.microsoftonline.com'),
    {
      auth: {
        username: 'myUsername' ,
        password: 'myPassword'
      }
    }
    cy.visit('https://example.com')
    cy.wait(2000)
    cy.contains('Text I expect')
  })
})

Any help would be appreciated, thank you.


text:
Q: Get List Values in JavaScript Remoting Hi folks,
          Can anyone tell me how to get the list of account names in visualforce page using java script remoting?
Below is my code
Visualforce.remoting.Manager.invokeAction(
        '{!$RemoteAction.AccController.getAccountList}',

        function(result, event) {
            if (event.status) {
                var ListVariable = '"//I dono how to get the list in javascript"

            }
        );

//Controller
@RemoteAction
 global static List<Account> getAccountList(){
      List<Account> accList=[select id,Name from account];
      return accList;
}

A: That's quite clearly explained in the documentation. Do you understand the code you've written ?
Visualforce.remoting.Manager.invokeAction(
        '{!$RemoteAction.AccController.getAccountList}',
        function(result, event) {
            if (event.status) {
                var ListVariable = '"//I dono how to get the list in javascript"

            }
        );

The fully qualified remote action is a string that represents the
  complete path to the remote action method, including namespace, base
  class, and so on:
  namespace[.BaseClass][.ContainingClass].ConcreteClass.Method. Use
  $RemoteAction in an expression to automatically resolve the namespace,
  for example {!$RemoteAction.MyController.getAccount}.
Invocation parameters are the arguments used to perform the remote
  method invocation, and are the same arguments used to make a standard
  remoting call:

*

*The parameters to send to the @RemoteAction method, if any.

*The callback function, which handles the returned result.

*Configuration details for the invocation, if any.

The second bulletpoint is the answer here, you're written the callback which has 2 parameters :

Your callback function will receive as parameters an event object
  representing the status of the remote call, and the result object
  returned by the remote Apex method.
Apex primitive data types returned by result—such as strings or
  numbers—are converted to their JavaScript equivalents. Apex objects
  that are returned are converted to JavaScript objects, while
  collections are converted to a JavaScript array. Keep in mind that
  JavaScript is case-sensitive, so id, Id, and ID are considered
  different fields.

So if your remote apex method returns a List<sObject>,  the result parameter/variable in your JS will be an JS array containing those objects in JS objects. Basically:
var ListVariable =  result;

So there's also no real need to use an additional variable unless you consider that easier to understand and maintain.


text:
Q: Flutter: how to set the height of a dropdown in Flutter I have a dropdown list in my flutter app that has about 30 items in it. When it is selected  I see the values but it takes up whole screen.
How can I control the height of the selected list so that it does not overlay the entire screen (maybe show 10 items with a scroll)
Here is my code
 Widget buildCategoryFormField(candidateModel) {
    return Column(
      crossAxisAlignment: CrossAxisAlignment.start,
      children: <Widget>[
        Text("Job category"),
        SizedBox(
          height: 5,
        ),
        FormField(
          builder: (FormFieldState state) {
            return InputDecorator(
              decoration: InputDecoration(
                border: OutlineInputBorder(
                  borderSide: BorderSide(
                    color: Colors.grey,
                  ),
                ),
                enabledBorder: OutlineInputBorder(
                  borderSide: BorderSide(
                    color: Colors.grey,
                  ),
                ),
                focusedBorder: OutlineInputBorder(
                  borderSide: BorderSide(
                    color: Colors.blue,
                  ),
                ),
                // hintText: "firstname *",
                // labelText: "job category",
                errorText: state.hasError ? state.errorText : null,
                labelStyle: TextStyle(
                  color: Colors.grey,
                ),
              ),
              isEmpty: _selectedjobCategory == '',
              child: new DropdownButtonHideUnderline(
                child: new DropdownButton(
                  style: TextStyle(fontSize: 18, color: Palette.GREY),
                  value: _selectedjobCategory,
                  isDense: true,
                  onChanged: (String newValue) {
                    setState(() {
                      _selectedjobCategory = newValue;
                      state.didChange(newValue);
                    });
                  },
                  items: JOB_CATEGORY.map((String value) {
                    return new DropdownMenuItem(
                      value: value,
                      child: new Text(value),
                    );
                  }).toList(),
                ),
              ),
            );
          },
          validator: (val) => validateJobCategory(val),
        ),
      ],
    );
  }

A: You can define menuMaxHeight on DropdownButton to set maximum height of the expanded dropdown list items.
Expanded(
  /// LayoutBuilder can be used to fetch the parent widget's dimensions
  child: LayoutBuilder(builder: (context, constraints) {
    return Center(
      child: DropdownButton<String>(
        /// Set dropdown list max height
        menuMaxHeight: constraints.maxHeight,
        value: dropdownValue,
        items: dropdownItems,
      ),
    );
  }
)

Adding pagination to the dropdown list is feasible, but this will require creating a custom DropdownButton class. Design-wise, it would be better to break the list into smaller chunks (i.e. by categories) if you'll need to display >50 items in the dropdown.


text:
Q: Using Spring how do I get contents of HttpServletResponse in postHandle interceptor and in case of error redirect All my controllers return JSON response. As part of post handling how do I examine contents of JSON response and in case of errors how do I redirect. Thanks for your help.

A: The JSON operations in Spring are based on MappingJacksonHttpMessageConverter. If you want to log the result, extend it and override the write method OR use an aspect on this method:
@Aspect
 public class MyLogger {

   @Pointcut("execution(org.springframework.http.converter.AbstractHttpMessageConverter.write(..))")
   public void myPointCut() { }

   @AfterReturning(pointcut="myPointCut()",returning="result")
   public void logMethodEntry(JoinPoint jp) {
      ...
   }

}

To manage erors, you can use the ExceptionHandler annotation on your methods/classes:
@ExceptionHandler(YourException.class)
@ResponseStatus(value = HttpStatus.NOT_FOUND)
public Map<String, String> notFoundHandler(Exception e){
    return ...;
}

I hope this will help ;)


text:
Q: Trouble finding the level curves of $f(x,y)=\frac{2x}{x^2+y^2}$ I am trying to find the level curves of $f(x,y) = \frac{2x}{x^2+y^2}$ for $f(x,y) = {-1,0,1}$.
I can not find examples in Stewart Calculus for rational equations.
Any help would be greatly appreciated.

A: We have that
$$\frac{2x}{x^2+y^2}=k \implies x^2+y^2-\frac2kx=0 \implies \left(x-\frac1k\right)^2+y^2=\frac1{k^2}$$
which is a circle centered at $\left(\frac1k, 0\right)$ with radius $R=\frac1{|k|}$.

A: In polar coordinates,
$$2r\cos\theta=lr^2$$ or
$$r=\frac2l\cos\theta.$$
This is a family of homothetic circles through the origin.
The case $l=0$ is degenerate as the axis $x=0$.


text:
Q: How to reset value of form which is rendered by Api response via javascript I have a form which is rendered by using html string from api response, jQuery is only able to bind element which are ready when page is loaded, in order to bind on dynamic tag, it should use code like
$(document).on(EVENT_NAME, element, function(){})

However, reset is not an event, so can't bind the reset function.
I have tried to bind reset function to a click event, and trigger click by
$('from').trigger('click')
Doesn't work
So how can I reset value for dynamically generated form


text:
Q: AutoMapper not mapping correctly when same type I got a problem with the AutoMapper (3.1.1 on .NET 4.5) library is very strange, i will appreciate your help.
I got four objects:
public class UserDetail
{
    public int Salary { get; set; }
    public Address House { get; set; }
    public Address Office { get; set; }
}

public class UserDetailEntity
{
    public int Salary { get; set; }
    public Guid HouseId { get; set; }
    public Guid? OfficeId { get; set; }
    public virtual AddressEntity House { get; set; }
    public virtual AddressEntity Office { get; set; }
}

public class Address
{
    public string Street { get; set; }
}

public class AddressEntity
{
    public string Street { get; set; }
}

And with this scenario:
Mapper.CreateMap<Address, AddressEntity>();
Mapper.CreateMap<UserDetail, UserDetailEntity>()
    .ForMember("Office", s => s.MapFrom(ud => ud.Office));

UserDetailEntity entity = Mapper.Map<UserDetail, UserDetailEntity>(dto);

Assert.AreEqual(dto.House.Street, entity.House.Street);
Assert.AreEqual(dto.Office.Street, entity.Office.Street);

The Assert fails in the office address I always get the House address :(
Thank you!

A: Finally I solve the problem, AutoMapper uses the GetHashCode to determine if two objects are the same, and as I override this method, on this scenario the hashcode is the same.


text:
Q: Can't get sample J2EE application working with ibmsbt on Tomcat 7 server I'm following this guideline to get started with IBM Social Business ToolKit:
https://www.ibmdw.net/social/getting-started-as-java-developer/
And trying to get communities listed (/myapp.contextroot/GetMyCommunity.jsp)
I'm getting a response (application/javascript):
if(typeof _sbt=='undefined' || window._sbt_bridge_compat)
{_sbt=0;
    if(typeof define=='undefined'){
        dojo.registerModulePath('sbt','http://localhost:8080/sbt/js/sdk/sbt');
        dojo.registerModulePath('sbt._bridge','http://localhost:8080/sbt/js/sdk/_bridges/dojo');
        dojo.registerModulePath('sbt.widget','http://localhost:8080/sbt/js/sdk/dojo');
        dojo.require('sbt._bridge.amdcompat');
    }
         else {
            dojo.registerModulePath('sbt','http://localhost:8080/sbt/js/sdk/sbt');
            dojo.registerModulePath('sbt/_bridge','http://localhost:8080/sbt/js/sdk/_bridges/dojo-amd');
            dojo.registerModulePath('sbt/widget','http://localhost:8080/sbt/js/sdk/dojo2');
         }

            define('sbt/config',['sbt/ErrorTransport','sbt/Endpoint'],
                function(ErrorTransport,Endpoint){
                    window.sbt = {};
                    sbt.Properties={"libraryUrl":"http:\/\/localhost:8080\/social.helloworld\/library","serviceUrl":"http:\/\/localhost:8080\/social.helloworld\/service","sbtUrl":"http:\/\/localhost:8080\/sbt\/js\/sdk"};
                    sbt.Endpoints={
                        'sametime':new Endpoint({"invalid":"true","transport":new ErrorTransport('sametime','Required endpoint is not available: sametime')}),
                        'domino':new Endpoint({"invalid":"true","transport":new ErrorTransport('domino','Required endpoint is not available: domino')}),
                        'smartcloud':new Endpoint({"invalid":"true","transport":new ErrorTransport('smartcloud','Required endpoint is not available: smartcloud')}),
                        'connections':new Endpoint({"invalid":"true","transport":new ErrorTransport('connections','Required endpoint is not available: connections')})};
                    return sbt;
                }
                );
 }

It seems I need to configure JS runtime somehow. Am I right?
and
At point #8 in guideline document said to create the file managed-beans.xml in the WebContent\WEB-INF folder. Should it be empty? How to configure it?
FYI: com.ibm.sbt.sample.web works against own IBM Connections installation like a charm.
Using:

*

*sbtsdk-1.0.0.20130603-0843

*preconfigured apache-tomcat-7.0.30

*eclipse Juno (for EE developers)

*IBM Connection 4 on own server

UPDATE: I wrote to ibmsbt teem about that mistake and it was corrected. So, now there is no errors in that tutorial. Go ahead!

A: I think the cause of the problem is there is a mistake in the documentation in point #5. The url pattern for the library servlet is /library/* instead of /*.
If this does not resolve the problem, can you point me the code of the GetMyCommunity.jsp ? That will give me a better idea of the reason of the problem.
For managed-beans.xml, you need to populate the endpoint and environment configurations in the file. As a reference, you can refer to a sample file that is used by com.ibm.sbt.sample.web application. Go to sbtsdk\samples\war\sbt.sample.web\WEB-INF in the SDK build. You would need to expand the sbt.sample.web application. Note that the variable %{connections.url} in the "connections" endpoint can be replaced with the URL to your own connections instance, or you can modify the value for the variable connections.url in the file sbt.properties.
Also here a link which gives more information on managed-beans.xml
http://www-10.lotus.com/ldd/appdevwiki.nsf/xpDocViewer.xsp?lookupName=IBM+Social+Business+Toolkit+SDK+documentation#action=openDocument&res_title=Connecting_to_other_systems_SDK1.0&content=pdcontent
Hope this resolves your problem


text:
Q: How to limit database call to a random number to random number plus five? I needed a random number limit to be 1-90, inclusive. So whatever random number I get to current random number + 5.
$query2 = $xxx->query("SELECT * FROM tablename ORDER BY tableid LIMIT FLOOR(RAND() * 90)  + 1, (FLOOR(RAND() * 90)  + 1) + 5");

A: There is no reason to call RAND() twice.
As limit says:

With two arguments, the first argument specifies the offset of the first row to return, and the second specifies the maximum number of rows to return. The offset of the initial row is 0 (not 1):

i.e.
LIMIT offset, max rows

So you can just do
LIMIT FLOOR(RAND() * 90) + 1, 5

Also considering that offset is zero-based, are you sure you want 1-90 and not 0-90?

It is also possible to generate the number php-size
$rand = rand(1, 90);
// if your $xxx->query supports positional parameters
$query2 = $xxx->query('SELECT ... LIMIT ?,?', $rand, $rand + 5);
// or without it
$query2 = $xxx->query(sprintf('SELECT ... LIMIT %d,%d', $rand, $rand + 5));


text:
Q: Summarized the resultset like following in SQL Server 2005 I have a table as
ID,      Name  ,  atricle , price
1  |     ajit |   phone |   20
2  |     arif |   phone |   30
3  |     arun |   mobile |   50
4  |     sandy |   mobile |   70
5  |     rocky |   car|   100

I want the result set as
ID,      Name  ,  atricle , price

phone

1  |     ajit |   phone |   20
2  |     arif |   phone |   30

mobile

3  |     arun |   mobile |   50
4  |     sandy |   mobile |   70

car

5  |     rocky |   car|   100

I did what i want by 1st use distinct to article ,get all the article, did while loop, and then inserted records, with where artcle='@artcle'
But I want a single SQL query to achieve this.


text:
Q: What is affecting the power supply current rating? My question is generally specific on how to determine the current rating for a power supply? does the current is always constant? or it's according to the load of the circuit? Also does the maximum current rating of the power supply is determined according to the power rating of the components used in the circuit?
What will happen if I connect an 4 Amp LED to a transformer based 10 Amp power supply of the same voltage rating?

A: I'm assuming you're talking about a AC-DC power supply.
Ratings:
The main ratings on an AC supply that you can't usually exceed are:

*

*Input voltage (and frequency): Don't give it higher than this voltage on the input.

*Output current: Don't draw more than this amount of current from the output.

Exceeding either of those two will likely break something.
There are couple other basic ratings that a power supply has, but they relate to how the supply will behave if your adhere to the above:

*

*Output voltage: At the specified input voltage, this will be the output voltage

*Input current: At the maximum specified output current, this will be the maximum input current

Since your LED draws 4 amps, you are just fine connecting it to a 10 amp supply.
How they are determined:
Primarily by two things:

*

*Heat and voltage the parts can take before breaking.

*The supply behaving as specified.

Whenever you draw current through a wire, it heats up since some energy is lost. A transformer is two or more giant coils of wire wound around some kind of core, so the wires inside the transformer heat up with current. At some point, the temperature of the transformer will get hot enough that the insulation between the wires stops working as designed and your transformer shorts out between the windings. This causes the wiring ratio to change and the output voltage of the transformer to drop (or rise!!), often far enough so that the DC side of the supply stops working. The maximum current rating of a transformer is the current that can be drawn through it without heating it up to the point where its life is reduced. There are other factors as well in addition to winding resistance (for one, the core of the transformer has a maximum amount of magnetic flux it can contain before it stops behaving as expected), but heating is generally a good indicator if something is being pushed too hard.
For the input voltage rating, there is a point where the transformer will start shorting out because the input voltage is so high that it breaks down the insulation between the individual coils on the same winding or the insulation between the input (primary) and output (secondary) winding. This voltage is known as the "isolation rating" or "breakdown voltage" and most properly certified transformers will have a breakdown voltage of at least a thousand volts for a short period of time.  However, that doesn't mean that you could put several thousand volts on the transformer and expect it to work. The magnetic properties of the transformer see to that.
As for the DC part of the supply, on a basic level it consists of a diode, capacitor, and possibly some semiconductors. Each of these components also has a voltage and current rating that needs to be respected. The exact ratings are determined through a variety of ways, but again, they will heat up when this is exceeded. Putting too much voltage into the supply could cause too much voltage to be put into the DC components. Drawing too much current from the output could exceed the current ratings of these components. Certain components, such as capacitors, are rated to operate for a certain number of hours at some temperature (105C, 85C, etc). The output current rating of the supply is also calculated to prolong the life of these kinds of components so that they will hopefully last as long as the customer expects them to. This is also a place where corners are cut, since the power supply might get just warm enough so that the useful lifespan of the parts is shortened, but it will work good enough for some time and use cheaper parts.
In reality, perhaps you could draw more current through a supply than it has specified, or you could put more input voltage to it. However, the supply wasn't designed to work within those conditions and could misbehave. The specifications on the supply also reflect the designer's intentions for how the supply is to be used.


text:
Q: Map F2 to NEERDTreeToggle I want just to open and close NERDTree, pushing the F2 button. I've mapped it in this way  :
map <silent>  <F2> NERDTreeToggle

But, Actually this doesn't work properly and I haven't understood why...

A: Here is my config for NERDTree.
silent! nmap <C-p> :NERDTreeToggle<CR>
silent! map <F3> :NERDTreeFind<CR>

let g:NERDTreeMapActivateNode="<F3>"
let g:NERDTreeMapPreview="<F4>"

F3 will open NERDTree panel and highlight current file.
And when you're in the NERDTree panel, F3 will open file under cursor.
So, I can use one button to jump between buffer and NERDTree.
(And F4 for preview because it's next to F3)

A: your mapping:
map <silent>  <F2> NERDTreeToggle
should be:
map <F2> :NERDTreeToggle<CR>
I think you'll find that'll work (you basically missed the colon and the <CR> to make the action happen...


text:
Q: Prevent blocking after using matplotlib.fig.canvas timer for animation I have a script that uses matplotlib within a multiprocessing.Process to draw images.
I would like to extend the software to plot motions using fig.canvas.new_timer while keeping the matplotlib figure open at any time.
However I run into a blocking issue when I combine animations and plots.
I cannot change the use of multiprocessing at this point as the original software is designed that way.
The following example demonstrates the issue as it blocks on the create_animation. It should show a gray gradient followed by a small random animation. The next gray gradient after the animation is never executed.
import time
import numpy as np
import matplotlib.pyplot as plt
from multiprocessing import Process, Queue

ts = 0
timer = None
def callback(line):
    global ts
    global timer
    x = np.random.randint(0, 1024)
    y = np.random.randint(0, 1024)
    line.set_data(x, y)
    plt.pause(0.01)
    print(ts)
    ts += 1
    if ts == 50:
        print('stop callback')
        timer.stop()
        plt.show(block=False)

def create_animation(fig, ax, line):
    global ts
    global timer
    r,g,b = 0,0,0
    ax.set_facecolor((r,g,b))

    ts = 0
    interval = 10
    timer = fig.canvas.new_timer(interval=interval,
                                 callbacks=[(callback, [line], {})])
    timer.start()
    #plt.ioff()
    plt.show(block=True)

def run():
    fig = plt.figure()
    ax = fig.add_subplot(111)
    line, = ax.plot([], [], color='grey', marker='o')
    minx, maxx, miny, maxy = 0, 1024, 0, 1024
    ax.axis([minx, maxx, miny, maxy])

    # plot gray gradient
    x = np.linspace(0, 1, 1024)
    data = np.tile(x, (1024, 1))
    ax.imshow(data, cmap='gray', aspect='auto')
    plt.pause(0.01)
    time.sleep(2)

    # this blocks
    create_animation(fig, ax, line)
    plt.ion()

    # plot gray gradient
    time.sleep(3)
    x = np.linspace(1, 0, 1024)
    data = np.tile(x, (1024, 1))
    ax.imshow(data, cmap='gray', aspect='auto')
    plt.pause(0.01)
    time.sleep(2)

if __name__ == '__main__':
    q = Queue()
    p = Process(target = run, args=())
    p.daemon = True
    p.start()

    while True:
        pass


text:
Q: How to retrieve available RAM from Windows command line? Is there a command line utility within Windows or third-party program that can retrieve available RAM on a machine? (Since I don't believe this can be done in pure JAVA, since it is run within a virtual machine, that has preset / allocated RAM)?

A: There is a whole bunch of useful low level tools from SysSnternals.
And psinfo may be the most useful.
I used the following psinfo switches:
-h        Show installed hotfixes.
-d        Show disk volume information.

Sample output is this:
c:> psinfo \\development -h -d

PsInfo v1.6 - local and remote system information viewer
Copyright (C) 2001-2004 Mark Russinovich
Sysinternals - www.sysinternals.com

System information for \\DEVELOPMENT:
Uptime: 28 days, 0 hours, 15 minutes, 12 seconds
Kernel version: Microsoft Windows XP, Multiprocessor Free
Product type Professional
Product version: 5.1
Service pack: 0
Kernel build number: 2600
Registered organization: Sysinternals
Registered owner: Mark Russinovich
Install date: 1/2/2002, 5:29:21 PM
Activation status: Activated
IE version: 6.0000
System root: C:\WINDOWS
Processors: 2
Processor speed: 1.0 GHz
Processor type: Intel Pentium III
Physical memory: 1024 MB
Volume Type Format Label Size Free Free
A: Removable 0%
C: Fixed NTFS WINXP 7.8 GB 1.3 GB 16%
D: Fixed NTFS DEV 10.7 GB 809.7 MB 7%
E: Fixed NTFS SRC 4.5 GB 1.8 GB 41%
F: Fixed NTFS MSDN 2.4 GB 587.5 MB 24%
G: Fixed NTFS GAMES 8.0 GB 1.0 GB 13%
H: CD-ROM CDFS JEDIOUTCAST 633.6 MB 0%
I: CD-ROM 0% Q: Remote 0%
T: Fixed NTFS Test 502.0 MB 496.7 MB 99%
OS Hot Fix Installed
Q147222 1/2/2002
Q309521 1/4/2002
Q311889 1/4/2002
Q313484 1/4/2002
Q314147 3/6/2002
Q314862 3/13/2002
Q315000 1/8/2002
Q315403 3/13/2002
Q317277 3/20/2002

A: Bit old but I wanted to know similar. Just adding the solution I came across since IMO the best answer came from Everardo w/ Physical Memory

wmic OS get FreePhysicalMemory /Value

This lead me to look deeper into wmic... Keep in mind Free Physical Memory is not the type to look at.
wmic OS get FreePhysicalMemory,FreeVirtualMemory,FreeSpaceInPagingFiles /VALUE
This returns something like...
FreePhysicalMemory=2083440
FreeSpaceInPagingFiles=3636128
FreeVirtualMemory=842124

A: systeminfo is a command that will output system information, including available memory

A: PS C:\Users\Rack> systeminfo | findstr "System Memory"
System Boot Time:          5/5/2016, 11:10:41 PM
System Manufacturer:       VMware, Inc.
System Model:              VMware Virtual Platform
System Type:               x64-based PC
System Directory:          C:\Windows\system32
System Locale:             en-us;English (United States)
Total Physical Memory:     40,959 MB
Available Physical Memory: 36,311 MB
Virtual Memory: Max Size:  45,054 MB
Virtual Memory: Available: 41,390 MB
Virtual Memory: In Use:    3,664 MB

A: wmic OS get FreePhysicalMemory /Value

A: Use wmic computersystem get TotalPhysicalMemory. E.g.:
C:\>wmic computersystem get TotalPhysicalMemory
TotalPhysicalMemory
4294500352

A: Powershell version of the posted wmic commands:
Get-CIMInstance Win32_OperatingSystem | Select *memory*

FreePhysicalMemory     : 1507688
FreeVirtualMemory      : 2131128
MaxProcessMemorySize   : 137438953344
TotalVirtualMemorySize : 13639352
TotalVisibleMemorySize : 8214848

A: wmic OS get TotalVisibleMemorySize /Value

Note not TotalPhysicalMemory as suggested elsewhere

A: This cannot be done in pure java. But you can run external programs using java and get the result.
Process p=Runtime.getRuntime().exec("systeminfo");
Scanner scan=new Scanner(p.getInputStream());
while(scan.hasNext()){
    String temp=scan.nextLine();
    if(temp.equals("Available Physical Memmory")){
       System.out.println("RAM :"temp.split(":")[1]);
       break;
    }
}

A: Try MemLog. It does the job perfectly and quickly.
Download via one of many mirrors, e.g. this one: SoftPedia page for MemLog.
(MemLog's author has a web site. But this is down some times. Wayback machine snapshot here.)
Example output:
C:\>memlog
2012/02/01,13:22:02,878956544,-1128333312,2136678400,2138578944,-17809408,2147352576

878956544 being the free memory

A: Here is a pure Java solution actually:
public static long getFreePhysicalMemory()
{
    com.sun.management.OperatingSystemMXBean bean =
            (com.sun.management.OperatingSystemMXBean)
                    java.lang.management.ManagementFactory.getOperatingSystemMXBean();
    return bean.getFreePhysicalMemorySize();
}

A: Just in case you need this functionality in a Java program, you might want to look at the sigar API: http://www.hyperic.com/products/sigar
Actually, this is no answer to the question, I know, but a hint so you don't have to reinvent the wheel.


text:
Q: Negative binomial model cannot find starting position to sample I am having difficulties running a PYMC3 model when the observed data is discrete. Oddly, if the observed data contains the value zero (0.), the model will run.
I've read in other posts that that suggest using
start = pm.find_MAP(fmin=scipy.optimize.fmin_powell) but that does not resolve the issue.
pymc3.__version__ = '3.0'
theano.__version__ = '0.7.0.dev-RELEASE'
numpy.__version__ = '1.8.0rc1'
Python 2.7.10

See iPython notebook
The code and error are below.
import pymc3 as pm

data = [6.0,12.0,12.0,46.0,5.0,11.0,11.0,39.0,4.0,10.0,25.0,11.0,8.0,5.0,10.0,2.0,30.0,21.0]

with pm.Model() as model:
    alpha = pm.Uniform('alpha', lower=0, upper=100)
    mu = pm.Uniform('mu', lower=0, upper=100)

    y_pred = pm.NegativeBinomial('y_pred', mu=mu, alpha=alpha)

    y_est = pm.NegativeBinomial('y_est',
                                mu=mu,
                                alpha=alpha,
                                observed=data)

    start = pm.find_MAP()

    step = pm.Metropolis()
    trace = pm.sample(20000, step, start, progressbar=True)

The error I get is:
---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)
<ipython-input-5-b9f2264fccfc> in <module>()
     14                                 observed=data)
     15
---> 16     start = pm.find_MAP()
     17
     18     step = pm.Metropolis()

/Library/Python/2.7/site-packages/pymc3/tuning/starting.pyc in find_MAP(start, vars, fmin, return_raw, disp, model, *args, **kwargs)
     79     if 'fprime' in getargspec(fmin).args:
     80         r = fmin(logp_o, bij.map(
---> 81             start), fprime=grad_logp_o, disp=disp, *args, **kwargs)
     82     else:
     83         r = fmin(logp_o, bij.map(start), disp=disp, *args, **kwargs)

/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/scipy/optimize/optimize.pyc in fmin_bfgs(f, x0, fprime, args, gtol, norm, epsilon, maxiter, full_output, disp, retall, callback)
    775             'return_all': retall}
    776
--> 777     res = _minimize_bfgs(f, x0, args, fprime, callback=callback, **opts)
    778
    779     if full_output:

/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/scipy/optimize/optimize.pyc in _minimize_bfgs(fun, x0, args, jac, callback, gtol, norm, eps, maxiter, disp, return_all, **unknown_options)
    830     else:
    831         grad_calls, myfprime = wrap_function(fprime, args)
--> 832     gfk = myfprime(x0)
    833     k = 0
    834     N = len(x0)

/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/scipy/optimize/optimize.pyc in function_wrapper(*wrapper_args)
    279     def function_wrapper(*wrapper_args):
    280         ncalls[0] += 1
--> 281         return function(*(wrapper_args + args))
    282
    283     return ncalls, function_wrapper

/Library/Python/2.7/site-packages/pymc3/tuning/starting.pyc in grad_logp_o(point)
     74
     75     def grad_logp_o(point):
---> 76         return nan_to_num(-dlogp(point))
     77
     78     # Check to see if minimization function actually uses the gradient

/Library/Python/2.7/site-packages/pymc3/blocking.pyc in __call__(self, x)
    117
    118     def __call__(self, x):
--> 119         return self.fa(self.fb(x))

/Library/Python/2.7/site-packages/pymc3/model.pyc in __call__(self, state)
    397
    398     def __call__(self, state):
--> 399         return self.f(**state)
    400
    401 class LoosePointFunc(object):

/Library/Python/2.7/site-packages/theano/compile/function_module.pyc in __call__(self, *args, **kwargs)
    862                     node=self.fn.nodes[self.fn.position_of_error],
    863                     thunk=thunk,
--> 864                     storage_map=getattr(self.fn, 'storage_map', None))
    865             else:
    866                 # old-style linkers raise their own exceptions

/Library/Python/2.7/site-packages/theano/gof/link.pyc in raise_with_op(node, thunk, exc_info, storage_map)
    312         # extra long error message in that case.
    313         pass
--> 314     reraise(exc_type, exc_value, exc_trace)
    315
    316

/Library/Python/2.7/site-packages/theano/compile/function_module.pyc in __call__(self, *args, **kwargs)
    850         t0_fn = time.time()
    851         try:
--> 852             outputs = self.fn()
    853         except Exception:
    854             if hasattr(self.fn, 'position_of_error'):

ValueError: Input dimension mis-match. (input[0].shape[0] = 1, input[4].shape[0] = 18)
Apply node that caused the error: Elemwise{Composite{Switch(i0, i1, Switch(i2, Switch(i3, i1, i4), i1))}}(TensorConstant{(1,) of 0}, TensorConstant{(1,) of 0}, Elemwise{mul,no_inplace}.0, InplaceDimShuffle{x}.0, TensorConstant{[  6.  12... 30.  21.]})
Toposort index: 33
Inputs types: [TensorType(int8, vector), TensorType(int8, (True,)), TensorType(int8, (True,)), TensorType(int8, (True,)), TensorType(float64, vector)]
Inputs shapes: [(1,), (1,), (1,), (1,), (18,)]
Inputs strides: [(1,), (1,), (1,), (1,), (8,)]
Inputs values: [array([0], dtype=int8), array([0], dtype=int8), array([1], dtype=int8), array([0], dtype=int8), 'not shown']
Outputs clients: [[Sum{acc_dtype=float64}(Elemwise{Composite{Switch(i0, i1, Switch(i2, Switch(i3, i1, i4), i1))}}.0)]]

HINT: Re-running with most Theano optimization disabled could give you a back-trace of when this node was created. This can be done with by setting the Theano flag 'optimizer=fast_compile'. If that does not work, Theano optimizations can be disabled with 'optimizer=None'.
HINT: Use the Theano flag 'exception_verbosity=high' for a debugprint and storage map footprint of this apply node.


text:
Q: Secure contents of a div which is centered on a page I am placing all my content into a section with a class="wrapper". This section has a set width and height and must satisfy the following conditions:

*

*be placed in the middle of the page, both horizontally and vertically. If window size is larger than the
 itself, then this element has to center itself automatically.

*at the same time, if window size is smaller than the
 size, the
 should be entirely scrollable and all elements should be viewable.
I have a problem with part 2, since when I make the window size smaller, the upper and lower borders of the
 actually disappear behind the screen and content. It appears that the top content is "eaten" by the vertical resizing. This does not happen with the left and right borders, I am still able to view full content by scrolling.
The described problem is true for Safari, Chrome and Opera, but not for Firefox. I have not tested in IE.
I use this to center vertically and horizontally:
.wrapper{
    position: absolute;
    top:0;
    bottom: 0;
    left: 0;
    right: 0;
    margin: auto;
    height: 660px;
    width: 1200px;
    border: 1px dotted yellow;
}

Obviously if I use the approach below then it does not work in Safari either, since
 goes behind the viewport upon resizing:
.wrapper{
    position: absolute;
    top: 50%;
    left: 50%;
    margin-top: -330px; /* half of  height */
    margin-left: -600px;  /* half of width */
    height: 660px;
    width: 1200px;
    border: 1px dotted yellow;
}

Any advice on how to fit all content of the section will be appreciated!

A: https://jsfiddle.net/ahmadasjad/kemzkopm/13/

HTML part:

        Wrapper Section

CSS part:
.wrapper{
    margin: 0 auto;
    height: 100px;
    width: 400px;
    max-width:100%;
    border: 1px dotted red;

}
.child{
    vertical-align:middle;
    display:table-cell;
}
.parent{
    display:table;
    height:100vh;
    width:100%;
}