google sheets – How to start the script from the third row for dependent drop down list?

I am NOT expert in coding, just managed to piece together a script with dependent drop down list.
The script is to allow user to select the drop down list from Row 1, Column B, C, D, … (eg. B1) with dependent drop down list (eg. B2, B3, B4, B5). Similarly for Row 6, 11; Column B, C, D, ….
However, the script doesn’t work when I insert two rows above Row 1 as I would want the first and second row for date and time.

1

Below is the script that works if everything start from Row 1.

function onEdit() {
  var tabLists = "Lists";
  var tabValidation = "Main";
  var ss = SpreadsheetApp.getActiveSpreadsheet().getActiveSheet();
  var datass = SpreadsheetApp.getActiveSpreadsheet().getSheetByName(tabLists);
  var activeCell = ss.getActiveCell();
  
  if(activeCell.getRow() % 5 == 1 && activeCell.getColumn() > 1  && activeCell.getColumn() < 10  && ss.getSheetName() == tabValidation){
    activeCell.offset(1, 0).clearContent().clearDataValidations();
    activeCell.offset(2, 0).clearContent().clearDataValidations();
    activeCell.offset(3, 0).clearContent().clearDataValidations();
    activeCell.offset(4, 0).clearContent().clearDataValidations();
    
    var makes = datass.getRange(1, 1, 1, datass.getLastColumn()).getValues();
    var makeIndex = makes(0).indexOf(activeCell.getValue()) + 1;
    
    if(makeIndex != 0){
        var validationRange = datass.getRange(3, makeIndex, datass.getLastColumn());
        var validationRule = SpreadsheetApp.newDataValidation().requireValueInRange(validationRange).build();
        activeCell.offset(1, 0).setDataValidation(validationRule);
        activeCell.offset(2, 0).setDataValidation(validationRule);
        activeCell.offset(3, 0).setDataValidation(validationRule);
        activeCell.offset(4, 0).setDataValidation(validationRule);
      }     
   }      
}

Any advice on how to make it works if I would like to add two more rows above Row 1?

sql injection – how to dump all first row of table in several database using SQLmap?

sql injection – how to dump all first row of table in several database using SQLmap? – Information Security Stack Exchange

php – Laravel 8: SQLSTATE[23000]: Integrity constraint violation: 1452 Cannot add or update a child row: a foreign key constraint fails

I want to apply OneToMany Relationship between users and roles table and I have already some data in these two tables.

So in order to make this relationship, I made this Migration for adding role_id to users table:

public function up()
    {
        Schema::table('users', function (Blueprint $table) {
            $table->unsignedBigInteger('role_id')->nullable()->unsigned();
            $table->foreign('role_id')->references('id')->on('roles')->onDelete('cascade');
        });
    }

But when I want to run this Migration, I get this error:

SQLSTATE(42S21): Column already exists: 1060 Duplicate column name
‘role_id’ (SQL: alter table users add role_id bigint unsigned
null)

So what is going wrong here ? How can I fix this issue ?

Here is also the Migration of roles table:

public function up()
    {
        Schema::create('roles', function (Blueprint $table) {
            $table->id();
            $table->string('name');
            $table->string('slug');
            $table->timestamps();
        });
    }

Creating/dropping MySQL users using “IF NOT EXISTS” when row based replication is in place

I’d like to know the affect of using “IF NOT EXISTS” when creating or dropping users when row based replication is being used to replicate data to a mysql slave. I know that in the past I have broken replication by creating or dropping users that already existed (or didn’t exist) on the slave, even though row based replication was being used. It seems that the user table isn’t replicated in a row based fashion even though the database itself is. Would adding “if not exists” to my create or drop statements prevent me from breaking replication in the future?

theming – How to declare several templates for a Views row plugin

I want to create a custom Views display type called Card using Fields for the rows.
In my module I define the relevant plugins using hook_views_plugins as such:

