text:
Q: Vimeo player iframe height I have a Vimeo player iframe on my website's homepage. My intention is have it at full width - edge to edge - in the browser window; while retaining the aspect ratio and avoiding black bars. So the video fills the most area.
I have this css applied to the vimeo player it:
.fluidVideoWrapper {
  padding: 0;
  width: 100%;
  height: 20em;
  position: relative;
}

.fluidVideoWrapper iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

The 20em is just so you guys can see it on the page. When I set the height to 100% it disappears, the height seemingly becoming 0.
An example of what I'm trying to attempt can be seen here, scroll down to the vimeo player: vsco.co
Can anyone suggest a fix for this?

A: Try making the .fluidVideoWrapper container position: absolute; too and make the width and height of it 100%


text:
Q: Как организовать скрытие меню? Имеем 2 уровневое меню
Блок1 и Блок2 на скриншоте http://prntscr.com/kp2tvi независимые, Блок2 находится вне Блока1.
Код примерно такой:

$('.bl-1').hover(function() {
  var childBlock = $('[data-parent="' + $(this).data('children') + '"]');
  $(this).addClass('hover');
  $(childBlock).css({
    'display': 'block'
  });
});

Ванны

Акриловые

    ...

Т.е. по ховеру на .bl-1 ему присваивается класс .hover и меняется свойство display у .bl-2
Не могу придумать, как правильно закрыть эти блоки. Нужно, чтобы они закрывлись в случае если курсор покидает .bl-1 в направлениях право/лево/верх (см. скриншот), либо если курсор покидает .bl-2.
Немного запутано объяснил, но надеюсь, что можно понять суть вопроса.

A: Дичайщий говнокод, но работает.

$('.menu a').bind('mouseenter',function(){
  $('.menu a.active').removeClass('active');
  $('.item.active').removeClass('active');

  var dataDropname = $(this).data('dropname');
  var posLeft = $(this).offset().left;
  $('.item[data-drop="'+dataDropname+'"], .menu a[data-dropname="'+dataDropname+'"]').addClass('active');
  $('.item[data-drop="'+dataDropname+'"]').css('left',posLeft);

  $('.item.active').bind('mouseleave',function(){
    $('.menu a.active').removeClass('active');
    $(this).removeClass('active');
  });
});
a {
  color: #000;
  text-decoration: none !important;
}

.nav, .drop {
  display: block;
  width: 100%;
  position: absolute;
  left: 0;
  top: 0;
  right: 0;
}

.menu {
  display: block;
  width: 100%;
  height: 50px;
  background: #ddd;
}

.menu a {
  display: inline-block;
  padding: 0 5px;
  height: 50px;
  line-height: 50px;
}

.menu a:hover, .item a:hover {
  color: red;
}

.menu a.active {
  background: #999;
}

.item {
  display: none;
  padding: 10px;
  background: #999;
  position: absolute;
  top: 50px;
  left: 0;
}

.item.active {
  display: inline-block;
}

.item a {
  display: block;
  margin-bottom: 10px;
}

.item a:last-child {
  margin-bottom: 0;
}

    Ванные
    Не ванные
    Тут тоже не ванные

    Обычные
    Такие
    Сякие
    Никакие

    Я же
    Сказал
    Тут
    Не ванные

А вообще, я бы сделал так, на чистом CSS)

a {
  text-decoration: none !important;
}

.menu {
  display: block;
  width: 100%;
  height: 50px;
  background: #ddd;
  position: absolute;
  left: 0;
  top: 0;
  right: 0;
}

.menu a:hover {
  color: red;
}

.menu .hover {
  display: inline-block;
  position: relative;
}

.menu .menu-item {
  display: inline-block;
  padding: 0 10px;
  height: 50px;
  line-height: 50px;
  color: #000;
}

.menu .item {
  display: none;
  padding: 10px;
  background: #999;
  position: absolute;
  top: 50px;
  z-index: 1;
}

.menu .hover:hover .menu-item {
  background: #999;
}

.menu .hover:hover .item {
  display: block;
}

.menu .item a {
  display: block;
  width: 100%;
  margin-bottom: 10px;
  color: #000;
}

.menu .item a:last-child {
  margin-bottom: 0;
}

.menu .item a:hover {
  color: red;
}

    Ванные

      Обычные
      Такие
      Сякие
      Никакие

    Не ванные

      Я же
      Сказал
      Тут
      Не ванные

  Тут тоже не ванные

redpajama_set_name: RedPajamaStackExchange


text:
Q: SVN in web development as a base code repository I have been told that SVN is a good method of being able to manage multiple sites running from the same code base. I am struggling however to find out enough information about SVN and how it would be used in this way. Basically, I would look to put my ecommerce system into an SVN and then run it on multiple sites, each having specific configuration settings in order to specify allowed modules.
Could anyone advise me if
(a) SVN is the correct method to do this
(b) There is any material/tutorials out there on how best to do this.

