qid
int64
1
74.7M
question
stringlengths
0
58.3k
date
stringlengths
10
10
metadata
list
response_j
stringlengths
2
48.3k
response_k
stringlengths
2
40.5k
1,167,315
Does the $\sqrt{x^2}$ always equal $x$? I am trying to prove that $i^2 = -1$, but to do that I need to know that $\sqrt{(-1)^2} = -1$. If that is true then all real numbers are imaginary, because an imaginary number is any number that can be written in terms of $i$. For example, 2 can be written as $i^2 + 3$. Does this...
2015/02/27
[ "https://math.stackexchange.com/questions/1167315", "https://math.stackexchange.com", "https://math.stackexchange.com/users/219619/" ]
Not always. $\sqrt{(-1)^2}=\sqrt{1}=1\neq -1$. In general $\sqrt{x^2}=|x|$
1. It is not true that $\sqrt{x^2} = x$. As a very simple example, with $x=-2$, we obtain $$ \sqrt{(-2)^2} = \sqrt{4} = 2 \ne -2. $$ In general, if $x \in \mathbb{R}$, then $\sqrt{x^2} = |x|$. Things get more complicated when you start working with complex numbers, but I think that a discussion of "branches of the squa...
56,042,625
summary : system("clear"); isn't working well. I'm using gcc, ubuntu 18.04 LTS version for c programming. what I intended was "read each words and print from two text files. After finish read file, delay 3 seconds and erase terminal" so I was make two text files, and using system("clear"); to erase terminal. here i...
2019/05/08
[ "https://Stackoverflow.com/questions/56042625", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10058141/" ]
``` #include <stdio.h> #include <string.h> #include <stdlib.h> #include <unistd.h> void printFiles(char *file1,char *file2,char *change1, char *change2){ FILE *f; char *text = malloc(sizeof(char)*100); f=fopen(file1,"r"); system("clear"); //while(!feof(f)){ while(EOF!=fscanf(f,"%s",text)){ //fscanf(f,...
You can try this solution for **delay**. ``` #include <time.h> #include <stdio.h> void delay(double seconds) { const time_t start = time(NULL); time_t current; do { time(&current); } while(difftime(current, start) < seconds); } int main(void) { printf("Just waiting...\n"); delay(...
37,056,579
I get an error with the following code: ``` func prepareAnimationForDictionary(settings: NSDictionary,repeated: Bool) -> SKAction { let atlas: SKTextureAtlas = SKTextureAtlas(named: settings["AtlasFileName"] as! String) let textureNames:NSArray = settings["Frames"] as! NSArray let te...
2016/05/05
[ "https://Stackoverflow.com/questions/37056579", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5192623/" ]
Just use the expected (Swift) types ``` ... let textureNames = settings["Frames"] as! [String] var texturePack = [SKTexture]() for texPath in textureNames { texturePack.append(atlas.textureNamed(texPath)) } ... ``` From the Swift point of view the mutable Foundation collection types `NSMutableArray` and `NSMut...
Change `timePerFrame` to `(timePerFrame as [AnyObject]) as! [SKTexture]`
37,056,579
I get an error with the following code: ``` func prepareAnimationForDictionary(settings: NSDictionary,repeated: Bool) -> SKAction { let atlas: SKTextureAtlas = SKTextureAtlas(named: settings["AtlasFileName"] as! String) let textureNames:NSArray = settings["Frames"] as! NSArray let te...
2016/05/05
[ "https://Stackoverflow.com/questions/37056579", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5192623/" ]
Just use the expected (Swift) types ``` ... let textureNames = settings["Frames"] as! [String] var texturePack = [SKTexture]() for texPath in textureNames { texturePack.append(atlas.textureNamed(texPath)) } ... ``` From the Swift point of view the mutable Foundation collection types `NSMutableArray` and `NSMut...
Ok, think about this. You have a variable `texturePack`. You don't show the declaration, but based on the error message, I'm going to assume it's of type `NSMutableArray`. The call in question wants an array of `SKTexture` objects. So, cast your `texturePack` to the required type: ``` let anim:SKAction = SKAction.ani...
21,589,595
I'm new to shared\_ptr's and I'm trying to figure out the exact functionality of the .reset() function. ``` #include <memory> #include <stdio> using namespace std; class SomeClass{}; int main() { shared_ptr<SomeClass> sp (nullptr); //do some stuff, sp now has 10 co-owners cout << sp.use_count << endl; ...
2014/02/05
[ "https://Stackoverflow.com/questions/21589595", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2857080/" ]
No. The whole purpose of `shared_ptr` is that you cannot delete it from one place if someone is using it in another. `shared_ptr::reset()` just decreases `use_count` by one and replaces its object by `nullptr`.
The .reset() method only applies to the object it's called upon. It just replaces the pointer that variable is holding.
21,589,595
I'm new to shared\_ptr's and I'm trying to figure out the exact functionality of the .reset() function. ``` #include <memory> #include <stdio> using namespace std; class SomeClass{}; int main() { shared_ptr<SomeClass> sp (nullptr); //do some stuff, sp now has 10 co-owners cout << sp.use_count << endl; ...
2014/02/05
[ "https://Stackoverflow.com/questions/21589595", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2857080/" ]
When you use `.reset()`, you are eliminating *one* owner of the pointer, but all of the other owners are still around. Here is an example: ``` #include <memory> #include <cstdio> class Test { public: ~Test() { std::puts("Test destroyed."); } }; int main() { std::shared_ptr<Test> p = std::make_shared<Test>(); ...
The .reset() method only applies to the object it's called upon. It just replaces the pointer that variable is holding.
21,589,595
I'm new to shared\_ptr's and I'm trying to figure out the exact functionality of the .reset() function. ``` #include <memory> #include <stdio> using namespace std; class SomeClass{}; int main() { shared_ptr<SomeClass> sp (nullptr); //do some stuff, sp now has 10 co-owners cout << sp.use_count << endl; ...
2014/02/05
[ "https://Stackoverflow.com/questions/21589595", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2857080/" ]
When you use `.reset()`, you are eliminating *one* owner of the pointer, but all of the other owners are still around. Here is an example: ``` #include <memory> #include <cstdio> class Test { public: ~Test() { std::puts("Test destroyed."); } }; int main() { std::shared_ptr<Test> p = std::make_shared<Test>(); ...
No. The whole purpose of `shared_ptr` is that you cannot delete it from one place if someone is using it in another. `shared_ptr::reset()` just decreases `use_count` by one and replaces its object by `nullptr`.
54,243,422
I'm making a car quiz app where the user will try to match the model with the brand(make). Both the models and brands are presented as UIImages. ``` let carModelList = ["Camaro", "Mustang", "Challenger"] let carBrandList = ["Chevy", "Ford", ...
2019/01/17
[ "https://Stackoverflow.com/questions/54243422", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
You're being presented with that message because indeed you're trying to pass an image, but the constructor is expecting the name of the image, which is a String. if you wanna call it like this: ``` carModel.image = UIImage(named: carModelList.randomElement()!) carBrand.image = UIImage(named: carBrandList.randomEleme...
The problem is that you use ``` let carModelList = ["Camaro", "Mustang", "Challenger"] let carBrandList = ["Chevy", "Ford", "Dodge"] ``` AND ``` var carModelList: [UIImage] = [ UIImage(named: "Camaro")!, UIImage(named: "Mustang")!, UIIma...
196,114
I chmod'ed the directory to 777, same with the directory contents. Still, I get a "permission denied" error. Does PHP throw this error if apache is not the group/owner, regardless of the file permissions? Here's the call that's failing: ``` rename('/correct/path/to/dir/1', '/correct/path/to/dir/2'); ```
2008/10/12
[ "https://Stackoverflow.com/questions/196114", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11577/" ]
Another thing that might help these kinds of situations is to try actually lowering permissions. I've seen occasions where apache denies an application permission to do something because its permissions are set too *high*. My guess is that this is to encourage good security practice.
You must change the permissions of the folder and the files contained in it recursively. You need to do this from ssh as root user and then run the following command: ``` chown -R www-data:www-data /directory/path/to/apply/chown ``` then you can execute the chown statement without any problems. I found this way a...
196,114
I chmod'ed the directory to 777, same with the directory contents. Still, I get a "permission denied" error. Does PHP throw this error if apache is not the group/owner, regardless of the file permissions? Here's the call that's failing: ``` rename('/correct/path/to/dir/1', '/correct/path/to/dir/2'); ```
2008/10/12
[ "https://Stackoverflow.com/questions/196114", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11577/" ]
You're editing the higher level directory, so the PHP user needs to have write access to that directory.
You must change the permissions of the folder and the files contained in it recursively. You need to do this from ssh as root user and then run the following command: ``` chown -R www-data:www-data /directory/path/to/apply/chown ``` then you can execute the chown statement without any problems. I found this way a...
196,114
I chmod'ed the directory to 777, same with the directory contents. Still, I get a "permission denied" error. Does PHP throw this error if apache is not the group/owner, regardless of the file permissions? Here's the call that's failing: ``` rename('/correct/path/to/dir/1', '/correct/path/to/dir/2'); ```
2008/10/12
[ "https://Stackoverflow.com/questions/196114", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11577/" ]
to clarify, php can only rename directories it has actual ownership over: ``` -rwxrwxrwx user user temp/ -rwxr-xr-x apache apache temp2/ -rw-r--r-- user user script.php ``` assume script.php is trying to rename these two directories: ``` // this operation fails as PHP (running as apache) does not own "temp"...
Try running the following script: ``` print_r(posix_getpwuid(getmyuid())); print_r(pathinfo($YOUR_PATH)); ``` And see what that returns.
196,114
I chmod'ed the directory to 777, same with the directory contents. Still, I get a "permission denied" error. Does PHP throw this error if apache is not the group/owner, regardless of the file permissions? Here's the call that's failing: ``` rename('/correct/path/to/dir/1', '/correct/path/to/dir/2'); ```
2008/10/12
[ "https://Stackoverflow.com/questions/196114", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11577/" ]
You're editing the higher level directory, so the PHP user needs to have write access to that directory.
Thats probably because apache is not the owner of the parent directory. Renaming (or moving) a file is basically the same thing as creating a new file.
196,114
I chmod'ed the directory to 777, same with the directory contents. Still, I get a "permission denied" error. Does PHP throw this error if apache is not the group/owner, regardless of the file permissions? Here's the call that's failing: ``` rename('/correct/path/to/dir/1', '/correct/path/to/dir/2'); ```
2008/10/12
[ "https://Stackoverflow.com/questions/196114", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11577/" ]
Thats probably because apache is not the owner of the parent directory. Renaming (or moving) a file is basically the same thing as creating a new file.
Try running the following script: ``` print_r(posix_getpwuid(getmyuid())); print_r(pathinfo($YOUR_PATH)); ``` And see what that returns.
196,114
I chmod'ed the directory to 777, same with the directory contents. Still, I get a "permission denied" error. Does PHP throw this error if apache is not the group/owner, regardless of the file permissions? Here's the call that's failing: ``` rename('/correct/path/to/dir/1', '/correct/path/to/dir/2'); ```
2008/10/12
[ "https://Stackoverflow.com/questions/196114", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11577/" ]
You're editing the higher level directory, so the PHP user needs to have write access to that directory.
Try running the following script: ``` print_r(posix_getpwuid(getmyuid())); print_r(pathinfo($YOUR_PATH)); ``` And see what that returns.
196,114
I chmod'ed the directory to 777, same with the directory contents. Still, I get a "permission denied" error. Does PHP throw this error if apache is not the group/owner, regardless of the file permissions? Here's the call that's failing: ``` rename('/correct/path/to/dir/1', '/correct/path/to/dir/2'); ```
2008/10/12
[ "https://Stackoverflow.com/questions/196114", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11577/" ]
to clarify, php can only rename directories it has actual ownership over: ``` -rwxrwxrwx user user temp/ -rwxr-xr-x apache apache temp2/ -rw-r--r-- user user script.php ``` assume script.php is trying to rename these two directories: ``` // this operation fails as PHP (running as apache) does not own "temp"...
Another thing that might help these kinds of situations is to try actually lowering permissions. I've seen occasions where apache denies an application permission to do something because its permissions are set too *high*. My guess is that this is to encourage good security practice.
196,114
I chmod'ed the directory to 777, same with the directory contents. Still, I get a "permission denied" error. Does PHP throw this error if apache is not the group/owner, regardless of the file permissions? Here's the call that's failing: ``` rename('/correct/path/to/dir/1', '/correct/path/to/dir/2'); ```
2008/10/12
[ "https://Stackoverflow.com/questions/196114", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11577/" ]
You're editing the higher level directory, so the PHP user needs to have write access to that directory.
to clarify, php can only rename directories it has actual ownership over: ``` -rwxrwxrwx user user temp/ -rwxr-xr-x apache apache temp2/ -rw-r--r-- user user script.php ``` assume script.php is trying to rename these two directories: ``` // this operation fails as PHP (running as apache) does not own "temp"...
196,114
I chmod'ed the directory to 777, same with the directory contents. Still, I get a "permission denied" error. Does PHP throw this error if apache is not the group/owner, regardless of the file permissions? Here's the call that's failing: ``` rename('/correct/path/to/dir/1', '/correct/path/to/dir/2'); ```
2008/10/12
[ "https://Stackoverflow.com/questions/196114", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11577/" ]
Another thing that might help these kinds of situations is to try actually lowering permissions. I've seen occasions where apache denies an application permission to do something because its permissions are set too *high*. My guess is that this is to encourage good security practice.
Try running the following script: ``` print_r(posix_getpwuid(getmyuid())); print_r(pathinfo($YOUR_PATH)); ``` And see what that returns.
196,114
I chmod'ed the directory to 777, same with the directory contents. Still, I get a "permission denied" error. Does PHP throw this error if apache is not the group/owner, regardless of the file permissions? Here's the call that's failing: ``` rename('/correct/path/to/dir/1', '/correct/path/to/dir/2'); ```
2008/10/12
[ "https://Stackoverflow.com/questions/196114", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11577/" ]
Thats probably because apache is not the owner of the parent directory. Renaming (or moving) a file is basically the same thing as creating a new file.
You must change the permissions of the folder and the files contained in it recursively. You need to do this from ssh as root user and then run the following command: ``` chown -R www-data:www-data /directory/path/to/apply/chown ``` then you can execute the chown statement without any problems. I found this way a...
49,113,128
I have a menu of topics (e.g. "About us", "Support") and I want to be able to tell what topic is active right now. When a topic is clicked it will become the active one. Think of it as a substitute for a router that will set an active route. This is not possible in my case since I'm working in SharePoint 2010... in a c...
2018/03/05
[ "https://Stackoverflow.com/questions/49113128", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6793625/" ]
In postgres you can use a format like: ``` INSERT INTO films (code, title, did, date_prod, kind) VALUES ('B6717', 'Tampopo', 110, '1985-02-10', 'Comedy'), ('HG120', 'The Dinner Game', 140, DEFAULT, 'Comedy'); ``` Due to your record base exception handling you can better first resolve the duplicates before generating...
Building one large INSERT statement instead of many of them will considerably improve the execution time, you should take a look [here](https://stackoverflow.com/questions/1793169/which-is-faster-multiple-single-inserts-or-one-multiple-row-insert). It is for mysql, but I think a similar approach apply for postgreSQL
6,998,664
I need to save a CGDDisplayModeRef to a plist file but none of the available types are good for storing CGDisplayModeRef. Is there a way around this?
2011/08/09
[ "https://Stackoverflow.com/questions/6998664", "https://Stackoverflow.com", "https://Stackoverflow.com/users/813852/" ]
I would have used: ``` testdf$groupCode <- cut(testdf$b, breaks = quantile(testdf$b, seq(0,1, by=0.05), na.rm=TRUE)) grpbrks <- quantile(testdf$b, seq(0,1, by=0.05), na.rm=TRUE) ``` Then you can use: ``` findInterval(newdat$newvar, grpbrks) # to group new data ``` And you then won't...
Screwing around with some regular expressions seems to be the only way of actually returning the value of an object resulting from `cut`. The following code does the necessary screwing: ``` cut_breaks <- function(x){ first <- as.numeric(gsub(".{1}(.+),.*", "\\1", levels(x))[1]) other <- as.numeric(gsub(".+,(.*).{...
67,031,903
I am using Ionic with vanila java script I am using CDN in head component ``` <script type="module" src="https://cdn.jsdelivr.net/npm/@ionic/core/dist/ionic/ionic.esm.js"></script> <script nomodule src="https://cdn.jsdelivr.net/npm/@ionic/core/dist/ionic/ionic.js"></script> <link rel="stylesheet" href="https://cdn.jsd...
2021/04/10
[ "https://Stackoverflow.com/questions/67031903", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4702366/" ]
One way to do this is to put the data into long format. Not really sure how meaningful this graph is as it gives the sum highway and city miles per gallon. Might be more meaningful to calculate the average highway and city miles per gallon for the different fuel types. ```r library(ggplot2) library(tidyr) mpg %>% ...
Barcharts makes the height of the bar proportional to the number of cases in each group. It can't have x and y aesthetic at the same time. From your description I think you want to map categorical data to numeric, in this case use boxplots e.g. ``` mpg %>% select(fl, cty, hwy) %>% pivot_longer(-fl) %>% ggplot(a...
9,853,562
I am using xcode to develop a prototype application. Nothing too fancy, just slide effects and other simple gestures. Mostly moving images around the screen. I can preview the app on my laptop using ios simulator, but how do I take the prototype to the iPad for a more realistic view? Thank you
2012/03/24
[ "https://Stackoverflow.com/questions/9853562", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1006020/" ]
First, you need to join a paid [iOS Developer Program](https://developer.apple.com/programs/) or, if possible, the [iOS University Program](https://developer.apple.com/programs/ios/university/). Then, you will have to create and install provisioning profiles using the steps in this [documentation](https://developer.ap...
This process requires a developer account with Apple - and you have to go through the Provisioning Portal to setup your provisioning profile. Apple recently came up with a great getting started guide: <https://developer.apple.com/programs/ios/gettingstarted/> Read the section on "Installing and Testing Apps on iPad, ...
61,285,531
I have a widget which has `String Function() validation` as one of its properties. The widget looks something like ``` MyWidget(validation: () { if (text.isEmpty) { return "Text is required"; } else { return null; } }, ); ``` The problem is when i try to access MyWidget.vali...
2020/04/18
[ "https://Stackoverflow.com/questions/61285531", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13271097/" ]
think i found the solution. i don't know is it ok to do this, but it worked for me. so, you have two explorer.exe in your windows one in `C:\Windows\System32` and the other in `C:\Windows`. when you want to open the first one it shows > > This Application only runs under WinPE or WinRE. > > > error. but second ...
As far as I'm told it's the Common Item Dialog, not explorer that opens up your browser. So the solution posted by ahmadreza moodi did not help me while solving this issue. This error appears in most programs that you try to browse files not only Android Studio, but it will also happen even if you try to open a folder...
1,683,967
> > Let $R$ be a relation from $A$ to $B$ and suppose the domain of $R$ is $A$. > Then there exists a subset $f^\*$ of $R$ such that $f^\*$ is a function > from $A$ into $B$. > > > --- Proof: > > **Zorn's Lemma**: > > > Let $X$ be a non-empty partially ordered set in which every totally ordered > subset has a...
2016/03/05
[ "https://math.stackexchange.com/questions/1683967", "https://math.stackexchange.com", "https://math.stackexchange.com/users/298619/" ]
You're not using Zorn's lemma correctly. You don't want $P$ to be a subset of $R$, but rather of the *power set* of $R$. Namely, you want $f\in P$ to satisfy $f\subseteq R$. Other than that, you're almost done. You need to appeal to maximality of $f^\*$, if $A^\*\neq A$ then you can extend $f^\*$ by another ordered p...
In this case it's much easier to directly apply the axiom of choice. Using the fact that $A$ is the domain of $R$, we know that the set $\{b \in B \mid a R b\}$ is nonempty for every $a \in A$. So by the axiom of choice we can choose an element $b\_a \in \{b \in B \mid a R b\}$ for each $a$. Then, we define $f(a) = b\_...
13,526,608
I need to update given selector continually after the given time intervel. this is my code using javascript. ``` function current_time(){ var content = document.getElementById('time_div'); content.innerHTML = '<p> Time is : '+Date()+'</p>'; } var v = setInterval( 'current_time()', 1000); ``` this is ok. but m...
2012/11/23
[ "https://Stackoverflow.com/questions/13526608", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1784592/" ]
This should do the trick... ``` $(document).ready(function() { var v = setInterval(function() { $("#time_div").html("<p>" + Date() + "</p>"); }, 1000); }); ``` To make your original code a little friendlier to read... ``` var v = setInterval(function() { document.getElementById("time_div").innerH...
All you need to do is this :- ``` $(document).ready(function(){ $('#time_div').click(function(){ $(this).html('<p>'+Date()+'</p>'); }); }); var v = setInterval( function(){$('#time_div').trigger('click')} , 1000); ``` *setInterval* is a standard JavaScript function, not part of jQuery. You call it w...
13,526,608
I need to update given selector continually after the given time intervel. this is my code using javascript. ``` function current_time(){ var content = document.getElementById('time_div'); content.innerHTML = '<p> Time is : '+Date()+'</p>'; } var v = setInterval( 'current_time()', 1000); ``` this is ok. but m...
2012/11/23
[ "https://Stackoverflow.com/questions/13526608", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1784592/" ]
This should do the trick... ``` $(document).ready(function() { var v = setInterval(function() { $("#time_div").html("<p>" + Date() + "</p>"); }, 1000); }); ``` To make your original code a little friendlier to read... ``` var v = setInterval(function() { document.getElementById("time_div").innerH...
Try this: ``` $(document).ready(function(){ setInterval(function() { $('#time_div').html('<p>'+Date()+'</p>'); }, 1000); }); ```
23,932,934
Im making some div element dynamically ``` var QuickPanelItem = $('<div/>', { 'id': 'div' + WidgetDetails.Name + 'QuickPanel', 'class': 'left_slidethumbs button_' + WidgetDetails.Name + '' }); QuickPanelItem.append($('<div/>', { 'class': 'text_button' })); $("#divLeftQuickPanel").append(QuickPanelItem); `...
2014/05/29
[ "https://Stackoverflow.com/questions/23932934", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2834139/" ]
You can also do something like this: **js** ``` $("<div/>",{ id: "a", text:"sadsad", style:"background-color:red;height:50px;", class: "classA" }).appendTo("body"); ``` [fiddle](http://jsfiddle.net/tZqY4/4/)
Use this **[.css()](http://api.jquery.com/css/)** ``` $('#div' + WidgetDetails.Name + 'QuickPanel').css({ "background-image":"/path", "margin":"20px", "padding":"4px" }); ```
23,932,934
Im making some div element dynamically ``` var QuickPanelItem = $('<div/>', { 'id': 'div' + WidgetDetails.Name + 'QuickPanel', 'class': 'left_slidethumbs button_' + WidgetDetails.Name + '' }); QuickPanelItem.append($('<div/>', { 'class': 'text_button' })); $("#divLeftQuickPanel").append(QuickPanelItem); `...
2014/05/29
[ "https://Stackoverflow.com/questions/23932934", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2834139/" ]
You can do it the exact same way, as jQuery supports any jQuery method in the object passed when creating a new element ``` $('<div />', { 'class': 'text_button', css : { backgroundImage : 'url(image.png)', margin : '10px 20px 3px 5px' }, html : '<p>CONTENT</p>', on :...
Use this **[.css()](http://api.jquery.com/css/)** ``` $('#div' + WidgetDetails.Name + 'QuickPanel').css({ "background-image":"/path", "margin":"20px", "padding":"4px" }); ```
73,822,190
I'm trying to follow along this 2 year old Fluter tutorial on Udemy its based on a ride sharing app, but I've come to a halt. am receiving this error > > The method '[]' can't be unconditionally invoked because the receiver can be 'null' > > > I don't really know how to go around it. I'm supposed to retrieve some...
2022/09/23
[ "https://Stackoverflow.com/questions/73822190", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10389047/" ]
thats null-safety in flutter. there 2 option: * make value `nullable` ``` class User{ final String? fullName; final String? email; final String? phone; final int? id; User({ this.email, this.fullName, this.phone, this.id, }); ``` with this, your variable in user can be null, if no data...
Try the following code: ``` import 'package:firebase_database/firebase_database.dart'; class User{ var fullName; var email; var phone; var id; User({ this.email, this.fullName, this.phone, this.id, }); User.fromSnapshot(DataSnapshot snapshot){ id = snapshot.key; phone = snapsh...
411,825
I'm just curious, I'd like to understand how compiled code works from the moment I run an executable file. Some time ago I had found a very well written article which helped, using a hex editor, to read a binary file and, for example, find out the references to external function in external static libs. But I cannot fi...
2020/06/22
[ "https://softwareengineering.stackexchange.com/questions/411825", "https://softwareengineering.stackexchange.com", "https://softwareengineering.stackexchange.com/users/123094/" ]
There are a few pieces to the puzzle of executables. First, obviously, is the code itself. To understand this, you need to understand your target CPU's instruction set, including its binary encoding. Second, how the code is packaged into files. Different OSs use different formats for this, typically ELF on Linux and ...
> > Understanding how compiled code works > > > You need to read several books. ------------------------------- Several programming language specifications, e.g. for C11 its standard [n1570](https://web.cs.dal.ca/%7Evlado/pl/C_Standard_2011-n1570.pdf), for C++11 its standard [n3337](http://www.open-std.org/jtc1/s...
411,825
I'm just curious, I'd like to understand how compiled code works from the moment I run an executable file. Some time ago I had found a very well written article which helped, using a hex editor, to read a binary file and, for example, find out the references to external function in external static libs. But I cannot fi...
2020/06/22
[ "https://softwareengineering.stackexchange.com/questions/411825", "https://softwareengineering.stackexchange.com", "https://softwareengineering.stackexchange.com/users/123094/" ]
There are a few pieces to the puzzle of executables. First, obviously, is the code itself. To understand this, you need to understand your target CPU's instruction set, including its binary encoding. Second, how the code is packaged into files. Different OSs use different formats for this, typically ELF on Linux and ...
in here i want to completely explain what happens when a program is getting executed using an example. let's say that we have written some code in a file here: ``` #include<stdio.h> main(){ printf('hello world'); return 0; } ``` now the computer doesn't understand these codes , because it only understands binary or...
476,286
I'd like to reverse the order of the sheets in an Excel 2007 workbook and wonder if there is any way to do this other than a manual tedious process. I have around 100 sheets, so I'd like to avoid the manual way of doing this, but I see no programmatic way to accomplish this. Similarly, is there an easy way to search f...
2012/09/17
[ "https://superuser.com/questions/476286", "https://superuser.com", "https://superuser.com/users/9461/" ]
You can loop through the sheets programmatically and reverse their order using code similar to the following: ``` Sub ReverseSheets() Dim i As Integer For i = 1 To Worksheets().count Worksheets(i).Move before:=Worksheets(1) Next i End Sub ``` This code will automatically reverse all sheets in a workbook. The e...
To change a sheet name, you can use VBA: 1. Select your sheet: `Sheets("Sheet1".Select` 2. Rename your sheet: `Sheets("Sheet1").Name = "SheetA"` Then just create a loop to cycle through all of your sheets and have it assign the names you want.
58,647,500
I want to compare the patches in a certain radius regarding the amount of a certain class of agents on them. The agents should move to the patch where the most agents (in this case humans) are. If they are already on the patch with the most humans then they must not move. I coded it and the humans group but most of the...
2019/10/31
[ "https://Stackoverflow.com/questions/58647500", "https://Stackoverflow.com", "https://Stackoverflow.com/users/12304263/" ]
Exclude api routes from the web route ```php Route::get('/{any}', 'SPAController@index')->where('any', '^(?!api).*$'); ``` Hope this helps
I solved it. On vue it was supposed to be `api/login` not `/api/login` or `api/login/` or something.
14,800,288
Hi I was trying to find the number of elements in an array ``` byte[] salt = new byte[32]; ``` now I only have mentioned size 32 so the **Length** Property of Array and Enumerable's **Count** Method will give me **32**. Even if I will iterate on this Array **salt** using for or foreach or any other looping constru...
2013/02/10
[ "https://Stackoverflow.com/questions/14800288", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1217882/" ]
An array is an array, and in .NET is initialized when it is allocated. Once it's initialized, the question of whether a given value is uninitialized or simply 0 isn't something that's possible to check. A 0 is a 0. However, you can bypass that in several ways. You can use a `List<int>`, like @SLaks suggested, to have ...
Ok, when you define an array as int[] myArray = int[32]; you are saying, I HAVE 32 ints. Not, create me space for 32 ints that I will fill in later. That's why count is giving you 32. If you want something which you can genuinly add to and resize, you need to use a List (or one of it's relatives. If you want to have ...
14,800,288
Hi I was trying to find the number of elements in an array ``` byte[] salt = new byte[32]; ``` now I only have mentioned size 32 so the **Length** Property of Array and Enumerable's **Count** Method will give me **32**. Even if I will iterate on this Array **salt** using for or foreach or any other looping constru...
2013/02/10
[ "https://Stackoverflow.com/questions/14800288", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1217882/" ]
An array is an array, and in .NET is initialized when it is allocated. Once it's initialized, the question of whether a given value is uninitialized or simply 0 isn't something that's possible to check. A 0 is a 0. However, you can bypass that in several ways. You can use a `List<int>`, like @SLaks suggested, to have ...
Short answer is you can't, the array contains 32 integers, .net framework doesn't care if some of them are 0, so you can create your own function that counts how many integers from an array are different than 0, or keep a "count" when you assign values for array elements or something like that. Or you can use another ...
12,171,815
I'm trying out some code that essentially involves using an FPGA and reading values from a temperature sensor. The code is below: ``` library IEEE; use IEEE.STD_LOGIC_1164.ALL; use IEEE.STD_LOGIC_ARITH.ALL; use IEEE.STD_LOGIC_UNSIGNED.ALL; ---- Uncomment the following library declaration if instantiating ---- any Xi...
2012/08/29
[ "https://Stackoverflow.com/questions/12171815", "https://Stackoverflow.com", "https://Stackoverflow.com/users/737798/" ]
Nothing is wrong here. The warning says that `write_temp_0` is always 0 - that is, the warning only applies to bit 0 of `write_temp`, not the other 7 bits. This is to be expected, as you never set bit 0 of `write_temp` to be anything but 0. The synthesizer picks up on this, and optimizes it by simply trimming it to be...
dear same problem i am facing same problem running my code on fir, i have run your code it synthesis but due to warning it show's undefined values of your input and clk, don't assign 0 value, try to put different value like write\_temp 7 to 1. i am not full expert of vhdl but when i make this change similar way i get o...
12,171,815
I'm trying out some code that essentially involves using an FPGA and reading values from a temperature sensor. The code is below: ``` library IEEE; use IEEE.STD_LOGIC_1164.ALL; use IEEE.STD_LOGIC_ARITH.ALL; use IEEE.STD_LOGIC_UNSIGNED.ALL; ---- Uncomment the following library declaration if instantiating ---- any Xi...
2012/08/29
[ "https://Stackoverflow.com/questions/12171815", "https://Stackoverflow.com", "https://Stackoverflow.com/users/737798/" ]
Nothing is wrong here. The warning says that `write_temp_0` is always 0 - that is, the warning only applies to bit 0 of `write_temp`, not the other 7 bits. This is to be expected, as you never set bit 0 of `write_temp` to be anything but 0. The synthesizer picks up on this, and optimizes it by simply trimming it to be...
I guess, this warning (FF/Latch) occurs when we forget to assign some value for some signals (or even maybe we think that it is not necessary to assign some value), especially when there are some conditions like if-else. It is expected that for all conditions we assign a value. So, it makes our code neatly and also lon...
12,171,815
I'm trying out some code that essentially involves using an FPGA and reading values from a temperature sensor. The code is below: ``` library IEEE; use IEEE.STD_LOGIC_1164.ALL; use IEEE.STD_LOGIC_ARITH.ALL; use IEEE.STD_LOGIC_UNSIGNED.ALL; ---- Uncomment the following library declaration if instantiating ---- any Xi...
2012/08/29
[ "https://Stackoverflow.com/questions/12171815", "https://Stackoverflow.com", "https://Stackoverflow.com/users/737798/" ]
dear same problem i am facing same problem running my code on fir, i have run your code it synthesis but due to warning it show's undefined values of your input and clk, don't assign 0 value, try to put different value like write\_temp 7 to 1. i am not full expert of vhdl but when i make this change similar way i get o...
I guess, this warning (FF/Latch) occurs when we forget to assign some value for some signals (or even maybe we think that it is not necessary to assign some value), especially when there are some conditions like if-else. It is expected that for all conditions we assign a value. So, it makes our code neatly and also lon...
2,227,092
If I have a list of 6 options to choose from and a selector that has 8 possible values, can that selector be reduced to evenly select from the 6 options? I'm using 3 bits, so a value between 0 and 8 exclusive and I need to select from 6 options. My understanding is that I have more information than I need, but I don't...
2017/04/10
[ "https://math.stackexchange.com/questions/2227092", "https://math.stackexchange.com", "https://math.stackexchange.com/users/435235/" ]
It follows from the assumption that for every $y$ in the image of $f$ we have$$f(y)=\frac{1}{y}.$$Now, as you already found out yourself, both $9$ and $1/9$ are in the image. As $f$ is assumed to be continuous, it follows that $5$ is also in the image, and so,$$f(5)=\frac{1}{5}.$$
You have calculated $f(9)=1/9$. So consider the interval $[9,10]$. Since $f$ is continuous, by intermediate value theorem, you can find $z$, which lies in $[9,10]$ such that $f(z)=5$. Now $f(z)\cdot f(f(z))=5 \cdot f(5)=1$. Then $f(5)=1/5.$
1,648,910
The exercise 8 of chapter 4 of Do Carmo's "Riemannian Geometry" ask to prove the *Schur's Theorem*. I don't understand a step in the hint (the "hint" is essentially the proof of the theorem). *Schur's Theorem*: Let $M^n$ be a connected Riemannian manifold with $n\ge3$. Suppose $M$ is *isotropic*, i.e. for each point $...
2016/02/10
[ "https://math.stackexchange.com/questions/1648910", "https://math.stackexchange.com", "https://math.stackexchange.com/users/271255/" ]
That's because the metric itself is nabla-flat, so by Leibniz rule you get what you want.
I don't quite understand why the fact that the metric is nabla flat gives the answer. What I saw is that, starting off from the definition of the *covariant differential*, if we expand the 2nd term we obtain $$R(\nabla\_U W,Z,X,Y) = K(p)R'(\nabla\_U W,Z,X,Y) = K(p)\big(\langle \nabla\_U W, X \rangle \langle Z,Y \rang...
1,255,600
Being new to functional programming, I was working on my application's javascript (using jQuery exclusively), and wondering how jQuery's event system relates to it's functional programming paradigm. I have a function setupAccountHeader that could easily be either a document-bound event like ``` $(document).bind('setu...
2009/08/10
[ "https://Stackoverflow.com/questions/1255600", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6705/" ]
The nice thing about the second style is that it will show in the debugger call stack with its name, as opposed to "anonymous", which I find a bit more helpful. You could achieve the above along with jQuery's added event mechanisms (as Elzo said) with the following: ``` $(document).bind('setupAccountHeader', setupAcc...
* The official method of binding an event in jQuery is the first version, this way you have similar methods for binding and unbinding events. I think is not that much of a personal preference as it helps code readability, getting support for your code and using other functions related and included in jQuery like preven...
207,709
What are the factors that help the Earth to form a magnetic field around itself and why it is spread throughout from South to North?
2015/09/18
[ "https://physics.stackexchange.com/questions/207709", "https://physics.stackexchange.com", "https://physics.stackexchange.com/users/87161/" ]
The outer core of the Earth is a fluid consisting of molten iron, nickel, cobalt and other ferromagnetic metals. These are in constant motion. Their motion and the high temperature together cause the production of the Earth's magnetic field. Since the source of the field is itself dynamic, the magnetic field of the ear...
The Earth's outer core is essentially made of molten iron, nickel, cobalt and other ferromagnetic metals, which are in constant motion. With these elements inside the outer core and in motion, they help create Earth's magnetic field. This is the basic idea of the hydromagnetic dynamo model: > > Convection currents of...
27,272,463
I use following now to check syntax error: ``` system "ruby -wc path/to/file.rb" ``` but it very waste time if there are too many file(for instance, i refactory code), so **my question is:** is there way to ruby syntax check in ruby code?
2014/12/03
[ "https://Stackoverflow.com/questions/27272463", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4259591/" ]
My experience has been that the easiest way to check whether my code is properly compiled is to run automated tests. The compiler is going to do the same work whether it's compiling to run tests or just checking that files are lexically correct. MRI === MRI's parser is written in C. I couldn't find a specific referen...
You can use Ripper, the Ruby interface to the Ruby parser: <http://ruby-doc.org/stdlib/libdoc/ripper/rdoc/Ripper.html>
27,272,463
I use following now to check syntax error: ``` system "ruby -wc path/to/file.rb" ``` but it very waste time if there are too many file(for instance, i refactory code), so **my question is:** is there way to ruby syntax check in ruby code?
2014/12/03
[ "https://Stackoverflow.com/questions/27272463", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4259591/" ]
My experience has been that the easiest way to check whether my code is properly compiled is to run automated tests. The compiler is going to do the same work whether it's compiling to run tests or just checking that files are lexically correct. MRI === MRI's parser is written in C. I couldn't find a specific referen...
The simplest way is with the command line `-c` flag: ``` ruby -c file_you_want_to_check.rb ```
27,272,463
I use following now to check syntax error: ``` system "ruby -wc path/to/file.rb" ``` but it very waste time if there are too many file(for instance, i refactory code), so **my question is:** is there way to ruby syntax check in ruby code?
2014/12/03
[ "https://Stackoverflow.com/questions/27272463", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4259591/" ]
Under MRI, you can use `RubyVM::InstructionSequence#compile` ([relevant documentation](http://ruby-doc.org/core-2.2.0/RubyVM/InstructionSequence.html#method-c-compile)) to compile Ruby code (which will throw exceptions if there are errors): ``` 2.1.0 :001 > RubyVM::InstructionSequence.compile "a = 1 + 2" => <RubyVM::...
You can use Ripper, the Ruby interface to the Ruby parser: <http://ruby-doc.org/stdlib/libdoc/ripper/rdoc/Ripper.html>
27,272,463
I use following now to check syntax error: ``` system "ruby -wc path/to/file.rb" ``` but it very waste time if there are too many file(for instance, i refactory code), so **my question is:** is there way to ruby syntax check in ruby code?
2014/12/03
[ "https://Stackoverflow.com/questions/27272463", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4259591/" ]
Under MRI, you can use `RubyVM::InstructionSequence#compile` ([relevant documentation](http://ruby-doc.org/core-2.2.0/RubyVM/InstructionSequence.html#method-c-compile)) to compile Ruby code (which will throw exceptions if there are errors): ``` 2.1.0 :001 > RubyVM::InstructionSequence.compile "a = 1 + 2" => <RubyVM::...
The simplest way is with the command line `-c` flag: ``` ruby -c file_you_want_to_check.rb ```
27,272,463
I use following now to check syntax error: ``` system "ruby -wc path/to/file.rb" ``` but it very waste time if there are too many file(for instance, i refactory code), so **my question is:** is there way to ruby syntax check in ruby code?
2014/12/03
[ "https://Stackoverflow.com/questions/27272463", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4259591/" ]
The simplest way is with the command line `-c` flag: ``` ruby -c file_you_want_to_check.rb ```
You can use Ripper, the Ruby interface to the Ruby parser: <http://ruby-doc.org/stdlib/libdoc/ripper/rdoc/Ripper.html>
42,109,471
I have a Symfony3 project on my localhost (Windows 7 Entreprise) and I use Wamp Server 3.0.0 with PHP 5.6.16 and Apache 2.4.17. When I do : `php bin/console cache:clear` I have this error : [![enter image description here](https://i.stack.imgur.com/OpHWo.png)](https://i.stack.imgur.com/OpHWo.png) I also have a memor...
2017/02/08
[ "https://Stackoverflow.com/questions/42109471", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6154476/" ]
You can use `:after` instead of `:before` and float it to the left: ```css span { display: inline-block; color: #66a400; } span:first-letter { text-transform: capitalize; } span:after { content: "-"; padding: 0 2px; float: left; } ``` ```html <span>my first word</span> ```
Try the following: ``` span::first-letter { text-transform: uppercase; } ```
42,109,471
I have a Symfony3 project on my localhost (Windows 7 Entreprise) and I use Wamp Server 3.0.0 with PHP 5.6.16 and Apache 2.4.17. When I do : `php bin/console cache:clear` I have this error : [![enter image description here](https://i.stack.imgur.com/OpHWo.png)](https://i.stack.imgur.com/OpHWo.png) I also have a memor...
2017/02/08
[ "https://Stackoverflow.com/questions/42109471", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6154476/" ]
It's a problem due to the `span:before` selector, see below. From <https://developer.mozilla.org/en-US/docs/Web/CSS/::first-letter> > > The first letter of an element is not necessarily trivial to identify: > > > ... > > > Finally, a combination of the ::before pseudo-element and the content property may inject ...
Try the following: ``` span::first-letter { text-transform: uppercase; } ```
42,109,471
I have a Symfony3 project on my localhost (Windows 7 Entreprise) and I use Wamp Server 3.0.0 with PHP 5.6.16 and Apache 2.4.17. When I do : `php bin/console cache:clear` I have this error : [![enter image description here](https://i.stack.imgur.com/OpHWo.png)](https://i.stack.imgur.com/OpHWo.png) I also have a memor...
2017/02/08
[ "https://Stackoverflow.com/questions/42109471", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6154476/" ]
``` span { display:inline-block; color:#66a400; } ``` span:before { content:"-"; padding:0 2px; } span { text-transform:capitalize; } ``` <p><span>my</span> first word</p> ```
Try the following: ``` span::first-letter { text-transform: uppercase; } ```
42,109,471
I have a Symfony3 project on my localhost (Windows 7 Entreprise) and I use Wamp Server 3.0.0 with PHP 5.6.16 and Apache 2.4.17. When I do : `php bin/console cache:clear` I have this error : [![enter image description here](https://i.stack.imgur.com/OpHWo.png)](https://i.stack.imgur.com/OpHWo.png) I also have a memor...
2017/02/08
[ "https://Stackoverflow.com/questions/42109471", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6154476/" ]
You can use `:after` instead of `:before` and float it to the left: ```css span { display: inline-block; color: #66a400; } span:first-letter { text-transform: capitalize; } span:after { content: "-"; padding: 0 2px; float: left; } ``` ```html <span>my first word</span> ```
It's a problem due to the `span:before` selector, see below. From <https://developer.mozilla.org/en-US/docs/Web/CSS/::first-letter> > > The first letter of an element is not necessarily trivial to identify: > > > ... > > > Finally, a combination of the ::before pseudo-element and the content property may inject ...
42,109,471
I have a Symfony3 project on my localhost (Windows 7 Entreprise) and I use Wamp Server 3.0.0 with PHP 5.6.16 and Apache 2.4.17. When I do : `php bin/console cache:clear` I have this error : [![enter image description here](https://i.stack.imgur.com/OpHWo.png)](https://i.stack.imgur.com/OpHWo.png) I also have a memor...
2017/02/08
[ "https://Stackoverflow.com/questions/42109471", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6154476/" ]
You can use `:after` instead of `:before` and float it to the left: ```css span { display: inline-block; color: #66a400; } span:first-letter { text-transform: capitalize; } span:after { content: "-"; padding: 0 2px; float: left; } ``` ```html <span>my first word</span> ```
``` span { display:inline-block; color:#66a400; } ``` span:before { content:"-"; padding:0 2px; } span { text-transform:capitalize; } ``` <p><span>my</span> first word</p> ```
42,109,471
I have a Symfony3 project on my localhost (Windows 7 Entreprise) and I use Wamp Server 3.0.0 with PHP 5.6.16 and Apache 2.4.17. When I do : `php bin/console cache:clear` I have this error : [![enter image description here](https://i.stack.imgur.com/OpHWo.png)](https://i.stack.imgur.com/OpHWo.png) I also have a memor...
2017/02/08
[ "https://Stackoverflow.com/questions/42109471", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6154476/" ]
It's a problem due to the `span:before` selector, see below. From <https://developer.mozilla.org/en-US/docs/Web/CSS/::first-letter> > > The first letter of an element is not necessarily trivial to identify: > > > ... > > > Finally, a combination of the ::before pseudo-element and the content property may inject ...
``` span { display:inline-block; color:#66a400; } ``` span:before { content:"-"; padding:0 2px; } span { text-transform:capitalize; } ``` <p><span>my</span> first word</p> ```
22,922,421
So I have a string in small talk, the string comes across TCP/IP connection as '$100xxxxxxZZ' where the x's are numbers 0-9 or letters A - Z, and the ZZ is the checksum as calculated by the sender. With the string I need to calculate a checksum of '100xxxxxx' in order to verify this is the correct msg and checksum. SO ...
2014/04/07
[ "https://Stackoverflow.com/questions/22922421", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1241199/" ]
You could try ``` myString allButFirst ``` (which, btw, would work on any collection)
In normal VisualWorks you would use #allButFirst: (works much like the related methods: #allButLast:, #first: and #last:). These are all helper methods around #copyFrom:to:. If these methods don't exist in 2.5 yet, i encourage you to simply port them because they make life a lot easier. They're implemented in Sequenca...
22,922,421
So I have a string in small talk, the string comes across TCP/IP connection as '$100xxxxxxZZ' where the x's are numbers 0-9 or letters A - Z, and the ZZ is the checksum as calculated by the sender. With the string I need to calculate a checksum of '100xxxxxx' in order to verify this is the correct msg and checksum. SO ...
2014/04/07
[ "https://Stackoverflow.com/questions/22922421", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1241199/" ]
You could try ``` myString allButFirst ``` (which, btw, would work on any collection)
You can also take a different approach. ``` newMsg := tmpMsg copyWithout: $$. ``` This copies the string but excludes the all $ characters during the copy. It doesn't do what you asked but it does what you want. This method will work in VisualWorks 2.5.
65,179,651
I use Gatsby and NetlifyCMS for my website and currently get the following error message at **running Workflow** in **GitHub Actions**: ``` error "gatsby-plugin-manifest" threw an error while running the onPostBootstrap lifecycle: Error: Input file contains unsupported image format ``` It is very strange that the e...
2020/12/07
[ "https://Stackoverflow.com/questions/65179651", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3160135/" ]
The issue seems to be related to the favicon path, ensure that the path is correct and try changing it to other dummy image. If the paths are correct [this issue is likely due to an outdated dev-dependency](https://github.com/gatsbyjs/gatsby/issues/22191#issuecomment-598097714) (`@babel/helper-compilation-targets`) or...
Had similar failure on github workflow. Error was ``` success Build manifest and related icons - 0.002s error "gatsby-plugin-manifest" threw an error while running the onPostBootstrap lifecycle: Input file contains unsupported image format Error:Input file contains unsupported image format not finished onPostBoot...
51,369,452
Consider I have 2 points. QPoint(100,100) QPoint(200,200) Now, I need to draw a pointed arrow at the end of line QPoint(200,200). How can I get the points of the arrow coordinates since the line is in inclined angle? The arrow should be like given below. [![enter image description here](https://i.stack.imgur.com/0l...
2018/07/16
[ "https://Stackoverflow.com/questions/51369452", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1050619/" ]
You need to calculate the slope of your line, which will let you find a point on the line a given distance from your endpoint. You can then build a a new line perpendicular to the original line that goes through the point. The ends of the arrows should lie on that line a given distance from the original. It's easier to...
If we have a look at the points we need (U and D needed, S and E given): ``` U /| / | S---------------------E \ | \| D ``` We actually have to go back from S to E, then we turn by 90 degrees and walk up the same length. If we take the direction between S and E (represented as Vector...
69,159,012
I have a file called "mp3.txt" with the following content: ``` 1.mp3 2.mp3 3.mp3 4.mp3 5.mp3 ``` The Python code to read the "mp3.txt", and create a new file for each line: ``` from pathlib import Path with open("mp3.txt", "r") as file: for line in file.readlines(): Path(line).touch() ``` Result: ``...
2021/09/13
[ "https://Stackoverflow.com/questions/69159012", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6460392/" ]
[Strip](https://www.programiz.com/python-programming/methods/string/strip) the strings (file names). The "new line" you have after each file name cause the `?` to be part of the file that is created by `Path` ``` from pathlib import Path with open("mp3.txt", "r") as file: file_names = [line.strip() for line in fi...
Based on the answer, I came up with this: ``` from pathlib import Path with open("mp3.txt", "r") as file: for line in file.readlines(): new = line.strip() Path(new).touch() ```
12,328,253
I have googled and looked all over, but can't find it ANYWHERE. Anyone know where to get it?
2012/09/08
[ "https://Stackoverflow.com/questions/12328253", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1582900/" ]
OK. After a little research on the documentation for this, I believe the library you're looking for is part of the WinAVR-GCC Toolkit, the static library kit for CEENBoT-API, and a few other things. According to the [links](http://www.ceen.unomaha.edu/CEENBoT/API/CEENBoT-API_GettingStarted%28Rev1.07%29.pdf) at UnOmaha,...
math library is part of C standard library. It should be provided with compiler.
154,555
I recently started learning AngularJS, and I have the following sample code that does a REST callout from a Visualforce page - the code does a successful callout. My question: In the 'app.config' where we provide the Authorization header as a string value ('BASIC base64Hash'), base64Hash being the username:password has...
2017/01/04
[ "https://salesforce.stackexchange.com/questions/154555", "https://salesforce.stackexchange.com", "https://salesforce.stackexchange.com/users/29655/" ]
The data type that gives you fine-grained control over precision is `Decimal`. For example, if you wanted to have 30 decimal places after the divide this: ``` Decimal d = 5; d = d.divide(3, 30); System.debug('>>> ' + d); ``` outputs this: ``` >>> 1.666666666666666666666666666667 ``` Take a look at the [Decimal do...
Decimal, Float or Double data type always lose precision when multiplied, added or divided. **Regardless of programming language** we use, this behavior is universal. I would like you to go through following post if you want to understand in detail. [What Every Computer Scientist Should Know About Floating-Point Arit...
154,555
I recently started learning AngularJS, and I have the following sample code that does a REST callout from a Visualforce page - the code does a successful callout. My question: In the 'app.config' where we provide the Authorization header as a string value ('BASIC base64Hash'), base64Hash being the username:password has...
2017/01/04
[ "https://salesforce.stackexchange.com/questions/154555", "https://salesforce.stackexchange.com", "https://salesforce.stackexchange.com/users/29655/" ]
The data type that gives you fine-grained control over precision is `Decimal`. For example, if you wanted to have 30 decimal places after the divide this: ``` Decimal d = 5; d = d.divide(3, 30); System.debug('>>> ' + d); ``` outputs this: ``` >>> 1.666666666666666666666666666667 ``` Take a look at the [Decimal do...
When you store certain types of fractions in a Decimal value, their value is approximated, because they can not be exactly represented in the binary format used by computers. While we humans have no problems with 2 / 3 \* 3 equaling 2, ordinary programming languages can't express all numbers precisely. Let's take a lo...
112,212
I recently bought the new updated textures from textures.com (cgtextures), and after more than an hour of intense download and sorting the textures, i get this annoying message: "Cannot read '//....\Desktop\Trabajos Blender\Do Widzenia\Blender\Biblioteca del Blender\Texturas, Materiales\Texturas de páginas random\Meta...
2018/07/05
[ "https://blender.stackexchange.com/questions/112212", "https://blender.stackexchange.com", "https://blender.stackexchange.com/users/46124/" ]
MS Windows includes limitations on the maximum file path to any accessible file - it appears that you have exceeded that limit. See [docs.microsoft.com/en-us/windows/desktop/fileio/naming-a-file](https://docs.microsoft.com/en-us/windows/desktop/fileio/naming-a-file) - in particular the following section : **Maximum P...
My solution for this was that you need to copy downloaded file to 3D Objects map `C:\Users\<your username>\3D Objects` that worked for me
45,053,472
I want to return an array containing the keys: ``` <?php if(isset($values[0]->Content)): $jarray= json_decode($values[0]->Content); print_r(array_keys($jarray)); exit; endif; ?> ``` Output of `$jarray`: ``` stdClass Object ( [_token] => QjyTAyDDUeadYvO0qj0gAZyK7OVyudSsY7Sq8Hhp [datefrom] => 2017-07-07 [...
2017/07/12
[ "https://Stackoverflow.com/questions/45053472", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
For each element, you can get the namespaces associated with it. This is an array such as ``` Array ( [admin] => someval ) ``` So you need to extract the first key from this to get the namespace of the element... ``` foreach ($xpath as $child) { $arr[] = array_keys($child->getNameSpaces())[0].'...
The "someval" values are the real namespaces. "admin", "system" and "links" are only aliases/prefixes in the document. They are optional and can change on ANY element node. Register your own prefix for the namespace, use the prefix in your Xpath expressions. ``` $xml = <<<'XML' <?xml version="1.0" encoding="US-ASCII"...
126,282
I am trying to run a script which does some work including stripping the leading two characters from the string inside each row of a column. To do this I am using `RIGHT()` and it works fine when I use it in a `SELECT..FROM` but when I use that same code inside an `UPDATE` it fails with > > Invalid length parameter p...
2016/01/14
[ "https://dba.stackexchange.com/questions/126282", "https://dba.stackexchange.com", "https://dba.stackexchange.com/users/29717/" ]
> > why is it failing in the `UPDATE` but not the `SELECT...FROM`? > > > Because in your `SELECT` you are filtering out the rows via `WHERE #ReleaseTemp.ReleaseNotes <> ''`. You do not have that filter on your `UPDATE` statement and you probably have at least one row that has a length of 0 or 1. Try making it: ``...
To do updates with select and avoid ambiguity, I use below approach which I learned, hope this helps you too.This is nowhere related to your question. Small test: ``` create table #temp ( id int ) ; insert into #temp select 1 ; -- now update part update a set a.id=3 from #temp a where a.id=3 ; ---- using cte, I c...
52,359,598
From *Understanding the Linux Kernel*: > > the Linux kernel defines the list\_head data structure, whose only > fields next and prev represent the forward and back pointers of a > generic doubly linked list element, respectively. It is important to > note, however, that the pointers in a list\_head field store the...
2018/09/17
[ "https://Stackoverflow.com/questions/52359598", "https://Stackoverflow.com", "https://Stackoverflow.com/users/156458/" ]
> > Why do the pointers in a list\_head field store the addresses of other > list\_head fields rather than the addresses of the whole data > structures in which the list\_head structure is included? > > > Because it is logically right and easier to implement. You don't need to know the type to iterate the list. ...
`list_head` stores pointer to next/prev list nodes. One data structure can be placed in more then one list using more then one `list_head` elements in it. Processing code "knows" which of these elements placed into given list and can restore pointer to data structure from pointer to node using [`list_entry`](https://el...
50,892,879
I have a `PhysicalServer` model: ``` class PhysicalServer(models.Model): name = models.CharField(max_length=32) cabinet = models.ForeignKey(to=Cabinet, on_delete=models.DO_NOTHING, related_name="physical_servers") physical_server_model = models.ForeignKey(to=PhysicalServerModel, null=True, on_delete=models...
2018/06/17
[ "https://Stackoverflow.com/questions/50892879", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7646621/" ]
You'll need to extract the numbers from the strings. Postgres and mysql provide `regexp_replace` function (I'm not sure about other databases). But Django doesn't provide an implementation, so we'll write our own [function](https://docs.djangoproject.com/en/1.11/ref/models/expressions/#func-expressions): ``` from djan...
Use [Substr](https://docs.djangoproject.com/en/stable/ref/models/database-functions/#substr) to separate out the first part of the name from the numbers at the end, and then sort by this new annotation first. ``` from django.db.models.functions import Substr, Length qs = qs.annotate(letters=Substr('name', 1, 6), leng...
58,805,626
One of my querysets returns list of items with several fields: ``` <QuerySet [{'name': 'John', 'products': 4}, {'name': 'John', 'products': 6}, {'name': 'Sam', 'products': 7}, ...]> ``` How do I aggregate this data to get combined `Sum()` of `products` value for elements with the same `name` field to avoid duplicate...
2019/11/11
[ "https://Stackoverflow.com/questions/58805626", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4726424/" ]
You can construct such queryset with: ``` from django.db.models import Sum Model.objects.values('name').annotate( **sum\_products=Sum('products')** ).order_by(**'name'**) ``` The `.order_by(..)` is necessary to force Django to use a GROUP BY clause.
What you need is `annotate`, and you can do something like this: ```py from django.db.models import Sum your_queryset = YourModel.objects.annotate(total_products=Sum('products')).values_list('name', 'total_products') ``` You can learn more about it by looking at the [docs](https://docs.djangoproject.com/en/2.2/topi...
17,059
While reading this wikipedia [article](http://en.wikipedia.org/wiki/No_Silver_Bullet), Brookes has told that there is a difference between "good" designers and "great" designers. What is the difference between them? How can I decide if a designer is good or great?
2010/11/05
[ "https://softwareengineering.stackexchange.com/questions/17059", "https://softwareengineering.stackexchange.com", "https://softwareengineering.stackexchange.com/users/7087/" ]
A great designer catches the intent of what I want to accomplish and improves on it to my delight. A good designer follows a specification to the letter, but creativity shows in how they did that. A bad designer is, well, none of the above. I think 'exceptional' is always in the eye of the client, and the people the...
A good designer creates something that does the job well. A great designer also makes the user say "wow!!!". A good designer knows the established standards, and applies them well. A great designer goes beyond that and creates new solutions that become new standards.
17,059
While reading this wikipedia [article](http://en.wikipedia.org/wiki/No_Silver_Bullet), Brookes has told that there is a difference between "good" designers and "great" designers. What is the difference between them? How can I decide if a designer is good or great?
2010/11/05
[ "https://softwareengineering.stackexchange.com/questions/17059", "https://softwareengineering.stackexchange.com", "https://softwareengineering.stackexchange.com/users/7087/" ]
A good designer can design for simplicity **or** flexibility **or** efficiency **or** robustness. A great designer has a deep understanding of the tradeoffs involved and can effectively balance all of these and come up with a solution that satisfies all of them reasonably well.
If you want to know what Fred Brooks was saying in *No Silver Bullet* you should read [the paper itself](http://www.cs.nott.ac.uk/~cah/G51ISS/Documents/NoSilverBullet.html) and not a Wikipedia article about the paper. Brooks isn't specific as to the the precise difference but he nevertheless makes it clear that the dis...
17,059
While reading this wikipedia [article](http://en.wikipedia.org/wiki/No_Silver_Bullet), Brookes has told that there is a difference between "good" designers and "great" designers. What is the difference between them? How can I decide if a designer is good or great?
2010/11/05
[ "https://softwareengineering.stackexchange.com/questions/17059", "https://softwareengineering.stackexchange.com", "https://softwareengineering.stackexchange.com/users/7087/" ]
If you want to know what Fred Brooks was saying in *No Silver Bullet* you should read [the paper itself](http://www.cs.nott.ac.uk/~cah/G51ISS/Documents/NoSilverBullet.html) and not a Wikipedia article about the paper. Brooks isn't specific as to the the precise difference but he nevertheless makes it clear that the dis...
Great designers can make 2 + 2 = 5. They change the art of the possible.
17,059
While reading this wikipedia [article](http://en.wikipedia.org/wiki/No_Silver_Bullet), Brookes has told that there is a difference between "good" designers and "great" designers. What is the difference between them? How can I decide if a designer is good or great?
2010/11/05
[ "https://softwareengineering.stackexchange.com/questions/17059", "https://softwareengineering.stackexchange.com", "https://softwareengineering.stackexchange.com/users/7087/" ]
A good designer can design for simplicity **or** flexibility **or** efficiency **or** robustness. A great designer has a deep understanding of the tradeoffs involved and can effectively balance all of these and come up with a solution that satisfies all of them reasonably well.
Great designers can make 2 + 2 = 5. They change the art of the possible.
17,059
While reading this wikipedia [article](http://en.wikipedia.org/wiki/No_Silver_Bullet), Brookes has told that there is a difference between "good" designers and "great" designers. What is the difference between them? How can I decide if a designer is good or great?
2010/11/05
[ "https://softwareengineering.stackexchange.com/questions/17059", "https://softwareengineering.stackexchange.com", "https://softwareengineering.stackexchange.com/users/7087/" ]
A great designer catches the intent of what I want to accomplish and improves on it to my delight. A good designer follows a specification to the letter, but creativity shows in how they did that. A bad designer is, well, none of the above. I think 'exceptional' is always in the eye of the client, and the people the...
After The Mythical Man Month came out, Fred Brooks released another collection of essays under the title [The Design of Design](http://rads.stackoverflow.com/amzn/click/0201362988). There's a lot of information in this book about how to design, the design process and methodologies, what makes a good design, methods of ...
17,059
While reading this wikipedia [article](http://en.wikipedia.org/wiki/No_Silver_Bullet), Brookes has told that there is a difference between "good" designers and "great" designers. What is the difference between them? How can I decide if a designer is good or great?
2010/11/05
[ "https://softwareengineering.stackexchange.com/questions/17059", "https://softwareengineering.stackexchange.com", "https://softwareengineering.stackexchange.com/users/7087/" ]
I'm going to assume you're talking about Software Design as opposed to the narrower Ux design. I'll quote a semi-famous passage from Alan Perlis: "Fools ignore complexity. Pragmatists suffer it. Some can avoid it. Geniuses remove it." One aspect of a Great designer is that they reduce complexity.
Great designers can make 2 + 2 = 5. They change the art of the possible.
17,059
While reading this wikipedia [article](http://en.wikipedia.org/wiki/No_Silver_Bullet), Brookes has told that there is a difference between "good" designers and "great" designers. What is the difference between them? How can I decide if a designer is good or great?
2010/11/05
[ "https://softwareengineering.stackexchange.com/questions/17059", "https://softwareengineering.stackexchange.com", "https://softwareengineering.stackexchange.com/users/7087/" ]
After The Mythical Man Month came out, Fred Brooks released another collection of essays under the title [The Design of Design](http://rads.stackoverflow.com/amzn/click/0201362988). There's a lot of information in this book about how to design, the design process and methodologies, what makes a good design, methods of ...
Depends on what kind of design. For web page designers a good designer can make something that looks good but a great designer can make something that looks good and works well (ie intuitive and easy to use).
17,059
While reading this wikipedia [article](http://en.wikipedia.org/wiki/No_Silver_Bullet), Brookes has told that there is a difference between "good" designers and "great" designers. What is the difference between them? How can I decide if a designer is good or great?
2010/11/05
[ "https://softwareengineering.stackexchange.com/questions/17059", "https://softwareengineering.stackexchange.com", "https://softwareengineering.stackexchange.com/users/7087/" ]
A great designer catches the intent of what I want to accomplish and improves on it to my delight. A good designer follows a specification to the letter, but creativity shows in how they did that. A bad designer is, well, none of the above. I think 'exceptional' is always in the eye of the client, and the people the...
Great designers can make 2 + 2 = 5. They change the art of the possible.
17,059
While reading this wikipedia [article](http://en.wikipedia.org/wiki/No_Silver_Bullet), Brookes has told that there is a difference between "good" designers and "great" designers. What is the difference between them? How can I decide if a designer is good or great?
2010/11/05
[ "https://softwareengineering.stackexchange.com/questions/17059", "https://softwareengineering.stackexchange.com", "https://softwareengineering.stackexchange.com/users/7087/" ]
I'm going to assume you're talking about Software Design as opposed to the narrower Ux design. I'll quote a semi-famous passage from Alan Perlis: "Fools ignore complexity. Pragmatists suffer it. Some can avoid it. Geniuses remove it." One aspect of a Great designer is that they reduce complexity.
A good designer creates something that does the job well. A great designer also makes the user say "wow!!!". A good designer knows the established standards, and applies them well. A great designer goes beyond that and creates new solutions that become new standards.
17,059
While reading this wikipedia [article](http://en.wikipedia.org/wiki/No_Silver_Bullet), Brookes has told that there is a difference between "good" designers and "great" designers. What is the difference between them? How can I decide if a designer is good or great?
2010/11/05
[ "https://softwareengineering.stackexchange.com/questions/17059", "https://softwareengineering.stackexchange.com", "https://softwareengineering.stackexchange.com/users/7087/" ]
A good designer can design for simplicity **or** flexibility **or** efficiency **or** robustness. A great designer has a deep understanding of the tradeoffs involved and can effectively balance all of these and come up with a solution that satisfies all of them reasonably well.
After The Mythical Man Month came out, Fred Brooks released another collection of essays under the title [The Design of Design](http://rads.stackoverflow.com/amzn/click/0201362988). There's a lot of information in this book about how to design, the design process and methodologies, what makes a good design, methods of ...
4,062,115
i've checked through the posts on several sites including stackoverflow but was not able to see a similar problem like mine. I have a page with some div containers, that separate input boxes and let them look good. **Problem:** Although everything looks good on safari/opera/chrome, the boxes get weird o...
2010/10/31
[ "https://Stackoverflow.com/questions/4062115", "https://Stackoverflow.com", "https://Stackoverflow.com/users/288774/" ]
removing {float:left} prop of .box\_login\_container #input\_container will give you desire result Updated and corrected fiddle: <http://jsfiddle.net/Zg7tH/1/> remember the suggestions for class and ids reasons: `.box_login_inputs{ margin-top: -26px;}` --> **causing it to slide up and** `.box_login_container #in...
`login_special_input`, `input_container`, etc. are IDs. You can't use the same ID on two different elements. Change them to classes.
64,567,814
I was trying to create a custom runtime Lambda using quarkus and GraalVM and in that process(<https://quarkus.io/guides/amazon-lambda>), I was trying to build a native-image for the Gradle application. I have GraalVM(20.2.0) and native-image(20.2.0) installed on my windows machine along with the JAVA 11 and Docker. Whe...
2020/10/28
[ "https://Stackoverflow.com/questions/64567814", "https://Stackoverflow.com", "https://Stackoverflow.com/users/12505047/" ]
I faced more or less the same issue with maven package in Windows: ``` mvn clean package -Pnative -Dquarkus.native.container-build=true -Dquarkus.native.builder-image=quay.io/quarkus/ubi-quarkus-mandrel:21.2-java11 ``` (...) ``` error during connect: Post "http://%2F%2F.%2Fpipe%2FdockerDesktopLinuxEngine/v1.24/imag...
Navigate to Docker installation and Try following command. > > DockerCli.exe -SwitchDeamon > > > It will switch your container from windows to Linux and if there are no installations are there to support the switch it will throw you the error the along with link. please go through the link and complete the instal...
64,567,814
I was trying to create a custom runtime Lambda using quarkus and GraalVM and in that process(<https://quarkus.io/guides/amazon-lambda>), I was trying to build a native-image for the Gradle application. I have GraalVM(20.2.0) and native-image(20.2.0) installed on my windows machine along with the JAVA 11 and Docker. Whe...
2020/10/28
[ "https://Stackoverflow.com/questions/64567814", "https://Stackoverflow.com", "https://Stackoverflow.com/users/12505047/" ]
I faced more or less the same issue with maven package in Windows: ``` mvn clean package -Pnative -Dquarkus.native.container-build=true -Dquarkus.native.builder-image=quay.io/quarkus/ubi-quarkus-mandrel:21.2-java11 ``` (...) ``` error during connect: Post "http://%2F%2F.%2Fpipe%2FdockerDesktopLinuxEngine/v1.24/imag...
For windows you need to install : <https://aka.ms/vs/15/release/vs_buildtools.exe> and run the command : ".\mvnw package -P native" with your respective repo from your Visual studio. steps : <https://quarkus.io/guides/building-native-image> Use a 64-bit hosted developer command prompt : <https://learn.microsoft.com/...
72,804,181
I am kind of stuck with this, I searched on google for an answer but I can not find it. I would like to turn my `xticks` 45 degrees of my subplot. I know how to do it for a normal plot: ``` plt.xticks(rotation = 45) ``` But when I put this in my plot script nothing happens. I would really like to know how I can app...
2022/06/29
[ "https://Stackoverflow.com/questions/72804181", "https://Stackoverflow.com", "https://Stackoverflow.com/users/18463786/" ]
Below code will convert it into appropriate format ``` df = pd.DataFrame({'datetime':['2013-11-1_00:00','2013-11-1_00:10','2013-11-1_00:20']}) df['datetime_changed'] = pd.to_datetime(df['datetime'].str.replace('_','T')) df.head() ``` output: [![enter image description here](https://i.stack.imgur.com/MlUi2.png)](htt...
You can use `pd.to_datetime` with `format` ```py df['datetime'] = pd.to_datetime(df['datetime'], format='%Y-%m-%d_%H:%M') ```
13,998,599
I would like to express all of the following Scala code in Java: ``` object TupleDemo { val tuple = (3, "Hello, world! ") /** @return str replicated x times */ def foo(x: Int, str: String) = str * x val tupledFoo1 = (foo _).tupled // partially applied function val tupledFoo2 = Function.tupled(foo _) // de...
2012/12/21
[ "https://Stackoverflow.com/questions/13998599", "https://Stackoverflow.com", "https://Stackoverflow.com/users/553865/" ]
`tupled` is implemented in `Function2` (and therefore in `AbstractFunction2`), so there's no need to define it here—you can just write this: ``` import scala.Function; import scala.Function2; import scala.Tuple2; import scala.collection.immutable.WrappedString; import scala.runtime.AbstractFunction2; public class Jav...
The problem with the answer by Travis Brown is that he did not include all of the code. Here is the complete code, which does not compile. ``` import scala.Function; import scala.Function2; import scala.Tuple2; import scala.collection.immutable.WrappedString; import scala.runtime.AbstractFunction2; public class JavaT...
72,421,310
I would like to download all the txt files from a directory that is located an FTP server. The directory has a very complex structure, that consists in many sub-directories. Each subdirectory has a `md5sum.txt` file. How can I write in script that recursively download the `md5sum.txt` from each sub-directory? To be mo...
2022/05/29
[ "https://Stackoverflow.com/questions/72421310", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4954674/" ]
Here is the `onclick` event functionality without `javascript` by using the checkbox hack, Look at the code: ```css #btn{ display: none; } label:hover { cursor: pointer; } label::after { content: 'Close Trailer'; display: none; } label > iframe { display: none; } #btn:checked + label > iframe { dis...
> > Make sure IDs are unique for each item, otherwise this won't work > > > ```css body { display: flex; flex-direction: column; align-items: center; justify-content: center; margin: 0; height: 100vh; font-family: "Open Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu...
58,220,926
I have a table with several columns. The only way to tell the connection to each row is by session\_id My goal is to update the age column with a random number. Therefore I used following query ``` UPDATE userdata SET age = (FLOOR(18 + RAND() * 62)) WHERE session_id IN ( SELECT session_id FROM ( ...
2019/10/03
[ "https://Stackoverflow.com/questions/58220926", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10820177/" ]
Try this: ``` update userdata inner join (select *, (FLOOR(18 + RAND() * 62)) as age2 from userdata group by session_id) T ON T.session_id = userdata.session_id set userdata.age = T.age2 ```
This seems the wrong way around. It seems session\_id is not unique (when perhaps it should be?--which is where the first way you can correct this is)... so you are trying to create a unique column based on it...but as you rightly point out you can't create a new number based on the session id as it too will be the sam...
51,646,462
I have the following mumbers in column B ``` 4025015659 4025015660 4025015661 4025015662 -266490.78 -266491.78 -266492.78 -266493.78 0 0 0 ``` I need to the delete the all numbers except negative numbers. Is it possible to have a formula or vba code to do so.
2018/08/02
[ "https://Stackoverflow.com/questions/51646462", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5866783/" ]
You are using the same alias (B) for the inner and the outer query. You have to use different alias (B1 & B2) to differentiate them : ``` SELECT B1.BEN, B1.Budhol, B1.COCODE, B1.FIELD, B1.OBJ, B1.SPARE1, B1.SPARE2, SUM(B1.value) as Value , STUFF((SELECT ', ' + Code FROM #temp2 b2 ...
``` CREATE TABLE #Table1 ([Budhol] int, [COCODE] int, [BEN] int, [OBJ] int, [SPARE2] varchar(4), [SPARE1] varchar(6), [TASKNO] varchar(4), [Value] int, [Field] int, [Code] varchar(100)) ; INSERT INTO #Table1 ([Budhol], [COCODE], [BEN], [OBJ], [SPARE2], [SPARE1], [TASKNO], [Value], [Field], [Code]) VALUES (...
51,646,462
I have the following mumbers in column B ``` 4025015659 4025015660 4025015661 4025015662 -266490.78 -266491.78 -266492.78 -266493.78 0 0 0 ``` I need to the delete the all numbers except negative numbers. Is it possible to have a formula or vba code to do so.
2018/08/02
[ "https://Stackoverflow.com/questions/51646462", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5866783/" ]
The problem appears to have to do with the `NULL` values in some of your columns. In particular, the `SPARE1` and `SPARE2` columns can take on `NULL` values, and your intention is that such `NULL` values should equate. In the query below, I wrapped them on both sides of the join with `COALESCE`, and I am getting the ex...
You are using the same alias (B) for the inner and the outer query. You have to use different alias (B1 & B2) to differentiate them : ``` SELECT B1.BEN, B1.Budhol, B1.COCODE, B1.FIELD, B1.OBJ, B1.SPARE1, B1.SPARE2, SUM(B1.value) as Value , STUFF((SELECT ', ' + Code FROM #temp2 b2 ...
51,646,462
I have the following mumbers in column B ``` 4025015659 4025015660 4025015661 4025015662 -266490.78 -266491.78 -266492.78 -266493.78 0 0 0 ``` I need to the delete the all numbers except negative numbers. Is it possible to have a formula or vba code to do so.
2018/08/02
[ "https://Stackoverflow.com/questions/51646462", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5866783/" ]
The problem appears to have to do with the `NULL` values in some of your columns. In particular, the `SPARE1` and `SPARE2` columns can take on `NULL` values, and your intention is that such `NULL` values should equate. In the query below, I wrapped them on both sides of the join with `COALESCE`, and I am getting the ex...
``` CREATE TABLE #Table1 ([Budhol] int, [COCODE] int, [BEN] int, [OBJ] int, [SPARE2] varchar(4), [SPARE1] varchar(6), [TASKNO] varchar(4), [Value] int, [Field] int, [Code] varchar(100)) ; INSERT INTO #Table1 ([Budhol], [COCODE], [BEN], [OBJ], [SPARE2], [SPARE1], [TASKNO], [Value], [Field], [Code]) VALUES (...
51,997,222
I am using the official php docker image as base for my application container, so the Dockerfile starts like so: ``` FROM php:5.6-fpm-jessie ``` Later in the file I would like to have something like that: ``` RUN apt-get update \ && apt-get install -y libssh2-1-dev libssh2-1 \ && docker-php-ext-install s...
2018/08/24
[ "https://Stackoverflow.com/questions/51997222", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8431626/" ]
For Alpine and php > 7 ``` RUN apk add --no-cache libssh2-dev autoconf build-base RUN pecl install ssh2-1.2 && docker-php-ext-enable ssh2 ```
For someone looking for a newer version of this for php 7.4 you'll need the following: install dependencies ==================== ``` RUN apt-get update && apt-get install -y \ ssh \ libssh2-1 \ libssh2-1-dev \ wget \ libssl-dev \ && apt-get clean \ && rm -rf /var/lib/apt/lists/* # Install...
51,997,222
I am using the official php docker image as base for my application container, so the Dockerfile starts like so: ``` FROM php:5.6-fpm-jessie ``` Later in the file I would like to have something like that: ``` RUN apt-get update \ && apt-get install -y libssh2-1-dev libssh2-1 \ && docker-php-ext-install s...
2018/08/24
[ "https://Stackoverflow.com/questions/51997222", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8431626/" ]
The easiest solution is to use `install-php-extensions`. It's a script that can install the required system libraries automatically, on any Docker PHP image. ```dockerfile COPY --from=mlocati/php-extension-installer /usr/bin/install-php-extensions /usr/local/bin/ RUN install-php-extensions ssh2 ``` `install-php-ext...
I had some error on an other solutions In my running container on [richarvey/nginx-php-fpm](https://hub.docker.com/r/richarvey/nginx-php-fpm) image worked with two command. ``` apk add --no-cache libssh2-dev autoconf build-base pecl install https://pecl.php.net/get/ssh2-1.3.tgz docker-php-ext-enable ssh2 ```
51,997,222
I am using the official php docker image as base for my application container, so the Dockerfile starts like so: ``` FROM php:5.6-fpm-jessie ``` Later in the file I would like to have something like that: ``` RUN apt-get update \ && apt-get install -y libssh2-1-dev libssh2-1 \ && docker-php-ext-install s...
2018/08/24
[ "https://Stackoverflow.com/questions/51997222", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8431626/" ]
It looks like the pecl option isn't available for anything newer then PHP 6. In order to get it installed, I had to build from source. From `php:7.1.27-cli` I was able to get it setup with these commands - the `php:7.1.27-cli` image is based on debian stretch: ```sh # install dependencies RUN apt-get update && apt-ge...
The solution that worked for me on the CLI image of PHP 7.2: ```sh FROM php:7.2-cli RUN apt-get install -y libssh2-1 libssh2-1-dev RUN pecl install ssh2-1.2 && docker-php-ext-enable ssh2 ``` Build the Docker image and confirm the SSH2 extension is installed: ```sh docker build -t example/php-build . docker run --r...
51,997,222
I am using the official php docker image as base for my application container, so the Dockerfile starts like so: ``` FROM php:5.6-fpm-jessie ``` Later in the file I would like to have something like that: ``` RUN apt-get update \ && apt-get install -y libssh2-1-dev libssh2-1 \ && docker-php-ext-install s...
2018/08/24
[ "https://Stackoverflow.com/questions/51997222", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8431626/" ]
In case you are using PHP >=8.0 image: ``` FROM php:8.0.2-fpm RUN apt-get install -y libssh2-1-dev libssh2-1 \ && pecl install ssh2-1.3.1 \ && docker-php-ext-enable ssh2 ```
It looks like the pecl option isn't available for anything newer then PHP 6. In order to get it installed, I had to build from source. From `php:7.1.27-cli` I was able to get it setup with these commands - the `php:7.1.27-cli` image is based on debian stretch: ```sh # install dependencies RUN apt-get update && apt-ge...
51,997,222
I am using the official php docker image as base for my application container, so the Dockerfile starts like so: ``` FROM php:5.6-fpm-jessie ``` Later in the file I would like to have something like that: ``` RUN apt-get update \ && apt-get install -y libssh2-1-dev libssh2-1 \ && docker-php-ext-install s...
2018/08/24
[ "https://Stackoverflow.com/questions/51997222", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8431626/" ]
It looks like the pecl option isn't available for anything newer then PHP 6. In order to get it installed, I had to build from source. From `php:7.1.27-cli` I was able to get it setup with these commands - the `php:7.1.27-cli` image is based on debian stretch: ```sh # install dependencies RUN apt-get update && apt-ge...
The easiest solution is to use `install-php-extensions`. It's a script that can install the required system libraries automatically, on any Docker PHP image. ```dockerfile COPY --from=mlocati/php-extension-installer /usr/bin/install-php-extensions /usr/local/bin/ RUN install-php-extensions ssh2 ``` `install-php-ext...
51,997,222
I am using the official php docker image as base for my application container, so the Dockerfile starts like so: ``` FROM php:5.6-fpm-jessie ``` Later in the file I would like to have something like that: ``` RUN apt-get update \ && apt-get install -y libssh2-1-dev libssh2-1 \ && docker-php-ext-install s...
2018/08/24
[ "https://Stackoverflow.com/questions/51997222", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8431626/" ]
Finally, this is successful. ``` && apt-get install -y libssh2-1-dev libssh2-1 \ && pecl install ssh2 \ && docker-php-ext-enable ssh2 ```
For Alpine and php > 7 ``` RUN apk add --no-cache libssh2-dev autoconf build-base RUN pecl install ssh2-1.2 && docker-php-ext-enable ssh2 ```
51,997,222
I am using the official php docker image as base for my application container, so the Dockerfile starts like so: ``` FROM php:5.6-fpm-jessie ``` Later in the file I would like to have something like that: ``` RUN apt-get update \ && apt-get install -y libssh2-1-dev libssh2-1 \ && docker-php-ext-install s...
2018/08/24
[ "https://Stackoverflow.com/questions/51997222", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8431626/" ]
Finally, this is successful. ``` && apt-get install -y libssh2-1-dev libssh2-1 \ && pecl install ssh2 \ && docker-php-ext-enable ssh2 ```
In case you are using PHP >=8.0 image: ``` FROM php:8.0.2-fpm RUN apt-get install -y libssh2-1-dev libssh2-1 \ && pecl install ssh2-1.3.1 \ && docker-php-ext-enable ssh2 ```
51,997,222
I am using the official php docker image as base for my application container, so the Dockerfile starts like so: ``` FROM php:5.6-fpm-jessie ``` Later in the file I would like to have something like that: ``` RUN apt-get update \ && apt-get install -y libssh2-1-dev libssh2-1 \ && docker-php-ext-install s...
2018/08/24
[ "https://Stackoverflow.com/questions/51997222", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8431626/" ]
In case you are using PHP >=8.0 image: ``` FROM php:8.0.2-fpm RUN apt-get install -y libssh2-1-dev libssh2-1 \ && pecl install ssh2-1.3.1 \ && docker-php-ext-enable ssh2 ```
I had some error on an other solutions In my running container on [richarvey/nginx-php-fpm](https://hub.docker.com/r/richarvey/nginx-php-fpm) image worked with two command. ``` apk add --no-cache libssh2-dev autoconf build-base pecl install https://pecl.php.net/get/ssh2-1.3.tgz docker-php-ext-enable ssh2 ```
51,997,222
I am using the official php docker image as base for my application container, so the Dockerfile starts like so: ``` FROM php:5.6-fpm-jessie ``` Later in the file I would like to have something like that: ``` RUN apt-get update \ && apt-get install -y libssh2-1-dev libssh2-1 \ && docker-php-ext-install s...
2018/08/24
[ "https://Stackoverflow.com/questions/51997222", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8431626/" ]
It looks like the pecl option isn't available for anything newer then PHP 6. In order to get it installed, I had to build from source. From `php:7.1.27-cli` I was able to get it setup with these commands - the `php:7.1.27-cli` image is based on debian stretch: ```sh # install dependencies RUN apt-get update && apt-ge...
I had some error on an other solutions In my running container on [richarvey/nginx-php-fpm](https://hub.docker.com/r/richarvey/nginx-php-fpm) image worked with two command. ``` apk add --no-cache libssh2-dev autoconf build-base pecl install https://pecl.php.net/get/ssh2-1.3.tgz docker-php-ext-enable ssh2 ```
51,997,222
I am using the official php docker image as base for my application container, so the Dockerfile starts like so: ``` FROM php:5.6-fpm-jessie ``` Later in the file I would like to have something like that: ``` RUN apt-get update \ && apt-get install -y libssh2-1-dev libssh2-1 \ && docker-php-ext-install s...
2018/08/24
[ "https://Stackoverflow.com/questions/51997222", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8431626/" ]
In case you are using PHP >=8.0 image: ``` FROM php:8.0.2-fpm RUN apt-get install -y libssh2-1-dev libssh2-1 \ && pecl install ssh2-1.3.1 \ && docker-php-ext-enable ssh2 ```
For someone looking for a newer version of this for php 7.4 you'll need the following: install dependencies ==================== ``` RUN apt-get update && apt-get install -y \ ssh \ libssh2-1 \ libssh2-1-dev \ wget \ libssl-dev \ && apt-get clean \ && rm -rf /var/lib/apt/lists/* # Install...
48,658,097
I have a liferay cluster(2 servers), while each liferay boundle has one lucene files, I want to separate these lucene files into a mounted volume, like EFS. Is there any way that I can do this? I had tried, but failed, the main reason is that the server will lock the lucene file when indexing, and another server can no...
2018/02/07
[ "https://Stackoverflow.com/questions/48658097", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9326034/" ]
When using a clustered environment, it is recommended to not use a plain file base lucene search index. Liferay rather recommends ([Liferay Clustering](https://dev.liferay.com/discover/deployment/-/knowledge_base/6-2/liferay-clustering)) to use a pluggable enterprise search such as SOLR or Elasticsearch. There are also...
As Liferay says: > > Sharing a Search Index (not recommended unless you have a file > locking-aware SAN) > > > That's why, the best option are: 1. Use pluggable engines like [SolR](https://web.liferay.com/marketplace/-/mp/application/36322550) or ElasticSearch ([Elasticray](https://web.liferay.com/marketplace/-...
56,608,384
I am seeking for an explanation regarding how incrementing an address affects a pointer. I learned about how C pointers work and how incrementing a pointer is done by considering the pointer type. still I don't understand the following case ``` int main() { int a[] = {1,2,3,4,5}; int *p = (int*)(&a+1); pr...
2019/06/15
[ "https://Stackoverflow.com/questions/56608384", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10060417/" ]
So in this example `&a` is of type `int(*)[5]`. When you add 1 to it it actually adds `sizeof(int[5])` - because that is how pointer arithmetic works, adding an offset adds the size of the type being pointed to times the offset. That is how you get `p` to be one past last element of `a`, after which you cast it to `int...
You can manipulate the array `a` as a pointer to a int `int *`. But it is not the same for `&a`, which is a pointer to an array of 5 ints : `&a + 1` will add the size of the 5 ints to the pointer. Just remove the `&` before adding 1 to a, and it'll work as you expected: ``` #include <stdio.h> int main() { int a[...
56,608,384
I am seeking for an explanation regarding how incrementing an address affects a pointer. I learned about how C pointers work and how incrementing a pointer is done by considering the pointer type. still I don't understand the following case ``` int main() { int a[] = {1,2,3,4,5}; int *p = (int*)(&a+1); pr...
2019/06/15
[ "https://Stackoverflow.com/questions/56608384", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10060417/" ]
Two basic concepts: * Except when it is the operand of the `sizeof` or unary `&` operators, or is a string literal used to initialize a character array in a declaration, a *expression* of type "N-element array of `T`" will be converted ("decay") to an expression of type "pointer to `T`", and the value of the expressio...
So in this example `&a` is of type `int(*)[5]`. When you add 1 to it it actually adds `sizeof(int[5])` - because that is how pointer arithmetic works, adding an offset adds the size of the type being pointed to times the offset. That is how you get `p` to be one past last element of `a`, after which you cast it to `int...