text:
Q: Emailer font color and size issue I have created a html markup for weekly digest which forwarded to the subscribed user.
My problem is i put a link in side the template and it is working fine for gmail and hotmail but when i check in yahoo the link color and font size is not proper
Here is my html markup
Text

I tried this also but its also not working in yahoo.
.yshortcuts {
      border-bottom: none !important;
      color:#4A9BA2 !important;
      font-size: 11px !important;
      text-decoration: none !important;
      }

      .yshortcuts a span {  border-bottom: none !important;
      color:#4A9BA2 !important;
      font-size: 11px !important;
      text-decoration: none !important; }

This is happing because after a yahoo adds a span tag in side a applying its own css.Like this way.
Text

Some one please help me i am stacking with this problem.

A: You could try to take advantage of the precedence rules of CSS. The CSS selector that should take precedence is a span.yshortcuts. With this selector you should be able to override the color defined in the Yahoo CSS.
a span.yshortcuts {
    color:#4A9BA2 !important;
    font-size:11px !important;
}

This has higher precedence and should be used by the css interpreter.


text:
Q: Django DB Router Sending Table to default DB instead of Correct One I am creating a site that will be connected to 4 databases. I got the first three going no problem. I created a separate app for each db then created a router for each one. The problem with the last db is that the router is not triggering. It keeps sending the traffic to the default db.
The default db is app2, and the db I want to use is 'Login'.
Here is my router
 class LoginRouter(object):
     def db_for_read(self, model):

         if model._meta.app_label == 'Login':
             return 'Login'
         return 'default'

Here is my Settings declaration:
 DATABASE_ROUTERS = ['reports.dbrout.CucRouter', 'reports.dbrout.CpsgRouter', 'reports.dbrout.LoginRouter', ]

Here is the model in the 'Login' app that is not connecting to the right db.
 from __future__ import unicode_literals

 from django.db import models

 class TblUsers(models.Model):
     userid = models.AutoField(db_column='userID', primary_key=True)
     username = models.CharField(db_column='userName', max_length=100)
     useremail = models.CharField(db_column='userEmail', unique=True, max_length=100)
     userpass = models.CharField(db_column='userPass', max_length=100)
     userstatus = models.CharField(db_column='userStatus', max_length=1)
     tokencode = models.CharField(db_column='tokenCode', max_length=100)
     companyid = models.CharField(db_column='companyID', max_length=255, blank=True, null=True)
     fk_customer = models.IntegerField(blank=True, null=True)
     is_admin = models.IntegerField(blank=True, null=True)

     class Meta:
         managed = False
         db_table = 'tbl_users'
         app_label = 'Login'

     def __str__(self):
         return str(self.userid)

Full dbrout page:
 class CucRouter(object):
     def db_for_read(self, model):

         if model._meta.app_label == 'CUCMCDR':
             return 'CUCMCDR'
         return 'default'

  class CpsgRouter(object):
      def db_for_read(self, model):

         if model._meta.app_label == 'CPSG':
             return 'CUCMCDR'
         return 'default'

 class LoginRouter(object):
     def db_for_read(self, model):

         if model._meta.app_label == 'Login':
             return 'Login'
         return 'default'

Like I said this worked for the first three. What am I missing here that is not catching for the last one!!???

A: The order in which routers are processed is significant. Routers will be queried in the order they are listed in the DATABASE_ROUTERS setting.
Add it like below way.
DATABASE_ROUTERS = ['reports.dbrout.LoginRouter','reports.dbrout.CucRouter', 'reports.dbrout.CpsgRouter',]
While setting it make sure your order,  if Login app_label is used in LoginRouter and CucRouter then  LoginRouter will process before CucRouter

redpajama_set_name: RedPajamaStackExchange


text:
Q: character pointers in C++ I have a doubt regarding character pointers in c++. Whenever we create a character pointer in c++: char *p="How are you doing", p should contain the address of memory location which holds the value "how are you doing".
However, I am perplexed at a sample code and the output. Why cout<<p gives back the entire string? It should give value of a memory address. Secondly, why does cout<<*p gives only first character of the string?
Code:
#include <iostream>
using namespace std;

int main () {

const char *str = "how are you\n";
int i[]={1,2,3};

 cout << str << endl;   // << is defined on char *.
 cout << i << endl;
 cout << *str << endl;

}

OUTPUT:
how are you

0xbfac1eb0

h

A: If you want to print the address, then you've to cast the char* to void*, as
const char *str = "how are you\n";
cout << (void*) str << endl;

In the absense of the cast, cout sees str as const char* (which in fact it is) and so cout thinks you intend to print the null-terminated char string!
Think : if you want coud << str to print the address, how would you print the string itself?
--
Anyway here is more detail explanation:
operator<< is overloaded for char* as well as void* :
//first overload : free standing function
basic_ostream<char, _Traits>& operator<<(basic_ostream<char, _Traits>& _Ostr, const char *_Val);

//second overload : a member of basic_ostream<>
_Myt& operator<<(const void *_Val);

In the absence of the cast, first overload gets called, but when you cast to void*, second overload gets called!

A: This is due to Operator overloading.
the << operator is overloaded to output the string pointed to by the character pointer.
Similarly, with *p, you will get the first character, hence you get the first character as output.

A: The cout << str << endl; prints "how are you", because str is char *, which is treated as a string.
The cout << i << endl; prints 0xbfac1eb0, because i is a int [], which is treated as int*, which is treated as void*, which is a pointer.
The cout << *str << endl' prints "h" because *str is a char with value of 'h'.