A: SVN is a versioning tool, not a multi-site management tool. Although I can see how it can be used in that way, that is not what you get out of the box. You need an understanding of SVN first.
As an example, each website could have it's own svn branch of the code. Any updates that you want to propagate to the rest of the branches, you would merge with trunk, then update the rest of the branches.
That said, branching can very quickly get very complicated, especially with multiple developers. Git handles branching much better than SVN (my opinion). Git is also a versioning tool, just like SVN. But again, it's designed for versioning, bit multi-site management.

A: I suppose that you could treat each installation as a working copy of the SVN repository, log in to each system, and do a checkout from the latest code on the SVN server.
I do not recommend this approach.  It will be slow and will pollute your application folders with a bunch of svn data that you do not need on your web server.  You do not want to risk by putting it insider your web root.
I recommend using rsync.  With rsync, pushing out updates is slightly more complicated than copying a local file.  If you are running linux, the odds are that rsync is already on your system.  On windows you can run it under cygwin or find various alternative implementations, such as DeltaCopy.
If for some reason you can't use rsync won't work, I would recommend SFTP.


text:
Q: What is C:\WINDOWS\assembly\NativeImages_v2.0.50727_32\index3a0.dat used for? I'm trying to diagnose why out .Net ActiveX control has a much slower load time on certain machines than others and I've discovered (using ProcMon) that on machines that load the control slowly the browser process seems to spend a lot of time doing something with this file.
In the slow process I see groups of events (4-8) in the above format that take around 200ms to complete:
6:02:17.333 CreateFile C:\WINDOWS\assembly\NativeImages_v2.0.50727_32\index3a0.dat NAME NOT FOUND
6:02:17.364 CreateFile C:\WINDOWS\assembly\NativeImages_v2.0.50727_32\index3a0.dat NAME NOT FOUND
6:02:17.396 CreateFile C:\WINDOWS\assembly\NativeImages_v2.0.50727_32\index3a0.dat NAME NOT FOUND
6:02:17.427 CreateFile C:\WINDOWS\assembly\NativeImages_v2.0.50727_32\index3a0.dat NAME NOT FOUND

However in a similar trace taken on a machine where the control loads quickly I see only a single line with a SUCCESS result.
What is this file?

A: I assume this has something to do with caching/quick lookup of GAC entries or something like that, on my system it is called index1c.dat (It is 0 bytes on this system)
I'm guessing the name comes from the LatestIndex value under HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Fusion\NativeImagesIndex\v2.0.50727_32
You could try windows update or try running "%windir%\Microsoft.NET\Framework\v2.0.50727\ngen" update
...but even if you could trigger a update of this cache, this might not be the cause of your problems.