function cards_format_views_plugins()
    {
      $path = drupal_get_path('module', 'cards_format');
      $plugins = array(
        'style' => array(
          'cards_format_style' => array(
            //  THEME
            'theme' => 'cards_format',
            'theme path' => $path . '/theme',
            //  HANDLER
            'handler' => 'cards_format_views_plugin_style_cards_format_style',
            'path' => $path . '/views/plugins',
            //  UI
            'title' => t('Cards'),
            'machine_name' => 'cards',
            'help' => t('Displays result in Cards using Material CSS'),
            //  OPTIONS
            'uses row plugin' => TRUE,
            'uses row class' => TRUE,
            'uses grouping' => TRUE,
            'uses options' => TRUE,
            'type' => 'normal',
          )
        ),
        'row' => array(
          'cards_format_fields' => array(
            //  THEME
            'theme' => 'cards_fields',
            'theme path' => $path . '/theme',
            //  HANDLER
            'handler' => 'cards_format_views_plugin_row_cards_format_row_style',
            'path' => $path . '/views/plugins',
            //  UI
            'machine_name' => 'cards_fields',
            'title' => t('Card Fields'),
            'help' => t('Displays fields in Cards using Material CSS'),
            // OPTIONS
            'uses fields' => TRUE,
            'uses options' => TRUE,
            'type' => 'normal',
          )
        )
      );
      return $plugins;
    }

I have created the relevant templates in my /theme folder : cards-fields.tpl.php and cards-format.tpl.php This works.

Now I want to handle two different cases with two different templates instead of the current cards-fields.tpl.php. When the card has an image I want cards-fields–image.tpl.php to be called and when it does not, cards-fields–no-image.tpl.php should be called.
So, I have declared a preprocessor tied to the theme function for fields cards_fields, which declares theme suggestion depending on the result, like so:

function template_preprocess_cards_fields(&$variables)
{

  $fields($label) =
  $variables('view')->render_field($label, $variables('view')->row_index);

  $image = $fields('field_basic_image');
  if($image){
   $variables('theme_hook_suggestions')() = 'cards__image_fields';
  }
  else {
   $variables('theme_hook_suggestions')() = 'cards__no_image_fields';
  }
}

I am stuck there, none of the templates corresponding to the theme suggestions are picked up, only the cards_fields.tpl.php one.

I assumed that preprocess functions could help declare custom templates regardless of whether there is a theme function declared in the plugin, but maybe I am missing something.

google sheets – How to pick a random row that also does not contain text in one cell?

so I have a google spreadsheet full of youtube videos.
Column A looks if the video is already in column B, and if it is it says “duplicate”

Column B is youtube link

Column C is the title of the video

Column D is the name of the author

Column E is the genre (eg. car review, lets play, comedy…)

Column F is the lenght

And finally column G contains “x” as in I already watched it. And few times “unlisted”.

So I want to create a randomizer which picks a random link and all the info about it, but does not contain “x” – random video that i havent watched.

I came up with this =INDEX(B5:G; RANDBETWEEN(1; COUNTA(B5:B))). Works great as a randomizer, but it doesnt care about the filter I have set.

If someone has a idea how to pick a random link which does not contain a text in collum G and lists the info – title,author,genre ect., I would be very happy.

google sheets – Divide data evenly in row, place in additional rows

Okay, so what I have presented is a random divisor for every number. If you want all the rows in a column to add up, it will not be a random number. for instance, if you want to have 4 rows, the number in which you will use as a divisor will be 4. This is unless you are referring to the average of the random divisors to equal 4… or however that really works. The point is, choosing a random number between 4 and 7 will not have the summation results in which you are looking for.

    function myFunction() {
  var ss = SpreadsheetApp.getActiveSpreadsheet().getActiveSheet();
  var data = ss.getDataRange().getValues();
  var newData = ((,,,,,));
  var i = 0;
  var j = 0;
  var k = 1;
  var random = ();
  for (var i = 0, dataLength = data.length; i < dataLength; i++) {
    for (k = 1; k < 6; k++) {
    random(k) = Math.floor(Math.random() * 7) + 4;
    }
    newData(j) = (data(i)(0) / random(1),data(i)(1) / random(2),data(i)(2) / random(3),data(i)(3) / random(4),data(i)(4) / random(5),data(i)(5));
    for (k = 1; k < 6; k++) {
      random(k) = Math.floor(Math.random() * 7) + 4;
    }
    newData(j+1) = (data(i)(0) / random(1),data(i)(1) / random(2),data(i)(2) / random(3),data(i)(3) / random(4),data(i)(4) / random(5),data(i)(5));
    for (k = 1; k < 6; k++) {
      random(k) = Math.floor(Math.random() * 7) + 4;
    }
    newData(j+2) = (data(i)(0) / random(1),data(i)(1) / random(2),data(i)(2) / random(3),data(i)(3) / random(4),data(i)(4) / random(5),data(i)(5));
    for (k = 1; k < 6; k++) {
      random(k) = Math.floor(Math.random() * 7) + 4;
    }
    newData(j+3) = (data(i)(0) / random(1),data(i)(1) / random(2),data(i)(2) / random(3),data(i)(3) / random(4),data(i)(4) / random(5),data(i)(5));
    j = j + 4
  }
  ss.getRange(1,1, newData.length,6).setValues(newData);
}

