Response stringlengths 15 2k | Instruction stringlengths 37 2k | Prompt stringlengths 14 160 |
|---|---|---|
I finally solved the problem used the code below.private String getMacAdressByPorts(Set<Integer> ports) {
return ports.stream().sorted().collect(Collectors.toList()).toString(); | I found this bug on Sonarqube:private String getMacAdressByPorts(Set<Integer> ports) {
ports.stream().sorted(); // sonar list show "Refactor the code so this stream pipeline is used"
return ports.toString();
} //getMacAdressByPortsI have been searching for a long time on the Internet, but it was no use. Please ... | How to fix "Intermediate Stream methods should not be left unused" on Sonarqube |
The term you are looking for is padding. And it greatly depends on the architecture. Some architectures support "packed" structures.
No assumptions can be made about unless the compiler on given machine explicitely states what kind of padding is used. C/C++ standards do not define that.
Often the amount of padding wil... |
This question already has answers here:
size of a user defined class
(5 answers)
How is the size of a C++ class determined?
(4 answers)
... | how is memory allocation done in struct by compiler? [duplicate] |
3
server {
server_name "~^www\.(.*)$";
return 301 https://$1$request_uri;
}
Use nginx regexp server_name to achieve it. https://nginx.ru/en/docs/http/server_names.html
Share
Improve this answer
Follow
... |
We are running nginx and hosting multiple domains on it.
We'd like to redirect all the www.domain to non-www domain. Is there a way to do it for all the servers at once without configuring individual servers. For example, I know I can achieve it for one server by following configuration, but I am looking for a soluti... | nginx redirect all www domains to non-www domains |
You can addunless on() (day_of_month()==10 and hour() ==1 and minute()>0<15)to your metric, to ignore values over some period of time.For example,up unless on() (day_of_month() == 10 and hour() == 1 and minute() >= 0 <= 59)will return values except for 01:00 - 02:00 on 10th of every month.Demo can be seenhere.I case of... | I am using below query to display the average up-time of a certain website in percentage for SLA monitoring.(avg_over_time(probe_success{job="$http_job"}[24h]) * 100)try to exclude palnned downtime(15mins or 1hr depends on url) which can be different w.r.t env/production.
Can anyone pls help on thistried with offset bu... | Prometheus query to calculate avg_over_time up-time, but want to ignore individual url wise planned downtimes |
You have a memory leak somewhere. Somewhere you hold references to memory intensive data in a long lived object. By this the GC cannot collect those data. Your app will use even more memory the longer it is running until all the memory is used up. Then your app is killed with an OutOfMemory Exception
Links that might ... |
In my app I refresh data every 3 minutes. If app will work for couple hours I'go this kinda error:
java.lang.OutOfMemoryError
at org.apache.http.util.CharArrayBuffer.<init>(CharArrayBuffer.java:55)
at org.apache.http.util.EntityUtils.toString(EntityUtils.java:131)
at org.apache.http.util.EntityUtils.toString(EntityUti... | Android OutOfMemoryError while refresh data |
The configuration of Ingress is correct. The key was in the SSL certificate bundle file.
I use a chain of certificates in onecrtfile that contains 5 certificates.Example snippet is:-----BEGIN CERTIFICATE-----
MIIF4zCCBMugAwIBAhIMUCJSvK6eipIjbvq7MA0GCSqGSIb3DQEBCwUAMEwxGzAJ
...
-----END CERTIFICATE-----
-----BEGIN CERTI... | I'm getting the error:[lua] certificate.lua:89: call(): failed to set DER cert: SSL_add0_chain_cert() failed, context: ssl_certificate_by_lua*,when configure ingress to serve kubernetes dashboard on GKE. This trouble realated only to Dashboard. In other namespaces simular configuration work fine. I mean with the same S... | How to correctly configure the Kubernetes Dashboard via Ingress-Nginx on GKE |
Your variable is for an object type, and as such must be declared as a pointer:@property (nonatomic) UIColor * color; // Note the asterisk"Statically allocated" in this case would mean that the memory for that object was allocated at compile-time. All objects in Obj-C, however, are allocated at runtime and accessed ... | I tried to put this in the header file of my view object:@property (nonatomic) UIColor color;to store the color that lines should be drawn with in this view.Xcode gives me an error on this line:Interface type cannot be statically allocatedWhat does that mean, and what should I do?EDIT:I did add a *, and at the point of... | Interface type cannot be statically allocated? |
You need to make sure your username and email are properly setup on your local repository. Check out Githubs help page.
you will use the following commands:
git config user.name "Your Name"
git config user.email "[email protected]"
|
When I push changes via git to GitHub from my job PC, it shows different user in commit history. I use same username and password when git asks me for remote login info. None of these commits (from my workplace) are recorded as mine in profile page commits map.
| When pushing from other PC, other user is displayed |
It depends upon the size of the matrix and number of iterations that needs to be performed. This is because you need to copy the matrix data from CPU memory to GPU memory and copy back the results from the GPU to CPU. If you are gonna perform only one iteration on the matrix, its always better to do it on the CPU rath... |
What do you think? What would be faster and how much faster: Doing sparse matrix (CSR) multiplication (with a vector) on the GPU or the CPU (multithreaded)?
| Sparse Matrix Multiplication on GPU or CPU? |
This is easier if you prevent a file to be merged in a branch, through pull-request.That means the file can still be checked-in, but not in a protected branch, updated only through pull-request.Then you can use theGitHub Actionxalvarez/prevent-file-change-action: you might need to fork that action in order to add a fil... | Is it possible to stop a file from being checked in? If so, how would you do this in a GitHub Action or comparable technology?Conceptual (but not actual) workflowDeveloper attempts to check in a fileCheck the text to make sure that the string "Owner: Acme" is present in a commentIf the text string is not present then d... | Stop a file from being checked into a repository? |
-2"NFS (SMB to be precise)"Which is it? They are not the same thing. Your code example is showing nfs, but you said SMB. | I'm trying to mount a Persistent Volume on a self hosted Kubernetes cluster using NFS (SMB to be precise). I created a share with a user and password on another machine (my samba host), I have tested that the share is accessible from the network. So the problem is that when accessing it I would need to provide the cred... | Mounting NFS Persistent Volumes with authentication |
I don't think you need a lint for crontab. There's 5 fields that are space separated then a space then the command to run and its args finish off the line.
Also, on Ubuntu at least, crontab won't let you save a bum file. I just tried a few things and it barfed on all of them. I guess that means that crontab is its ... |
Is there anything like lint for crontab? I'd like to know that i've got all my spaces and stars sorted out without waiting for something to not work.
| Is there a lint like program for crontab? |
26
Found my issue. I had old AWS keys in my environment variables. If you have environment variables named
AWS_SECRET_ACCESS_KEY
AWS_ACCESS_KEY_ID
the awscli will use those values instead of what is provided via ~/.aws/credentials.
Try running printenv | grep AWS and... |
I am using AWS CLI on Ubuntu 16.04 LTS, I am trying to list all buckets. In aws configure I have input the IAM user access key and IAM user secret key. This IAM user has permissions to list buckets and can list buckets in the console. But using AWS CLI with these keys and running the command aws s3 ls, it is giving me... | AWS CLI listing S3 buckets gives SignatureDoesNotMatch error using IAM user credentials |
You seem to be asking about the difference between compile-time initialization and run-time initialization. In the following C code:int i;
int main() {
int j;
return i + j;
}iis a globally scoped variable and so is default initialized to zero, which is achieved by including it in the data segment of the program... | In Uninitialized Data Segment, the kernel initialize the uninitialized variable to 0.But if we directly use an uninitialized variable (for eg. int sum; and not int sum=0; ) and use it in program like sum=sum+n(n be any number), sum will take any garbage value.So why the sum will take any garbage value if it has already... | uninitialized data segment of program memory |
The first version alters memory in sequence, so uses the processor cache optimally.
The second version uses one value from each cache line it loads, so it pessimal for cache use.
The point to understand is that the cache is divided into lines, each of which will contain many values in the overall structure.
The first... |
#define IMGX 8192
#define IMGY 8192
int red_freq[256];
char img[IMGY][IMGX][3];
main(){
int i, j;
long long total;
long long redness;
for (i = 0; i < 256; i++)
red_freq[i] = 0;
for (i = 0; i < IMGY; i++)
for (j = 0; j < IMGX; j++)
red_freq[img[i][j][0]] += 1;
total = 0;
for (i = 0; i... | algorithm comparison in C, what's the difference? |
No. This is known as the static-initialization fiasco. The order that objects get constructed prior to entering main is unspecified. The only guarantee is that it happens.
What you can do is lazy-initialize. This means your objects won't be initialized until you use them. Such as:
struct A { /* some data */ };
struct ... |
I've got a class (A) that accesses (indirectly via a static method) a static variable (an STL container) in another class (B) in its constructor and destructor.
A objects may be global, global constants, static members of another class, stored in other classes (which may themselves have global or static instances) or ... | C++ Controlling destructor order for global objects |
As mentioned inissue 939the error clearly indicates that the daemon is not running in the newly introduced agent mode (docker/libnetwork#1149). Without that, daemon will expect KV-Store to be configured for any overlay network to be created.For docker as ancient as 1.7, I would first upgrade it.If not, try at least "Se... | I am trying to create a network using docker 1.71 ubuntu image.Everything is installed and working fine, however when I try to create my own network, I get the following error:$docker network create -d overlay test
Error response from daemon: datastore for scope "global" is not initialized | How to create overlay network for docker, getting error datastore for scope "global" is not initialized |
This was asked and answered in the past, seeHow to get item count from DynamoDB?Basically, you need to use the "Select" parameter to tell DynamoDB to only count the query's results, instead of retrieving them.As usual in DynamoDB, this is truncated by paging: if the result set (not the count - the actual full results) ... | I would like to check how many entries are in a DynamoDB table that matches a querywithout retrieving the actual entries, using boto3.I want to run a machine learning job on data from DynamoDB table. The data I'm training on is a data that answers a query,not the entire table. I want to run the job only if I have enoug... | AWS DynamoDB count query results without retrieving |
1
git fetch origin master
This command will update your local copy of the remote repo without touching your local repo or working directory. This way you can see what the difference is between the remote branch and your local branch by running the following command:
git di... |
I recently made a mess of one of my projects that I track with Git. I made several changes, and instead of reverting the changes of my local repo back, I decided to clone the repo again into another directory on my machine, to create a backup of sorts (kind of redundant, I know). I then went ahead and did revert the c... | Local copy ahead of master |
The init containers are stored inspec.initContainers:kubectl get pods POD_NAME_HERE -o jsonpath={.spec.initContainers[*].name}You can display both with a bit ofJSONPath magic:kubectl get pod POD_NAME_HERE -o jsonpath="{.spec['containers','initContainers'][*].name}"Before Kubernetes 1.6 the init containers were stored i... | A solution to retrieve all containers running in a pod is to runkubectl get pods POD_NAME_HERE -o jsonpath={.spec.containers[*].name}, however this command line does not provide the init containers.Is there a way to cleanly retrieve all containers running in a pod, including init containers?[edit] as svenwltr noted, on... | How to list all containers running in a pod, including init containers? |
1
Backup paths are always relative to the server. You can backup to UNC (which I do personally, even if it's a local UNC) or, if you're on a sufficiently recent build of SQL 2012, Azure blob storage (http://technet.microsoft.com/en-us/library/jj919148.aspx).
Share
... |
I followed the examples from http://msdn.microsoft.com/en-us/magazine/cc163409.aspx
I am creating a utility that creates backup of databases (local or remote).
I was able to create backup of databases located at my local server. But when I do so for databases located at host server I get following error:
System.Data.S... | Can we use SMO to take backup of database located at hosting server? |
I'll answer my question:
I've solved it using Dev certificate when creating p12, then use it in AWS SNS website. Go to Xcode-> Use Dev Certificate & Dev Provisioning profile and now it works :) | So im using AWS SNS to send push notifications to apple devices.I've followed the following steps:Created an app IDCreated a APNs Production iOS certificateCreated .p12 certificate to use in AWS SNSCreated AWS SNS ApplicationConfig in iOS App (It works. I get deviceToken and creates an EndPoint to AWSSNS App)When i pub... | AWS SNS EndPoint disabled when publishing |
8
don't know if it can still help you. Faced the same issue hence I tried to figure it out. Apparentley the volume from your host filesystem to the container slows it down dramatically. Try to use the following setup with your volume:
~/mysql/:/var/lib/mysql:delegated
The ... |
I migrated my mysql database to docker and I restored a dump file. My mysql server was instaled directly on Linux, and I had not issues. On docker container my queries is 30x slower. Someone had a similar problem? I am running docker on Ubuntu 16 and I am using the following docker compose:
version: '3'
services:
db... | Performance issues with mysql docker container |
For viewing, or for some additional processing?
If you want to sort the files for viewing on a Windows desktop, an inexpensive option is to install WebDrive and map a drive to Amazon S3. You can do a column sort by date, file type, name, etc.
|
Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 11 years ago.
Improve this question
... | Is it possible to sort files on Amazon S3? [closed] |
If you've already got a Github Pages repository set up for the organization (e.g. some-org.github.io), then any additional gh-pages repository will be accessible via some-org.github.io/<repo name>.
For example, I've got the organization "SusHack", and it has a repository called sushack.github.io.
sushack.github.io ser... |
I want to know if creating a Jekyll GitHub blog for a particular GitHub page will associate itself with that entire GitHub entity or if it is possible to make multiple Jekyll blogs under the auspices of a single GitHub profile.
I'm part of an "Organization" on GitHub, my research group, and I want to create a blog fo... | create a Jekyll GitHub blog as a subdirectory of an Organization |
-1You can set thePathto the cert .pfx
If you have it in a separate store you can set that too
The example areHere | Supposing you have imported two wildcard certificates for "*.foobar.net" in the Windows certificate store (certlm.msc) having different expiration dates and theappsettings.jsonconfigured as bellow. Which certificate Kestrel will choose to serve requests?"Kestrel": {
"EndPoints": {
"HTTPS": {
"Url": "h... | How does Kestrel select among similar or duplicated TLS certificates? |
Where I work we manage our branch protection using a program calledGithub Organization Manager, which basically uses a file inside of a single git repository to manage the settings for our repositories. This allows settings to be exposed without giving admin access (and the organizer tool doesn't let users do things li... | For our project we're using Github'sbranch protectionto enforce at least 1 reviewer for all changes, no exceptions for administrators.The day will come however, when we need to rush an emergency fix. This will require expedited merging of a branch, which can only happen if someone else is around to review. But what hap... | Ability to "break glass" and bypass Github branch protection for emergency fixes? |
Sure, have a look atgit filter-branch, it is made for situations like this. Which filter arguemnt you need depends on what you want to do exactly. If you want to remove the whole config file, you might want to use--index-filter, if you just want to remove the line with the password, you might want to use--tree-filteran... | I am stuck in situation, where one of the config file in my project has a signing password in it and its been committed on to git since the start (Almost 800+) commits so far. I want to move the password from that config file and use it separately from now on. But my concern is the older commits still have that content... | Is there a way I could change content of a file through out all commits in git? |
I do similar thing with glusterFS it requires higher permissions for the container but it's doable. In short docker command would be:
docker run --cap-add SYS_ADMIN --device fuse -v host_mount_dir:container_mount_dir:shared IMAGE COMMAND
If you get error like "Path /foo is mounted on /foo but it is not a shared mount... |
I have been playing around with possibility of having a container that mounts an s3 bucket and exposes it to the outside.
I used https://github.com/FindHotel/aws-s3-mount to have the s3 bucket mounted inside the container successfully. The mount is using FUSE.
I couldn't find a way to reach to that s3 mount from the h... | s3 mounted inside the container. how to expose it to the host? |
Isweek1a submodule?Note the relevant part from the output of thegit statuscommand:(commit or discard the untracked or modified content in submodules)Trycd week1and issuing anothergit statusto see what changes you have made to theweek1submodule.Seehttp://git-scm.com/book/en/Git-Tools-Submodulesfor more information about... | I have a very basic github setup with a readme, a directory, and another directory inside it with an html file. On github I can only view the readme and the first folder but none of its contents, and I am getting this messagetc349 ryntc3$ git add *
tc349 ryntc3$ git status
On branch master
Changes not staged for commit... | github changes not staged for commit |
Git submodules are fully-fledged git repositories, so you can't check out just part of a git repo using submodules: it needs to have its own folder. You can, however, name that folder whatever you like:git submodule add git@hostname:location.git path/to/moduleclones the submodule topath/to/modulein your git repo. | I have 2 repositories at github: 1st is for a cURL library, 2nd is for a project I'm writing. I'm trying to add my library as submodule to my project:cd /www/fifa14api/CI-FIFA14-API/
git submodule add[email protected]:ctepeo/CI-cURL.gitMy project based on CodeIgniter, so file structure looks like/application/
/system/
... | git add submodule without repo name |
A Java library that converts cron expressions into human readable strings: https://github.com/RedHogs/cron-parser
|
Closed. This question is seeking recommendations for software libraries, tutorials, tools, books, or other off-site resources. It does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions see... | Cron to human readable string [closed] |
It turns out that this is not possible with GoDaddy. If anyone else reading this has a similar problem, only current solution is to cancel your domain registration and register with someone else.
(edit) As @aavrug mentions in their comment, Amazon now have a guide for this.
|
I'm following the serverless-stack guide and have a website hosted in an Amazon S3 bucket. I purchased a domain using GoDaddy and I have set up cloudfront to work with this bucket, then have used AWS certificate manager to generate SSL certificates for my domain (both www.my_domain.com and my_domain.com).
In GoDaddy ... | HTTPS connections to cloudfront / S3 using godaddy domain |
After yourgit reset --hard, use to be sure thegit restorecommandcd /path/to/repository
git restore -- .That should restore (as its name implies) the working tree with what is in HEAD (and you just reset HEAD to the right commit)ShareFollowansweredJan 26, 2021 at 23:28VonCVonC1.3m539539 gold badges4.6k4.6k silver badges... | I want my entire repository to roll back to a certain previous commit (that is 20 commits behind my latest commit).I tried usinggit reset --hard <commit#>andgit revert <commit#>Both the git commands run successfully with the message -Head is now at <commithead>But then when I see the code in my repo, I can still see th... | Git revert and reset : Files in the repository are not getting rolled back |
You could just read out/proc/meminfo. Be aware that the "free memory" is usually quite low, as the OS heavily uses free, unused memory for caching.Also, it's best if you don't try to outsmart your OS's memory management. That usually just ends in tears (or slower programs). Better just take the RAM you need. If you wan... | I would like my python script to use all the free RAM available but no more (for efficiency reasons). I can control this by reading in only a limited amount of data but I need to know how much RAM is free at run-time to get this right. It will be run on a variety of Linux systems. Is it possible to determine the free... | Determine free RAM in Python |
You can use a different approach of throwing the url in a single parameter, and parse it in your application.So the apache rewrite rule would look like:RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]which will convert your urls as follows:/user/MyUse... | Not sure how you'll take this question but...Whenever I try to make my URLs lookprettyI always end up messing around for too long and it's simply not worth the trouble. But the end effect is good if it were a simple task.So what I want to do is create a method which in the end would achive something like...index.php?do... | Easy mod_rewrite - So I'll never have to think about it again |
No, cudf is not available as a pip package.You don't say why you need cudf, but I would try pandas, dask or vaex, surely one of those will do what you need. | On google colab I installed conda and then cudf through conda. However now i need to reinstall all packages like sklearn etc which I am using in my code. Is there some way to install cudf without conda ? pip no more works with cudf. Also if there is some other similar gpu dataframe which can be installed using pip, it ... | Install cudf without conda |
0
You could pass the host ip as a environment variables at the docker run time, and then grab it in php with $_ENV['your_env_name'];
# GET & SET HOST IP
# double check this on the system you're working on.
# should work on most linux env
# Adjust NR=1 or NR=2 NR=3 depending... |
how can i receive the clients ip address in any docker container?
in my php application i need to check client ip addresses with $_SERVER[REMOTE_ADDR] to control access which is at the moment not possible.
for example i am running a php-apache webserver in container on port 8080.
my ip address is : 192.168.80.177
con... | Docker: get clients IP address in container |
Nginx uses theReactorpattern. Basically, it's single-threaded (but can fork several processes to utilize multiple cores). The main event loop waits for the OS to signal a readiness event - e.g. that data is available to read from a socket, at which point it is read into a buffer and processed. The single thread can ver... | I understand thread driven that Apache uses: every connection opens up a thread and when the response is sent, the thread is closed, releasing the resources for other threads).But I don't get the event driven design that Nginx uses. I've read some basics about event driven design .. but I don't understand how this is u... | How does Nginx handle HTTP requests? |
I don't think you understand how memory management in Cocoa works. The array will retain the objects you add to it, and it will release them by itself when the array no longer needs them (such as when you release the array).In other words, add the autoreleased object to the array, and don't worry about its retain count... | I need help with deallocation of my NSMutableArray of custom objects. I need to retain the array and so I have added a property in .h and I release it in dealloc in .m file. When I add objects to the array, I do the following:myarray = [[NSMutableArray alloc] init];
[myarray addObject:[[mycustomObject alloc]initWithO... | Deallocating NSMutableArray of custom objects |
In general different Browsers do not behave exactly the same wrt. HTTP cache headers.One small difference I remember (can't find the source, so I'm not 100% this is the exact behavior description) is that Chrome (afair) treatmax-age=0as if you specifiedmax-age=10(assuming the behavior difference is small enough, but pe... | What's the difference between a HTTP response withCache-Control: no-cachevsCache-Control: max-age=0, must-revalidate, proxy-revalidate?Do browsers treat that asidentical? | "no-cache" vs "max-age=0, must-revalidate, proxy-revalidate" |
The token used is created by the user which has sufficient permission for the projectPJYou need to check the permission and generate new token accordingly. | I am accessing the SonarQube API through API key as described inhttps://docs.sonarqube.org/latest/extension-guide/web-api/A call to /api/components/search_projects works.A call to/api/project_analyses/search?project=PJfails with http error code 403If I log into the web interface with that user, I can browse the statist... | SonarQube api api/project_analyses/search fails with 403 "msg": "Insufficient privileges" yet API key user is admin |
3
I had the same issue.
It worked after I changed the branch='master' by branch='main'.
That's because of that: https://www.zdnet.com/article/github-to-replace-master-with-main-starting-next-month/
Cheers,
Share
Improve this answer
Follo... |
I am trying to upload a .csv file to GitHub using this code:
### THIS PART WOKRS ###
g = Github("My_Access_Key")
repo = g.get_user().get_repo('tradr')
all_files = []
contents = repo.get_contents("")
while contents:
file_content = contents.pop(0)
if file_content.type == "dir":
contents.extend(repo.get_c... | Using PyGitHub to push file to GitHub with Python, getting a "Branch master not found" error |
I had a same issue and I used this raw file to extract the necessary Application.* inputs and filters that would allow You to use $(tag['0') as a log_stream key.https://raw.githubusercontent.com/aws-samples/amazon-cloudwatch-container-insights/latest/k8s-deployment-manifest-templates/deployment-mode/daemonset/container... | I'm using Fluent-Bit to ship kubernetes container logs into cloudwatch.This configis working fine. Instead ofoutput-elasticsearch.confI have following:output-cloudwatch.conf: |
[OUTPUT]
Name cloudwatch_logs
Match *
region us-east-1
log_group_... | Fluent-Bit sending kubernetes logs to AWS Cloudwatch. How to change log stream prefix based on kubernetes namespace? |
malloc()does allocate the memory, but most OS will only give you a virtual address space until you actually try to read or write within that memory, at which time they'll start allocating backing physical or swap memory. You simply need to loop writing some garbage values into the memory.ShareFolloweditedApr 4, 2011 a... | How can I allocate a large amount of memory with 16GB ram? Please provide a simple C/C++ program as an example.E.g.main()
{
// (10 gigabytes) / (4 bytes) = 2 684 354 560
int *hugearray = malloc( 2684354560 * sizeof(int) );
}...obviously that doesn't work. | Hello world - what is a simple program to use 16GB of memory? |
The best approach is to use the Standard Library. std::vector saves you from having to worry about memory management and having to set the vector's size.
std::vector<std::vector<double>> a;
You can also use std::unique_ptr, but it is more bothersome to allocate dynamic memory. However, since it is a std::unique_ptr ... |
This is to hold a data like
double **a;
a = new (double*)[100];
for (int i=0; i<100; ++i) {
a[i] = new double[99];
}
The ptr_vector can include a vector of pointers. But it does not seem supporting customized deleter to free an array.
One solution is that I can create a new class that manages 99 doubles, and use p... | Does boost have smart pointers for a vector of arrays? |
Changing some of the attributes in DynamoDB is not permitted, for example, changing Partition key, adding a Local Secondary Index, etc.When such changes occur, it will need to replace the resource and to replace, it will try to delete and re-create the resource. During this process, if table already exists, it will fai... | I have a DynamoDB table created with this Terraform:resource "aws_dynamodb_table" "materials_table" {
name = "materials"
hash_key = "MATERIAL"
billing_mode = "PROVISIONED"
read_capacity = 5
write_capacity = 5
attribute {
name = "MATERIAL"
type = "S"
}
}The tabl... | Changing hash_key with Terraform causes Table already exists error |
When the firewall rule is set for 0.0.0.0 it only allows that IP, and 0.0.0.0/0 is the whole internet.So If the firewall rule you set was only for 0.0.0.0 it is an expected behavior.ShareFollowansweredDec 6, 2019 at 23:04Soni SolSoni Sol2,46733 gold badges1212 silver badges2424 bronze badgesAdd a comment| | Today I've experienced very unusual behavior of Google AppEngine's firewall.
I've an app running inside of GKE pod and another one is running inside of AppEngine.
I need my pod to be able to access AppEngine
If I do curl from a pod like this
curl ifconfig.co
I see
35...*
btw, if I'm trying to crul ipinfo.io/ip answe... | Google AppEngine's Firewall Strange behavior |
It has to do with optimizing memory access. Your GPU has a number of threadgroups, each containing a relatively small amount of dedicated memory (a few KB) that can be accessed very quickly. This is separate from your GPU's main memory, which might be a few GBs of comparatively slow memory.
Since it's unlikely that al... |
I'm learning Apple's Metal trying to do some GPU computation.
I checked the matrix multiplication example given by Apple. There's a point I cannot understand.
In the file MetalMatrixMult.h
// Number of rows in matrices A and C.
@property (nonatomic) uint16_t m;
// Number of columns in matrix A; number of rows in matr... | Why Apple's Metal Matrix Multiplication Example needs padding C |
The easiest way to accomplish this is to redirect stderr to /dev/null (or to an error log file). Details here:http://tldp.org/HOWTO/Bash-Prog-Intro-HOWTO-3.htmlThen the only thing printed will be your message to stdout. | I'd like a small function to detect whether a given computer has a CUDA-enabled GPU available, such as the following.#include <stdio.h>
#include <cuda_runtime.h>
int main() {
int deviceCount;
struct cudaDeviceProp properties;
cudaError_t cudaResultCode = cudaGetDeviceCount(&deviceCount);
if (cudaResult... | Disable printing to stderr by NVIDIA driver? |
The normal way to approach this is to run the app on multiple servers behind a load balancer. Do a rolling upgrade where one server at a time is stopped, new version pulled, and new version runs so as to preserve uptime. | I am using Docker and Fig for my Rails/Postgres app.What is the best way to pushupdatesto Rails app to production? Currently I am running the following script on production but it causes about 10 seconds of downtime:sudo fig pull web
sudo fig up -d webI guess the downtime happens when Fig recreates thewebcontainer.Here... | How to update rails app on production with Docker and Fig with zero downtime? |
Just a guess, but how aboutsites:
- map: main-url.app
to: /Code/Laravel/public
- map: sub.main-url.app
to: /Code/Laravel/public
- map: another-domain.app
to: /Code/Laravel/public | I was wondering how one would assign multiple domains to the same path in Homestead/Vagrant?This is basically what I want, but it does not work.. When I attempt this, I can't access the server at all.sites:
- map: main-url.app, sub.main-url.app, another-domain.app
to: /Code/Laravel/publicAnd same goes when I ... | Homestead: How would I map multiple domains to the same path? |
It seems like this is a GitHub web interface only glitch.The system can verify the signatures internally.The trick to get through this is to use the "Command line instructions".I was able to merge the branchwithoutturning off any checks.ShareFollowansweredFeb 10, 2020 at 5:35Eric LamEric Lam35911 gold badge55 silver ba... | Github is blocking the pull request from being merged, even though all the commits are verified.Rule settings: 'Require signed commits' & 'Include administrators' are checked.Does anyone know how to solve this? | Github - Merging is blocked - The base branch requires all commits to be signed |
Both Route53 and ELB are used to distribute the network traffic. These AWS services appear similar but there are minor differences between them.
ELB distributes traffic among Multiple Availability Zone but not to multiple Regions. Route53 can distribute traffic among multiple Regions. In short, ELBs are intended to ... |
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by prog... | Elastic Load Balancer (ELB) and Route 53 in AWS [closed] |
The problems seems to be the beginning of the string ("/var").
Grafana seems to treat every string starting with/as regular expression, and it expects any regular expression to start with/, too (it seems).So the fix was to add a trailing/, and escape the literal/as\/.Unfortunately this only removes the error message, b... | An Icinga2 plugin (written by myself) returns performance data with metrics named/var(avail_MB),/var(total_MB)and similar. Data is forwarded to an InfluxDB with Grafana as Frontend.I'm using "GROUP BY" "tag(metric)" and "ALIAS BY" "$tag_metric" in a dashboard's panel query.
The metric names are displayed correctly belo... | Grafana: Overrriding series with metric named `/var(avail_MB)`: "Panel rendering error '/var(avail_MB)' is not a valid regular expression." |
I'm not sure what you mean. Why not just clone the repo to the new directory?ShareFollowansweredJan 25, 2013 at 12:58Sami NSami N1,17022 gold badges99 silver badges2121 bronze badges2Clone overwrite old files to my new files?–Dokuz Tane OnJan 25, 2013 at 13:00Ah, now I got it. So you have an unversioned directory that ... | I have a Github remote repo and sync with my local repo. It's ok. But now, create a new directory and it's have last and true files.How can i change my local repo via Git? | Change local repo directory in Github |
2
As you can see in the documentation, updating user data doesn't necessarily (and in most cases shouldn't) require replacing the instance.
You could try and run the updated User Data script from a Systems Manager command. The script should be stored in /var/lib/cloud/ins... |
I'm using the UserData field in a CloudFormation template to install software on the instance. When I update the UserData I would like CloudFormation to replace the instance. However, UserData is not a replace field and as a result the instance is stopped but not replaced and the new UserData script is never run.
Is t... | Force EC2 Instance Replacement When Updating UserData in CloudFormation |
As @matt pointed out, Git only "sees files you explicitly ask it to see". A simple solution here would be to not check in anything but your desired files.$ git add file1.xls file2.xls
$ git commit -m "Here are the Excel files"If you want the ability to checkin everything with$ git add ., or just avoid the chance of add... | I have a large directory full of files and subdirectories.Two or three of the files are excel spreadsheets in the main directory that I need to transfer to and from home regularly.My idea was to make a git repository that only includes those few files, then use git to pass the files back and forth via a private reposit... | .gitignore everything except |
You can use preview or incermental option while scanning the project,incremental will be good option to run scan on delta changes.https://docs.sonarqube.org/plugins/servlet/mobile?contentId=6947686#content/view/6947686ShareFollowansweredOct 6, 2018 at 15:22satish kumar pandeysatish kumar pandey1621Thank you for reply. ... | We recently integrated sonarqube to our existing build and release environment.
Everytime any commit triggers sonar scanning total project again instead of latest commit.How to make sonar to scan only the latest commits from second time onwards as it is taking lot of time for scanning.if not let us know any alternative... | sonarqube only latest commit should be scan |
Essentiallyyes; Git will freeze the diff of the PR at the point at which the PR was created. If something else has been merged intomastersubsequent to you creating the PR, theheadsections will differ, and as such thediffwill also differ.In order to see only your changes (and not those made tomasterin the mean-time), yo... | I've had a situation where a PR diff (from a feature branch to master) is different to a diff generated by comparing that ame feature branch to master.The only thing I can think of is that GitHub 'freezes' the PR diff at the time of creation, and then that diff gets 'outdated' as master moves on (other feature branches... | Outdated PR diff |
You can download all files in that directory to Colab first with:!npx degit Jainu-s/urldata/al -fThen, you can loop it like local files. | I have folder in github which contains text files and when I tried to read below code in Google colab I'm getting errorFileNotFoundError: [Errno 2] No such file or directory:
'https://github.com/Jainu-s/urldata/tree/master/al?raw=true'loc = 'https://github.com/Jainu-s/urldata/tree/master/al?raw=true'
#uploaded = fil... | How to read .txt files from github into Google colab |
For those looking for a way to import an existing GitHub repo into Stackblitz, please read: https://stackblitz.com/docs#import-from-github.
You can run any public repo on Github by providing the username + repo name like so:
stackblitz.com/github/{GH_USERNAME}/{REPO_NAME}
And you can also optionally specify a branc... |
I have an angular project and I know it is possible to open a github project in StackBlitz, but what about the changes that were made on the StackBlitz project? Is it possible to commit to github without downloading the code to your PC?
| StackBlitz synchronization with github - upload to from StackBlitz to github |
A sketchy not recommended approach is to use a PythonUser Defined Function:CREATE OR REPLACE FUNCTION janky_sleep (x float) RETURNS bool IMMUTABLE as $$
from time import sleep
sleep(x)
return True
$$ LANGUAGE plpythonu;
select janky_sleep(5.0); | Does Redshift have any functions similar topg_sleep()in PostgreSQL?I have a SQL script that needs to wait for some time before continuing with the execution.TheUnsupported PostgreSQL FunctionsRedshift documentation that sayspg_sleep()is not supported.Update 1:I am running into deadlock issue in Redshift. I have multipl... | Delay execution of SQL script in Amazon Redshift |
I discovered that this feature is not supported in Sonarqube. A ticket opened for thisissuehas already been closed as "Won't Fix" by the Sonarqube Team.For a workaround you can checkthis | Im using SonarQube v6.4. I'm aware that all types of tests (Unit Tests, Integration Tests etc) have been merged together as overall coverage.However, on the interface I can see statistics for only Unit tests, Is there a way to get the statistics for other types of tests?Example of statistics available only for unit tes... | How to show Integration Test Statistics? |
If you've already built your CRD, you can access the objects in the kubernetes api like this.const k8s = require('@kubernetes/client-node');
const kc = new k8s.KubeConfig()
kc.loadFromDefault();
const k8sClient = kc.makeApiClient(k8s.CustomObjectsApi);
resp = k8sClient.getNamespacedCustomObjectStatus('api.yourorg.io... | Examples are pretty limited, so going off what my IDE shows me and what I dig up from the source code. Having trouble.I created my CRD already. I want to post it. Currently, its just a github webhook with a payload that I plan to trim later. I can't seem to find the right constructor to pass to KubeConfig's makeApiCli... | How do I write a CRD using the kubernetes-client for javascript? |
If you want to really look at what is going on in the VM memory you should use a good tool likeVisualVM. This is Free Software and it's a great way to see what is going on.Nothing is really "wrong" with explicitgc()calls. However, remember that when you callgc()you are "suggesting" that the garbage collector run. Ther... | We have a j2ee application running on Jboss and we want to monitor its memory usage. Currently we use the following codeSystem.gc();
Runtime rt = Runtime.getRuntime();
long usedMB = (rt.totalMemory() - rt.freeMemory()) / 1024 / 1024;
logger.information(this, "memory usage" + usedMB);This code works fine. Th... | How to monitor Java memory usage? |
This should work:RewriteCond %{HTTP_HOST} ^[^.]+\.[^.]+$
RewriteRule ^(.*) http://www.%{HTTP_HOST}/$1 [R=301]It will redirect all request without a subdomain to www.domainame.tld. | I found this code to force using www.RewriteEngine On
RewriteCond %{HTTP_HOST} !^www.example.com$
RewriteRule ^(.*)$ http://www.example.com/$1 [R=301]But i have many domain that pointed to same directory. So i need a version of this code for multiple domains. It must run on any domain, is it possible ? | Htaccess to force use WWW for mutlidomain |
Just increase height of your graph panels in the UI - make them higher (or disable legend, so there will be space for graph). See example of the same panels with different heights:Click on the mark in the right bottom corner and change height of the panel. | I am working on build grafana dashboards for my project.I have facing the issue that some of my panels keep shows "Invalid dimensions for plot, width = 415, height = 0"I am not sure how to fix it. I tried to increase the size of the graph, however the table always there.I really appreciate your help.The screenshot is ... | Grafana Panel Error about height and width |
You can use anHTTP Module, however, to use it you will need to map all requests to IIS which can be done using awild card map.. This will have a performance impact because you're going to be forcing all requests through the .net runtime.You could also write your own ISAPI filter, but I believe you'll have to use C++.Ed... | I'd like to run a discrete chunk of .Net code for each and every request that comes through a certain Web site in IIS. This is completely isolated code -- it doesn't affect anything before or after it -- it logs some information from the request, then ends.Note that this is not something I can put in Application_OnReq... | What part of the ASP.Net framework do you use to execute arbitrary code on every inbound request to IIS? |
I also understand that it's impossible to have 2 Ingress serving External HTTP requestI am not sure where you've found this but you totally can do this.You should be able to create two separate ingress objects like following:apiVersion: networking.k8s.io/v1beta1
kind: Ingress
metadata:
name: frontdoor-bar
namespace... | I have different applications running in the same Kubernetes Cluster.I would like multiple domains to access my Kubernetes Cluster and be redirected depending the domain.
For each domain I would like different annotations/configuration.Without the annotations I have an ingress deployment such as:apiVersion: networking.... | Kubernetes - multiple configuration in one Ingress |
AWS Cognito Advanced Security Features provides this functionality. You can find more details herehttps://aws.amazon.com/blogs/security/how-to-use-new-advanced-security-features-for-amazon-cognito-user-pools/Advanced Security Features | I am using Cognito for authentication. I am using the default sign-in page application for the end user to login to the application.I need to log end-user activities related to the sign-in page for auditing purpose. Basically, I need to log when the user signed-up, signed-in, signed out and changed password. I can use ... | AWS Cognito - Logging end user activities for auditing |
AhostPathvolume mounts a file or directory from the host node's filesystem into your Pod. So, if you have a multi-node cluster, the pod is restarted for some reasons and assigned to another node, the new node won't have the old data on the same path. That's why we have seen, that hostPath volumeswork well only on singl... | What is the main difference between hostpath and local persistent volume in Kubernetes?Assuming I have a kubernetes cluster running on my machine with a pod running a database that uses a local persistent volume to save data, if the whole cluster fail (for example shutting down the machine), at the next start of the m... | Kubernetes persistent volume: hostpath vs local and data persistence |
Currently it is not in Cognito user pools documentation, but following example should work for SignUp. Similarly you can formulate it for other APIs. Payload should be what has been mentioned in the documentation you pointedCONTENT-TYPE: application/x-amz-json-1.1
X-AMZ-TARGET: com.amazonaws.cognito.identity.idp.model.... | We are looking into using user pools for our application. I would like to try out API in REST manner. Documentation athttps://docs.aws.amazon.com/cognito-user-identity-pools/latest/APIReference/Welcome.htmldoesn't have request and response examples like others. Looking for SignUp, ResendConfirmationCode,ChangePassword ... | AWS Cognito user pool identity REST examples |
I figured this out. Turns out our preload and asset change monitoring endpoint (which reports to the front end when assets change and need to be reloaded) was testing against the on disk list of digests to make this determination. Naturally - the on disk digest could get ahead of which digests had actually been comp... |
I've been tinkering with setting up multiple cloudfront endpoints for a rails app running behind nginx to improve page load times. Basically - we had a single endpoint set up before that appears to have been working fine, but when I added in a second endpoint using the following declaration for asset_host:
config.act... | Cloudfront is caching 404s from nginx for assets that do exist on the origin server |
@gennady-vanin-novosibirsk....
String s1="Java";String s2="Java";String s3="Java";String s4="Java";
The above all objects available in StringConstantPool location those are all objects are pointing to only one ("Java") location
|
Coming from the question will two strings with same content be stored in the same memory location?
Having the Java code
String s1="Java";
will this string be allocated in the same memory location (or multipe):
if to launch the same program multiple times executing it in parallel (concurrently)?
Possible ans... | When do (not) two strings with same content share the same memory? |
You should useRewriteMap.It uses text file that is mentioned in .htaccess and can be used for mapping 'something' to 'something' in RewriteRule.Something like this:RewriteMap p2f txt:/path/to/map.txt
RewriteRule ^([^/]+)/?$ /{p2f:$1|notfound.php} [L]map.txt would be:1 page1.php
2 page2.php
...Apache monitoring the file... | I have a website with about a 100 pages for which the sample .htaccess file hasRewriteRule ^1/?$ page1.php [NC,L]
RewriteRule ^2/?$ page2.php [NC,L]
RewriteRule ^3/?$ page3.php [NC,L]The problem is these pages get a lot of redirection between one another and while addingheader("location: pa... | Use MySQL to create .htaccess file URL rewrite parameters |
As per a training I attended - this should be the best practice :cv = CrossValidator(estimator=lr,..)
pipelineModel = Pipeline(stages=[idx,assembler,cv])
cv_model= pipelineModel.fit(train)This way your pipeline would fit only once and not with each recurring run with the param_grid which makes it run faster.
Hope this ... | Cross Validation outside from pipeline.val naivebayes
val indexer
val pipeLine = new Pipeline().setStages(Array(indexer, naiveBayes))
val paramGrid = new ParamGridBuilder()
.addGrid(naiveBayes.smoothing, Array(1.0, 0.1, 0.3, 0.5))
.build()
val crossValidator = new CrossValidator().setEstimator(pipeLine)
.setE... | cross validation with pipe line in spark |
if you send one file you can count itpublic static async Task Execute(string repositoryOwner, string repoName, GitHubClient gitHubClient,
List<ExtractedFile> files,
IEnumerable<ExtractedFile> extractedSource)
{
foreach (var file in extractedSource)
{
var fileContent = awa... | how get the number of lines by languages in a github repository using javascript?i want to get something like this[
{ "extension": "java","lines": 360},
{"extension": "xml","lines": 45},
…
]i try thisfunction getSloc(repo, tries) {
//repo is the repo's path
if (!repo) {
return Promise.reject(new Error(... | how get the number of lines by languages in a github repository? |
This is my suggestion, you should take advantage the more you can of docker cache.
Assume this multi-module project pom layout:
+-- my-project
+-- module1
| `-- pom.xml
+-- module2
| `-- pom.xml
`- pom.xml
Dockerfile:
# cache as most as possible in this multistage dockerfile.
FROM maven:3.6-alpine... |
I have a multi-module maven project where the single modules are all runnable microservice applications containing their own Dockerfile, so in production every module will be a containerized application.
The parent project, which contains the child-modules only contains the parent pom.xml and the docker-compose.yml
I ... | multi-module Maven project on Dockers |
How to protect branch with "Require pull request reviews before merging" | In GitHub, I have the following rule active on a branch called 'main':Require a pull request before mergingBut it still allows me to push directly to the protected branch.We only have 1 branch and the settings show that the rules are applied to 1 branch. I am not sure what other settings I would need to change. | GitHub still allows me to push directly to protected branch |
'Unused private fields should be removed' is the message generated by the internal SonarQube rulesquid:S1068, whereas your@SuppressWarningsannotation disables the matching (and deprecated) PMD check.You might want to check your quality profile, eventually disable this rule, or put some exclusions for the Lombok augment... | After upgrading SonarQube from 4.0 to 4.2, I got a bunch of 'Unused private fields should be removed' errors from the classes with Lombok annotations.I have@SuppressWarnings("PMD.UnusedPrivateField")declared at the beginning of all those classes. It worked fine when I was using SonarQube 3.7 and 4.0.I usemvn sonar:sona... | sonarqube 4.2 and lombok |
SonarQube needs to talk to the database in order to save the results (metrics) of the analysis.I will not talk about all the different possibilities that you can implement in order to avoid SonarQube's users to know the admin login, but here is the one I use:SonarQube + RunnerJenkins with Sonar pluginThis post (on my b... | In the similar questionSonar-Runner talks to the local database"David RACODON - SonarSource" wrote:The SonarQube Runner needs to talk to both the database and the web server.I'm will try to understand why Sonar Runner talks do sonar database, because somebody who use sonar runner will known database user and password a... | Why Sonar-Runner talks to the local database? |
I worked with Jaeger and springboot few years ago. In a dockerized environment, I remember you have to supply few environment variables to the application, something like:JAEGER_AGENT_HOST=jaeger-agent.example.io
JAEGER_AGENT_PORT=5775
JAEGER_SAMPLER_TYPE=const
JAEGER_SAMPLER_PARAM=1
JAEGER_SAMPLER_MANAGER_HOST_PORT=ja... | I am using below GitHub link to setup opentracing withJaegerfor microservices hosted in kubernetes env and it works fine for Java apps like Jenkins.https://github.com/lucas-matt/auto-tracing-webhookhttps://medium.com/opentracing/opentracing-on-kubernetes-get-yer-tracing-for-free-7a69cca03c8aHowever when I try to setup ... | Spring Boot application with Jaeger |
"Does mod_wsgi/Python include internal optimizations that would stop complete execution? Does it guess the output is deterministic and cache?"
No.
The problem is (generally) that you have a global variable somewhere in your program that is not getting reset the way you hoped it would.
Sometimes this can be unintention... |
I have been trying to track down weird problems with my mod_wsgi/Python web application. I have the application handler which creates an object and calls a method:
def my_method(self, file):
self.sapi.write("In my method for %d time"%self.mmcount)
self.mmcount += 1
# ... open file (absolute path to file),... | Is mod_wsgi/Python optimizing things out? |
So I found a potential interesting solution to this problem.
One thing I didn't really think about but just noticed were the (fetch) and (push) parentheses after a remote URL listing from the verbose git remote command:
$ git remote -v
origin https://github.com/YOUR_USERNAME/YOUR_FORK.git (fetch)
origin https:/... |
The GitHub forking documentation outlines that the best remote tracking practice for when you have your own fork is to have origin as your own branch and upstream as the branch that you forked from:
$ git remote -v
origin https://github.com/YOUR_USERNAME/YOUR_FORK.git (fetch)
origin https://github.com/YOUR_USERN... | Proper git remote tracking practice |
I agree with Eddie that you need to modify the permissions of the migrations folder.
The migrations folder is located at:
/opt/python/current/app/quotations/migrations/
You probably need to do something like:
subprocess.call(['chmod', '-R', '+w', '/opt/python/current/app/quotations/migrations/'])
You'll probably nee... |
I have a scenario, where I need to create a table dynamically, To create the table dynamically I have written code to create a model.py file with the table content that I want to create.
Once this file get created then I want to perform the makemigrations command from the code itself like
from django.core.management... | call_command makemigrations does not work on Elastic Beanstalk |
You can usedocker loadUsage: docker load [OPTIONS]
Load an image from a tar archive or STDINGit bash console:docker load < HDP_2.5_docker.tarWindows cmd:docker load -i windowsservercore.tar | I have installed Docker for Windows. I have downloadedHDP_2.5_docker.tarfromhttp://hortonworks.com/downloads/#sandboxwhich is a 10 GB file.How can I load an image tar file? I have tried this command:docker import HDP_2.5_docker.tar | How to load a Docker image from a tar file |
The command looks like the following:Makecert -r -pe -n CN="www.example.com" -b 05/10/2010 -e 12/22/2011 -eku 1.3.6.1.5.5.7.3.1 -ss my -sr localmachine -sky exchange -sp "Microsoft RSA SChannel Cryptographic Provider" -sy 12If you copy the sample command from the MSDN page above and run it via the command-line, you'll ... | I am following step 2 inthistutorial.
After entering this command,makecert -r -pe -n "CN=PC-Name" -b 01/01/2000 -e 01/01/2036 -eku 1.3.6.1.5.5.7.3.1 -ss my -sr localMachine -sky exchange -sp "Microsoft RSA SChannel Cryptographic Provider" -sy 12I a getting ERROR: Too many parametersHow to solve this issue? Help please | How to solve too many parameters error when using makecert? |
This rule:RewriteRule ^(([\w/\-]+)?[\w-])(/|\.html)?$ test/index.php?slug=$1 [L]Will trapdomain.com/slug-text,domain.com/slug-text/anddomain.com/slug-text.htmland sendslug-textto/test/index.phpinsideslugparam.If you really want to redirect using[R=301]from old urls to new then use this:RewriteRule ^(([\w/-]+)?[\w-])/?(... | So to begin with I have a custom url rewrite that sends a request variable to a php scriptRewrite rule is below:RewriteRule ^([\w\/-]+)(\?.*)?$ test/index.php?slug=$1 [L,T=application/x-httpd-php]So if you access something likedomain.com/slug-textit sendsslug-texttoindex.phplocated in folder named test.What I want is a... | htaccess add .html extension for urls with or without trailing slash |
UseCreateFileMappingwith specificLPSECURITY_ATTRIBUTES. | I want to use shared memory, but i want only my application instances to be able to access this memory, somehow want to protect it from accessing by other applications...
I am coding in C on Windows.Thanks in advance. | Protected shared memory? |
Put this code in yourDOCUMENT_ROOT/.htaccessfile:RewriteEngine On
RewriteRule ^api/([^/]+)/([^/]+)/?$ /index.php?eID=api&Service=$1/$2 [L,QSA,NC]ShareFollowansweredNov 26, 2013 at 9:31anubhavaanubhava771k6666 gold badges582582 silver badges649649 bronze badgesAdd a comment| | i know many others asked questions to clarify how to use RewriteRules and Conditions, and i read many posts here and on other sites and tried to get it work on my own, but i didnt get it work.When the user calls a url like thishttps://example.com/api/[EXTENSION]/[SERVICE_NAME]?paramsinternally this url should be called... | Rewrite Rule for api calls |
I've figured out a way to work around it. I don't think it's the best way but it works. I hope you can find this solution useful buildspec.yml:
version: 0.2
phases:
build:
commands:
- mkdir build-output
- cp -R <path>/public/ build-output
post_build:
commands:
- mv build-output/**/* ./
... |
I'm trying to use AWS CodeBuild to get all files and subfolders inside a nested public folder and deploy to an S3 bucket using CodePipeline. I was able to hook them all together but struggling to configure the buildspec.yml file to get the output I want.
My folder structure:
<path>/public/
├── 404.html
├── css
│ ├─... | AWS CodeBuild buildspec.yml get all files and subfolders recursively |
2
For delete purpose we can use file API like following:
function removeAllCache(){
window.resolveLocalFileSystemURL(cordova.file.externalCacheDirectory, gotDirRemove, function(error){});
}
function gotDirRemove(entry){
var directoryReader = entry.createReader();
directo... |
I'm currently developing app for android using Phonegap technology, for your information, my app concept as below
Capture image (by default Phonegap will store cache image locally: i.e the image path is (file://androidappnames/cache/21323213.jpg)
Retrieve the image
Do some work with the image.
The question is, how ... | Delete cache image in phonegap |
1
Lucky you with GPU - I am still trying to get thru the (torch GPU) DLL Hell on Windows :-). But it looks like Spacy 3 uses more GPU memory than Spacy 2 did - my 6GB GPU may have become useless.
That said, have you tried running your case without the GPU (and watching me... |
there is a Memory leak when using pipe of en_core_web_trf model, I run the model using GPU with 16GB RAM, here is a sample of the code.
!python -m spacy download en_core_web_trf
import en_core_web_trf
nlp = en_core_web_trf.load()
#it's just an array of 100K sentences.
data = dataload()
for index, review in enumerat... | Memory leak with en_core_web_trf model, Spacy |
11
Adding this for reference purposes as I had this error message on Wheezy. Doing this
apt-get install libcgroup1
fixed things for me.
Share
Improve this answer
Follow
answered Jul 19, 2014 at... |
I've got problem running docker on ArchLinux. I pull debian base image, and when i try to launch an interactive bash prompt with that command :
# docker run -it debian:latest /bin/bash
Docker give me this error :
2014/06/24 22:49:11 Error response from daemon: Cannot start container 94d0c07b428c63205390d3b2ac49896038... | Docker error : mountpoint not found |
You can just remove the .git folder that came with the library. This will loose all the history of the library from GitHub, but that seems to be what you want.Assuming linux/osx:cd /path/to/library/dir
rm -rf .git/Once you have removed the GitHub repo, you can add it with just a normal git add:cd /path/to/library/dir
g... | I am working on a project which has it's own git repo, this one I would like to keep. However I used a library that I cloned from github. I cloned this into a subfolder of my project. So the folder structure is correct.What would be the best way to remove the repo from the library and add the library to my own repo? I ... | Remove Git Repo From 1 Folder and Add that Folder to Another Repo Git |
1
I commented the sequence of commands you typed. Maybe that can help you understand your issue...
git clone <myrepo>
cd <myrepo>
# You don't need to do git init for a cloned repository.
git init
# Have you changed anything on your local file before git add .? Otherwise you... |
Locally, there have commited files. But on GitHub files are without changes. Why? How i can push my local changes on GitHub? Thank you
i do this:
git clone <myrepo>
cd <myrepo>
git init
git add .
git commit -m <commit>
git push origin master
| I do commit locally , and all is well , but when I push on GitHub, the commit it comes empty and files are have no changes. Why? |
For intellij, it can also be resolved by addingDOCKER_TLS_VERIFYandDOCKER_CERT_PATHto your run/debug configuration as environment variables.The value of each can be empty (depending on your docker setup) so the run/debug configuration shows:DOCKER_TLS_VERIFY=;DOCKER_CERT_PATH= | I went through links likehttps://github.com/docker/compose/issues/3021andhttps://github.com/docker/compose/issues/3937, but still I am facing below error:C:\Users\pc\Downloads\docker-compose-scripts>docker-compose up --d
ERROR: TLS configuration is invalid - make sure your DOCKER_TLS_VERIFY and DOCKER_CERT_PATH are set... | ERROR: TLS configuration is invalid - make sure your DOCKER_TLS_VERIFY and DOCKER_CERT_PATH are set correctly. on windows |
This issue is caused because you have not let the Docker enough time to load completely. Please wait for some time and try again.
Github Issue Link
One other reason is OS mismatch. The node image is Linux-based and you are on windows. I would recommend you, get a Linux server or a VM for building the containers.
|
When I try to execute docker build -t exampledockeracc/testapp:v1.0.0 . I receive the following error: failed to dial gRPC: unable to upgrade to h2c, received 500, context canceled
When i search for the error people come with the solution to restart docker and waite a while before executing but it does not seem to wor... | Error when trying to build docker image: failed to dial gRPC: unable to upgrade to h2c, received 500 |
By usingawaitevery call is made and completed before the next runs. So, just remove the awaits and then you have a bunch ofTasks which you can wait all:var configMap = client.ListConfigMapForAllNamespacesAsync(cancellationToken: cancellationToken);
var secret = client.ListSecretForAllNamespacesAsync(cancellationToken: ... | In my application I am usingc# kubernetes client. I need to use Task.WhenAll but everytime namespaces is different and it fails compiling.var configMap = await client.ListConfigMapForAllNamespacesAsync(cancellationToken: cancellationToken);
var secret = await client.ListSecretForAllNamespacesAsync(cancellationToken: c... | How to use Task.WhenAll with c# kubernetes client? |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.