A: A C string is just a bunch of bytes, terminated by a null byte (that's a convention). You can also think of it as an array of bytes/characters. If you do char *str = "foobar"; the compiler reserves some memory for these bytes, and then assigns the memory location of the first byte/character to str.
So if you dereference the pointer str, you get the byte at that location which happens to be the first character of your string. If you do *(str + 1) you get the second one, which is the exact same thing as writing str[1].


text:
Q: Proving something is a lattice . Hi i was wondering if anyone could help me show the following
$f\le^{*}g \iff \exists k\forall m\ge k(f(m)\le g(m)$ Show that $\le^{*}$ is a lattice.
My definition of a lattice is the following let $\le$ be a partial ordering on $X$ and that $\sup\{x,y\}$ and $\inf\{x,y\}$ exist in $X$ $\forall x,y\in X$ then $\le$ is a lattice.?
I'm unsure where to start this problem, i know that i need to show that the $\inf\{x,y\}$ and $\sup\{x,y\}$ exists but how would i do that?

A: As was pointed out, <=* is not a porder.
It is only a preorder.  To rescue the problem for
functions f:R -> R a porder instead of a preorder is needed.
Define f eventually = g, f == g as
some k in R with for all x >= k, f(x) = g(x)
Show == is an equivalent relation.
To show the equivalent classes are a lattice
using f eventually <= g, f <=* g when
some k in R with for all x >= k, f(x) <= g(x).
Define [f] <<= [g] when f <=* g.
Show that <<= is well defined.
That is, if f ~ h, g ~ k, f <=* g, then h <=* k.
Continue to show <<= is a partial order.
Finally show [max(f,g)] = sup([f],[g]) and define inf.
Whence this curve ball problem?
Did you include all the details?


text:
Q: how to generate a map of instructions when compiling? when compiling a program with gcc or any other compiler, can I somehow make the compiler generate a map of instructions in memory ??
something like:
0000: First Instruction
0001: Second Instruction
1000: Third Instruction (after a jump for example)

I would like to use these addresses as a pattern to test a design of an instruction cache. I don't care what instructions are compiled or anything like that, just the addresses of these instruction. is this possible?

A: The easiest way has to be to use objdump on your compiled output. For instance:
$ objdump -d /tmp/test

/tmp/test:     file format elf64-x86-64

Disassembly of section .text:

0000000000400410 <_start>:
  400410:       31 ed                   xor    %ebp,%ebp
  400412:       49 89 d1                mov    %rdx,%r9
  400415:       5e                      pop    %rsi
  400416:       48 89 e2                mov    %rsp,%rdx
  400419:       48 83 e4 f0             and    $0xfffffffffffffff0,%rsp
  40041d:       50                      push   %rax
  40041e:       54                      push   %rsp
  40041f:       49 c7 c0 b0 05 40 00    mov    $0x4005b0,%r8
  400426:       48 c7 c1 20 05 40 00    mov    $0x400520,%rcx
  40042d:       48 c7 c7 fa 04 40 00    mov    $0x4004fa,%rdi
  400434:       e8 b7 ff ff ff          callq  4003f0 <__libc_start_main@plt>
  400439:       f4                      hlt
  40043a:       66 0f 1f 44 00 00       nopw   0x0(%rax,%rax,1)

And so on. If you want to only have the addresses, just filter them out with sed or something.


text:
Q: Is SMIL for SVG deprecated, un-deprecated or... paused but will eventually be deprecated? TLDR: I'm trying to establish whether it's worth spending some time mastering SMIL. The official line (at least from Blink, but maybe not from Gecko) appears to be that this animation technology is functionally deprecated... but the reality on the ground suggests this isn't the case at all.
I would like to learn SMIL because it strikes me as an elegant technology - but I don't wish to spend a couple of months this year learning something which will be obsolete in a year or two.
Question: Is it worth learning SMIL?

A few years ago, the consensus was that the SVG's animation language, SMIL (Synchronized Multimedia Integration Language) was going to be deprecated:
In April 2015, the Blink team wrote:

"We intend to deprecate SMIL animations in favor of CSS animations and Web animations"
Source: https://groups.google.com/a/chromium.org/g/blink-dev/c/5o0yiO440LM)

The two main reasons for the intent-to-deprecate five and a half years ago appeared to be:

*

*"In terms of implementation, SMIL adds significant complexity to Blink"

*"Internet Explorer does not support SMIL which limited its use for critical functionality"

Roll forward to 2020 and Internet Explorer is lost in the mists of time and MSIE's successor, Edge, now uses the Blink rendering engine (alongside Chromium, Chrome, Opera, Brave and others).
Blink's main competitor, Gecko, also appears completely happy with SMIL:

*

*https://developer.mozilla.org/en-US/docs/Web/SVG/SVG_animation_with_SMIL
The net result is that SMIL now has strong support across the entire modern browser landscape:

*

*https://caniuse.com/svg-smil
So where are we, now? Can we safely forget about the intention-to-deprecate from 2015 and work on the basis that SMIL is back and here to stay?

The proposed duplicate question and its answers provide good references to Blink's initial announcement that it intends to deprecate SMIL and later announcement that it intends to pause the deprecation of SMIL (which it will resume later). But the discussion is from 2016. The question does not contemplate whether, in 2020, SMIL advocates might (?) have quietly prevailed and, despite lack of official clarification, there may no longer be any determined intention to deprecate SMIL at all. (For instance, there never seems to be any enthusiasm from Gecko to deprecate SMIL, does there?)

A: The deprecation of SMIL got suspended. To quote, in case the site changes:

Although Chrome 45 deprecated SMIL in favor of CSS animations and Web animations, the Chrome developers have since suspended that deprecation.

Quoting from the link:

As a result, we've decided to suspend our intent to deprecate and take smaller steps toward other options.

SMIL not only can do awesome things, and have extra powers over eg. CSS animations, it lends another way of thinking about DOM animations. I think it's useful even if it's rarely used. Some alternatives eg. CSS Houdini have been in the making for years, with no cross-browser availability. So it's up to each person if it's worth it; depends on time available. Can be done for fun too. Same can be said about JS (non-SMIL) libraries like Lottie/Bodymovin too

A:
trying to establish whether it's worth spending some time mastering
SMIL. The official line appears to be that this animation technology
is functionally deprecated... but the reality on the ground suggests
this isn't the case at all.

Of course it's worth in my opinion to master SMIL.
For many reasons, it's worth learning:

*

*SMIL is a native SVG framework that was developed with it

*CSS animation for SVG still cannot replicate all the rich features of SMIL
I will try to show this with specific examples.

*Poor support for SVG filters and CSS animation of their attributes

*CSS has very weak support for vector objects and their attributes. For example widths, heights, radii, letters, as a vector element. Chrome has really started supporting it, but not all browsers do it.

Using the example below, we will consider the difference in the organization of the animation logic SMIL VS CSS Animation
All SMIL animation objects are interconnected by logical chains of conditions.
For example, the animation of the movement of the little man will start after the end of the animation of drawing the route  begin="anPathWalk.end"
There are no such possibilities in CSS, it is necessary to calculate the absolute value of the animation start time or its delay each time.
Which causes great difficulties in design and even greater difficulties when changing the logic of object interaction
In smil, when changing the logic, it is enough to change the logical chains of animation start and the SMIL preprocessor will calculate the necessary animation start times

<svg xmlns="http://www.w3.org/2000/svg"   xmlns:xlink="http://www.w3.org/1999/xlink" version="1"   viewBox="0 0 800 540"  >
  <defs>
   <path id="walk"
   d="m343 268 34-10 50-9-33-86 22-14 7-21 8-3 13 18 34-25 47 65 22-19"  />
  <g id="Man" transform="translate(0,0) scale(1,-1)">
    <path   fill="none">
         <animate
          attributeName="d"
          begin="0.1s"
          dur="0.3s"
          repeatCount="indefinite"
          values="M-3,0 0,10 3,0 M0,10 0,16 l 4,-5 M0,16 l-4,-5 M0,16 c4,4 -4,4 0,0;
                  M 0,0 0,10 0,0 M0,10 0,16 l 0,-5 M0,16 l 0,-5 M0,16 c4,4 -4,4 0,0;
                  M-3,0 0,10 3,0 M0,10 0,16 l 4,-5 M0,16 l-4,-5 M0,16 c4,4 -4,4 0,0"/>
    </path>
      </g>
  </defs>

  <image xlink:href="https://i.stack.imgur.com/XPdWW.png" width="100%" height="100%" />
  <path id="train" stroke-dasharray="312" stroke-dashoffset="312" stroke-width="2" d="M443 534 426 477 415 435 397 391 375 347 350 304 334 277 317 251" style="fill:none;stroke:violet;"/>

    <text
      font-size="28"
      font-family="Times New Roman"
      fill="#517DA6" >
<textPath id="result"
xlink:href="#train">
<tspan dx="0" > 🚅 </tspan>
<tspan dx="-12">  - </tspan>
<tspan dx="-15"> 🚃</tspan>
<tspan dx="-12">   -</tspan>
<tspan dx="-15">   🚃 </tspan>
<tspan dx="-12">   - </tspan>
<tspan dx="-15"> 🚃</tspan>
<tspan dx="-12">   -</tspan>
<tspan dx="-15">   🚃 </tspan>
<tspan dx="-12">   - </tspan>
<tspan dx="-15"> 🚃</tspan>
<tspan dx="-12">   -</tspan>
<tspan dx="-15" >   🚂 </tspan>
 <animate id="anTrain"
   begin="0s;an5.end"
   dur="12s"
   repeatCount="1"
   attributeName="startOffset"
   values="-60%;45%;45%;-60%"
   fill="freeze"/>
</textPath>
</text>

  <path id="walk"
   stroke-dasharray="409"
   stroke-dashoffset="409"
   stroke-width="3"
   d="m343 268 34-10 50-9-33-86 22-14 7-21 8-3 13 18 34-25 47 65 22-19"
   style="fill:none;stroke:#B34EE9">
  <animate id="anPathWalk"
   attributeName="stroke-dashoffset"
   begin="anTrain.end-7.5s"
   dur="2s"
   values="409;0"
   fill="freeze" />
  </path>

 <use xlink:href="#Man" transform="translate(0,0) scale(1.2)" style="stroke:blue; fill:black;">
     <animateMotion id="an2"
       begin="anPathWalk.end"
       dur="16s"
       repeatCount="1"  >
          <mpath xlink:href="#walk"/>
     </animateMotion>

          </use>

      <use xlink:href="#Man" transform="translate(0,0) scale(1.2)" style="stroke:crimson;" >
     <animateMotion id="an3"
       begin="anPathWalk.end+0.5s"
       dur="17s" repeatCount="1"  >
             <mpath xlink:href="#walk"/>
      </animateMotion>
     </use>
       <use xlink:href="#Man"
       transform="translate(0,0)
       scale(1)"
       style="stroke:black;">
     <animateMotion id="an4"
       begin="anPathWalk.end+1s"
       dur="13s"
       repeatCount="1"  >
          <mpath xlink:href="#walk"/>
      </animateMotion>
       </use>

       <use xlink:href="#Man"
       transform="translate(0,0)
       scale(0.8)"
       style="stroke:red;
       fill:black;">
     <animateMotion id="an5"
       begin="anPathWalk.end+1.5s"
       dur="11s"
       repeatCount="1"  >
          <mpath xlink:href="#walk"/>
     </animateMotion>
       </use>
        <use xlink:href="#Man"
        transform="translate(0,0)
        scale(0.8)"
        style="stroke:black;">
     <animateMotion id="an5"
      begin="anPathWalk.end+1.8s"
      dur="9.5s" repeatCount="1"  >
         <mpath xlink:href="#walk"/>
     </animateMotion>
       </use>

</svg>

        <audio class="my_audio" controls preload="true" autoplay="autoplay">
            <source src="https://w1.musify.club/track/dl/4064186/eruption-one-way-ticket-original.mp3" type="audio/mpeg">
        </audio>

There is no svg textPath analogue in CSS (I may be wrong, correct)
See how easy it is to make realistic animations in SMIL

<svg width="600" height="400" viewBox="100 100 400 300">

 <path id="pathChain" d="M100,200 C100,100 250,100 250,200 S 400,300 400,200" stroke="grey" fill="none"/>

<text font-size="36"  font-family="Times New Roman" fill="grey" >
<textPath id="result"    xlink:href="#pathChain">
<tspan dx="0" > ᴑ </tspan> <tspan dx="-15">   - </tspan><tspan dx="-15"> ᴑ</tspan><tspan dx="-15">   -</tspan><tspan dx="-15">   ᴑ </tspan><tspan dx="-15">   - </tspan><tspan dx="-15"> ᴑ</tspan><tspan dx="-15">   -</tspan><tspan dx="-15">   ᴑ </tspan><tspan dx="-15">   - </tspan><tspan dx="-15"> ᴑ</tspan><tspan dx="-15">   -</tspan><tspan dx="-15">   ᴑ </tspan><tspan dx="-15">   - </tspan><tspan dx="-15"> ᴑ</tspan><tspan dx="-15">   -</tspan><tspan dx="-15">   ᴑ </tspan><tspan dx="-15">   - </tspan><tspan dx="-15"> ᴑ</tspan><tspan dx="-15">   -</tspan><tspan dx="-15">   ᴑ </tspan>
<animate  dur="10s" repeatCount="2" attributeName="startOffset" values="1%;55%;1%"/>
</textPath>
</text>
</svg>

3. Examples with SVG filters
There is only one attribute in CSS for text outline -webkit-text-stroke:
SVG has the richest set of filters that can animate their attributes using SMIL
#3.1  Outline letters using the feMorphology and feColorMatrix filters

<svg version="1.1" xmlns="http://www.w3.org/2000/svg"
    xmlns:xlink="http://www.w3.org/1999/xlink" width="350" height="200" viewBox="0 0 330 200" >
    <filter id="outText"
            x="-20%" y="-20%" width="300%" height="300%">
      <feMorphology operator="dilate" in="SourceAlpha"
                    radius="4" result="e1" />
      <feMorphology operator="dilate" in="SourceAlpha"
                    radius="1" result="e2" />
      <feComposite in="e1" in2="e2" operator="xor"
                   result="outline"/>
      <feColorMatrix type="matrix" in="outline"
                     values="0 0 0 0 0.2
                             0 0 0 0 0.1
                             0 0 0 0 0.5
                             0 0 0 1 0" result="outline2"/>
      <feComposite in="outline2" in2="SourceGraphic"
                   operator="over" result="output"/>
    </filter>
    <rect width="100%" height="100%" fill="#111111" />
    <text x="10" y="150" filter="url(#outText)" font-size="150px" stroke-dasharray="0" font-family="sans-serif" fill="none" stroke="white" stroke-width="4" > DES

    </text>
</svg>

#3.2 Stroke animation
Add just one line of code
<animate attributeName="stroke-dashoffset" dur="5s" values="300;0" repeatCount="indefinite" />

<svg version="1.1" xmlns="http://www.w3.org/2000/svg"
    xmlns:xlink="http://www.w3.org/1999/xlink" width="350" height="200" viewBox="0 0 330 200" >
    <filter id="outText"
            x="-20%" y="-20%" width="300%" height="300%">
      <feMorphology operator="dilate" in="SourceAlpha"
                    radius="5" result="e1" />
      <feMorphology operator="dilate" in="SourceAlpha"
                    radius="1" result="e2" />
      <feComposite in="e1" in2="e2" operator="xor"
                   result="outline"/>
      <feColorMatrix type="matrix" in="outline"
                     values="0 0 0 0 0.2
                             0 0 0 0 0.1
                             0 0 0 0 0.9
                             0 0 1 1 0" result="outline2"/>
      <feComposite in="outline2" in2="SourceGraphic"
                   operator="over" result="output"/>
    </filter>
    <rect width="100%" height="100%" fill="#111111" />
    <text x="10" y="150" filter="url(#outText)" font-size="150px" stroke-dasharray="20" font-family="sans-serif" fill="none" stroke="silver" stroke-width="4"  > DES
       <animate attributeName="stroke-dashoffset" dur="5s" values="300;0" repeatCount="indefinite" />
    </text>
</svg>

#3.3 Water turbulence effect
For the effect of turbulence, filters feTurbulence, feDisplacementMap are used
Hover over the picture to start the animation

<svg xmlns="http://www.w3.org/2000/svg" version="1.1"   viewBox="0 0 500 300">
  <defs>
    <filter id="myFilter" >
      <feTurbulence type="turbulence" baseFrequency="0.0001" numOctaves="1" result="turbulence" >
     <animate attributeName="baseFrequency" dur="18s" values="0.0001;0.02;0.0001;0.02;0.0001" begin="img1.mouseover" end="img1.mouseout" />
      </feTurbulence>
     <feDisplacementMap xChannelSelector="R" yChannelSelector="G" scale="25" in="SourceGraphic" in2="turbulence" />
    </filter>
  </defs>
<image id="img1" xlink:href="https://i.stack.imgur.com/hHGO8.jpg" width="100%" height="100%" filter="url(#myFilter)" />
  </svg>

4. Letter as vector
Any text within SVG is a vector object. Therefore, the whole word or each letter included in it has coordinates x, y
Therefore, you can change these coordinates using SMIL to create various animation effects.
Below is one possible example of flying letters

<svg id="svg1" width="70%" height="70%" viewBox="0 0 1000 1000"
  xmlns="http://www.w3.org/2000/svg" version="1.1" baseProfile="tiny"
  xmlns:xlink="http://www.w3.org/1999/xlink" preserveAspectRatio="xMinYMin meet">

    <title>Animation of text x and y attributes</title>

<defs>
<linearGradient id="grad"
    x1="0" y1="0" x2="0" y2="100%"
    gradientUnits="userSpaceOnUse">
        <stop offset="2%" stop-color="#151515" />
          <stop offset="70%" stop-color="yellowgreen" />
    </linearGradient>
</defs>
 <rect width="100%" height="100%" fill="url(#grad)" />
<text  x="200 " y="500"
font-size="90" fill="#d3d3d3" stroke-width="1" stroke="#d3d3d3">Stackoverflow</text>
<text id="text1" x="200" y="500"
font-size="90">Stackoverflow</text>

<animate xlink:href="#text1"
      attributeName="x"
      attributeType="XML"
    values="200 233 266 299 332 365 400 431 464 497 530 563 596;
    100 600 200 365 700 465 465 563 530 398 431 850 900;
    200 500 900 950 150 531 300 620 150 266 365 650 900;
    332 233 820 300 800 633 200 670 300 850 800 530 266;
    464 900 900 900 820 670 430 900 530 600 233 365 100;
    332 100 100 100 500 100 800 563 900 700 900 100 100;
    200 233 266 299 332 365 400 431 464 497 530 563 596"
    dur="4s"
    begin="svg1.click"
    repeatCount="2" />
<animate xlink:href="#text1"
      attributeName="y"
      attributeType="XML"
    values="500 500 500 500 500 500 500 500 500 500 500 500 500;
    100 200 850 100 250 175 750 100 750 720 850 500 50;
    100 600 600 250 200 450 50 200 520 550 300 300 750;
    500 100 650 650 600 150 550 50 150 550 200 550 400;
    800 300 100 750 150 650 75 350 550 700 755 120 800;
    800 600 300 150 750 350 700 650 200 250 500 650 100;
    500 500 500 500 500 500 500 500 500 500 500 500 500"
        dur="3s"
      begin="svg1.click"
        repeatCount="2" />
</svg>

Update
StackOverflow on world map

<svg id="svg1" xmlns:svg="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg" version="1.1"  viewBox="-10 150 1800 1253" >

<defs>
 <path id="Strack" d="m322.1 281.9c0 0 75.6 16 97.2 44.3 38 49.7-13.2 140.2 30.3 185.2 32.5 33.6 94.4 9.6 137.7 27.2 26.4 10.7 44.3 38.6 71.6 46.7 7 2.1 21.8 0 21.8 0" fill="none" stroke="black" />

 <path id="Ttrack" d="m 144.7062,657.68616 c 0,0 37.753,-102.00963 83.24497,-115.92056 40.72325,-12.4527 79.61954,30.26928 119.81051,44.34545 31.19139,10.92423 61.09073,30.67633 94.13684,31.11961 25.18481,0.33783 47.2325,-23.61256 72.3531,-21.78373 26.84437,1.95434 48.54017,23.28963 73.1311,34.23157 11.57342,5.1497 19.26927,7.93532 35.00956,14.78182 32.47733,14.12656 11.1456,44.34609 68.43253,-59.12726" fill="none" />

 <path id="Atrack" d="m1145.2 859.2c0 0 25.7-28.7 27.2-46.7 2.4-27.5-8.5-59-28.8-77.8-31.6-29.4-89.6-10.3-124.5-35.8-36.7-26.9-35.4-92.1-75.5-113.6-74.3-39.8-252.9 0-252.9 0" fill="none" />

 <path id="Ctrack" d="m220 368.1c0 0 73.9 53.2 89.1 93.5 16.5 43.6-26.4 98.1-5.5 139.7 22.7 45.3 76.6 72.2 125.4 85.8 51.6 14.4 107.1-12.2 160.6-8.8 82.6 5.3 206.4 118.7 244.3 45.1 30.3-59-143.2-138.1-143.2-138.1" fill="none" />

 <path id="Ktrack" d="m1555.7 922.6c0 0 25.2-71.8 14.3-105.6-10.8-33.6-51.3-48.9-72.6-77-39.7-52.5-75.9-108.7-101.2-169.4-12.5-30.1 11.3-48.4-24.2-94.6-64.2-83.6-204.6-76.2-246.5-5.5-54.4 91.9 207.9 181.5 160.6 277.3-45.5 92.2-206 64.1-305.9 39.6C866 759.3 690.8 585.3 690.8 585.3" fill="none" />

   <path id="all_Letter" transfotm="translate(0 -55)" d="M690.8 585.3H505c0 0-229.3 55.3-267.8-25.7-23.1-48.7 71.5-83.7 89.7-134.4 16-44.7-28.4-120.8 14.2-141.8 71.8-35.4 126 108.5 204 126.5 82.6 19.1 169.7-41.5 253.1-25.9 75.4 14.1 128.4 101.5 205 104.4 94.6 3.5 169.3-129.2 261.9-109.6 92.6 19.6 181 112.9 194.9 206.5 6.8 45.6-19.5 105-61.6 123.8-60.4 27-125.4-55.6-191.5-52.5-84.9 3.9-157.1 113.9-238.7 90-64.3-18.9-60.1-131.1-119.9-161.2-46.9-23.6-157.5 0-157.5 0z" style="fill:none;stroke-width:3;stroke:#0000f1"/>

    <filter id="dropShadow">
      <feDropShadow dx="4" dy="4" stdDeviation="8" result="shadow"/>
       <feComposite in2="mask" in="shadow" operator="in" result="comp" />
      <feMerge result="merge">
        <feMergeNode in="SourceGraphic" />
        <feMergeNode in="comp" />
      </feMerge>
    </filter>
    <linearGradient id="gradEarth">
            <stop offset="40%" stop-color="dodgerblue"></stop>
            <stop offset="100%" stop-color="yellowgreen" ></stop>
        </linearGradient>
      <linearGradient id="Lg" x2="0" y2="0%">
            <stop offset="10%" stop-color="yellow"></stop>
            <stop offset="25%" stop-color="#F437FE"></stop>
            <stop offset="50%" stop-color="dodgerblue"></stop>
            <stop offset="75%" stop-color="#1EFE6B"></stop>
            <stop offset="100%" stop-color="red"></stop>
            <animate attributeName="y2" dur="8s" values="0%;100%;100%;0%;0%" repeatCount="indefinite" />

        </linearGradient>
</defs>
   <image xlink:href="https://i.stack.imgur.com/lDCcN.jpg" width="1800px" height="1253px" opacity="0.8" />

 <g id="Gr_All" >

<g id="Sgroup"  transform="scale(1.5)" filter="url(#dropShadow)">

 <path id="leftF" fill="crimson"  d="m31.9 64.5c0 0-5.6 18.1 0 23.7 3.1 3.1 12.4 4.3 12.9 0 0.4-3.4-9.9-2.6-9.9-2.6l-3-21.2M58.7 64.5" class="leg">
    <animateTransform attributeName="transform" type="rotate" begin="btn1.click" dur="0.5s"
    values="0, 29.41,64.39;30, 29.41,64.39;0, 29.41,64.39" fill="freeze" repeatCount="indefinite" />
  </path>

 <path id="rightF" fill="crimson" d="m58.7 64.5c0 0-5.6 18.1 0 23.7 3.1 3.1 12.4 4.3 12.9 0 0.4-3.4-9.9-2.6-9.9-2.6l-3-21.2" class="leg">
     <animateTransform attributeName="transform" type="rotate" begin="btn1.click+0.25s" dur="0.5s"
    values="0, 56.21,64.39;30, 56.21,64.39;0, 29.41,64.39" fill="freeze" repeatCount="indefinite" />
</path>

 <path  class="Sbody" fill="url(#Lg)"  d="m59.3 12.8 6.4 20.3q-5.3-4.5-9.5-6.9-4.2-2.4-6.8-2.4-2 0-3.1 1.1-1.1 1.1-1.1 3 0 2.4 2.4 4.3 2.4 1.9 7.5 3.4 11.3 3.4 15.3 6.7 4 3.3 4 8.4 0 8.3-8.1 13.6-8.1 5.3-20.9 5.3-6.5 0-12.9-2.3-6.4-2.4-11.8-6.7V69.6L13.9 49.3q4.7 3.8 9.2 5.9 4.6 2 8.3 2 4 0 6.2-1.7 2.2-1.7 2.2-4.7 0-2.8-1.8-4.5-1.8-1.7-8-3.6-9-2.9-13.5-6.8-4.4-4-4.4-9.3 0-6.7 5.9-11 5.9-4.3 15.4-4.3 6.2 0 12.2 2.2 5.9 2.2 12.2 6.9z">

   <animateTransform attributeName="transform" type="rotate" begin="btn1.click+0.5s" dur="1.5s"
    values="
    0, 43.25,51.14;
    30, 43.25,51.14;
    0, 43.25,51.14;
    -30, 43.25,51.14;
    0, 43.25,51.14"
    fill="freeze"
    repeatCount="indefinite"
    additive="sum"
    restart="whenNotActive" />
</path>
</g>
   <animateMotion xlink:href="#Sgroup" begin="btn1.click" dur="18s" restart="whenNotActive">
    <mpath xlink:href="#Strack" />
   </animateMotion>

<g id="Tgroup" transform="scale(1.5)" filter="url(#dropShadow)">
 <path id="Tleft" fill="#F437FE" d="m90.2 66.8c0 0-5.6 18.1 0 23.7 3.1 3.1 12.4 4.3 12.9 0 0.4-3.4-9.9-2.6-9.9-2.6l-3-21.2m26.8 0.1M117 66.8" class="leg">
    <animateTransform attributeName="transform" type="rotate" begin="btn1.click" dur="1s"
    values="0, 87.71,66.69;30, 87.71,66.69;0, 87.71,66.69" fill="freeze" repeatCount="indefinite" />
  </path>
  <path id="Tright" fill="#F437FE" d="m117 66.8c0 0-5.6 18.1 0 23.7 3.1 3.1 12.4 4.3 12.9 0 0.4-3.4-9.9-2.6-9.9-2.6l-3-21.2" class="leg">
     <animateTransform attributeName="transform" type="rotate" begin="btn1.click+0.5s" dur="1s"
    values="0,114.51,66.69;30, 114.51,66.69;0,114.51,66.69" fill="freeze" repeatCount="indefinite" />
</path>
 <path  class="TBody" fill="#F437FE"  d="M136.9 11.5 118.6 47.3 116.2 20 108.9 60.1 121.7 69.6 87 67.7 96.1 61 85.5 19.2 81.9 52.3 74.5 15.7Z">

   <animateTransform attributeName="transform" type="rotate" begin="btn1.click+0.5s" dur="2s"
    values="
           10, 105.69,52.39;
           -10, 105.69,52.39;
           -10, 105.69,52.39;
           10, 105.69,52.39"
           fill="freeze"
           repeatCount="indefinite"
           additive="sum"
           restart="whenNotActive" />
  </path>
</g>
   <animateMotion xlink:href="#Tgroup" begin="btn1.click" dur="18s" restart="whenNotActive">
    <mpath xlink:href="#Ttrack" />
   </animateMotion>

<g id="Agroup" transform="scale(1.5)" filter="url(#dropShadow)">
 <path id="Aleft" fill="dodgerblue" d="m147.4 64.5c0 0-5.6 18.1 0 23.7 3.1 3.1 12.4 4.3 12.9 0 0.4-3.4-9.9-2.6-9.9-2.6l-3-21.2m26.8 0.1M183.5 64.5" class="leg">
    <animateTransform attributeName="transform" type="rotate" begin="btn1.click" dur="0.5s"
    values="0, 144.91,64.39;30, 144.91,64.39;0, 144.91,64.39" fill="freeze" repeatCount="indefinite" />
  </path>
  <path id="Aright" fill="dodgerblue" d="m183.5 64.5c0 0-5.6 18.1 0 23.7 3.1 3.1 12.4 4.3 12.9 0 0.4-3.4-9.9-2.6-9.9-2.6l-3-21.2" class="leg">
     <animateTransform attributeName="transform" type="rotate" begin="btn1.click+0.25s" dur="0.5s"
    values="0,181.01,64.39;30, 181.01,64.39;0,181.01,64.39" fill="freeze" repeatCount="indefinite" />
</path>
 <path  class="ABody"  fill="dodgerblue" d="m171 38-5.3-15.1-5.1 18.6zm30.5 21.7-33 10.2 8.4-11.3-2.4-8.4-12.3 0.9-3.6 9.8 5.3 4.2-35.9 2.6 8.7-6.5 11.6-45.2-6.6-4.3 44.5 1.5-10.4 3.7 18.2 40.6z">

   <animateTransform attributeName="transform" type="rotate" begin="btn1.click+0.5s" dur="2s"
    values="
    0,164.7,51.4;
    30,164.7,51.4;
    0,164.7,51.4;
    -30,164.7,51.4;
    0,164.7,51.4"
    fill="freeze"
    repeatCount="indefinite"
    additive="sum"
    restart="whenNotActive" />
    </path>
</g>
   <animateMotion xlink:href="#Agroup" begin="btn1.click" dur="18s" restart="whenNotActive">
    <mpath xlink:href="#Atrack" />
   </animateMotion>

<g id="Cgroup" transform="scale(1.5)" filter="url(#dropShadow)">
 <path id="Cleft" fill="#1EFE6B" d="m212.7 64.5c0 0-5.6 18.1 0 23.7 3.1 3.1 12.4 4.3 12.9 0 0.4-3.4-9.9-2.6-9.9-2.6l-3-21.2m26.8 0.1M238.4 64.5" class="leg">
    <animateTransform attributeName="transform" type="rotate" begin="btn1.click" dur="1s"
    values="0,210.21,64.39;30, 210.21,64.39;0,210.21,64.39" fill="freeze" repeatCount="indefinite" />
  </path>
  <path id="Cright" fill="#1EFE6B" d="m238.4 64.5c0 0-5.6 18.1 0 23.7 3.1 3.1 12.4 4.3 12.9 0 0.4-3.4-9.9-2.6-9.9-2.6l-3-21.2" class="leg">
     <animateTransform attributeName="transform" type="rotate" begin="btn1.click+0.5s" dur="1s"
    values="0,235.91,64.39;30, 235.91,64.39;0,235.91,64.39" fill="freeze" repeatCount="indefinite" />
</path>
 <path  class="CBody" fill="#1EFE6B"  d="m256.7 40.5-4 26.3-1.6-10.7q-5.5 6.5-12.1 9.9-6.6 3.4-13.8 3.4-4.7 0-9.2-1.9-4.5-2-8.1-5.7-4.3-4.3-6.6-9.7-2.3-5.4-2.3-11 0-7.8 3.3-14.2 3.3-6.4 9.3-10.5 4-2.7 8.7-4 4.7-1.3 10.1-1.3 5 0 9.2 1.6 4.3 1.6 8 4.7l2.2-6.3 3.9 20.7q-2.5-3.6-5.9-5.5-3.4-1.9-7.3-1.9-4.5 0-7.3 2.7-2.8 2.6-2.8 7 0 4.6 3.4 7.8 3.4 3.1 8.6 3.1 3.2 0 6.6-1.1 3.4-1.1 7.4-3.4z">

   <animateTransform attributeName="transform" type="rotate" begin="btn1.click+0.5s" dur="2s"
    values="
    10, 227.9,51.1;
    -10,227.9,51.1;
    -10, 227.9,51.1;
    10, 227.9,51.1"
    fill="freeze"
    repeatCount="indefinite"
    additive="sum"
    restart="whenNotActive" />
</path>
</g>
   <animateMotion xlink:href="#Cgroup" begin="btn1.click" dur="18s" restart="whenNotActive"   >
    <mpath xlink:href="#Ctrack" />
   </animateMotion>

<g id="Kgroup" transform="scale(1.5)" filter="url(#dropShadow)">
 <path id="Kleft" fill="#FFDD00" d="m274.6 64.5c0 0-5.6 18.1 0 23.7 3.1 3.1 12.4 4.3 12.9 0 0.4-3.4-9.9-2.6-9.9-2.6l-3-21.2m26.8 0.1M313 64.5" class="leg">
    <animateTransform attributeName="transform" type="rotate" begin="btn1.click" dur="0.5s"
    values="0,272.11,64.39;30, 272.11,64.39;0,272.11,64.39"  repeatCount="indefinite" />
  </path>
  <path id="Kright" fill="#FFDD00" d="m313 64.5c0 0-5.6 18.1 0 23.7 3.1 3.1 12.4 4.3 12.9 0 0.4-3.4-9.9-2.6-9.9-2.6l-3-21.2" class="leg">
     <animateTransform attributeName="transform" type="rotate" begin="btn1.click+0.25s" dur="0.5s"
    values="0,310.51,64.39;30, 310.51,64.39;0,310.51,64.39" fill="freeze" repeatCount="indefinite" />
</path>
 <path  class="KBody" fill="#FFDD00" d="m329.1 68.8-30.1-3.7 6-3.9-17.6-18.1-2 0.4 4.1 20.1 6.4 6.8-38.1-4.3 6.8-5 3.6-41.2-7.4-4.7 30.5-3.7-8.5 6.6 2.5 16 13.4-15.9-3.7-4.6 27.7 1-19.7 15.8z">

   <animateTransform attributeName="transform" type="rotate" begin="btn1.click+0.5s" dur="2s"
    values="
    0, 293.5,51.3;
    30,293.5,51.3;
    0,293.5,51.3;
    -30, 293.5,51.3;
    0, 293.5,51.3"
    fill="freeze"
    repeatCount="indefinite"
    additive="sum"
    restart="whenNotActive" />
</path>
</g>
   <animateMotion id="an_k" xlink:href="#Kgroup" begin="btn1.click" dur="18s" restart="whenNotActive"   >
    <mpath xlink:href="#Ktrack" />
   </animateMotion>

   <animateMotion xlink:href="#Gr_All" begin="an_k.end" dur="18s" repeatCount="15" >
    <mpath xlink:href="#all_Letter" fill="freeze" additive="sum" restart="whenNotActive" />
   </animateMotion>
 </g>

 <g id="btn1" transform="translate(-300,150)" onclick='play()' >
     <circle  cx="736" cy="263" r="8" fill="url(#gradEarth)" filter="url(#dropShadow)" />
     <text id="txt1" x="750" y="270" font-size="2rem" fill="crimson" >Start</text>
 </g>
</svg>

From the above examples, it can be seen that a lot that SMIl can do for CSS is not yet feasible or is poorly supported
A lot of working applications on SMIL have already been made in the world, and therefore when in 2016 they wanted to abolish smill, the developers asked in the Chrome blog what to do with already created applications and where is an equivalent replacement. There is no answer yet.
I hope SMIL will continue to live.


text:
Q: How to measure the max load factor of a hash table python class HashMap:
    """ hashmap class """
    def __init__(self):
        self.max_length = 8
        self.max_load_factor = 0.8
        self.length = 0
        self.map = [None] * self.max_length
        self.keyslist = []

    def _get_hash(self, key):
        hash = 0
        for char in str(key):
            hash += ord(char)
        return hash % self.max_length

    def get(self, key, default=None):
        key_hash = self._get_hash(key)
        if self.map[key_hash] is not None:
            for pair in self.map[key_hash]:
                if pair[0] == key:
                    return pair[1]
        if self.map[key_hash] is None:
            return None

    def set(self, key, value):
        key_hash = self._get_hash(key)
        key_value = [key, value]
        self.keyslist.append(key)
        if self.map[key_hash] is None:
            self.length += 1
            self.map[key_hash] = list([key_value])
            if self.max_load_factor >= .8:
                self.rehash(self.capacity * 2)
            return True
        else:
            for pair in self.map[key_hash]:
                self.length += 1
                if pair[0] == key:
                    pair[1] = value
                    return True
            if self.max_load_factor >= .8:
                self.rehash(self.capacity * 2)
            self.map[key_hash].append(key_value)
            return True

    def capacity(self):
        return self.max_length  # return the current capacity --number of buckets-- in the map

    def rehash(self):
        self.map = [None] * (self.max_length * 2)
        return self.map

So i need a max load factor of .8, and when that occurs, i need to rehash the table (essentially making the map double the capacity)
But how exactly do i measure the load factor? is it the length of the current buckets? Because if you look at the set() method, after adding, if the load-factor >= 80%, i need to rehash the map into a map double its current capacity. however, how exactly do i measure the load factor?
Any help would be appreciated. I just need to know how to measure the load factor!

A: I think this is what you wanted:
class HashMap:
    """ hashmap class """
    def __init__(self, max_length=8):
        self.max_length = max_length
        self.max_load_factor = 0.8
        self.length = 0
        self.map = [None] * self.max_length
        self.keyslist = []

    def _get_hash(self, key):
        hash = 0
        for char in str(key):
            hash += ord(char)
        return hash % self.max_length

    def get(self, key, default=None):
        key_hash = self._get_hash(key)
        if self.map[key_hash] is not None:
            for pair in self.map[key_hash]:
                if pair[0] == key:
                    return pair[1]
        if self.map[key_hash] is None:
            return None

    def _rehash_if_needed(self):
        if self.length >= self.max_load_factor * self.capacity():
            self._rehash(self.capacity() * 2)

    def set(self, key, value):
        key_hash = self._get_hash(key)
        key_value = [key, value]
        self.keyslist.append(key)
        if self.map[key_hash] is None:
            self.length += 1
            self.map[key_hash] = list([key_value])
            self._rehash_if_needed()
            return True
        else:
            for pair in self.map[key_hash]:
                self.length += 1
                if pair[0] == key:
                    pair[1] = value
                    return True
            self.map[key_hash].append(key_value)
            self._rehash_if_needed()
            return True

    def capacity(self):
        return self.max_length

    def _rehash(self, new_capacity):
        # Create new hashmap with new capacity
        new_hashmap = HashMap(new_capacity)
        # Insert all the keys in the new hashmap
        for key in self.keyslist:
            value = self.get(key)
            new_hashmap.put(key, value)

        # Copy all the fields of the new hashmap to this hashmap
        self.max_length = new_hashmap.max_length
        self.max_load_factor = new_hashmap.max_load_factor
        self.length = new_hashmap.length
        self.map = new_hashmap.map
        self.keyslist = new_hashmap.keyslist


text:
Q: Is there any area where Threads should be favored over Coroutines? I just gave a talk about Kotlin's Coroutines and the question arised if Coroutines can always replace Threads or if there also might be disadvantages.
Or the other way round: Is there any area where Coroutines should not be used for?

A: Coroutines are useful for asynchronous programming. When you are writing code that has to wait most of the time for some external events, like it often happens in modern connected user-interfaces and micro-service-oriented backend applications, then coroutines and the concept of Kotlin suspending functions let you write naturally looking and easy-to-understand code that is more scalable than the code with explicit threads.
If you are writing some kind of computation, CPU-intensive code, then you'd find that classical patterns of multithread-programming and parallelism work better.
It does not mean that you cannot use coroutines to parallelize some piece of CPU-intensive application, but you will not get any benefits in either code readability or its performance from doing so.


text:
Q: How to generate an array filled with a few different values? I want to generate the following array:
[3, 3, 3, 3, 4, 4, 5, 5, 5]

there are 3 different values that should repeat m, n, and k times. What is the easiest way to do that?
If I do Array(m + n + k).fill(...).fill(...).fill(...) the start and end points in later fill calls look not very straightforward.

A: Generate the arrays separately and then combine them into one final array
[
  ...Array(4).fill(3),
  ...Array(2).fill(4),
  ...Array(3).fill(5)
]

A: Create an array of values, and an array of repeat. Iterate the values with Array.map(), and return a new array filled with the values. Flatten by spreading into Array.concat():

const values = [3, 4, 5];
const repeat = [4, 2, 3];

const arr = [].concat(...values.map((v, i) => new Array(repeat[i]).fill(v)));

console.log(arr);

A:

var arrValues = [3,4,5];
var arrRepeats = [4,2,3];
var arr = [];

for(var i =0; i< arrRepeats.length;i++){
  arr.push(Array(arrRepeats[i]).fill(arrValues[i]));
}
console.log(arr)

Or

var arrValues = [3,5,4];
var arrRepeats = [4,2,3];
let arr = [];
for(var i =0; i< arrRepeats.length; i++){
  for(var j=0; j<arrRepeats[i];j++){
    arr.push(arrValues[i]);
  }
}

console.log(arr)

Or you can do that if you wanna generate arrays and combine them

var arrValues = [3,5,4];

var arrRepeats = [4,2,3];  // m, n, k
var mainArr = [];

for(var i =0; i< arrRepeats.length; i++){
    var arr = [];
  for(var j =0; j < arrRepeats[i]; j++){

    arr.push(j);
    arr.fill(arrValues[i]);
  }
    mainArr.push(arr);

}

    console.log(mainArr)


text:
Q: How to get base secure url without index.php I want to to get base-secure-url without index.php.
I enabled index.php for some reason. Now I have a PHP file at Magento root directory, and I want to call Magento secure pages from this PHP file.
Note: i have multi stores in my site
Please provide more ideas on this.

A: Below URL Access list
Get URLs in CMS pages or static blocks

*

*Base URL:
{{base url=''}}

*Store URL:
{{store url='test.html'}}

also only store URL
{{store url=""}}

*Media URL:
only get media URL
{{media url=''}}

if you get some folder path
{{media url='imagefolder/imagename.jpg'}}

*Skin URL:
{skin url='images/imagename.jpg'}}

only get skin URL
{skin url=''}}