views – How can I exclude the shown node without reducing the row count?

I have a view block for related content in which I’ve configured a contextual filter (“Content ID from URL”) such that, when displaying the block on a node, that node node is excluded from the view. However, in cases where the current node is captured in the view, the total row count is reduced (in my case, from 3 rows to 2 rows) per the exclusion. In other words, the filter doesn’t simply filter out node when making the query, it removes the node from the query result (so far as I understand the process).

Is there a way to configure the view so that excluding the current node does not reduce the overall row count? I tried ordering the the contextual filters so that that the node exclusion occurs first, but this doesn’t have any effect on the result.

tables – How to show search results when the column isn’t there or will have too many results per row?

if I search for a User by "typing Bob" it might show 20 of them. But since I'm using a table, I can't show that many. Which is why I am showing the # of users. However I really need the ability to search by User or Deal.

The same issue can happen with Deal. If I search for “AUG” I might get 100 results for 1 Group or 1 row, so in total I may have 300 rows with 100 results per row. So I obviously can’t show that many deals. Which is why I am only showing a total # of deals. But if they search, what is the best way to show the matches? Would I put “Matched 2” after the # of total deals in a group?

Single Row Cylindrical Roller Bearing in stock

Our History
Nanjing Younarui Bearing Co., Ltd was established in the year 2010. YNR is our brand and trademark. After 10 years of development, nowadays YNR has become into a group corporation with branch companies in Xi鈥檃n city, Shanxi Province and Wuhu City, Anhui Province.
Our Factory
Production Line Capacity: Bearing: 40,000 Pieces / Month;
Number of Product Categories: 20;
Number of Product Models: 3000
Our Product
Deep groove ball bearing, Cylindrical roller bearing, Taper roller bearing, Angular contact ball bearing, Self-aligning bearing, Pillow block bearing units and other special bearings
Product Application
Applicated for oil drilling, mining, excavation and mineral processing machinery. Our bearings meet the most stringent tolerances ensuring equipment runs at maximum load for peak output.
Our Certificate
SGS certificate (Alibaba Assessed Supplier), CPST Bearing Test Report (Eurones (Dongguan) Consumer Products Testing Service Co., Ltd), YNR trademark
Production Equipment
CNC Lathe: CJK0660, Quantity: 32 , Number of Year(s) Used: 3
CNC Grinding Machine: Pusen, Quantity: 35 , Number of Year(s) Used: 2
Wire-Cutting Machine: Boruige, Quantity: 11 , Number of Year(s) Used: 2
CNC Machining Center: VMC859L, Quantity: 12 , Number of Year(s) Used: 1
Projecto: VMS-3020F, Quantity: 1 , Number of Year(s) Used: 1
Hardness Tester, Quantity:3 , Number of Year(s) Used: 2
Surface Configuration Tester: N/A, Quantity: 1 , Number of Year(s) Used: 2
Spectrometer: BRUKER, Quantity: 1 , Number of Year(s) Used: 2
Length Measuring Instrument: JD25-C, Quantity: 1 , Number of Year(s) Used: 2
Production Market
Our products had been exported to the America, Europe, Southeast of Asia, Africa, the Middle East etc. with good quality and reasonable prices, have gotten good reputation among the customers.
Our Service
Provide OEM Service, 2000 square meters warehouse to keep huge stocks for fast delivery. One-stop purchasing for most types of bearings. Single Row Cylindrical Roller Bearing in stock
website:http://www.ynr-bearing.com/
website2:http://www.ynr-cojinetes.com/

DreamProxies - Cheapest USA Elite Private Proxies 100 Private Proxies 200 Private Proxies 400 Private Proxies 1000 Private Proxies 2000 Private Proxies ExtraProxies.com - Buy Cheap Private Proxies Buy 50 Private Proxies Buy 100 Private Proxies Buy 200 Private Proxies Buy 500 Private Proxies Buy 1000 Private Proxies Buy 2000 Private Proxies ProxiesLive Proxies-free.com New Proxy Lists Every Day Proxies123