Categories
User Help Web Pro

Isn’t the truth that “SEO” is, and always was, pure nonsense?

I used to follow discussions on this “WebmasterWorld” forum, where a small group of old-timers would sit and analyze every single word of every text published by Google/Yahoo/Microsoft/whatever other search engines existed, getting their pants wet whenever they made the slightest (perceived) change in their blackbox algorithms and generally seeming extremely stressed out and dependent […]

Categories
CMS Drupal Mastering Development

How can I automate values from select options in custom form

Am building a custom form and one of the fieldsets is for date of birth. So the day looks like this: $form[‘dob_fieldset’][‘dob’][‘day’] = [ ‘#type’ => ‘select’, ‘#options’ => [ ‘DD’ => $this->t(‘DD’), ’01’ => $this->t(’01’), ’02’ => $this->t(’02’), ’03’ => $this->t(’03’), ….. ’29’ => $this->t(’29’), ’30’ => $this->t(’30’), ’31’ => $this->t(’31’) ], ‘#default_value’ => […]

Categories
Mastering Development

Javascript returns NaN only in IOS browsers

I am making this age calculator website which uses the Date object in JS and by subtracting the current time in milliseconds and the user’s date of birth in milliseconds calculates their age in different units (years, months, days etc.) and outputs it to the html. It is completely functional on windows and android, however, […]

Categories
Development

optimize numpy loop using functional approach

Dears, I am new in Python/Numpy, would like to know how to eliminate the loops and have a better performance for the code below, for a monte carlo simulation. import matplotlib.pyplot as plt from mpl_toolkits.mplot3d import Axes3D import numpy as np import pandas as pd iterations = 3 months = 12 group_size = 5 exit_factor […]

Categories
CMS Development Wordpress

Change Human Time Difference Number Language

I have added function /* Function which displays your post date in time ago format */ function human_time_diff_nepali( $from, $to = ” ) { if ( empty( $to ) ) { $to = time(); } $diff = (int) abs( $to – $from ); if ( $diff < HOUR_IN_SECONDS ) { $mins = round( $diff / […]

Categories
Development

Creating an R function that can accept both datasets and object names as well as those names as a string object

I can make a function that takes object names as arguments (this is just a normal function). I can also now make a function that get’s its data and column arguments via a named vector (utilising dataset <- eval(sym(dataset)) and date_col <- sym(date_col)). However I would like a function that can handle both types of […]

Categories
Development

Grouping dates and times

Is there an R package that provides grouping of dates and times? Background I often need to group responses to HTTP requests into 15 second intervals. Function lubridate::floor_date() and lubridate::ceiling_date() got me started, but I came up with something based on the modulo (%%), but it feels like I’m reinventing the wheel regarding operating on […]

Categories
Development

How to calculate a faster days-in-month weighted average

It is common that energy meters don’t start and end on the beginning and end of a month but overlap unevenly with the calendar. I’m trying to use weighted average logic to line up these read dates and calculate a single month value. I’ve attached my code example that builds a similar dataset to what […]

Categories
Development

Writing an R function but how do I modify it to loop over columns in a dataframe and loop over multiple datasets?

I’m a novice to R and I’ve written very clunky functions to apply to geochemical datasets to interpolate data to nearby dates, convert decimal dates, reshape & average the geochemical data by year/month, and spit it all out at the end as a new data frame. However, it only does one column at a time […]

Categories
Development

why is it causing endless loop or at least if I add `m` to prefix array starts printing data?

I am trying to find if the strings on my prefix are in the target s_date then show me which ones are the strings which contain those words. the output of extract_fulltext is 30 dagen geleden def extract_fulltext(url): try: page = requests.get(‘http://www.indeed.com’ + url) soup = BeautifulSoup(page.text, “lxml”, from_encoding=”utf-8″) spans = soup.findAll(‘div’, attrs={‘class’: ‘jobsearch-jobDescriptionText’}) for […]