Get URLs in PHP files (incl. templates/PHTML)

*

*Get Base Url  in magento:
$baseurl = Mage::getBaseUrl();

Get Base Url without index.php
Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_WEB);

// output: http://example.com/

*Current Url
$currentUrl = Mage::helper('core/url')->getCurrentUrl();

or
$currentUrl = Mage::getUrl('*/*/*', array('_current' => true));

or
if (!in_array(Mage::app()->getFrontController()->getAction()->getFullActionName(), array('cms_index_noRoute', 'cms_index_defaultNoRoute')))
{
    $currentUrl = Mage::helper('core/url')->getCurrentUrl();
}

*Skin URL:
$skinUrl = Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_SKIN);

Unsecure Skin URL:
$skinUrl = $this->getSkinUrl('images/imagename.jpg');

Secure Skin URL:
$this->getSkinUrl('images/imagename.gif', array('_secure'=>true));

*Media URL
$mediaUrl = Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_MEDIA);

or
$mediaUrl = Mage::getBaseUrl('media');

*Get Js URL:
$jsUrl = Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_JS);

or
$jsUrl = Mage::getBaseUrl('js');

*get store URL:
$storeUrl = Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_WEB);

*Get Home URL:
$homeUrl= Mage::helper('core/url')->getHomeUrl();

*Get Directory paths
Mage::getBaseDir('design') // Get design directory path
Mage::getBaseDir('code')   // Gives code directory file path
Mage::getBaseDir('lib')    // Gives lib directory file path
Mage::getBaseDir('skin')   // Gives skin directory file path
Mage::getBaseDir('var')    // Gives var directory file path
Mage::getBaseDir('cache')  // Gives cache directory file path
Mage::getBaseDir('log')    // Gives log directory file path

