Find all date ranges for overlapping start and end dates in R

Issue I have a data frame that looks like this: w<-read.table(header=TRUE,text=” start.date end.date 2006-06-26 2006-07-24 2006-07-19 2006-08-16 2007-06-09 2007-07-07 2007-06-24 2007-07-22 2007-07-03 2007-07-31 2007-08-04 2007-09-01 2007-08-07 2007-09-04 2007-09-05 2007-10-03 2007-09-14 2007-10-12 2007-10-19 2007-11-16 2007-11-17 2007-12-15 2008-06-18 2008-07-16 2008-06-28 2008-07-26 2008-07-11

Continue reading

SQL: Merge Overlapping Date Ranges

Issue I have two tables both containing date ranges, the first table contains the default record ID that applies during the date range: STARTDATE | ENDDATE | RECORDID __________________________________________________ 2022/Nov/01 00:00 | 2022/Nov/30 00:00 | 10 2022/Dec/01 00:00 | 2022/Dec/31

Continue reading

Pandas CustomBusinessHour reduced performance

Issue I need to reduce the performance of the following operation : st = time.time() bh = CustomBusinessHour(start=’00:00′, end=’23:00′) bdates = pd.date_range(start=’2024-01-01 00:00:00′, end=’2024-12-31 23:00:00′, freq=bh, name=’ts’, closed=None) print_statistics(f'{bdates}’, ‘filter_bp()’, ‘utils.py’, time.time() – st) which gives has the following output

Continue reading

Python: Loop over datetimeindex based on different periods

Issue I have a DataFrame and I am trying to loop over the datetmeindex based on different frequencies: data = [[99330,12,122],[1123,1230,1287],[123,101,812739],[1143,12301230,252],[234,342,4546],[2445,3453,3457],[7897,8657,5675], [46,5675,453],[76,484,3735], [363,93,4568], [385,568,367], [458,846,4847], [574,45747,658468], [57457,46534,4675]] df1 = pd.DataFrame(data, index=[‘2022-01-01’, ‘2022-01-02’, ‘2022-01-03’, ‘2022-01-04’, ‘2022-01-05’, ‘2022-01-06’, ‘2022-01-07’, ‘2022-01-08’, ‘2022-01-09’, ‘2022-01-10’,

Continue reading

Who validates the property?

Issue I’m trying to find the piece of code that is responsible for property value validation. For example I have: <h1 [style.color]=”myColor”> And I bound myColor variable with input: <input (input)=”myColor = $event.target.value”> I expect change of color on input

Continue reading

Javascript to Angular 2 : document.querySelector('el').emit('em') to @viewChild

Issue How to convert HTML <a-entity id=”fading-cube” geometry=”primitive: box” material=”opacity: 1″> <a-animation attribute=”material.opacity” begin=”fade” to=”0″></a-animation> </a-entity> JS document.querySelector(‘#fading-cube’).emit(‘fade’); This is my code in Angular 2 that is not working. @ViewChild(‘fading-cube’) fadingCubeInput: any; fadecube(){ this.renderer.setProperty(this.fadingCubeInput.nativeElement,’emit’,”fade”) } Solution To access your element

Continue reading

Why does django-pipeline's {% compressed_js … %} tag output each script separately?

Issue I’ve configured pipeline as follows: STATICFILES_FINDERS = ( ‘django.contrib.staticfiles.finders.FileSystemFinder’, ‘django.contrib.staticfiles.finders.AppDirectoriesFinder’, ‘pipeline.finders.PipelineFinder’, ) # Static files storage STATICFILES_STORAGE = ‘pipeline.storage.PipelineStorage’ # Pipeline JS compressor PIPELINE_JS_COMPRESSOR = ‘pipeline.compressors.jsmin.JSMinCompressor’ PIPELINE_JS = { ‘website-main’: { ‘source_filenames’: ( ‘shared/jquery/jquery-1.10.2.min.js’, ‘shared/bootstrap/js/bootstrap.min.js’, ‘shared/jquery/jquery.cookie.js’, ), ‘output_filename’: ‘pipeline-compressed/website-main.js’,

Continue reading

django pipeline breaks admin when DEBUG=False

Issue here is the settings for css PIPELINE_CSS = { ‘base’: { ‘source_filenames’: ( ‘scss/core.scss’, ), ‘output_filename’: ‘css/min.css’, }, ‘ie8’: { ‘source_filenames’: ( ‘css/ie-8-overrides.css’, ), ‘output_filename’: ‘css/ie8.css’, }, } Somehow it complains about: ValueError: The file ‘admin/css/base.css’ could not be

Continue reading

Django-pipeline producing empty files

Issue Right now, when running python manage.py collectstatic produces a minified file but it is completely empty. Here are my settings.py (I am on a windows environment): STATICFILES_STORAGE = ‘pipeline.storage.PipelineStorage’ PIPELINE_ENABLED = True PIPELINE_DISABLE_WRAPPER = True PIPELINE_CSS_COMPRESSOR = ‘pipeline.compressors.yui.YUICompressor’ PIPELINE_JS_COMPRESSOR

Continue reading

Overriding Bootstrap in django-pipeline

Issue I have a Django application with which I am using the django-pipeline package and bootstrap.css: PIPELINE_CSS = { ‘myCSS’: { ‘source_filenames’: ( ‘css/bootstrap.css’, ‘css/bootstrapoverride.css’, ), ‘output_filename’: ‘bootmin.css’, ‘variant’: ‘datauri’, }, } As you can see above I have included

Continue reading

Overriding Bootstrap in django-pipeline

Issue I have a Django application with which I am using the django-pipeline package and bootstrap.css: PIPELINE_CSS = { ‘myCSS’: { ‘source_filenames’: ( ‘css/bootstrap.css’, ‘css/bootstrapoverride.css’, ), ‘output_filename’: ‘bootmin.css’, ‘variant’: ‘datauri’, }, } As you can see above I have included

Continue reading