text:
Q: Get URL variable in twig I have the authentification controller
public function indexAction(Request $request)
{

$em = $this->getDoctrine()->getEntityManager();
$repository = $em->getRepository('Mql14mqlmeBundle:User');

   if ('POST' === $request->getMethod()) {
        $username = $request->get('login');
    $password = $request->get('pass');
          if(($username=='admin')&&($password=='admin')){

           return $this->redirect($this->generateUrl('mql14mqlme_admin',  array('name' => 'welcome')));
            }

    $user = $repository->findOneBy(array('login' => $username, 'pass' =>  $password));

    if ($user) {

        return $this->redirect($this->generateUrl('mql14mqlme_acceuil', array('name' => $user->getNom(),
                'id'=> $user->getId(),
            )));

    }else {
      return $this->redirect($this->generateUrl('mql14mqlme_homepage', array('name' =>$username)));
  }

If the user has provided the right login and password he is redirected to acceuil twig, in this twig I want to get the user's id to use it in another twig, so the line where I have a problem is this:
INTERETS

the error I get is:Variable "name" does not exist in Mql14mqlmeBundle:Default:acceuil.html.twig at line 89
The action code for acceuil:
public function acceuilAction()
{

$em = $this->container->get('doctrine')->getEntityManager();
$evenements= $em->getRepository('Mql14mqlmeBundle:Evenement')->findAll();
$categories= $em->getRepository('Mql14mqlmeBundle:Categorie')->findAll();
return $this->container->get('templating')->renderResponse('Mql14mqlmeBundle:Default:acceuil.html.twig',
        array(
                'evenements' => $evenements,
                'categories' => $categories
        ));

}

A: Try :
INTERETS

Question :
Does your

$user = $repository->findOneBy(array('login' => $username, 'pass' =>  $password));

indicates that your looking for user by plain password ?

A: In twig, all variables need to be passed in when you call render. EG:
echo $template->render(array('name' => 'bob'));

A: What you need is getting the name from the query string and pass the name to the rendered view
public function acceuilAction($name) // <-- This is the name you are passing to request
{
    ...
    return $this->container->get('templating')->renderResponse('Mql14mqlmeBundle:Default:acceuil.html.twig',
    array(
            'name' => $name, // <-- Here you pass the received name to your twig
            'evenements' => $evenements,
            'categories' => $categories
    ));
}

Base on documentation generating URL and passing arguments as array, means you pass the name through the request. If you want to pass as QueryString (not a part of url path) change the generate URL as
$this->redirect($this->generateUrl('mql14mqlme_acceuil').'?name='.$user->getId());

In this case you need to change routing and controller, too


text:
Q: What is the function of 'i' in for loop in JavaScript when accessing arrays?

const rapperArray = ['Tupac', 'Jay-Z', 'Notorious B.I.G', 'Kendrick Lamar']

for (let i = 0; i < rapperArray.length; i++) {
  console.log(rapperArray[i]);
  if (i === 2) {
    break;
  }
}
console.log("And if you don't know, now you know.");

So how does i work in that console.log( rapperArray[ i ] );? I know that it accesses the elements in the array but I can't seem to get my head around how it actually functions.

A: The i is a variable. In a for loop, you have the following syntax:
for(initialization; condition; update) {
    // for loop body
}

The for loop will begin by running the initialization portion first, which in this case declares the variable i with an initial value of 0. Before each iteration of the loop, condition is checked and the loop body will run as long as condition is true. Then, after the loop body runs, update will run. In this case, the variable i will have its value incremented by 1, i.e. i++ is basically the same thing as i += 1.
In other words, the for loop will use every value of i from 0 up until rapperArray.length - 1. So console.log(rapperArray[i]); will be the same as console.log(rapperArray[0]); in the first iteration, console.log(rapperArray[1]); in the second iteration, and so on.
You can see this more clearly by running the following:
const rapperArray = ['Tupac', 'Jay-Z', 'Notorious B.I.G', 'Kendrick Lamar'];

for (let i = 0; i < rapperArray.length; i++) {
  console.log('When i is ' + i + ', rapperArray[i] is ' + rapperArray[i] + '.');
}

A: A for loop header consists of three parts:

*

*Initial state let i = 0

*Condition to check if loop should continue i < length

*Increment per run i++
We start with 0, in the beginning i is lower than length, then we up it by 1 (i++ increases i by 1), if it's still lower than length - we continue until i has the same value as  length and then we stop.

A: It indicates the current iteration of the loop. For each iteration, i is incremented. When used to get an array item, it represents the index of the item to retrieve from the array. You can read more about indexed collections here: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Indexed_collections
Arrays in JavaScript are zero-index based, which means the first index is always zero. And they increment from there. Arrays are ordered collections, so the item at the first index (zero) is always the same, and so on.
If you have a list on paper in front of you, you may number the lines starting with 1 and going up from there. Each item in an array is somewhat like each line on that piece of paper, only the line numbers start at zero instead of one. If you want to get line n from the paper, you find the line numbered n and there you go.


text:
Q: Cordova facebook connect plugin java.lang.NullPointerException After running cordova build, I use eclipse to run my app, and got "cordova facebook connect plugin failed on init." and my log:
W/System.err( 1234): java.lang.NullPointerException
W/System.err( 1234):    at
 org.apache.cordova.facebook.ConnectPlugin.execute(ConnectPlugin.java:203)
W/System.err( 1234):    at
 org.apache.cordova.CordovaPlugin.execute(CordovaPlugin.java:65)
W/System.err( 1234):    at
 org.apache.cordova.PluginManager.execHelper(PluginManager.java:242)
W/System.err( 1234):    at
 org.apache.cordova.PluginManager.exec(PluginManager.java:227)
W/System.err( 1234):    at
 org.apache.cordova.ExposedJsApi.exec(ExposedJsApi.java:53)
W/System.err( 1234):    at
 com.android.org.chromium.base.SystemMessageHandler.nativeDoRunLoopOnce(Native Method)
W/System.err( 1234):    at
   com.android.org.chromium.base.SystemMessageHandler.handleMessage(SystemMessageHandler.java:27)
W/System.err( 1234):    at android.os.Handler.dispatchMessage(Handler.java:102)
W/System.err( 1234):    at android.os.Looper.loop(Looper.java:136)
W/System.err( 1234):    at android.os.HandlerThread.run(HandlerThread.java:61)

index.js:
  var app = {
      // Application Constructor
      initialize: function() {
          this.bindEvents();
      },
      // Bind Event Listeners
      //
      // Bind any events that are required on startup. Common events are:
      // 'load', 'deviceready', 'offline', and 'online'.
      bindEvents: function() {
          document.addEventListener('deviceready', this.onDeviceReady, false);
      },
      // deviceready Event Handler
      //
      // The scope of 'this' is the event. In order to call the 'receivedEvent'
      // function, we must explicity call 'app.receivedEvent(...);'
      onDeviceReady: function() {
          app.receivedEvent('deviceready');
           FB.init({
               appId: "439058150542",
               nativeInterface: CDV.FB,
               useCachedDialogs: false
           });
          angular.element(document).ready(function() {
              angular.bootstrap(document, ['Myapp']);
          });
      },
      // Update DOM on a Received Event
      receivedEvent: function(id) {
      }
  };