*Create module URL:
Mage::getUrl('module/controller/action');

Get More details about get URLs

A: This should do the trick:
Mage::getBaseUrl('link',true);

Short and sweet.

A: Mage::getStoreConfig(Mage_Core_Model_Url::XML_PATH_SECURE_URL);

I mention this because no one else has, but I prefer using Mage::getUrl or Mage::getBaseUrl.  Both of those automatically detect if the page is already secure when you do not specify it.

A: as @Aphroz said, you can use
Mage::getBaseUrl( Mage_Core_Model_Store::URL_TYPE_WEB, true );

in order to retrieve secure base url. This returns secure url because we have specified it through second parameter true. Here first parameter is specified as Mage_Core_Model_Store::URL_TYPE_WEB. This means the method returns value correspond to this system configuration field web/secure/base_url. This field is the value that we specify at
 System  >  Configuration  > Web  >  Secure url

so if this field is not using index.php there along with the base url, then the method will not give index.php along with the url. If it holds index.php, then it will return the same. So to ensure index.php is not there you can use str_replace function.

A: Can't you use this?
str_replace('index.php','whatever.php',Mage::getBaseUrl('web', true));


text:
Q: How to reset Azure DevOps connector in MS Teams I was moved from one DevOps organisation to another and access to the old org was removed. This caused my MS Teams DevOps plugin to stop working in private chats, but was fine in team channels.

