Invisible layers in Sketch when using Material UI as the basis for UI component library

I’m trying to use the Material UI Theme Editor which spits out a Sketch file as the basis for our component library. I’m then exporting the components to Zeplin for developers to get specs on.

However, I’ve been unable to get the ripples to show up in Zeplin, and they don’t even show up when one UI component is created from the base sympbol in another part of the the Material UI file (here’s ours:

This makes no sense to me…how could the “RIPPLE” that I can see so clearly on the base component disappear from this instantiation of it? I think the fact that I can’t see it in Sketch is the root of the trouble, and why I can’t see it in Zeplin.

Base Component

Instantiation of Component in Design

Magento 2 UI component import from two sources

I need the product field “disabled” attribute to be dependent from two other checkbox fields. For now I have it dependent from one field like this (DataModfier):

protected function customizeFieldSub(array $  meta) {     $  dependentPath = $  this->arrayManager->findPath('show_email_for_instant_price', $  meta, null, 'children');      if ($  dependentPath) {         $  meta = $  this->arrayManager->merge(             $  dependentPath . static::META_CONFIG_PATH,             $  meta,             [                 'dataScope' => 'dependent_field',                 'validation' => [                     'required-entry' => true,                     'validate-zero-or-greater' => true                 ],                 'formElement' => 'input',                 'additionalClasses' => 'admin__field-small',                 'imports' => [                     'disabled' =>                          '!ns = $  { $  .ns }, index = field1:checked'                 ]             ]         );     }     return $  meta; } 

I need something like this:

               'imports' => [                     'disabled' =>                         '(!ns = $  { $  .ns }, index = field1:checked) && (!ns = $  { $  .ns }, index = field2:checked)'                 ] 

But it doesn’t work this way. And also it doesn’t allow to use functions there. How can I achieve what I want? I need the field to be disabled until you enable two checkboxes

Strongly Connected component algorithm implementation(Python)

My goal is to implement Strongly Connected Components algorithm using python. I have splitted up my code on 3 parts:

  1. Data Load:

    import csv as csv import numpy as np import random as random import copy as copy import math import sys, threading import time sys.setrecursionlimit(800000) threading.stack_size(67108864)  start = time.time()  num_nodes = 160000 graph = [[] for i in range(num_nodes)] reverse_graph = [[] for i in range(num_nodes)] graph_2_step = [[] for i in range(num_nodes)]  file = open("C:\Users\yefida\Desktop\Study_folder\Online_Courses\Algorithms\Project 5\test7.txt", "r")  data = file.readlines() for line in data:     if line.strip():         items = line.split()           if int(items[1]) not in reverse_graph[int(items[1]) - 1]:                reverse_graph[int(items[1]) - 1].append(int(items[1]))              reverse_graph[int(items[1]) - 1].append(int(items[0]))          else:             reverse_graph[int(items[1]) - 1].append(int(items[0]))             if int(items[0]) not in graph[int(items[0]) - 1]:                graph[int(items[0]) - 1].append(int(items[0]))              graph[int(items[0]) - 1].append(int(items[1]))          else:             graph[int(items[0]) - 1].append(int(items[1]))    for i in range(len(graph)):     if len(graph[i]) == 0:         graph[i] = [i+1,i+1]     if len(reverse_graph[i]) == 0:         reverse_graph[i] = [i+1,i+1]   end = time.time() time_taken = end - start print('Time: ',time_taken) 
  2. Depth-first search algorithm on the reversed graph:

    #2. Run DFS-loop on reversed Graph: start = time.time()  t = 0 # for finishing lines: how many nodes are processed so far s = None # current source vertex explored = set() finish_time = {}    def DFS(graph,node):     explored.add(node)     global s      for vertex in graph[node - 1][1:]:         if vertex not in explored:             DFS(graph,vertex)          global t     t+= 1     finish_time[node] = t  #Nodes starts from n to 1 for i in range(max(reverse_graph)[0],0,-1):     if i not in explored:         s = i         DFS(reverse_graph,i)  #Mapping to the new list in increasing order for edge in range(len(graph)):     for vertex in range(len(graph[edge])):         graph[edge][vertex] = finish_time[graph[edge][vertex]]      graph_2_step[graph[edge][0] - 1] = graph[edge]    end = time.time() time_taken = end - start print('Time: ',time_taken) 
  3. Depth-first-search algortihm on the graph after step 2:

    start = time.time() #3. Run DFS-loop on Graph with original directions(but with labeled finishing times): all_components = []#Saves all strongly connected components all_comp_elem = set()#check if element is in Strongly Connected Components(already explored) SCC = set() # strongly connected component, that will be saved in "all_components" explored= set() # variables, that are already explored  next_elem = 0 # contains information how many elements have to be checked, before making a decision  #c)modification of DFS def DFS_2_Path(graph,node):     global all_components     global SCC     global next_elem     explored.add(node)#node is explored       next_elem += len(graph[node - 1][1:]) # add number elements, that must be explored from the current node      #checking one vertex -> minus one element that must be explored     for vertex in graph[node - 1][1:]:         next_elem -= 1         #check if element is in Strongly Connected Components(already explored)         if node not in all_comp_elem:             SCC.add(node)          #if vertex is not explored, than reccursion and go to the next vertex         if vertex not in explored:                   SCC.add(vertex)             DFS_2_Path(graph,vertex)            #if vertex is not the last element in the chain(Ex: [6,5,1,7] -> 6 is a main Node, and 7 is the last element, to which     #node 6 is connected)             elif vertex in explored and vertex != graph[node - 1][1:][len(graph[node - 1][1:]) - 1]:             continue         #if vertex is the last element in the chain(Ex: [6,5,1,7] -> 6 is a main Node, and 7 is the last element, to which     #node 6 is connected) -> update stringly connected components              elif vertex in explored and vertex == graph[node - 1][1:][len(graph[node - 1][1:]) - 1] and next_elem == 0:             all_components.append(SCC)             all_comp_elem.update(SCC)             SSC = set()  #Main loop             for i in range(max(graph_2_step)[0],0,-1):     if i not in explored:         DFS_2_Path(graph_2_step,i)    end = time.time() time_taken = end - start print('Time: ',time_taken) 

I have tested my algorithm on different test cases -> it works correct. First two parts of the algorithm work fast(on the data set with 160000 nodes). But when I run the third part -> kernel in Jupyter dies.

I have improved the speed of the code as much as I could. I definitely need a fresh look on my code.

P.S Don’t look at first 2 parts of the code. I provided them to you only for the test, if you want to test.

P.S.S The link to the file, that I have used for the test:

Error Angular component no detectado en la importaciĆ³n

//Este es mi archivo de rutas, y cuando hago la importacion de heroe, no me lo detecta, pero si comento la linea del { path: ‘heroe’, component: HeroeComponent }, todo funciona bien.

import { Routes, RouterModule } from '@angular/router'; import { NgModule } from '@angular/core';  import { HomeComponent } from './components/home/home.component'; import { HeroesComponent } from './Components/heroes/heroes.component'; import { HeroeComponent } from './Components/heroe/heroe.component'; import { AboutComponent } from './Components/about/about.component';  const APP_ROUTES: Routes = [     { path: 'home', component: HomeComponent },     { path: 'heroes', component: HeroesComponent },     { path: 'heroe', component: HeroeComponent },     { path: 'about', component: AboutComponent },     { path: '**', pathMatch: 'full', redirectTo: 'home' } ];  @NgModule({     imports: [RouterModule.forChild(APP_ROUTES)],     exports: [RouterModule] }) export class RoutingModule {} // export const app_routing = RouterModule.forRoot(APP_ROUTES); 

Angular 7 Component Abuse

I am currently working on a new project and are migrating to Angular 8. I’m noticing in code reviews that developers are basically putting just about anything and everything into a component. These components are single use and to me make no sense to split them out from the main component.

When I say everything I mean everything, a drop down list, a button group, a context menu and in some cases even a single input. This is blowing up the code base and introducing what I would consider unnecessary complexity, bloat and a maintenance nightmare in the making. I understand the importance of components but is there is any literature or authoritative guidance on effective component use and abuse?

How do I replace part of a webform component label with a variable token?

I have webform component labels like this:

Did [your pet] have any illnesses?

and I want to replace [your pet] with a variable token?

Do I need to write a custom module or can I do this by editing one of the theme .tpl files?

Tried this code as suggested:

<?php  /*  * Implementation of hook_form_alter()  */  drupal_set_message(t('Outwith the hook'), 'warning'); // display outwith the hook  function wit_bootstrap_form_alter(&$  form, &$  form_state, $  form_id) {  drupal_set_message(t('Inside the hook'), 'warning'); // display within the hook    // target my form / my field   if ($  form_id == "webform_client_form_1") {     // target my form / my field      if ($  form['neutered']['#title']) {         $  title = $  form['neutered']['#title'];         $  token_val = 'freelo';//get_tokenised_value(); // Which ever way you handle that...         $  title = str_replace('[your pet]', $  token_val, $  title);         $  form['neutered']['#title'] = $  title;     }   } } 

Magento 2 UiRegistry can’t get component element

this my checkout_index_index.xml

<?xml version="1.0"?> <page xmlns:xsi="" layout="checkout" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">     <head>         <css src="Asiantech_Postcode::css/jquery.Thailand.min.css"/>     </head>     <body>         <referenceBlock name="checkout.root">             <arguments>                 <argument name="jsLayout" xsi:type="array">                     <item name="components" xsi:type="array">                         <item name="checkout" xsi:type="array">                             <item name="children" xsi:type="array">                                 <item name="autocomplete" xsi:type="array">                                     <item name="sortOrder" xsi:type="string">0</item>                                     <item name="component" xsi:type="string">Vendor_Module/js/autocomplate</item>                                 </item>                             </item>                         </item>                     </item>                 </argument>             </arguments>         </referenceBlock>     </body> </page> 


define([ 'jquery', 'uiComponent', 'Magento_Checkout/js/checkout-data', 'uiRegistry', ], function ( $  , Component, checkoutData, uiRegistry, ) { "use strict";    console.log(uiRegistry.get('checkout.steps.shipping-step.shippingAddress.shipping-address-fieldset.postcode'));  return Component.extend({     /**      * Initialization method      */     initialize: function () {         this._super();     }   }); }); 

but my result is `undefined’,what’s wrong with this component ?

Component Based Servicing (CBS) affects shutdown duration in Windows Server 2016

I tested UPS shutdown in case of power failure on Windows Server 2016 + APC Smart UPS + NUT.

In some moment NUT has sent shutdown command to Windows. But instead of real shutdown I observed screen with “Getting ready your server” or something like it, I do not remember exactly. Screen like it were some updates installing during shutdown process. But server has been configured for anual upates. And I have checked and installed all updates couple of ours before this.

It took 20-25 minutes for shutdown process to complete. Fortunately UPS did not turn off the power (due to some config errors). But in real situation with correct configs UPS would remove AC power from server in 3 minutes after shutdown command.

Later I’ve investigated logs and have found that CBS (Component Based Servicing) has began some maitenanace tasks several munites before shutdown. So Windows waited for it to complete.

Approximate timings:

15:36:55 shutdown command with 30 sec delay (shutdown.exe /f /s /t 30) 15:37:25 user logoff about 15:55 shutdown has completed 

From CBS.log:

2019-05-08 15:34:59, Info                  CBS    Maint: begin deep clean ... ... 2019-05-08 15:37:26, Info                  CBS    Trusted Installer signaled for shutdown, going to exit. 2019-05-08 15:37:26, Info                  CBS    A system shutdown was initiated while idle scavenging was running 2019-05-08 15:37:26, Info                  CBS    Shtd: Prepare for shutdown processing. 2019-05-08 15:37:26, Info                  CBS    Plan: Package: Package_for_RollupFix~31bf3856ad364e35~amd64~~14393.2273.1.4, Update: 4103720-19196_neutral_PACKAGE, current: Absent, pending: Default, start: Absent, applicable: Absent, targeted: Absent, limit: Absent, selected: Default 2019-05-08 15:37:26, Info                  CBS    SetProgressMessage: progressMessageStage: 0, ExecuteState: ExecuteStateNone, SubStage: 0 2019-05-08 15:37:26, Info                  CBS    Shtd: PreshutdownTimeout: 3600000ms, BlockTimeIncrement: 900000ms 2019-05-08 15:37:26, Info                  CBS    Shtd: progress thread started 

It seems for me a problem that any process can affect shudown. Especially when server must shutdown as soon as possible.


  1. Is this a behaviour of only WinServer2016? What about WinServer2012R2?
  2. Is it possible to make forced but correct shutdown to override such busy processes?