Show More Tags:  MORE

Permission Denied Error using Laravel & Docker

I have two docker containers: Nginx and App.The app container extends PHP-fpm and also has my Laravel Code.In my docker-compose.yml I'm doing:version: '2'services: nginx: build: context: ./nginx dockerfile: ./Dockerfile ports: - "80:80" links: - app app: build: context: ./app dockerfile: ./DockerfileIn my Nginx Dockerfile i'm doing:FROM nginx:latestWORKDIR /var/wwwADD ./nginx.conf /etc/nginx/conf.d/default.confADD . /var/wwwEXPOSE 80In my App Dockerfile I'm doing:FROM php:7-f...

ambiguity in package references version

In a project there are several references to Ninject library which have their own version, and unit tests fails, error : Message: System.IO.FileLoadException : Could not load file or assembly 'Ninject, Version=, Culture=neutral, PublicKeyToken=c7192dc5380945e7' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040) ---- System.IO.FileLoadException : Could not load file or assembly 'Ninject, Version=, Culture=neutral, PublicKeyToken=c7192dc5380945e7' or one of its depen...

SSL: no alternative certificate subject name matches target host name $

I want to run tensorflow traning script in google cloud ml. One of the buckets from an external project. I have created cloud ml engine service account and add it as an user to this external project. After that, have executed the following command in my terminal with gcloud initialised project:gcloud auth activate-service-account --my-service-acc-key.jsonAnd then submit my job as:gcloud ml-engine jobs submit training ..argumentsJob was submitted successfully and was running until accessing resources from external bucket with file_io.FileIO('gs://external-bucket')I got the f...

How can I fill out a Python string with spaces?

I want to fill out a string with spaces. I know that the following works for zero's:>>> print "'%06d'"%4'000004'But what should I do when I want this?:'hi 'of course I can measure string length and do str+" "*leftover, but I'd like the shortest way. You can do this with str.ljust(width[, fillchar]): Return the string left justified in a string of length width. Padding is done using the specified fillchar (default is a space). The original string is returned if width is less than len(s).>>> 'hi'.ljust(10)'hi ' [XXX]Unless you need to suppo...

how can I, character and words count from string to make a line break insert in android