When I tried to open the app settings, I got a white window with a JSON that suggested a permission problem.
How do I connect the app to the new organisation?

A: Trying to open the app settings using the Teams webpage I got a popup that let me read the request URL and I saw the two GET parameters for organisation and project ID.

Removing those two parameters gave me a screen to select an organisation and a project. The tab closed right away and the integration is fixed.
I guess replacing the project_id and tfs_uri with the correct data from the target project would work, too, but that's the purpose of the section page, already.
Going to the app settings now yields this exact selection page, by the way, so this is a bug in the DevOps Teams app. There's one line of information at the top that apparently requires access to the DevOps organisation and needlessly gates the whole dialog behind organisation access permissions.


text:
Q: Testing on a second iPhone I have developed my first full fledged iPhone app, and tested it on my phone.  I would like to have it tested by one of the contributing graphic artists on their iPhone.  They live in another state so I do not have access to their device.  I added their Device ID to the apple portal.
A couple of questions:
I do not see the device show in Xcode when I hit refresh.  Should I be seeing it?
Which executable file(s) do I send to them?

A: Look at testflight. It makes distributing apps very easy. Since you have already included the designers device ID, all you have to do is:

*

*Sign up to test flight

*invite the designer and tell him to register and add his device info

*go to apple developer portal - provisioning - distribution and create a new distribution profile (don't forget to add the designers device when creating the profile), download and open the certificate (which will be shown in Xcode's Window>Organizer) - make sure that the correct certificates are selected in your build settings.

*make sure that iOS device is selected ( and not the simulator) now in Xcode go to Product>Archive, when the archive is shown click distribute>adhoc distribution

*this will create an IPA file.

*upload this to test flight and follow the instructions to select the designer from your team.

A: Use TestFlight. It's free, takes 5 mins to install their API, and gives step by step instructions on how to push your app to any tester over the air.

A: Add their device id to your developer account, Update your adhoc profile (which you are using for running your app on device) attach their device with this profile. Now again sign your build with updated profile and give this APP file and provisioning profile to others or upload it on TestFlight.


text:
Q: Standard Error of prediction for Logistic Sigmoid function Standard Error of prediction for Logistic Sigmoid function
(previously: Finding the prediction interval for logistic regression)
Update 2:
This paper describes what I am looking to implement.
Update:

*

*Based upon some comments I am renaming this question. I am asking for the std error to calculate prediction bands on a Logistic sigmoid function, which is fit using regression not the regression predictions, which are binary.

*Predictions are being made using scipy.special.expit like so: prediction = [expit(x*beta  + alpha) for x in a_pred]. The results look like this:

Based on Kerby Shedden's answer and this I now have to methods of calcualting the SE for the prediction interval:
$ SE = \sqrt(xSx^T) $
and
$ SE = \sqrt(MSE + xSx^T) $
However, is it legitimate to caluate the MSE based on residuals from binary data as shown:

TL;DR
there are two type of SE(Standard error) - More Detail
How do I calculate the SE for a predicted indivdual (not the mean) put into a logistic regression model statsmodels.discrete.discrete_model.Logit
Like this  for linear regression in statsmodels or this  in R.
I can extract model parameter variance, covariance and std dev but that is it....the model does not return std error of predictions - how do I calculate these?
Full
I am trying to fit a prediction interval for logitistic regression model.
I am using statsmodels although I am happy hear answers using another package.
My procedure so far:
Fit the model to data df:
log_mdl = statsmodels.discrete.discrete_model.Logit.from_formula ("hit ~ a",df).fit()
The models parameters returned:
                           Logit Regression Results
==============================================================================
Dep. Variable:                    hit   No. Observations:                  200
Model:                          Logit   Df Residuals:                      198
Method:                           MLE   Df Model:                            1
Date:                Tue, 10 Mar 2020   Pseudo R-squ.:                  0.6209
Time:                        14:02:57   Log-Likelihood:                -45.308
converged:                       True   LL-Null:                       -119.52
Covariance Type:            nonrobust   LLR p-value:                 3.823e-34
==============================================================================
                 coef    std err          z      P>|z|      [0.025      0.975]
------------------------------------------------------------------------------
Intercept     -4.0571      0.532     -7.624      0.000      -5.100      -3.014
a              0.0990      0.015      6.657      0.000       0.070       0.128
==============================================================================

then I make some predictions for values a_pred so I can plot the line:
    log_pred = [expit(x* log_mdl.params[1]  + log_MLE.params[0]) for x in a_pred]
I now wish to find the prediction interval for each prediction.
To do this I need the SE (Standard Error) of each prediction:
However there are two type of SE - More detail:
Ideally there would be a method like this for linear regression in statsmodels or this in R.
I have found this for 95% Confidence interval for of the true logit, which is the same as the martic operation in this. Which is apparently what R returns as the SE for a prediction.

However I am not sure if this is the SE of the predicted mean (Confidence interval) or the SE of a predicted individual (Prediction interval).
I have also found this in which there are two method of calcualting the CI, one for the funct (i assume mean) and another for an observation (I assume this means a single prediction). This reflects what is said here, that there are two SEs one for the mean and another for a single prediction which includes the variation of the signal not just the accuracy of the estimated mean.
How can I find the SE of a predicted individual?

A: Something like below should work:
x = log_mdl.model.exog
c = log_mdl.cov_params()
vcov = np.dot(x, np.dot(c, x.T))
se = np.sqrt(np.diag(vcov))

If x is very large there are faster ways to do this that only compute the diagonal of vcov, i.e.
v = (x * np.dot(x, c)).sum(1)
se = np.sqrt(v)

But this is less transparent.
For terminology, I think you could refer to this as the standard error for the logit probabilities.

A: The usual way to assess predictive uncertainty for logistic regression is using cross-validation.  If you want something that sort of looks like the OLS prediction interval, you can use something like below:
import numpy as np                                                                                import statsmodels.api as sm                                                                                import pandas as pd                                                                                from scipy.stats.distributions import norm                                                                                n, p = 200, 3
# Generate data
x = np.random.normal(size=(n, p))                                                                                par = np.r_[1, 0, -1]
lpr = np.dot(x, par)
pr = 1 / (1 + np.exp(-lpr))
y = (np.random.uniform(size=n) < pr).astype(np.int)

# Fit a model
model = sm.GLM(y, x, family=sm.families.Binomial())
result = model.fit()

# Calculate the accuracy.
c = result.cov_params()
lpr_hat = np.dot(x, result.params)
pr_hat = 1 / (1 + np.exp(-lpr_hat))
sd = np.sqrt(np.diag(np.dot(x, np.dot(c, x.T))))
q = pr_hat*(1 - norm.cdf(-lpr_hat/sd)) + (1 - pr_hat)*norm.cdf(-lpr_hat/sd)

The bottom five lines are a plug-in estimate of the probability that the observed value and predicted value are the same, for each case.


text:
Q: Java-how to split one list in two lists Who can help me and give me a code that split an list contains positif and negatif values in two list :the first list contains neagtif values and second list contains positf values without using java library.help me

A: Why not a little help!
Assuming your List contains integers.
List<Integer> integers = listOfIntegers();
List<Integer> positive = new ArrayList<>();
List<Integer> negative = new ArrayList<>();

for (Integer i : integers) {
    if (i >= 0)
        positive.add(i);
    else
        negative.add(i);
}

The next time you need to specify more information. Furthermore, you must ask about a particular problem in your code and not for a complete solution.


