2018-10-22         Sam

## Looking for a tutorial or detailed method to plot contours of confidence level

I try to find out a method or a tutorial to know how are plotted the contours of different confidence levels (68%, 95%, 99.7% etc ...).Here below an example of these contours on a plot that I would like to generate :It represents the constraints on cosmological parameters (\omega_Lambda represents dark energy and \Omega_m total matter quantity).Once I have data sets on \Omega_Lambda and \Omega_mat, how can I produce these contours : I know what is a confidence level but I only know the standard deviation. If I plot standard deviation for both parameters from the expected va...

2018-10-22         Sam

## Does Error object have literal syntax?

I found so far that most fundamental objects have literal syntaxNumeric literal is a sequence of digits 453String literal consists of characters enclosed in quotes. "yes" Boolean type has two literal values: true and false.Object literal is a list of name and value pairs in curly braces {}Array literal is a list enclosed in square brackets [].Function literal, synonym for function expression var add = function (a, b) {return a + b} Date objects have no literal syntax.RegExp literal is a pattern enclosed between slashes var re = /abc/;Error objects have no literal syntax??...

2018-10-22         Sam

## How to configure multiple IDPs in Shibboleth

I have installed shibboleth 3.0.2 version. I am hosting a single page application, which needs to be protected through ADFS login. There are two ADFS for different set of users. I have few queries as how to achieve this.How can i configure two IDPs in shibboleth2.xml file. element is allowed only once. I have provided two tags with different metadata file but when I click the linkhttps://devserver.testhost.com/Shibboleth.sso/DiscoFeed, it shows me two "entityID" elements with same IDP provided in .How does system work with two IDPs. What should be the process to identify ...

2018-10-22         Sam

Let me explain you the situation in brief:I am working on a django project in which I am trying to add a functionality wherein, I can upload a file directly to S3 from django-admin. For this purpose, I am using django-s3direct package. I have done all the setup as stated in the documentation. The problem I am facing is, whenever I select a file to upload, the progress-bar in the admin shows no progress and the following is the output on commandline:POST /s3direct/get_aws_v4_signature/ HTTP/1.1" 200 64Requesting your help at the earliest. Solved the issue. The problem occ...

2018-10-22         Sam

## How to change array of floats to array of strings, then save to txt