how can I, character and words count from string to make a line break insert in androidI have a text output of words with max 150 letters and want the all 50 letters carried a line break without separating the can I implement it?here is a code snippet ....ll = (TableLayout) rootview.findViewById(;TableRow row = new TableRow(getActivity());consoleLocalStore.storeConsoleData(consolex);LayoutInflater inflater = getLayoutInflater(getArguments());View theInflatedView = inflater.inflate(R.layout.activity_consolex, null);TextView attid = (TextVie...

Regex with exception of particular words

I have problem with regex.I need to make regex with an exception of a set of specified words, for example: apple, orange, juice.and given these words, it will match everything except those words above. apple (should not match)applejuice (match)yummyjuice (match)yummy-apple-juice (match)orangeapplejuice (match)orange (should not match)juice (should not match)orange-apple-juice (match)apple-orange-aple (match)juice-juice-juice (match)orange-juice (match) If you really want to do this with a single regular expression, you might find lookaround helpful (especially negative l...

How do i add data in dataframe under the columns and across the rows?

I have a few dataframes that are loaded previously from CSV filesb = portfolionew_df.loc [1,['x_1','x_2','x_3','x_4','x_5']]x = [stockprice_df.loc[ :, b]]print(x)This is the result for x: NYSEARCA:RYE NYSEARCA:XOP NYSEARCA:PXE NYSEARCA:VAW NYSEARCA:PYZ 0 68.37 52.00 25.37 87.94 35.00 1 60.70 48.04 22.64 83.78 32.61 2 67.04 54.48 24.70 86.61 34.44 3 65.86 53.75 24.16 84.94 34.21c = pd.DataFrame(index=(t...

Get the most used words with special characters

I want to get the most used word from an array. The only problem is that the Swedish characters (Å, Ä, and Ö) will only show as �.$string = 'This is just a test post with the Swedish characters Å, Ä, and Ö. Also as lower cased characters: å, ä, and ö.';echo '<pre>';print_r(array_count_values(str_word_count($string, 1, 'àáãâçêéíîóõôúÀÁÃÂÇÊÉÍÎÓÕÔÚ')));echo '</pre>';That code will output the following:Array( [This] => 1 [is] => 1 [just] => 1 [a] => 1 [test] => 1 [post] => 1 [with] => 1 [the] => 1 [Swedish] => 1 ...

In R: How do i solve "Out of memory" error in POS tagger?

In R, i have a data with 30 records for sample, main data has 20000 records. records are tweets. I extract bigrams from any tweet and i use from postagger. For sample data,that shown me errors .jnew("", .jcast(.jnew("", : java.lang.OutOfMemoryError: Java heap spaceor .jnew("", .jcast(.jnew("", : java.lang.OutOfMemoryError: GC overhead limit exceededHow do i solve this peroblem? My code is : how do i solve this peroblem? for(i in 1:nrow(data1)){ . . ...

How to swap using different data types

Ok so lets suppose I have an array of 4 ints == int[] input = new int[]{1,2,3,4};//now I some how converted these numbers into words and gets an array:-String Str = new String[]{one,two,three,four};//then I run a sort method on Str.Arrays.sort(Str);//and I got this array in the end ::: {four,one,three,two}Now i want to reconvert it into numbers(int) so that my final result should look like this:- {4,1,3,2}In Summery :-I want to sort the input int arrays through its English(words)representation Examples :-[input] [convert to words] [sorting] [Resul...

How can I create a directory if it does not exist?

What is the most elegant way to check if the directory a file is going to be written to exists, and if not, create the directory using Python? Here is what I tried:import osfile_path = "/my/directory/filename.txt"directory = os.path.dirname(file_path)try: os.stat(directory)except: os.mkdir(directory) f = file(filename)Somehow, I missed os.path.exists (thanks kanja, Blair, and Douglas). This is what I have now:def ensure_dir(file_path): directory = os.path.dirname(file_path) if not os.path.exists(directory): os.makedirs(directory)Is there a flag for ...

No visible @interface for 'GADUNativeCustomTemplateAd' error

The error I am getting is: no visible @interface for 'GADUNativeCustomTemplateAd' declares the selectors 'performClickOnAssetWithKeycustomClickHandler:clickHandler:'Can anyone please help me solve this?.m file// Copyright 2014 Google Inc. All Rights Reserved.#import "GADUNativeCustomTemplateAd.h"@implementation GADUNativeCustomTemplateAd - (instancetype)initWithAd:(GADNativeCustomTemplateAd *)nativeCustomTemplateAd { self = [super init]; if (self) { _nativeCustomTemplateAd = nativeCustomTemplateAd; } return self;}- (NSString *)templateID { return [self.nativeCusto...

Pandas assign the groupby sum value to the last row in the original table

For example, I have a table Aid price sum1 2 01 6 01 4 02 2 02 10 02 1 02 5 03 1 03 5 0What I want is like (the last row of sum should be the sum of price of a group)id price sum1 2 01 6 01 4 122 2 02 10 02 1 02 5 183 1 03 5 6What I can do is find out the sum usingA['price'].groupby(A['id']).transform('sum')However I don't know how to assign this to the sum column (last row).Thanks Use last_valid_index to locate rows to fillg = df.groupby('id')l ...

Add a new function to Elgg River

I'm trying to add functionality in a new tab I added on my custom mod/myplugin/views/default/page/layouts/content.php and remove some elements based on their tags from the main activity. $tabs = array( 'all' => array( 'text' => elgg_echo('all'), 'href' => (isset($vars['all_link'])) ? $vars['all_link'] : "$context/all", 'selected' => ($filter_context == 'all'), 'priority' => 200, ), 'mine' => array( 'text' => elgg_echo('mine'), 'href' => (isset($vars['mine_link'])) ? $vars['mine_link'] : "$context/...

how to group records in days based on timestamp value from current date in oracle

I Have a table with a column as timestamp with timezone as shown below.desc log_records:id number not null,event_id number not null,event_desc varchar2(2000),log_date timestamp with time zoneHow do i suppose to group the records like older than 300 days 12 rowsolder than 250 days 12831 rowsolder than 200 days 438121 rows based on the current date in oracle Kaushik, thank you for sample data. (BTW, I think your solution is wrong, I'll leave a comment).I think that this is what you're looking for:SQL> select 2 sum(case when sysdate - trunc(log_date) > 300 then 1...

Adding directory to PATH Environment Variable in Windows

In Windows NT Operating systems, I tried to add this directory to my system PATH environment variable:C:\xampp\phpSo I added that directory by "My Computer" > "Properties" > "Advanced" > "Environment Variables" > "Path". I saved it, but when I typed: pathto my console, it doesn't show any added "C:

Windows 8.1 + DNSCrypt + Unbound for DNS Cache

I'm following this guide ( and others but nothing:I have Windows 8.1 x64, DNSCrypt 1.4.3, Unbound last version downloaded from the site.I started DNSCrypt on, changed my DNS setup in network card to and I set t

cloud-init per-boot script on ubuntu ec2-instance

I am trying to start a script with cloud-init on a ubuntu 11.10 ec2 instance.I put the script in the folder /var/lib/cloud/scripts/per-boot.Content of is simple:#/!/bin/sh echo "test"After a reboot, I get the following error:run-parts: failed to exec /var/lib/cloud/scripts/per-bo

Active MQ clustering using http auto discovery with multi cast on Amazon EC2

We are trying to set up the active MQ cluster on production environment on Amazon EC2 with Auto discover and multicast. I was able to configure successfully auto discovery with multi-cast on my local active mq server but on Amazon EC2 it is not working.From the linkI found that Amazon EC2 does not s

Max connection pool size and autoscaling group

In Sequelize.js you should configure the max connection pool size (default 5). I don't know how to deal with this configuration as I work on an autoscaling platform in AWS. The Aurora DB cluster on r3.2xlarge allows 2000 max connections per read replica (you can get that by running SELECT @@MAX_CONN

What is the alternative option of self-signed certificates in production for internal systems authentication

I Want to authenticate systems deployed on different servers with each others using certificates. If it wasn't a self-signed certificate, what should it be to let each system has its own certificate and trust in in the other server in the production environment?The signed certificates are paid and I

Where are SSL certificates are stored?

I understand how SSL works, but my question is more regarding the storage of certs on client side. To understand the exact context you can assume that I am sort of writing my own browser.My Rendering part will be done by WebKit and http request handling part will be done by libCurl. libCurl has an o

Forward named pipe over ssh

I'd like to forward a named pipe over SSH, from remote Windows machine to a local machine. The remote Windows machine is running sshd (OpenSSH). The pipe I want to forward is for the Docker Engine API, although that shouldn't matter.To forward an equivalent Unix domain socket from a remote Unix mach

What does "2>&1" in a Windows Command Do?

Doing some maintenance on a script, I found this line:ping -n 40 > NUL 2>&1I know from this question that everything up to the NUL causes the script to sleep for 39 seconds. But I don't know what the rest of the command does.What does the 2>&1 do? Decomposing the linep

Amazon EC2 and getting a response from my IP address without using the Amazon public DNS

I have tried everything, I can get to my application using the, I cannot ping the address.However, when I do ping the amazon DNS, it identifies with the IP address of but does not respond to ping. When I put the IP address in the browser, it times out and gives m

Windows 8 - XAML - Conditional background for row in ListView

I have a data source with items in it. Each item has a boolean called "IsAvailable".I want to render the datasource in a ListView. The background of each row must be green if "IsAvailable" = true or red if "IsAvailable" = false.How can I do it?Thanks-- MarcoThis is the code:<ListView x:Name="frIt

Private Key/Public Key (SSL certificate) to setup an Amazon EC2 Load Balancer

I am trying to create an Elastic Load Balancer, but I am unable to get the information (private key and public key certificate) to validate through the AWS console. I keep receiving private key/public key mismatch.Digicert provides the cert in a .p7b file format. Besides the p7b certificate I have a

Use PuTTY as a local terminal emulator?

Currently, I use PuTTY for SSHing into my linux server and Cygwin for local development when working on my Windows machine. Sadly, the terminal emulator that comes with Cygwin doesn't approach the quality of the excellent terminal emulator that comes with PuTTY. And it occurs to me that there really

Why is the script in the DataUser section of my Ubuntu EC2 instance not running? I am using Cloudformation

I am using CloudFormation to create an EC2 instance that runs Ubuntu. I have inserted into the UserData property of the EC2 instance a command to install pip and a command to install the cfn cloudformation helper scripts. To wit, the key cloudformation template fragment is:"UserData" : { "Fn::B

How to get new password from change password scenario in custom credential provider

I am doing a custom wrapped credential provider. In that i need to get the 'new password' field string from change password scenario. As far as I learnt, after user submits from the change password scenario, GetSerialization function in my credential provider is called and there i should be able to