text:
Q: Error in using aggregate function max() oracle I am trying to run query
select * from OS_Historystep where step_name = '011' and finish_date = max(finish_date) ;

But i am getting error that
ORA-00934: group function is not allowed here
00934. 00000 -  "group function is not allowed here"
*Cause:
*Action:
Error at Line: 12 Column: 72

what i am doing wrong?
Thanks

A: You can't use an aggregate in a where clause. Also, you can't mix non-aggregated data and aggregated data from the same column in a single select. You'll need to use a sub-query:
select *
from OS_Historystep hs1
where step_name = '011'
and finish_date = (select max(finish_date)
                   from OS_Historystep hs2
                   where hs2.step_name = hs1.step_name);

A: you cannot reference an aggregate like that. you would either have to put a sub query up like below (assuming you wanted the max(finish_date) to mean the max finish date for step 011 and not the max finish date in the whole table (which may return no rows):
select *
  from OS_Historystep
 where step_name = '011'
   and finish_date = (select max(finish_date)
                        from OS_Historystep
                       where step_name = '011');

or use an analytic function
select *
  from (select s.*, rank() over (partition by step_name order by finish_date desc) rnk
          from OS_Historystep s
         where step_name = '011')
 where rnk = 1;


text:
Q: ValueError when using scikit-learn train_test_split function in PySpark Pandas UDF I want to create a pandas udf function for Pyspark in which I am using the scikit-learn train_test_split function and returning a dataframe.
And I have a dataframe like this:

But in my dataframe, there is no id column. So I have added id column in dataframe
This is what I have done.
@pandas_udf(schema, PandasUDFType.GROUPED_MAP)
def load_dataset(df):
    X = df[X_columns]
    y = df[y_columns]
    X_train, X_test, y_train, y_test = train_test_split(X, y, test_size = 0.2, random_state = 42)

    df_sample_0 = pd.concat([y_test, X_test], axis=1)

    return df_sample_0

And this is how I am applying groupby:
sample_df = final_df_spark.groupby("id").apply(load_dataset)

But I am getting this error:
ValueError: With n_samples=1, test_size=0.2 and train_size=None, the resulting train set will be empty. Adjust any of the aforementioned parameters.

How would I go about fixing this error?

A: I just replaced id column to Age column.
sample_df = final_df_spark.groupby("Age").apply(load_dataset)


text:
Q: why in a block element , the second inline-block element affects the position of the first inline-block element? here is the html code and CSS code:
<!DOCTYPE html>

  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">

  <link rel="icon" type="image/png" sizes="32x32" href="assets/favicon-32x32.png">

  <title>Frontend Mentor | Space tourism website</title>
  <link rel="stylesheet" href="testing-css/testing.css">

body {
    margin: 0;
    padding: 0;
    background-image: url('../assets/home/background-home-desktop.jpg') ;
    background-repeat: no-repeat;
    background-size: cover;
    background-position: center;
    height: 100vh;
    width: 100vh;
}

.main-menu {
    display: block;
    margin: 50px;
    padding: 25px 0 25px 0;
    width: 2000px;
    height: 50px;
    font-size: 0;
}

.logo {
    width: 50px;
    height: 50px;
    display: inline-block;

}

.logo-img {
    width: 50%;
    height: 50%;
}

.line {
    width: 600px;
    height: 50px;
    display: inline-block;
    padding-left: 50px;
    padding-right: 50px;
}
.horizontal-line {
    width: 600px;
    height: 2px;
    display: block;
    background-color:#979797;
    position: relative;
    bottom: -50%;
}

the result shows:
when there is no second inline-block element
when remove the comment remarks, the html code is:
<!DOCTYPE html>

  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">

  <link rel="icon" type="image/png" sizes="32x32" href="assets/favicon-32x32.png">

  <title>Frontend Mentor | Space tourism website</title>
  <link rel="stylesheet" href="testing-css/testing.css">

CSS code is the same as before, no changes.
the results shows :
when there has second inline-block element
the first inline-block element were pushed down...
what is the reason for this happening??
So , what is reason that affects the first inline-block element's position??


text:
Q: jvisualvm: visualgc histogram Does anyone know why I'v got error
Not supported for this JVM
when I run Visual GC plugin?
Bellow about information from jvisualvm
Version:    1.8.0 (Build 1360-130911); platform 20130911-unknown-revn
System:     Windows 7 (6.1) Service Pack 1, amd64 64bit
Java:   1.8.0; Java HotSpot(TM) 64-Bit Server VM (25.0-b70, mixed mode)
Vendor:     Oracle Corporation, http://java.oracle.com/
Environment:    Cp1250; pl_PL (visualvm)
User directory:     C:\Users\tech\AppData\Roaming\VisualVM\7u60
Cache directory:    C:\Users\tech\AppData\Local\VisualVM\Cache\7u60
Clusters:   "C:\Java\jdk1.8.0\lib\visualvm\platform
C:\Java\jdk1.8.0\lib\visualvm\visualvm
C:\Java\jdk1.8.0\lib\visualvm\profiler"

A: If it is the visualgc histogram, there is some discussion here that says

The Histogram view may or may not be displayed by default depending on
  the application configuration - when the monitored VM uses Parallel
  Scavenge collection (using Server VM or setting -XX:+UseParallelGC or
  -XX:+AggressiveHeap), Histogram view is hidden by default.

https://blogs.oracle.com/nbprofiler/entry/visual_gc_plugin_2_0
If it is visualgc itself, then it requires jstatd running, see here for help on how to setup jstatd on the remote server:
http://www.oracle.com/technetwork/java/visualgc-136680.html
http://docs.oracle.com/javase/1.5.0/docs/tooldocs/share/jstatd.html


text:
Q: getChildFragmentManager().findFragmentById(R.id.map_fragment) return null on GoogleMaps Android App Estaba desarrollando una App en Android que implementa un fragment en el que pretendo cargar un GoogleMapsActivity, pero en vez de implementarlo con activity la idea es hacerlo en una fragment, ya que mi App se basa en el Android Component Navigation, que navega entre fragments.
Creo que he realizado todos los registros en los servicios de google correctamente, pero al intentar la lanzar el mapa en mi App, obtengo una NullpointerException:
Process: com.example.journal, PID: 5750
    java.lang.NullPointerException: Attempt to invoke virtual method 'void com.google.android.gms.maps.SupportMapFragment.getMapAsync(com.google.android.gms.maps.OnMapReadyCallback)' on a null object reference
        at com.example.journal.ui.search.ItemBirdFragment.onCreate(ItemBirdFragment.java:92)

El código de mi fragment es el siguiente:
ItemBirdFragment.fragment
public class ItemBirdFragment extends Fragment implements OnMapReadyCallback {

...

@Override
    public void onSaveInstanceState(@NonNull Bundle outState) {
        super.onSaveInstanceState(outState);
        Bundle mapViewBundle = new Bundle();
        if(outState != null){
            outState.putBundle(Constants.MAPVIEW_BUNDLE_KEY, mapViewBundle);
            mapView.onSaveInstanceState(mapViewBundle);
        }else{
            Toast.makeText(getContext(), "No se ha podido cargar la localización del ave selecionada", Toast.LENGTH_LONG).show();
        }
    }

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

        //TODO:Prueba Maps.

        OnBackPressedCallback callback = new OnBackPressedCallback(true) {
            @Override
            public void handleOnBackPressed() {
                appNavigator.goBack(requireActivity());
            }
        };
        requireActivity().getOnBackPressedDispatcher().addCallback(this, callback);
    }

    @Nullable
    @Override
    @Override
    public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
        root = inflater.inflate(R.layout.fragment_item_bird, container, false);
        initView(root);
        initGoogleMap(savedInstanceState);

        int status = GooglePlayServicesUtil.isGooglePlayServicesAvailable(getContext());

        if(status  == ConnectionResult.SUCCESS){
            SupportMapFragment mapFragment = (SupportMapFragment) getChildFragmentManager().findFragmentById(R.id.map_fragment);
            mapFragment.getMapAsync(this);
        }else{
            Dialog diolog = GooglePlayServicesUtil.getErrorDialog(status, (Activity)getContext(), 10);
            diolog.show();
        }
        initListeners();
        return root;
    }

    @Override
    public void onViewCreated(@NonNull View view, Bundle savedInstanceState) {
        super.onViewCreated(view, savedInstanceState);
    }

    private void initListeners() {
        btn_add.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                openDialog();
            }
        });
    }

    private void initView(View root) {
        Serializable serializable = getArguments().getSerializable("item");
        bird = (Bird) serializable;
        bird_name = (TextView) root.findViewById(R.id.bird_name);
        sci_name = (TextView) root.findViewById(R.id.sci_name);
        data_date = (TextView) root.findViewById(R.id.date_data);
        location_name = (TextView) root.findViewById(R.id.location_name);
        quantity = (TextView) root.findViewById(R.id.quantity);
        bird_image = (ImageView) root.findViewById(R.id.bird_image);
        btn_add = (FloatingActionButton) root.findViewById(R.id.btn_add);
        quantity_image = (ImageView) root.findViewById(R.id.quantity_image);
        loading = (ProgressBar) root.findViewById(R.id.loading_bird);
        scroll_bird = (ScrollView) root.findViewById(R.id.scroll_bird);
        mapView = (MapView) root.findViewById(R.id.map_fragment);
        scroll_bird.setVisibility(View.INVISIBLE);
        loading.setVisibility(View.VISIBLE);
        loading.animate()
                .alpha(1f)
                .setDuration(3000)
                .setListener(new AnimatorListenerAdapter() {
                    @Override
                    public void onAnimationEnd(Animator animation) {
                        loading.setVisibility(View.INVISIBLE);
                        scroll_bird.setVisibility(View.VISIBLE);
                    }
                });
        bird_name.setText(bird.getComName());
        sci_name.setText(bird.getSciName());
        data_date.setText(bird.getDate());
        location_name.setText(bird.getLocName());

        if (bird.getHowMany() == "0") {
            quantity.setVisibility(View.INVISIBLE);
            quantity_image.setVisibility(View.INVISIBLE);
        } else
            quantity.setText(bird.getHowMany() + " " + getString(R.string.birds_seen));

        if (!bird.getUrlImg().equals(Bird.ERROR_IMAGE)) {
            Picasso.with(getContext()).load(bird.getUrlImg()).transform(new CropSquareTransformation()).resize(800, 600).into(bird_image);
        } else {
            bird_image.setImageResource(R.drawable.ic_broken_image);
        }
        //TODO: Video
    }

    private void openDialog() {
        //TODO: Before to send to the add
        DialogFragment dialogFragment = new AddDialog(getContext(), bird);
        dialogFragment.show(getFragmentManager(), "AddDialog");
    }

    private void initGoogleMap(Bundle savedInstanceState) {
        // *** IMPORTANT ***
        // MapView requires that the Bundle you pass contain _ONLY_ MapView SDK
        // objects or sub-Bundles.
        Bundle mapViewBundle = null;

        if (savedInstanceState != null) {
            mapViewBundle = savedInstanceState.getBundle(Constants.MAPVIEW_BUNDLE_KEY);
            mapView.onCreate(mapViewBundle);
            mapView.onResume();
            mapView.getMapAsync(this);
        } else {
            onSaveInstanceState(savedInstanceState);
        }
    }

    private void setCameraView() {
        if(map != null){
            map.addMarker(new MarkerOptions().position(new LatLng(Double.parseDouble(bird.getLat()), Double.parseDouble(bird.getLng()))));
            map.moveCamera(CameraUpdateFactory.newLatLng(
                    new LatLng(Double.parseDouble(bird.getLat()), Double.parseDouble(bird.getLng()))));
        }else{
            Toast.makeText(getContext(), "No se han podido cargar los detalles de localización del ave", Toast.LENGTH_LONG).show();
        }
    }

    @Override
    public void onResume() {
        super.onResume();
        if(mapView!=null){
            mapView.onResume();
        }else{
            Toast.makeText(getContext(), "No se han podido cargar los detalles de localización del ave", Toast.LENGTH_LONG).show();
        }
    }

    @Override
    public void onStart() {
        super.onStart();
        if(mapView!=null){
            mapView.onStart();
        }else{
            Toast.makeText(getContext(), "No se han podido cargar los detalles de localización del ave", Toast.LENGTH_LONG).show();
        }
    }

    @Override
    public void onStop() {
        super.onStop();
        if(mapView!=null){
            mapView.onStop();
        }else{
            Toast.makeText(getContext(), "No se han podido cargar los detalles de localización del ave", Toast.LENGTH_LONG).show();
        }
    }

    @Override
    public void onMapReady(GoogleMap googleMap) {
        if (ActivityCompat.checkSelfPermission(getActivity(), Manifest.permission.ACCESS_FINE_LOCATION)
                != PackageManager.PERMISSION_GRANTED
                && ActivityCompat.checkSelfPermission(getActivity(), Manifest.permission.ACCESS_COARSE_LOCATION)
                != PackageManager.PERMISSION_GRANTED) {
            return;
        }
        if(googleMap != null && map != null){
            MapsInitializer.initialize(getContext());
            googleMap.setMyLocationEnabled(true);
            map = googleMap;
            map.setMapType(GoogleMap.MAP_TYPE_SATELLITE);

            UiSettings settings = map.getUiSettings();
            settings.setZoomControlsEnabled(true);

            setCameraView();
        }else{
            Toast.makeText(getContext(), "No se han podido cargar los detalles de localización del ave", Toast.LENGTH_LONG).show();
        }

    }

    @Override
    public void onPause() {
        if(mapView!=null){
            mapView.onPause();
        }else{
            Toast.makeText(getContext(), "No se han podido cargar los detalles de localización del ave", Toast.LENGTH_LONG).show();
        }
        super.onPause();
    }

    @Override
    public void onDestroy() {
      if(mapView!=null){
            mapView.onDestroy();
        }else{
            Toast.makeText(getContext(), "No se han podido cargar los detalles de localización del ave", Toast.LENGTH_LONG).show();
        }
        super.onDestroy();
    }

    @Override
    public void onLowMemory() {
        super.onLowMemory();
        if(mapView!=null){
            mapView.onLowMemory();
        }else{
            Toast.makeText(getContext(), "No se han podido cargar los detalles de localización del ave", Toast.LENGTH_LONG).show();
        }
    }