I know this question is addressed here: Numpy converting array from float to strings, but I am having trouble with the implementation.A=np.array([57/13, 7/5, 6/8])B=A.astype('|S4' )yields array([b'4.38',b'1.4', b'0.75]). The b's remain when I save to txt.np.savetxt('my_file.txt', B, fmt="%s")The issue of why the b's are there is discussed here: What does the 'b' character do in front of a string literal?, but with no explanation for how to get rid of them. Any help?Also, is there any way to get rid of the ' ' around each string when printing? From documentation -...

2018-10-22         Sam

## Angular2 RC6 Inject LOCALE_ID fails after bundling

I am trying to bundle an Angular2 app, just updated to RC6, based loosely on this excellent blog post.I have a Pipe that only wraps the built-in DatePipe with the difference that it accepts a null argument and does something in the case that it receives that. For RC6, this had to be updated to pass the _locale argument to DatePipe. Here is the pipe:import {Pipe, PipeTransform, Inject, LOCALE_ID} from '@angular/core';import {DatePipe} from '@angular/common';@Pipe({ name: 'myDate',})export class MyDatePipe implements PipeTransform { constructor(@Inject(LOCALE_ID) priv...

2018-10-22         Sam

After looking at the new laravel version 5.4 i notice when using "$user = User::create(request(['name', 'email','password']));" the password isnt automatically bcrypt the password, is it me, or isnt the password hashed by default on the model create method? I dont remember, but isnt supposed the method "create" already do this? As stated in the Laravel Docs If you are using the built-in LoginController and RegisterController classes that are included with your Laravel application, they will automatically use Bcrypt for registration and authentication.If you use Register... laravel 2 answers 64 view 2018-10-22 Sam ## Hiding select2 options I'm trying to hide some of the select2 options, but when I do something like this:<option style="display: none;">...</option>select2 ignores it, unlike when I disable an option, or make it "readonly".Any ideas? I stumbled upon this subject when looking for an answer to the same problem and i resolved it using the 'templateResult' callback of select2.<select id="mySelect"> <option value="1" data-show="1">1</option> <option value="2">2</option> <!-- option i want to hide --></select>At the initialization of my select2... jquery 5 answers 101 view 2018-10-22 Sam ## T-SQL: Sorting by date, then grouping? Let's say I have a database table that looks like this:ID name salary start_date city region----------- ---------- ----------- ----------------------- ---------- ------ 1 Jason 40420 1994-02-01 00:00:00.000 New York W 2 Robert 14420 1995-01-02 00:00:00.000 Vancouver N 3 Celia 24020 1996-12-03 00:00:00.000 Toronto W 4 Linda 40620 1997-11-04 00:00:00.000 New York N 5 David 80026 1998-10-05 00:00:00.000 Vancouver W 6 James ... sql 5 answers 60 view 2018-10-22 Sam ## Is there a way to display PRINT results with SQL server JDBC driver? If my stored procedure has a print statement inside it:print 'message'Is there a way to fetch the output in java program that connects to SQL Server 2008 through JDBC?Also, is there a danger that print messages left for debugging would shutdown connection when called from JDBC application? Yes, there is: https://dba.stackexchange.com/a/44373/5457Statement stmt = ...;stmt.execute("some sql");SQLWarning warning = stmt.getWarnings();while (warn != null) { System.out.println(warning.getMessage()); warning = warning.getNextWarning();} [XXX]this article shows how to d... java 3 answers 67 view 2018-10-22 Sam ## Running Apache kafka on Windows I am trying to run Kafka in my laptop via cygwin. I set the below parameter as suggested in many links.exec$JAVA $KAFKA_HEAP_OPTS$KAFKA_JVM_PERFORMANCE_OPTS $KAFKA_GC_LOG_OPTS$KAFKA_JMX_OPTS $KAFKA_LOG4J_OPTS -cp cygpath -p -w "$CLASSPATH" $KAFKA_OPTS "$@"However I see the below error -[/cygdrive/c/CTP/software/kafka-0.11.0.0-src]bin/zookeeper-server-start.sh config/zookeeper.propertiescygpath: can't convert empty pathPlease can you let me know what I am missing? The problem is may be beacause you are building from the source package on windows. try using the binar...

2018-10-22         Sam

## pyenv-virtualenv: `3.6.4' is not installed in pyenv

This just confuses me and I don't know what it means. I have 3.6.4 installed on my computer(MacOS) but it doesn't want to work.I can't think of any solution and don't know what to do. The answer is slightly different wether you are on a Mac or a Linux (I am not that used of Windows for Python working).Install(MacOS =>) Be sure that the XCode CLI tools are installed on your computer.xcode-select --installThen, to install the virtualenv, you have to enter the following command.pyenv install 3.6.4Here, you can have some issues regarding the zlib library that is not availabl...

2018-10-22         Sam

## Search specific file by name in a directory

I am creating a function for search only files inside directories and inside the folder if there is, using the recursive method. I need to list the all the files matching to my keyword. I list the all the files inside the directory and trying to match the filename to my search key, that's how I am thinking to search file, I don't know it is the correct way, even though i can list the files but the search part not working,if ($_SERVER['REQUEST_METHOD'] == 'POST') {$key = trim($_POST['search']);$path = BOOKROOT; if (isset($key)) {$books = new Recurs...

2018-10-22         Sam

## How do I retrieve multiple types of entities using a single query to Azure Table Storage?

I'm trying to grasp how Azure table storage works to create facebook-style feeds and I'm stuck on how to retrieve the entries.(My questions is almost the same as https://stackoverflow.com/questions/6843689/retrieve-multiple-type-of-entities-from-azure-table-storage but the link in the answer is broken.)This is my intended approach:Create a personal feed for all users within my application which can contain different types of entries (notification, status update etc). My idea is to store them in an Azure Table grouped by a partition key for each user.Retrieve all entries wit...

2018-10-22         Sam

## Clear sqlalchemy reflection cache

I'm using sqlalchemy's reflection tools to get a Table object. I do this because these tables are dynamic and tables/columns can change. Here's the code I'm using:def getTableByReflection(self, tableName, metadata, engine): return Table(tableName, metadata, autoload = True, autoload_with = engine)The problem is that when the above code is run twice it seems to return the same results regardless of whether or not the columns have changed. I have tried refreshing using the mysession.refresh(mytable) but that fails because the table is not attached to any metadata - which m...