y el archvo .xml que define la interfaz gráfica es el siguiente:
fragment_item__bird.xml
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context=".ui.search.ItemBirdFragment">

    <ProgressBar
        android:id="@+id/loading_bird"
        style="?android:progressBarStyleLarge"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_gravity="center"
        android:layout_marginTop="50dp"
        android:progressTint="@color/dark_green"
        android:visibility="visible"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toTopOf="parent" />

    <ScrollView
        android:id="@+id/scroll_bird"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintHorizontal_bias="0.0"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toTopOf="parent"
        app:layout_constraintVertical_bias="1.0">

        <androidx.constraintlayout.widget.ConstraintLayout
            android:layout_width="match_parent"
            android:layout_height="match_parent">

            <TextView
                android:id="@+id/bird_name"
                style="@style/TitleDialogSimpleTextViewStyle"
                android:layout_width="0dp"
                android:layout_height="wrap_content"
                android:layout_marginStart="30dp"
                android:layout_marginTop="20dp"
                android:layout_marginEnd="16dp"
                android:layout_weight="1"
                android:text="-"
                android:textAlignment="textStart"
                app:layout_constraintEnd_toEndOf="parent"
                app:layout_constraintStart_toStartOf="parent"
                app:layout_constraintTop_toTopOf="parent" />

            <TextView
                android:id="@+id/sci_name"
                android:layout_width="0dp"
                android:layout_height="wrap_content"
                android:layout_marginStart="30dp"
                android:layout_marginTop="5dp"
                android:layout_marginEnd="16dp"
                android:text="-"
                android:textStyle="italic"
                app:layout_constraintEnd_toEndOf="parent"
                app:layout_constraintStart_toStartOf="parent"
                app:layout_constraintTop_toBottomOf="@+id/bird_name" />

            <ImageView
                android:id="@+id/imageView6"
                android:layout_width="100dp"
                android:layout_height="100dp"
                android:layout_marginTop="10dp"
                android:layout_marginEnd="10dp"
                android:src="@drawable/ic_wagtail"
                app:layout_constraintEnd_toEndOf="parent"
                app:layout_constraintTop_toTopOf="parent" />

            <com.google.android.material.floatingactionbutton.FloatingActionButton
                android:id="@+id/btn_add"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_marginTop="40dp"
                android:layout_marginEnd="32dp"
                android:clickable="true"
                android:src="@drawable/ic_add"
                app:layout_constraintEnd_toEndOf="parent"
                app:layout_constraintTop_toBottomOf="@+id/imageView6" />

            <ImageView
                android:id="@+id/bird_image"
                android:layout_width="200dp"
                android:layout_height="200dp"
                android:layout_marginStart="30dp"
                android:layout_marginTop="20dp"
                app:layout_constraintStart_toStartOf="parent"
                app:layout_constraintTop_toBottomOf="@+id/sci_name"
                tools:src="@drawable/ic_broken_image" />

            <TextView
                android:id="@+id/date_data"
                android:layout_width="0dp"
                android:layout_height="wrap_content"
                android:layout_marginStart="20dp"
                android:layout_marginTop="24dp"
                android:layout_marginEnd="20dp"
                android:drawableStart="@drawable/ic_calendar"
                android:drawablePadding="12dp"
                android:drawableTint="@color/super_dark_green"
                app:layout_constraintEnd_toEndOf="parent"
                app:layout_constraintStart_toStartOf="parent"
                app:layout_constraintTop_toBottomOf="@+id/bird_image" />

            <TextView
                android:id="@+id/location_name"
                android:layout_width="0dp"
                android:layout_height="wrap_content"
                android:layout_marginStart="20dp"
                android:layout_marginTop="24dp"
                android:layout_marginEnd="20dp"
                android:drawableStart="@drawable/ic_location"
                android:drawablePadding="12dp"
                android:drawableTint="@color/burgundy"
                app:layout_constraintEnd_toEndOf="parent"
                app:layout_constraintStart_toStartOf="parent"
                app:layout_constraintTop_toBottomOf="@+id/quantity" />

            <View
                android:id="@+id/view"
                android:layout_width="0dp"
                android:layout_height="1dp"
                android:layout_marginStart="20dp"
                android:layout_marginTop="12dp"
                android:layout_marginEnd="20dp"
                android:background="@color/burgundy"
                app:layout_constraintEnd_toEndOf="parent"
                app:layout_constraintStart_toStartOf="parent"
                app:layout_constraintTop_toBottomOf="@+id/location_name" />

            <com.google.android.gms.maps.MapView
                android:id="@+id/map_fragment"
                android:layout_width="match_parent"
                android:layout_height="0dp"
                android:layout_marginTop="10dp"
                android:layout_marginBottom="32dp"
                app:layout_constraintBottom_toBottomOf="parent"
                app:layout_constraintEnd_toEndOf="parent"
                app:layout_constraintHorizontal_bias="0.0"
                app:layout_constraintStart_toStartOf="parent"
                app:layout_constraintTop_toBottomOf="@+id/view" />

            <ImageView
                android:id="@+id/quantity_image"
                android:layout_width="40dp"
                android:layout_height="40dp"
                android:layout_marginStart="16dp"
                android:layout_marginTop="24dp"
                android:src="@drawable/ic_bird"
                app:layout_constraintStart_toStartOf="parent"
                app:layout_constraintTop_toBottomOf="@+id/date_data" />

            <TextView
                android:id="@+id/quantity"
                android:layout_width="0dp"
                android:layout_height="wrap_content"
                android:layout_marginStart="12dp"
                android:layout_marginTop="24dp"
                android:layout_marginEnd="16dp"
                android:elegantTextHeight="false"
                app:layout_constraintEnd_toEndOf="parent"
                app:layout_constraintHorizontal_bias="1.0"
                app:layout_constraintStart_toEndOf="@+id/quantity_image"
                app:layout_constraintTop_toBottomOf="@+id/date_data" />

        </androidx.constraintlayout.widget.ConstraintLayout>
    </ScrollView>
</androidx.constraintlayout.widget.ConstraintLayout>

Como digo lo que esta llegando a null, aunque esta inicializado es 'mapFragment'.
Si podeís ayudar, muchas gracias de ante mano!
[EDIT]
He actualizado el código, situando la linea que lanzaba el error en el onCreatedView(), pero sigue dando el mismo error.
Añado también una captura del debugger:


text:
Q: Laravel socialite don't have permission to access this link on server I'm trying to make social login using Google, Facebook, and LinkedIn on my website
the last two works very well but Google always gives me error like this :
Forbidden
You don't have permission to access /test/login/google/callback on this server.
Additionally, a 403 Forbidden error was encountered while trying to use an ErrorDocument to handle the request.

I don't know why it's only appearing with Google, can anyone help me?

A: The reason for getting this error is because Google+ API is not enabled
go on google console account and enable Google+ API. If you haven't known how to enable Google+ services then follow this steps:
First Open your Google Console Account from Here: console.developers.google.com
Then Go to -> library -> select Google+ API -> Enable
If you have any configuration related problem then see my GitHub code for Socialite


text:
Q: how to get coordinates of a linear array i am making a game in which i have a 3d map stored int an array int integers:
int width = 256;
int height = 256;
int depth = 64;
int[] map = new int[width * height * depth];

i need to be able to get get the x, y, z of an index. the current method i came up with is:
private int getX(int blockID) {
    return blockID % width;
}

private int getY(int blockID) {
    return (blockID % depth) / height;
}

private int getDepth(int blockID) {
    return blockID / (width * height);
}

the methods for getting the x and the depth seem to work but i cannot get the getY() to work correctly and i keep getting and ArrayIndexOutOfBoundsException like the one below:
Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: -1
at game.Level.updateLighting(Level.java:98)
at game.Level.generateMap(Level.java:58)
at game.Level.<init>(Level.java:21)
at game.mainClass.main(Minecraft.java:6)

please help if you know how to do this.

A: Dude. Just use a 3D array.
int[][][] map = new int[width][height][depth];

Then you don't have to worry about demuxing x, y, and z indices from the blockID. They are lineary independent, so keep them that way.

A: Try
private int getY(int blockID) {
    return (blockID / width) % height
}


text:
Q: Change Chartjs financial chart yaxis from left to right Change Chartjs financial chart yaxis from left to the right, tried this code but didnt work:
scales: {
yAxes: [{
display: true,
position: 'right'
}]
}
https://www.chartjs.org/chartjs-chart-financial/

A: add position right to the first (default) yAxes object in the options
options: {
    scales: {
        yAxes: [{
        position: 'right'
      }]
    }
  }

EDIT: Seems like chartjs financial is working with v3 of the lib. In v3 you have to edit the axis in a different way:
options: {
  scales: {
    y: {
      position: "right"
    }
  }
}

A: scales: {yAxes: [{
display: true,
position: 'right',
ticks: {
 beginAtZero: false,
 max: 2000,
 min: 1000,
 stepSize: 100
}}]}

scales: { yAxes: [{
display: true,
position: 'right',
ticks: {
 beginAtZero: true
},}]}

you can try these two ways, one of the them will work, depends on the your chart.


text:
Q: Can Anyone tell me how to parse JSON object with different key IOS? The Json Object here Comment has different keys like 1,2,3,4. Usually A Json Object has same key like in the inner part important,isgoal, minute etc. If i can parse 1,2,3,4 then it will be easy to parse important, isgoal, minute. But the problem is I can't get the objects 1,2,3,4. IOS throws Invalid key exception.....
Here's the Part of Json object---

*

*comm_commentaries: {

*

*comment: {

*

*1: {
 important: "False",
 isgoal: "False",
 minute: "90'",
 comment: "Attempt missed. Eliaquim Mangala (Manchester City) header from the centre of the box misses to the left. Assisted by Jesús Navas with a cross following a corner.",
 id: "8429441"
},

*2: {
 important: "False",
 isgoal: "False",
 minute: "90'",
 comment: "Corner, Manchester City. Conceded by Shaun Wright-Phillips.",
 id: "8429402"
},

*3: {
 important: "False",
 isgoal: "False",
 minute: "90'",
 comment: "Attempt blocked. Wilfried Bony (Manchester City) right footed shot from the centre of the box is blocked. Assisted by Yaya Touré.",
 id: "8429401"
 },

*4: {
 important: "True",
 isgoal: "True",
 minute: "87'",
 comment: "Goal! Manchester City 6, Queens Park Rangers 0. David Silva (Manchester City) right footed shot from very close range to the bottom right corner. Assisted by Wilfried Bony with a through ball.",
 id: "8429400"
 },
}
}

A: I suspect you are using the number 1 as the key, you should use a string @"1", please post the parsing copde that is failing. NSDictionary keys must be objects that implement NSCopying and are most commonaly NSStrings.
NSLog() output of NSDictionaries uses the description` method which omits the quotes when not needed. This makes understanding the output more difficult.
NSString *isgoal = jsonObject[@"comm_commentaries"][@"comment"][@"1"][@"isgoal"]
NSString *minute = jsonObject[@"comm_commentaries"][@"comment"][@"1"][@"minute"]


text:
Q: How to transform multiple parameter URL to clean URL I have a problem in my search function. when searching to the search field, I am fetching data from multiple get parameters in the URL.
here is the url:
domain.com/?s=&post_type=store&taxonomy1=municipality&taxonomy2=city&taxonomy3=zip&taxonomy4=country&taxonomy6=popular&submit=# (treat text after = as values)
this works fine, passing these $_GET parameters to wp_query. but I want to transform these URL parameters to clean URL, so I want it to look something like this:
domain.com/store/municipality/city/zip/country/popular/

is this possible? I know you can achieve the first 2 segments with CPT and taxonomy, but what about multiple value parameters? I appreciate your answers in advance, thank you


text:
Q: Percent or Pixels HTML/CSS Coding a new website. Basically, for position elements using CSS I would use percents and figured that was the best thing to do since everyone's monitor was a different size. But I noticed a lot of big websites use pixels.
I don't understand how you can use pixels to position things since we all have a different size screen?

A: The fluid layout provides, in general, better user experience, but is not without flaws. When using fluid layouts, you are testing them on medium-small to medium-large screens, but you certainly can't do complicated fluid layouts with CSS2 (no JavaScript, no HTML5/CSS3) which works perfectly well on any device, from a small mobile phone to a 30-inches full-screen mode.
The fluid layout is also more expensive in most cases. This is true for the visual design, the ergonomics and the HTML/CSS development.
The fixed layout gives the ability for a developer to say:

*

*I gathered the statistics about the browsers of my visitors, and know that 95% of users of my website have a resolution width between 1024 and 1920 pixels. Instead of spending a month designing a fluid layout, I will target the resolution of my 95% of users, and spend the free time to implement some cool features instead.

*If I have enough time and resources, I'll do a dedicated version for mobile phones.
The fact that fixed layouts are easier to implement is important here. I have a choice: either I do a fluid layout which will in all cases look bad on very small or very large screens, or I spend the same amount of time and money creating two or three layouts for different resolutions.
Aside the cost, fluid layouts have also some issues you can't solve without HTML5/CSS3 or JavaScript.

*

*Example 1: Programmers.SE has a fixed layout. This means that on any resolution, the main text I read (the questions and the answers) will be no longer than, say, 800 pixels in width. Given the current font size and the line spacing, this is ok to be able to read fast.
If Programmers.SE moves to fluid layout, your current question would we 1 600 pixels width on my screen at this moment. This will be totally unusable, and I wouldn't be able to read a long text without requiring to minimize the browser window and adjust it for the website.

*Example 2: in a recent project, I split the text in two columns for the browsers which support this. Given the font size and the line spacing, one column is not really readable, but two are perfect. Since I know the width of the page, I know how the text will appear in 93 to 94% cases: the other 5% are using browsers that don't support text columns, and the final 1 to 2% are using custom font sizes (i.e. people who don't see well and enlarge the fonts by default and/or people who don't have the font I use on the page).
With a fluid layout, I wouldn't be able to do that without HTML5: on a 30-inches monitor full-screen, two columns would still be unreadable: it would require four or five columns instead. On a screen of a large mobile phone, two columns would be unreadable neither, since there will be one to three words per line.

*Example 3: you have a topmost menu with the parts of your website. There are five parts, and the elements are float:lefted. With a fixed layout, it magically works, and fails if the user specifies the larger font for accessibility reason. With a fluid layout, what will happen with those elements if the user resizes the page to a width smaller than the total width of those five elements?

A: There are a couple situations when I will use pixel based positioning.
The first being when I am creating absolute positioned menus or items.
The other situation I can think of is when I create webapps. I want the environment to give a desktop like appearance utilising all of the space. The layout is dynamic in sizing(some times I use YUI2's layout which is really helpful. See here: http://developer.yahoo.com/yui/layout/). So on window resizes the layout also resizes.
Pixel based positioning gives you more control and the look will remain static however as mentioned when switching resolutions everything will be displayed larger or smaller.


text:
Q: Google map not showing in php page I am implementing a google map in my webpage. On clicking a update button in index.php, I am showing a dialog box which contains google map for users to locate their location. Map is not showing properly. Please help me!
My js:
if(!window.google||!window.google.maps){
var script = document.createElement('script');
script.type = 'text/javascript';
script.src = 'https://maps.googleapis.com/maps/api/js?v=3&' +
    'callback=initialize';
document.body.appendChild(script);
}
else{
  initialize();
}

 <script>
    var directionsDisplay,
    directionsService,
    map;

    function initialize() {
         var directionsService = new google.maps.DirectionsService();
        directionsDisplay = new google.maps.DirectionsRenderer();
        var chicago = new google.maps.LatLng(51.508742,-0.120850);
        var mapOptions = { zoom:3, mapTypeId: google.maps.MapTypeId.ROADMAP, center: chicago }
        map = new google.maps.Map(document.getElementById("googlemap"), mapOptions);
        var marker=new google.maps.Marker({
           position:chicago,
  });
        directionsDisplay.setMap(map);
}

HTML
<div name="mapdetail" value="" id="googlemap" style="width:350px;height:300px;"class="" >

The output:


text:
Q: Styling elements individually in mapped array - styled components I have 4 buttons and each of them has its own correctness check as object prop - isAnswerCorrect.
I have also isCorrect state which i change whenever the button is correct or no.
What i want to achieve?

*

*when correct button is clicked, its border color changes to green and rest of the uncorrect buttons borders remain the same

*when uncorrect button is clicked all the uncorrect buttons change their border color to red and the correct button should change its border color to green

Currently what i have does not have much sense because uncorrect button changes all borders to red and same story with correct button which changes all borders to green. And thats because of that one and only isCorrect state.
How to make it properly with combination of styled components?

A: You could create a helper function to set the value of isCorrect:
function isResponseCorrect(isAnswerCorrect) {
    if(isCorrect === undefined) {
      return;
    }

    if(isCorrect) {
      return isAnswerCorrect ? true : undefined;
    } else {
      return isAnswerCorrect ? true : false;
    }
  }

return (
    <Wrapper>
      {answerOptions.map((answerOption) => (
        <AnswerButton
          isCorrect={isResponseCorrect(answerOption.isAnswerCorrect)}
          key={answerOption.id}
          onClick={
            () => handleAnswerCorrectness(answerOption.isAnswerCorrect) // TODO
          }
        >
          {answerOption.answerText}
        </AnswerButton>
      ))}
    </Wrapper>
  );
}


text:
Q: jQuery each() function to append element to each form based on its id I'm trying to loop through the list of forms displayed on the page and append element to each of them depending on their id.
I thought of doing something like this, but it doesn't seem to be working:
var number_of_forms = $('.common_form_class').length;

if (number_of_forms > 1) {
    $('.common_form_class').each(function() {
        var identity = $(this).attr('id');
        $.getJSON("/token.php?key=" + identity, function(data){
            $(this).append('<input type="hidden" class="token" name="token" value="'+data.token+'" />');
        });
    });
} else {
    var identity = $('.common_form_class').attr('id');
    $.getJSON("/token.php?key=" + identity, function(data){
        $('.common_form_class').append('<input type="hidden" class="token" name="token" value="'+data.token+'" />');
    });
}

I understand that I can't refer to the form within the each() loop by using $(this), but does anyone know how could I achieve this?

A: That only works if you have more than one form. If there is only one form you are trying to use $(this) without an each loop, so this will be the window object.
Also, using $(this) inside the callback doesn't work, because the callback is executed later, outside the scope of the loop. Store the reference to the form in a local variable, so that it's inlcuded in the closure for the callback function.
You can just loop even if there is only one form:
$('.common_form_class').each(function() {
  var frm = $(this);
  $.getJSON("/token.php?key=" + frm.attr('id'), function(data){
    frm.append('<input type="hidden" class="token" name="token" value="'+data.token+'" />');
  });
});

Or making a bit better use of jQuery:
$('.common_form_class').each(function(i, frm) {
  $.getJSON("/token.php", { key: frm.attr('id') }, function(data){
    frm.append($('<input/>', { type: 'hidden', 'class': 'token', name: 'token' }).val(data.token));
  });
});

Note: By using the val method to set the value instead of concatenating it into the HTML code, you don't have to worry about characters that could break the HTML code.

A: I rewrote your code using better style, please test:
$('.common_form_class').each(function() {
    var $this = $(this);
    $.getJSON("/token.php", {key: $this.attr('id')}, function(data){
        $this.append($("<input/>", {type: "hidden", "class": "token", name: "token"}).val(data.token));
    });
});


text:
Q: MySQL Nested Query Select Statement I've got a table that helps me keep track of the delay times between my slaves and the master. My question is how can I craft a select statement that:
1. gives me the latest delay values, without repeating (or skipping) ip addresses
2. doesn't need to be updated if I add additional servers, or as servers become unresponsive
The goal of this query is to show me what servers are available to do work, and give me a rough estimate as to how hard they are working. Servers that are not operational, shouldn't appear in the results. I'm running a script to evaluate the delay times as CLI every minute, so if I could limit the possible records returned to the last minute and a half, that should be good enough to tell me which servers were up the last time they were queried.
Table looks like this (columns renamed to protect the innocent):
id INT NOT NULL AUTO_INCREMENT PRIMARY KEY ,
ip VARCHAR( 20 ) NOT NULL ,
sent TIMESTAMP NOT NULL ,
delay DECIMAL ( 7,4 ) NOT NULL ,
status VARCHAR( 100 ) NOT NULL ,
execution_time` DECIMAL ( 7,4 )NOT NULL ,
deleted` TINYINT NOT NULL ,

Any help would be appreciated.

A: What about this?
select delay
    from table_name,
         (select id, max(sent), ip from table_name group by ip) innertable
   where innertable.id = table_name.id;

Not 100% sure I understood what you want as a result set, so I just picked delay.

A: After some googling, and some testing, this is the best answer I've found thus so far:
    SELECT ip, id, delay, stat_sent
    FROM status
    WHERE stat_sent > DATE_SUB( NOW( ) , INTERVAL 1 MINUTE )
    AND stat_sent
    IN (

        SELECT max( stat_sent )
        FROM status GROUP BY stat_ip
    )

Modified my answer now it limits the scope of the results to servers that have been updated in the last minute.