qid
int64
1
74.7M
question
stringlengths
15
58.3k
date
stringlengths
10
10
metadata
list
response_j
stringlengths
4
30.2k
response_k
stringlengths
11
36.5k
253,036
I want to shorten ``` sudo http_proxy="http://proxy:port" apt-get ______ ``` to ``` sudo rep apt-get ________ ``` Is this possible to implement in Ubuntu? ### EDIT: So I added ``` alias rapt-get="http_proxy="10.1.1.26:8080" apt-get" ``` to my `~/.bash_aliases`. I have other working aliases in this file. If...
2013/02/09
[ "https://askubuntu.com/questions/253036", "https://askubuntu.com", "https://askubuntu.com/users/129716/" ]
This depends on your `/etc/sudoers` settings as well. For starters, as pointed out, the *alias* won't even be available within the `sudo` context. However, you could adjust your alias to say: ``` alias rapt-get='http_proxy="10.1.1.26:8080" sudo apt-get' ``` i.e. include the variable that you set for this invocation....
`~/.bashrc` adds aliases for you, and only you `sudo` runs as root. Even though you may have administrator access, your user is not root. So, add your alias to `~root/.bashrc` (generally this is `/root/.bashrc`). If you'd like to add this alias for all users, add it to `/etc/profile`
256,830
In this case I'm filtering by the tag [tag:css\*], but it's showing this as [css\*] and showing the [css](/questions/tagged/css "show questions tagged 'css'") tag's exerpt. ![Example](https://i.stack.imgur.com/kDkbz.png)
2015/05/20
[ "https://meta.stackexchange.com/questions/256830", "https://meta.stackexchange.com", "https://meta.stackexchange.com/users/211113/" ]
I am worried that changing the title in the browser will actually obfuscate the title that much, we can't make sense of the actually question opened any more. If you have opened a few tabs, which is that `1-800 SPAM` post? I don't think the obfuscation of the question itself is useful, since that is only visible to 10...
Unlike with a deleted answer, people aren't actually going to be seeing the deleted content except when explicitly going out of their way to visit the deleted spam post, so I don't see how this is at all necessary. With a deleted answer people are still going to be going to the question to see the non-spam content, and...
256,830
In this case I'm filtering by the tag [tag:css\*], but it's showing this as [css\*] and showing the [css](/questions/tagged/css "show questions tagged 'css'") tag's exerpt. ![Example](https://i.stack.imgur.com/kDkbz.png)
2015/05/20
[ "https://meta.stackexchange.com/questions/256830", "https://meta.stackexchange.com", "https://meta.stackexchange.com/users/211113/" ]
Since there's already a process in place to replace the question title and body with an appropriate text when deleted for being spam or rude, changing the page title as well should be a five minute fix. Ten minutes perhaps, to figure out a suitable replacement text, but here's my suggestion "Post Removed".
Unlike with a deleted answer, people aren't actually going to be seeing the deleted content except when explicitly going out of their way to visit the deleted spam post, so I don't see how this is at all necessary. With a deleted answer people are still going to be going to the question to see the non-spam content, and...
35,087
I am working with the latest version of Adobe Illustrator. I have the following: ![two rounded rectangles](https://i.stack.imgur.com/l0PQT.png) I would like to cup the shape at the following location, so that I create a flat document icon that is folded in one corner: ![slice line of rounded rectangle](https://i.sta...
2014/06/26
[ "https://graphicdesign.stackexchange.com/questions/35087", "https://graphicdesign.stackexchange.com", "https://graphicdesign.stackexchange.com/users/21854/" ]
First of all, I worked in Outline mode (Ctrl+Y). 1. You have you shapes stacked. ![enter image description here](https://i.stack.imgur.com/3pXe1.jpg) 2. Turn on Smart Guides (Ctrl+U) it will help to fit exactly into intersection points. Do a straight line of cut with Pen tool (P). ![enter image description here](https...
Click TRIM or MERGE in the pathfinder, then use the Direct selection tool and delete all unneeded anchor points! ![enter image description here](https://i.stack.imgur.com/ImxmL.png)
3,368,746
I have been asked to use a triple integral to find the volume of the solid bounded by the surface: z = $x^2$ and the planes y = z and y = 1. How do I find the bounds of the triple integral and does the order of the triple integral matter? e.g dzdydx, dxdydz
2019/09/24
[ "https://math.stackexchange.com/questions/3368746", "https://math.stackexchange.com", "https://math.stackexchange.com/users/692813/" ]
The order of integration will depend on the parameterization that you choose. However, for any order of integration, there is a parameterization you might choose. I suggest you always try to sketch the region. In this case, we have a parabolic cylinder and two planes. [![enter image description here](https://i.stack...
The triple volume integral can be set up as follows $$\int\_0^1\int\_{-\sqrt z}^{\sqrt z}\int\_z^1dydxdz$$ that is, integrate along $y$ first, then $x$ and finally $z$.
42,430,615
Hi I am trying to control the html based on the value inside directive. I have a html like this: ``` //myCtrl.isLoad was set to false <img ng-src="{{myCtrl.url}}" imageonload></img> <div ng-if="myCtrl.isLoad">Show me</div> ``` Directive: ``` angular.module('myApp') .directive('imageonload', imageonloadF...
2017/02/24
[ "https://Stackoverflow.com/questions/42430615", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6480044/" ]
you can just bind the controller property to the directive. ```js angular.module('myApp', []) .directive('imageonload', imageonloadFunction); function imageonloadFunction() { var directive = { 'link': link, 'scope': { 'isLoad': '=' }, ...
Display Loader When image load. In HTML: ``` <img src="img/loading.gif" imageload="{{myCtrl.url}}"> ``` Directive : ``` .directive('imageload', function() { return { restrict: 'A', scope: { imageload: '@' }, link: function(scope, element, att...
24,831,850
Back in Objective-C, I defined the following macros in a `constants.h` file: ``` #define IS_IPHONE5 (([[UIScreen mainScreen] bounds].size.height-568)?NO:YES) #define IS_IPAD (UI_USER_INTERFACE_IDIOM()==UIUserInterfaceIdiomPad) #define IS_IOS7 ([[[UIDevice currentDevice] systemVersion] floatValue] >= 7) #define APP_...
2014/07/18
[ "https://Stackoverflow.com/questions/24831850", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3680562/" ]
In this case, the easiest way to define these constants seems to be to use the `let` keyword. Macros are not available in Swift, so you have to use constants in this case (which may be better in terms of performance anyhow, in this case): ``` let IS_IPHONE5 = fabs(UIScreen.mainScreen().bounds.size.height-568) < 1; ...
For IPad : ``` static let IS_IPAD = UIDevice.currentDevice().userInterfaceIdiom == .Pad && ScreenSize.SCREEN_MAX_LENGTH >= 1024.0 ```
24,831,850
Back in Objective-C, I defined the following macros in a `constants.h` file: ``` #define IS_IPHONE5 (([[UIScreen mainScreen] bounds].size.height-568)?NO:YES) #define IS_IPAD (UI_USER_INTERFACE_IDIOM()==UIUserInterfaceIdiomPad) #define IS_IOS7 ([[[UIDevice currentDevice] systemVersion] floatValue] >= 7) #define APP_...
2014/07/18
[ "https://Stackoverflow.com/questions/24831850", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3680562/" ]
I tend to use these three structs in every project i do: ``` struct ScreenSize { static let SCREEN_WIDTH = UIScreen.mainScreen().bounds.size.width static let SCREEN_HEIGHT = UIScreen.mainScreen().bounds.size.height static let SCREEN_MAX_LENGTH = max(ScreenSize.SCREEN_WIDTH, ScreenSize.SCR...
For IPad : ``` static let IS_IPAD = UIDevice.currentDevice().userInterfaceIdiom == .Pad && ScreenSize.SCREEN_MAX_LENGTH >= 1024.0 ```
492,607
I have a directory `/var/mychoot` on the same filesystem as `/`, and I've started the program `/var/mychroot/prog` as `sudo chroot /var/mychroot /prog`, so the program is running as EUID 0. If the program executes the [chdir("..") escape technique](http://linux-vserver.org/Secure_chroot_Barrier#Using_chdir.28.22...22....
2019/01/05
[ "https://unix.stackexchange.com/questions/492607", "https://unix.stackexchange.com", "https://unix.stackexchange.com/users/3054/" ]
To protect against the specific `chdir("..")` escape technique you mentioned, you can simply drop the capability to execute `chroot(2)` again once you're chrooted to `/var/mychroot` yourself. The escape technique requires another call to `chroot()`, so blocking that is enough to prevent it from working. You can do tha...
> > they only work if /var/mychroot is a mount point, so they fail if /var/mychroot is just a subdirectory within the / filesystem. > > > You can make any directory a mount point: `mount --rbind /var/mychoot /var/mychoot`. This step - and others that you will need - are covered here: [How to perform chroot with ...
75,388
Let us consider affine Cremona group $GA\_{n}$ ($n\gt 1$). Question: do exist finite-dimensional representation of $GA\_{n}$ ? Thank you for the answer!
2011/09/14
[ "https://mathoverflow.net/questions/75388", "https://mathoverflow.net", "https://mathoverflow.net/users/10613/" ]
I mentioned [here](http://www.normalesup.org/~cornulier/cremona.pdf) (esp. Remark 5.3) that $GA\_2$ has no faithful linear representation (finite-dimensional, over any field), but the proof can easily be modified to show that any linear representation of the kernel $SGA\_2$ of the determinant of the Jacobian has no non...
There is one obvious representation which takes an automorphism of $\mathbb A^n$ to the determinant of its Jacobian. Let $G\_n$ be its kernel. It carries a natural structure of infinite-dimensional algebraic group. Shafarevich proved that $G\_n$ is simple as an algebraic group in this [paper](http://iopscience.iop.org/...
5,257,662
I am using table view and I am using different cell size, but when I delete the cell, it shows on constant position, not in the middle of the cell. What should I do for custom delete button position?
2011/03/10
[ "https://Stackoverflow.com/questions/5257662", "https://Stackoverflow.com", "https://Stackoverflow.com/users/651046/" ]
This is really hacky, but I found this snippet of code a while back: ``` - (void)willTransitionToState:(UITableViewCellStateMask)state { [super willTransitionToState:state]; if ((state & UITableViewCellStateShowingDeleteConfirmationMask) == UITableViewCellStateShowingDeleteConfirmationMask) { for (U...
Reload the table in `viewWillAppear`. It will reload the table after record has been deleted. ``` [super viewWillAppear:animated]; // [self.tableView reloadData ]; [tblSimpleTable reloadData]; ```
37,260,473
I have published my WCF project onto a server, i have also published an MVC application onto the same box which consumes the WCF services. When trying login on my MVC application, this uses a wcf service, but i get this exception on the browser, > > The Entity Framework provider type > 'System.Data.Entity.SqlServ...
2016/05/16
[ "https://Stackoverflow.com/questions/37260473", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5351206/" ]
@FranciscoGoldenstein saying ! You don't need to install Entity Framework in your Console application or whatever, you just need to add a reference to the assembly EntityFramework.SqlServer.dll. You can copy this assembly from the Class Library project that uses Entity Framework to a LIB folder and add a reference to i...
Uninstall Entity Framework nuget and just reinstall, worked for me.
37,260,473
I have published my WCF project onto a server, i have also published an MVC application onto the same box which consumes the WCF services. When trying login on my MVC application, this uses a wcf service, but i get this exception on the browser, > > The Entity Framework provider type > 'System.Data.Entity.SqlServ...
2016/05/16
[ "https://Stackoverflow.com/questions/37260473", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5351206/" ]
@FranciscoGoldenstein saying ! You don't need to install Entity Framework in your Console application or whatever, you just need to add a reference to the assembly EntityFramework.SqlServer.dll. You can copy this assembly from the Class Library project that uses Entity Framework to a LIB folder and add a reference to i...
I also had a similar problem My problem was solved by doing the following: [![enter image description here](https://i.stack.imgur.com/fYdqE.png)](https://i.stack.imgur.com/fYdqE.png) [![enter image description here](https://i.stack.imgur.com/tPsC9.png)](https://i.stack.imgur.com/tPsC9.png)
37,260,473
I have published my WCF project onto a server, i have also published an MVC application onto the same box which consumes the WCF services. When trying login on my MVC application, this uses a wcf service, but i get this exception on the browser, > > The Entity Framework provider type > 'System.Data.Entity.SqlServ...
2016/05/16
[ "https://Stackoverflow.com/questions/37260473", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5351206/" ]
@FranciscoGoldenstein saying ! You don't need to install Entity Framework in your Console application or whatever, you just need to add a reference to the assembly EntityFramework.SqlServer.dll. You can copy this assembly from the Class Library project that uses Entity Framework to a LIB folder and add a reference to i...
The easiest trick to resolve this issue is to add the following line inside one of the classes in your EF project: ``` public class Blablabla { private static string __hack = typeof(SqlProviderServices).ToString(); // other class members as they were before. } ``` This will force the build process to copy *...
37,260,473
I have published my WCF project onto a server, i have also published an MVC application onto the same box which consumes the WCF services. When trying login on my MVC application, this uses a wcf service, but i get this exception on the browser, > > The Entity Framework provider type > 'System.Data.Entity.SqlServ...
2016/05/16
[ "https://Stackoverflow.com/questions/37260473", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5351206/" ]
@FranciscoGoldenstein saying ! You don't need to install Entity Framework in your Console application or whatever, you just need to add a reference to the assembly EntityFramework.SqlServer.dll. You can copy this assembly from the Class Library project that uses Entity Framework to a LIB folder and add a reference to i...
Maybe is something silly, but for future reference: In my case I was working with Unit Testing. I added the configuration to the app.config, but never install the Entity Framework to the Unit Test Project. After installed, so far so good.
37,260,473
I have published my WCF project onto a server, i have also published an MVC application onto the same box which consumes the WCF services. When trying login on my MVC application, this uses a wcf service, but i get this exception on the browser, > > The Entity Framework provider type > 'System.Data.Entity.SqlServ...
2016/05/16
[ "https://Stackoverflow.com/questions/37260473", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5351206/" ]
Uninstall Entity Framework nuget and just reinstall, worked for me.
I also had a similar problem My problem was solved by doing the following: [![enter image description here](https://i.stack.imgur.com/fYdqE.png)](https://i.stack.imgur.com/fYdqE.png) [![enter image description here](https://i.stack.imgur.com/tPsC9.png)](https://i.stack.imgur.com/tPsC9.png)
37,260,473
I have published my WCF project onto a server, i have also published an MVC application onto the same box which consumes the WCF services. When trying login on my MVC application, this uses a wcf service, but i get this exception on the browser, > > The Entity Framework provider type > 'System.Data.Entity.SqlServ...
2016/05/16
[ "https://Stackoverflow.com/questions/37260473", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5351206/" ]
Uninstall Entity Framework nuget and just reinstall, worked for me.
Maybe is something silly, but for future reference: In my case I was working with Unit Testing. I added the configuration to the app.config, but never install the Entity Framework to the Unit Test Project. After installed, so far so good.
37,260,473
I have published my WCF project onto a server, i have also published an MVC application onto the same box which consumes the WCF services. When trying login on my MVC application, this uses a wcf service, but i get this exception on the browser, > > The Entity Framework provider type > 'System.Data.Entity.SqlServ...
2016/05/16
[ "https://Stackoverflow.com/questions/37260473", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5351206/" ]
The easiest trick to resolve this issue is to add the following line inside one of the classes in your EF project: ``` public class Blablabla { private static string __hack = typeof(SqlProviderServices).ToString(); // other class members as they were before. } ``` This will force the build process to copy *...
I also had a similar problem My problem was solved by doing the following: [![enter image description here](https://i.stack.imgur.com/fYdqE.png)](https://i.stack.imgur.com/fYdqE.png) [![enter image description here](https://i.stack.imgur.com/tPsC9.png)](https://i.stack.imgur.com/tPsC9.png)
37,260,473
I have published my WCF project onto a server, i have also published an MVC application onto the same box which consumes the WCF services. When trying login on my MVC application, this uses a wcf service, but i get this exception on the browser, > > The Entity Framework provider type > 'System.Data.Entity.SqlServ...
2016/05/16
[ "https://Stackoverflow.com/questions/37260473", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5351206/" ]
I also had a similar problem My problem was solved by doing the following: [![enter image description here](https://i.stack.imgur.com/fYdqE.png)](https://i.stack.imgur.com/fYdqE.png) [![enter image description here](https://i.stack.imgur.com/tPsC9.png)](https://i.stack.imgur.com/tPsC9.png)
Maybe is something silly, but for future reference: In my case I was working with Unit Testing. I added the configuration to the app.config, but never install the Entity Framework to the Unit Test Project. After installed, so far so good.
37,260,473
I have published my WCF project onto a server, i have also published an MVC application onto the same box which consumes the WCF services. When trying login on my MVC application, this uses a wcf service, but i get this exception on the browser, > > The Entity Framework provider type > 'System.Data.Entity.SqlServ...
2016/05/16
[ "https://Stackoverflow.com/questions/37260473", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5351206/" ]
The easiest trick to resolve this issue is to add the following line inside one of the classes in your EF project: ``` public class Blablabla { private static string __hack = typeof(SqlProviderServices).ToString(); // other class members as they were before. } ``` This will force the build process to copy *...
Maybe is something silly, but for future reference: In my case I was working with Unit Testing. I added the configuration to the app.config, but never install the Entity Framework to the Unit Test Project. After installed, so far so good.
53,287
If I want to move the user view in Mac, I can do it by pressing `Alt` + `Shift` + `LeftMouseButton`. Note that I just have a trackpad, not a mouse. Anyway, the problem is that this way I can just move along two axes. To make this clear I took a video, which you can see [here](https://onedrive.live.com/redir?resid=768CF...
2016/05/24
[ "https://blender.stackexchange.com/questions/53287", "https://blender.stackexchange.com", "https://blender.stackexchange.com/users/22491/" ]
You track forward/backward the same way that you scroll a web page. Often, a trackpad does this this with a two-finger drag up and down. Note, that even when this works correctly, it will still not allow you to view the back side of the cube. By default, it will track toward an invisible pivot point i the center of th...
For this answer to work, you will need to enable something in the *User Preferences*. Go to *File > User Preferences... > Input* and check *Emulate Numpad* at the middle left, if it isn't already. From here, you can key `1`, `3`, or `7` to rotate the view around. From one of these rotated views, you can surely do what ...
28,535,670
i have created an android application to download an image and save it to external directory but the application downloads the file and saves it to internal directory. this is my code ``` protected String doInBackground(String... aurl) { int count; try { File root = Environment.getExterna...
2015/02/16
[ "https://Stackoverflow.com/questions/28535670", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4570682/" ]
To make reduce a number by one, use the decrement operator. For example, ``` counter--; ``` would subtract one from the counter. If you want to subtract more than one, you can use the "-=" operator in the following manner: ``` counter -= 2; ``` So, in your code, in the final else if block, you could change the ...
Okay, so here is the full functional main method you are looking for: ``` public static void main(String[] args){ System.out.println("WELCOME TO GUESSING GAME BY JOSH!"); System.out.println("Rules: Player 1 picks number between 1 - 100 while Player 2 has 10 tries to guess"); Scanner...
2,516,783
I'm trying to solve the problem below. > > $U$ and $W$ are subspaces of polynomials over $\mathbb{R}$. > > > $U = Span(t^3 + 4t^2 - t + 3, t^3 + 5t^2 + 5, 3t^3 + 10t^2 -5t + 5)$ > $W = Span(t^3 + 4t^2 + 6, t^3 + 2t^2 - t + 5, 2t^3 + 2t^2 -3t + 9)$ > > > What is $dim(U \cap W)$? > > > I have solved it using ...
2017/11/12
[ "https://math.stackexchange.com/questions/2516783", "https://math.stackexchange.com", "https://math.stackexchange.com/users/381394/" ]
Consider a polynomial $p(t)=at^{3}+bt^{2}+ct+d$ belonging to $U$ and $V$ at the same time and solve two separated systems to find the conditions for $p(t)$ to be in $U$ and beside find the coditions for $p(t)$ to be in $V$ and once you find those two list of conditions consider a system on the unkowns $a,b,c$. $$p(t)...
Consider the matrix: \begin{bmatrix} 1 & 4 & -1 & 3 \\ 1 & 5 & 0 & 5 \\ 3 & 10 & -5 & 5 \\ 1 & 4 & 0 & 6 \\ 2 & 2 & -3 & 9 \\ \end{bmatrix} Row reduce the matrix to its Row reduced echelon form to get the basis of $U + W = \text{Span}\{v\_1,v\_2,v\_3,v\_4,v\_5,v\_6 \}$. Then use the formula: $$\dim(U + W) = \...
243,533
What to do when someone wants to show his flair/rep and at the same time do not want his identity to be known? I thought for a second for an intermediate site to produce a certified/anonymous flair.
2014/11/13
[ "https://meta.stackexchange.com/questions/243533", "https://meta.stackexchange.com", "https://meta.stackexchange.com/users/275154/" ]
Flair is not some secure proof of your rep. It's a picture. Anyone can get anyone's flair. The only way to gain real world benefit from your SE activities is to make a connection between the two, such as telling people "I am [username] on StackExchange." If you're not willing to do that, then you can't gain a real worl...
Like the commenters, I'm not sure I see the purpose of this. It sounds like you want to hold some anonymized badge that proves you to have millions and billions (or so) of rep points on one or several SE sites, but how would that even prove anything? **[![profile for Xline at Meta Stack Exchange, Q&A for meta-discussi...
70,030,106
I want to show from UserController how many products the User used and user information. I have created two `Resources` for it. SO I search him using `$id` Here is My `UserController` code ``` public function show($id) { // $user = User::find($id); if (is_null($user)) { return r...
2021/11/19
[ "https://Stackoverflow.com/questions/70030106", "https://Stackoverflow.com", "https://Stackoverflow.com/users/16432482/" ]
You have an issue with ref declaration between react hook refs which its assigned to the same input, you need to create ref but without using already assigned ref to another input. The trick here to resolve issue: ``` const dopMReg = register("dobMonth"); const dopYReg = register("dobYear"); ``` for example: `...
you can use like this too: ``` const dobYearInput = useRef(null) const { register } = useForm() const { ref:refDobMonth, ...restDobMonth } = register('dobMonth', { required: true, validate: (value) => validateDate(value, getValues), onChange: (e) => onChange(e), }) const { ref:refDobYear,...
22,339
In a discussion on the history of Ethernet and 10BASE5, Stefan Skoglund commented [Was 10BASE5 a mistake?](https://retrocomputing.stackexchange.com/questions/22246/was-10base5-a-mistake?noredirect=1#comment73425_22246) > > One reason why 10BaseT became possible is Moores law (and the same for the other designs after ...
2021/11/20
[ "https://retrocomputing.stackexchange.com/questions/22339", "https://retrocomputing.stackexchange.com", "https://retrocomputing.stackexchange.com/users/4274/" ]
I designed a 10BASET ethernet chip (codename ENZO used in Sage MainLAN <https://archive.org/details/byte-magazine-1991-01-rescan/page/n67/mode/2up?q=sage+mainlan>) and produced a proposed design for a 10BASET hub. In electronics terms 10BASET is simpler, a pair of resistors for pulse shaping the output externally, a t...
The per-port electronics in the network card is very similar, no matter whether you use 10base2 or 10baseT. AUI is slightly simpler on the network card, as a part of the electronics is not in the card, but in the MAU. The primary difference between coax and TP is that TP needs a hub or a switch, which is an additional...
22,339
In a discussion on the history of Ethernet and 10BASE5, Stefan Skoglund commented [Was 10BASE5 a mistake?](https://retrocomputing.stackexchange.com/questions/22246/was-10base5-a-mistake?noredirect=1#comment73425_22246) > > One reason why 10BaseT became possible is Moores law (and the same for the other designs after ...
2021/11/20
[ "https://retrocomputing.stackexchange.com/questions/22339", "https://retrocomputing.stackexchange.com", "https://retrocomputing.stackexchange.com/users/4274/" ]
I designed a 10BASET ethernet chip (codename ENZO used in Sage MainLAN <https://archive.org/details/byte-magazine-1991-01-rescan/page/n67/mode/2up?q=sage+mainlan>) and produced a proposed design for a 10BASET hub. In electronics terms 10BASET is simpler, a pair of resistors for pulse shaping the output externally, a t...
Your question seems to ignore the topology of a network completely: If you want to connect, say 20 computers via Thickwire or BNC, you need: * A length of the chosen cabling * 20 MAUs if you want Thickwire * Some cheap termination resistors That is: No active electronics except the MAUs (which you could consider par...
4,559,837
I have built a model that extends Zend\_Db\_Table\_Abstract and I can't figure out why I can't use createRow(); here is my code: ``` class Model_User extends Zend_Db_Table_Abstract { public function createUser() { $row = $this->createRow(); $row->name = 'test'; $row->save(); } } ``` and...
2010/12/30
[ "https://Stackoverflow.com/questions/4559837", "https://Stackoverflow.com", "https://Stackoverflow.com/users/306703/" ]
Possible answers: 1. You forgot to call `Stream.close()` or `Stream.Dispose()`. 2. Your code is messing up text and and other kinds of data (e.g. casting a `-1` from a `Read()` method into a `char`, then writing it. We need to see your code though...
**Size on disk** vs **Size** First of all you should note that the *Size on disk* is almost always different from the *Size* value because the *Size on disk* value reflects the allocated drive storage but the *Size* reflects the actual length of the file. A disk drive splits its space into blocks of the same size. Fo...
4,139,384
I have a simple form: ``` <form id="radio_form"> <fieldset> <label><input type="radio" name="color" value="1" />Red</label><br /> <label><input type="radio" name="color" value="2" />Yellow</label><br /> <label><input type="radio" name="color" value="3" />Blue</label><br /> <label><input type="rad...
2010/11/09
[ "https://Stackoverflow.com/questions/4139384", "https://Stackoverflow.com", "https://Stackoverflow.com/users/177435/" ]
Like most of jQuery's getter overloads, `val()` returns only the first item's value. You could use *map()* and join the resulting array: ``` $(function() { var value = $('input:radio:checked').map(function() { return this.value; }).get().join(" "); // You could join with a comma if you like $('.r...
``` $(function(){ $(".result").html(""); // clear result $("input:radio:checked").each(function() { $(".result").append($(this).val()); // append value of each matched selector }); }); ```
159,671
Suppose I participate in a basketball game with my friends. I do not play as well as usual. Can I explain to them: > > Sorry, I am not in the good state > > > Will the audience naturally take it to mean that now I am not in the good state in which I can play basketball well? Does it make sense to say that I can...
2014/03/25
[ "https://english.stackexchange.com/questions/159671", "https://english.stackexchange.com", "https://english.stackexchange.com/users/51369/" ]
> > The moon shone on his face as he spoke, and the girl was pleased to watch it, it seemed to breathe such an innocent and old-world kindness of disposition, yet with something high too, as of a well-founded self-content. > > > This is a complicated sentence but we can remove a few of the clauses in order to get ...
Mr Jekyll and Dr Hyde. Good one. "As" always means "similar to," like," etc. here, the object of "as" is "something high," which is modifying "it," which stands for his face on both occurrences. The something high here is indicated to have a quality quite like a well-founded self-content. Now, the question is why "...
159,671
Suppose I participate in a basketball game with my friends. I do not play as well as usual. Can I explain to them: > > Sorry, I am not in the good state > > > Will the audience naturally take it to mean that now I am not in the good state in which I can play basketball well? Does it make sense to say that I can...
2014/03/25
[ "https://english.stackexchange.com/questions/159671", "https://english.stackexchange.com", "https://english.stackexchange.com/users/51369/" ]
> > The moon shone on his face as he spoke, and the girl was pleased to watch it, it seemed to breathe such an innocent and old-world kindness of disposition, yet with something high too, as of a well-founded self-content. > > > This is a complicated sentence but we can remove a few of the clauses in order to get ...
Looking at [dictionary.com](http://dictionary.reference.com/browse/of) we see two useful definitions: > > 1. (used to indicate derivation, origin, or source): a man of good family; the plays of Shakespeare; a piece of cake. > 2. (used to indicate cause, motive, occasion, or reason): to die of hunger. > > > Whethe...
33,788,127
I'm subscribed to an issue in JIRA. Whenever someone comments on it, or changes a comment of his, I get an email. Often this results in multiple consecutive emails, when people enter a comment, and then refine it multiple times. I'd like to tell JIRA to wait after a new comment before sending me the notification mail,...
2015/11/18
[ "https://Stackoverflow.com/questions/33788127", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4636660/" ]
The reason is that you add your authentication provider twice, one time in `configure(HttpSecurity)` and one time in `configure(AuthenticationManagerBuilder)`. This will create a `ProviderManager` with two items, both being your provider. When authentication is processed, the providers will be asked in order until a s...
There may be a situtation which you don't override `configure(AuthenticationManagerBuilder)` and still same `AuthenticationProver`'s `authenticate` method gets called twice like Phil mentioned in his comment in the accepted answer. Why is that? The reason is that when you don't override `configure(AuthenticationManag...
60,917,678
I was trying to run a Python script from the linux terminal at AWS Ligthsail without success. ``` I tried multiple options and still can't get it to run: * * * * * /usr/bin/python3 path/to/my/script.py and within the .py script #/usr/bin/python3 I also tried: * * * * * /usr/bin/python3 path/to/my && ./script.py ...
2020/03/29
[ "https://Stackoverflow.com/questions/60917678", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7635726/" ]
I think the problem is in your cron schedule expression, it should be five stars `*`, like `* * * * *` to be excuted every minute , but in your example you are using just four stars which is wrong . in cron expressions each line has five time-and-date fields followed by a username (if this is the system crontab file)...
When putting the result of the cron I could see that in the .py I had to specify a path. Now it works! ``` * * * * * sudo /usr/bin/python3 path/to/my/script.py >> path/to/my/script.py/out.txt 2>&1 ```
32,408,391
I am trying to have the code print out the highest of the three grades; however, the if/else statement in the highest method is finding an error in return d. I have tried putting if(d>b && d>c) return d, and also else return d. But both times the program says it is unreachable. Can someone explain what I'm doing wrong?...
2015/09/05
[ "https://Stackoverflow.com/questions/32408391", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5302568/" ]
Yes. Because semicolon makes it an empty `if` body. ``` if(c>b && c>d); return c; ``` should be ``` if(c>b && c>d) return c; ``` or (the arguably better) ``` if(c>b && c>d) { return c; } ``` You could also use [`Math.max(double, double)`](https://docs.oracle.com/javase/7/docs/api/java/lang/Math.htm...
because of the semicolon in the second if ``` if(c>b && c>d); ``` That terminates the conditional statement right there and `return c;` becomes a statement that will get executed regardless of condition, remove it
12,653,237
We've started using the DevExpress MVC controls, which requires this code added in our Site.Master: ``` <% Html.DevExpress().RenderScripts(Page, new Script { ExtensionSuite = ExtensionSuite.GridView }, new Script { ExtensionSuite = ExtensionSuite.HtmlEditor }, new Script { ExtensionSuite = Extensi...
2012/09/29
[ "https://Stackoverflow.com/questions/12653237", "https://Stackoverflow.com", "https://Stackoverflow.com/users/325727/" ]
I suppose they create a dynamic js file instead of using static js file just to avoide people might copy their js files. However there are other controls on the market without this problem. If you need a specific control that you can find just there...well you have to survive wuth this problem...otherwise change for an...
I don't know how to fix it, but I have been working with DX components for more than a year in my current project so just want to tell you one thing: it's 3rd party component so you have to live with it, no other way. The components in my project also generate tons of scripts, and I personally think that you should onl...
20,706,534
I found a library which allows an app to wrap text around an image - however once implemented it changed the size of my text - how can the text size be increase when using this library? `android:textSize=` has no impact on the text size. Neither does: ``` FlowTextView titleTv = (FlowTextView) findViewById(R.id.tit...
2013/12/20
[ "https://Stackoverflow.com/questions/20706534", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3113035/" ]
In the short term a call to invalidate will probably get it working: ``` FlowTextView titleTv = (FlowTextView) findViewById(R.id.titleTv); titleTv.setTextSize(20); titleTv.invalidate(); ``` However, I suspect you are using the JAR file right? It is quite out of date so I would recommend checking the source code out ...
I checked the code of `android-flowtextview` and they have the text size **hardcoded** (check line 131 **[here](https://code.google.com/p/android-flowtextview/source/browse/trunk/src/com/pagesuite/flowtext/FlowTextView.java)**). You have to change their source code or use the public method `setTextSize(int)`. Also, **...
20,706,534
I found a library which allows an app to wrap text around an image - however once implemented it changed the size of my text - how can the text size be increase when using this library? `android:textSize=` has no impact on the text size. Neither does: ``` FlowTextView titleTv = (FlowTextView) findViewById(R.id.tit...
2013/12/20
[ "https://Stackoverflow.com/questions/20706534", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3113035/" ]
In the short term a call to invalidate will probably get it working: ``` FlowTextView titleTv = (FlowTextView) findViewById(R.id.titleTv); titleTv.setTextSize(20); titleTv.invalidate(); ``` However, I suspect you are using the JAR file right? It is quite out of date so I would recommend checking the source code out ...
<https://code.google.com/p/android-flowtextview/source/browse/trunk/src/com/pagesuite/flowtext/FlowTextView.java> There's a 'setTextSize(int)' method that should do exactly what you're looking for. If you want to set it from XML, it's a little more involved. Since FlowTextView's constructors ignore the AttributeSet ...
4,629,776
Can a Foursquare checkin function be added onto a website?
2011/01/07
[ "https://Stackoverflow.com/questions/4629776", "https://Stackoverflow.com", "https://Stackoverflow.com/users/535585/" ]
Although you can provide check-in capability on a web site, please use caution and realize that it may be difficult to comply with the appropriate Foursquare API requirements. (Poster amelvin is correct that the API you need is at <http://developer.foursquare.com/>) However keep in mind: * You need to find an accura...
Use the [foursquare api](http://developer.foursquare.com/) to add foursquare checkin to your site.
20,092,212
I am new to Web GIS mapping, I am interested to learn about WEB GIS and what are the skills needed. I Know Arcgis Desktop, FME, VBA, Microstation and Autocad. Please guide me.
2013/11/20
[ "https://Stackoverflow.com/questions/20092212", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3012320/" ]
As you are interested in ArcGIS, I would recommend you get familiar with the ArcGIS developer site: <https://developers.arcgis.com/en/documentation/>. In particular, I recommend the Javascript API documentation. The are also APIs for Silverlight and Flex but interest in these is dying out in favour of Javascript. Reme...
Maybe first you should start using the internets ... and find even more help here: <https://gis.stackexchange.com/>
20,092,212
I am new to Web GIS mapping, I am interested to learn about WEB GIS and what are the skills needed. I Know Arcgis Desktop, FME, VBA, Microstation and Autocad. Please guide me.
2013/11/20
[ "https://Stackoverflow.com/questions/20092212", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3012320/" ]
Quite an open ended question but really depends what you want it for? Career wise lots of organisations use Arc Server, but lots of people are going open now and Mapserver, Geoserver and Mapnik are all technologies I would seriously look at. Learning about the OGC protocols is a good start, i.e WFS, WMS etc. Open la...
Maybe first you should start using the internets ... and find even more help here: <https://gis.stackexchange.com/>
20,092,212
I am new to Web GIS mapping, I am interested to learn about WEB GIS and what are the skills needed. I Know Arcgis Desktop, FME, VBA, Microstation and Autocad. Please guide me.
2013/11/20
[ "https://Stackoverflow.com/questions/20092212", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3012320/" ]
**BASIC** * Knowledge about web development (Client: HTML, JS, CSS/ Server: Python, NodeJS, etc.): you can learn from the various resources. * Knowledge about GIS data (2D GIS: Shapefile, GeoJSON, etc. | 3D GIS: CityGML, 3D Tiles, I3S) and where to get them (e.g. [Get data from OpenStreetMap](https://towardsdatascienc...
Maybe first you should start using the internets ... and find even more help here: <https://gis.stackexchange.com/>
20,092,212
I am new to Web GIS mapping, I am interested to learn about WEB GIS and what are the skills needed. I Know Arcgis Desktop, FME, VBA, Microstation and Autocad. Please guide me.
2013/11/20
[ "https://Stackoverflow.com/questions/20092212", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3012320/" ]
As you are interested in ArcGIS, I would recommend you get familiar with the ArcGIS developer site: <https://developers.arcgis.com/en/documentation/>. In particular, I recommend the Javascript API documentation. The are also APIs for Silverlight and Flex but interest in these is dying out in favour of Javascript. Reme...
Quite an open ended question but really depends what you want it for? Career wise lots of organisations use Arc Server, but lots of people are going open now and Mapserver, Geoserver and Mapnik are all technologies I would seriously look at. Learning about the OGC protocols is a good start, i.e WFS, WMS etc. Open la...
20,092,212
I am new to Web GIS mapping, I am interested to learn about WEB GIS and what are the skills needed. I Know Arcgis Desktop, FME, VBA, Microstation and Autocad. Please guide me.
2013/11/20
[ "https://Stackoverflow.com/questions/20092212", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3012320/" ]
As you are interested in ArcGIS, I would recommend you get familiar with the ArcGIS developer site: <https://developers.arcgis.com/en/documentation/>. In particular, I recommend the Javascript API documentation. The are also APIs for Silverlight and Flex but interest in these is dying out in favour of Javascript. Reme...
**BASIC** * Knowledge about web development (Client: HTML, JS, CSS/ Server: Python, NodeJS, etc.): you can learn from the various resources. * Knowledge about GIS data (2D GIS: Shapefile, GeoJSON, etc. | 3D GIS: CityGML, 3D Tiles, I3S) and where to get them (e.g. [Get data from OpenStreetMap](https://towardsdatascienc...
20,092,212
I am new to Web GIS mapping, I am interested to learn about WEB GIS and what are the skills needed. I Know Arcgis Desktop, FME, VBA, Microstation and Autocad. Please guide me.
2013/11/20
[ "https://Stackoverflow.com/questions/20092212", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3012320/" ]
As you are interested in ArcGIS, I would recommend you get familiar with the ArcGIS developer site: <https://developers.arcgis.com/en/documentation/>. In particular, I recommend the Javascript API documentation. The are also APIs for Silverlight and Flex but interest in these is dying out in favour of Javascript. Reme...
if you use Arcmap you will certainly be able to use QGIS, the open source version to manage the same cartographic data you use with Arcmap. Just install the qgis2web plugin to produce a webgis instantly without spending money on licenses. A complete guide here <http://www.qgistutorials.com/en/docs/3/web_mapping_with_qg...
20,092,212
I am new to Web GIS mapping, I am interested to learn about WEB GIS and what are the skills needed. I Know Arcgis Desktop, FME, VBA, Microstation and Autocad. Please guide me.
2013/11/20
[ "https://Stackoverflow.com/questions/20092212", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3012320/" ]
Quite an open ended question but really depends what you want it for? Career wise lots of organisations use Arc Server, but lots of people are going open now and Mapserver, Geoserver and Mapnik are all technologies I would seriously look at. Learning about the OGC protocols is a good start, i.e WFS, WMS etc. Open la...
if you use Arcmap you will certainly be able to use QGIS, the open source version to manage the same cartographic data you use with Arcmap. Just install the qgis2web plugin to produce a webgis instantly without spending money on licenses. A complete guide here <http://www.qgistutorials.com/en/docs/3/web_mapping_with_qg...
20,092,212
I am new to Web GIS mapping, I am interested to learn about WEB GIS and what are the skills needed. I Know Arcgis Desktop, FME, VBA, Microstation and Autocad. Please guide me.
2013/11/20
[ "https://Stackoverflow.com/questions/20092212", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3012320/" ]
**BASIC** * Knowledge about web development (Client: HTML, JS, CSS/ Server: Python, NodeJS, etc.): you can learn from the various resources. * Knowledge about GIS data (2D GIS: Shapefile, GeoJSON, etc. | 3D GIS: CityGML, 3D Tiles, I3S) and where to get them (e.g. [Get data from OpenStreetMap](https://towardsdatascienc...
if you use Arcmap you will certainly be able to use QGIS, the open source version to manage the same cartographic data you use with Arcmap. Just install the qgis2web plugin to produce a webgis instantly without spending money on licenses. A complete guide here <http://www.qgistutorials.com/en/docs/3/web_mapping_with_qg...
3,917,890
Simple question, rewriting $e^x$ with $x$ as the base- or more generally, trying to remove $x$ from the exponent. I don't know if it's possible, as I played around with it for a little while and got nothing. If it is, I suspect it has something to do with the Lambert W function. If it's not possible, is there an intuit...
2020/11/22
[ "https://math.stackexchange.com/questions/3917890", "https://math.stackexchange.com", "https://math.stackexchange.com/users/803840/" ]
There's no $y$ such that $e^x = x^y$ for all $x$, because in the long term, the exponential beats **any** polynomial. One way to see it, is when defining the exponential as a power series: $e^x := \displaystyle\sum\_{n \geq 0} \dfrac{x^n}{n!}$. In particular, if the expression you're trying to simplify has $x \approx ...
$$e^0=1\text{ vs. }0^y=0$$ precludes any solution of the form $$e^x=x^y.$$ (And as shown by @nala, no polynomial can do. We can also add that no fractional polynomial can do. Furthermore, it is know that $e^x=1+x+\frac{x^2}2+\frac{x^2}{3!}+\cdots$ with an infinity of terms.) --- The equation $$e^x=x^y$$ is simply s...
25,446,281
I am trying to get the object count and key counts for that json. I have tried to use count() function, it returns 2. ``` $data = json_decode($json, true); echo count($data); ``` I want to get **2** for object count and **22** as each object's key count. ``` [ { "name" : "EF", "OrganizationID" ...
2014/08/22
[ "https://Stackoverflow.com/questions/25446281", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1494102/" ]
One approach ``` <?php $data = json_decode($json, true); echo count($data); echo count($data[0]); ``` or another one ``` echo count($data); foreach($data as $o){ echo count($o); } ```
Subelement count: ``` echo sizeof($data, COUNT_RECURSIVE) - sizeof($data); ``` Element count: ``` echo sizeof($data); ```
25,446,281
I am trying to get the object count and key counts for that json. I have tried to use count() function, it returns 2. ``` $data = json_decode($json, true); echo count($data); ``` I want to get **2** for object count and **22** as each object's key count. ``` [ { "name" : "EF", "OrganizationID" ...
2014/08/22
[ "https://Stackoverflow.com/questions/25446281", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1494102/" ]
One approach ``` <?php $data = json_decode($json, true); echo count($data); echo count($data[0]); ``` or another one ``` echo count($data); foreach($data as $o){ echo count($o); } ```
``` echo "Object Count = ".$sizeof($data)."<br/>"; foreach($data as $key=>$arr) { echo "Key - ".$key." Count = ".$sizeof($arr)."<br/>"; } ```
25,446,281
I am trying to get the object count and key counts for that json. I have tried to use count() function, it returns 2. ``` $data = json_decode($json, true); echo count($data); ``` I want to get **2** for object count and **22** as each object's key count. ``` [ { "name" : "EF", "OrganizationID" ...
2014/08/22
[ "https://Stackoverflow.com/questions/25446281", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1494102/" ]
Subelement count: ``` echo sizeof($data, COUNT_RECURSIVE) - sizeof($data); ``` Element count: ``` echo sizeof($data); ```
``` echo "Object Count = ".$sizeof($data)."<br/>"; foreach($data as $key=>$arr) { echo "Key - ".$key." Count = ".$sizeof($arr)."<br/>"; } ```
4,041,017
Let $f(x)=\sin\left(\frac{1}{x}\right)$ if $0<x\le1$ and $f(x)=0$ if $x=0$. Show that $f$ is Riemann integrable on $[0,1]$ and calculate it's integral on $[0,1]$. I would like to know if my proof holds, please. And, I would like have a hint on how we can calculate the intergal of this such of functions, please. My at...
2021/02/26
[ "https://math.stackexchange.com/questions/4041017", "https://math.stackexchange.com", "https://math.stackexchange.com/users/691131/" ]
This is about feedback on your proof. Your goal is to find a partition $\sigma$ such that $\overline{S}\_{\sigma} (f) <\underline{S} \_{\sigma} (f) +\epsilon $ but instead you are trying to use that $f$ is integrable on $[\epsilon/2,1]$ and prove that $f$ is integrable on $[0,\epsilon/2]$. This is not what you want. ...
Integrate by parts $$\int \sin \left(\frac{1}{x}\right) \, dx=x\sin \left(\frac{1}{x}\right) -\int x \left(-\frac{1}{x^2}\right)\cos \left(\frac{1}{x}\right)\,dx=$$ $$=x \sin \left(\frac{1}{x}\right)-\text{Ci}\left(\frac{1}{x}\right)+C$$ Ci is cosine integral $$\text{Ci}(x)=-\int\_x^{\infty}\frac{\cos x}{x}$$ $$\int\_...
57,352,312
I am very new to `MongoDB`. I want to create an array of date. I am using mongoose with node.js. Below is what I think. Please, will the datatype be saved as date? Thanks. ``` date: { type: Array, default: Date.now } ```
2019/08/05
[ "https://Stackoverflow.com/questions/57352312", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10966017/" ]
It happens that I find the answer myself after research. For anyone that might need it again, the correct way is: `date: [Date]` A better explanation is found on Mongoose site : [Mongoose Link](https://mongoosejs.com/docs/schematypes.html)
default value will be Array if type is set as Array ``` date: { type: Array, default: [Date] } ```
57,352,312
I am very new to `MongoDB`. I want to create an array of date. I am using mongoose with node.js. Below is what I think. Please, will the datatype be saved as date? Thanks. ``` date: { type: Array, default: Date.now } ```
2019/08/05
[ "https://Stackoverflow.com/questions/57352312", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10966017/" ]
it should be like :- date: { type: Array, default: [Date] }
default value will be Array if type is set as Array ``` date: { type: Array, default: [Date] } ```
57,352,312
I am very new to `MongoDB`. I want to create an array of date. I am using mongoose with node.js. Below is what I think. Please, will the datatype be saved as date? Thanks. ``` date: { type: Array, default: Date.now } ```
2019/08/05
[ "https://Stackoverflow.com/questions/57352312", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10966017/" ]
It happens that I find the answer myself after research. For anyone that might need it again, the correct way is: `date: [Date]` A better explanation is found on Mongoose site : [Mongoose Link](https://mongoosejs.com/docs/schematypes.html)
it should be like :- date: { type: Array, default: [Date] }
21,354,203
``` <a id="f_post_button" href="javascript:toggle_hide('f_post_button','f_postbox','post');"> <button class="btn btn-hg btn-primary">Make a Post</button> </a> ``` This is working fine for me in safari and chrome, but in IE and Firefox it just opens a blank page. Is there any alternative way to do it?
2014/01/25
[ "https://Stackoverflow.com/questions/21354203", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1232881/" ]
add void method to resolve this ``` <a id="f_post_button" href="javascript:void(toggle_hide('f_post_button','f_postbox','post'));"> <button class="btn btn-hg btn-primary">Make a Post</button> ```
What is saying Quentin is something like this : ```html <button id="my-button" class="btn btn-hg btn-primary">Make a Post</button> ``` ```js var myButton = document.getElementById("my-button"); myButton.click = function (f_post_button,f_postbox,post){ //do your stuff for toggle here } ```
21,354,203
``` <a id="f_post_button" href="javascript:toggle_hide('f_post_button','f_postbox','post');"> <button class="btn btn-hg btn-primary">Make a Post</button> </a> ``` This is working fine for me in safari and chrome, but in IE and Firefox it just opens a blank page. Is there any alternative way to do it?
2014/01/25
[ "https://Stackoverflow.com/questions/21354203", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1232881/" ]
If it is a button you don't need to use href you can use onclick Try this: ``` <button class="btn btn-hg btn-primary" onclick="toggle_hide('f_post_button','f_postbox','post')">Make a Post</button> ``` <http://www.w3schools.com/js/tryit.asp?filename=tryjs_function3>
add void method to resolve this ``` <a id="f_post_button" href="javascript:void(toggle_hide('f_post_button','f_postbox','post'));"> <button class="btn btn-hg btn-primary">Make a Post</button> ```
21,354,203
``` <a id="f_post_button" href="javascript:toggle_hide('f_post_button','f_postbox','post');"> <button class="btn btn-hg btn-primary">Make a Post</button> </a> ``` This is working fine for me in safari and chrome, but in IE and Firefox it just opens a blank page. Is there any alternative way to do it?
2014/01/25
[ "https://Stackoverflow.com/questions/21354203", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1232881/" ]
If it is a button you don't need to use href you can use onclick Try this: ``` <button class="btn btn-hg btn-primary" onclick="toggle_hide('f_post_button','f_postbox','post')">Make a Post</button> ``` <http://www.w3schools.com/js/tryit.asp?filename=tryjs_function3>
What is saying Quentin is something like this : ```html <button id="my-button" class="btn btn-hg btn-primary">Make a Post</button> ``` ```js var myButton = document.getElementById("my-button"); myButton.click = function (f_post_button,f_postbox,post){ //do your stuff for toggle here } ```
64,526,527
I have a string in ruby, let's say `"hello, I am a string, I am surrounded by quotes"` and I want to replace all words ( separated by a space ) which don't match a RegExp pattern, lets say `/.+?s/` with `"foo"`. so the result would be `"foo foo foo foo string, foo foo surrounded foo quotes"` since words have ...
2020/10/25
[ "https://Stackoverflow.com/questions/64526527", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11787079/" ]
I would avoid using an array: Use a @key on each row. Note: I did not know the type of EntAddModelsList so I used object. Change this to the item type. ``` @foreach (var entAddModel in Arae.EntAddModelsList) { <tr @key="entAddModel"> ... <td>@entAddModel.Label</td> // more concise than Arae.EntAddModelsLis...
first off, you must define a local varaible in your loop like this: ``` @for (int i = 0; i < Arae.EntAddModelsList.Count(); i++) { var local = i; } ``` And use it instead of i in the lambda expression; As for your question: define your anchor element like this: ``` <a href="" id="@i" class="btn btn-p...
44,366,227
I am trying to make utils for performing network operations in `kotlin`. I have below code where the primary constructor is taking `Command` and `Context`. I am unable to access command variable in `command.execute(JSONObject(jsonObj))`, getting below error. I am not sure what is causing an issue? > > Unresolved re...
2017/06/05
[ "https://Stackoverflow.com/questions/44366227", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2455259/" ]
A companion object is not part of an instance of a class. You can't access members from a companion object, just like in Java you can't access members from a static method. Instead, don't use a companion object: ``` class AsyncService(val command: Command, val context: Context) { fun doGet(request: String) { ...
You should pass arguments directly to your companion object function: ``` class AsyncService { companion object { fun doGet(command: Command, context: Context, request: String) { doAsync { val jsonObj = java.net.URL(request).readText() command.execute(JSONObject...
42,252
I am referring to a set of words that wouldn't make sense if one word or the other was omitted. Like *barbershop quartet*, or *Cyber Security*. What do you exactly call this set of words?
2011/09/18
[ "https://english.stackexchange.com/questions/42252", "https://english.stackexchange.com", "https://english.stackexchange.com/users/11171/" ]
A *collocation* is also an option, though the meaning is broader than requested. > > In corpus linguistics, collocation defines a sequence of words or terms that co-occur more often than would be expected by chance. > > > A pair or group of words that are juxtaposed in such a way > > > * “strong coffee” and “heav...
A phrase. > > Noun: A small group of words standing together as a conceptual unit, typically forming a component of a clause. > > >
42,252
I am referring to a set of words that wouldn't make sense if one word or the other was omitted. Like *barbershop quartet*, or *Cyber Security*. What do you exactly call this set of words?
2011/09/18
[ "https://english.stackexchange.com/questions/42252", "https://english.stackexchange.com", "https://english.stackexchange.com/users/11171/" ]
A *collocation* is also an option, though the meaning is broader than requested. > > In corpus linguistics, collocation defines a sequence of words or terms that co-occur more often than would be expected by chance. > > > A pair or group of words that are juxtaposed in such a way > > > * “strong coffee” and “heav...
This phenomenon is called a > > **stormy petrel** > > > which is both the name of the kind of bird and the name of the linguistic phenomenon because there is no such thing as a petrel of any other kind other than 'stormy'. There are [a number of examples here](http://www.satiche.org.uk/satiche/sat-0342.htm) It...
42,252
I am referring to a set of words that wouldn't make sense if one word or the other was omitted. Like *barbershop quartet*, or *Cyber Security*. What do you exactly call this set of words?
2011/09/18
[ "https://english.stackexchange.com/questions/42252", "https://english.stackexchange.com", "https://english.stackexchange.com/users/11171/" ]
A *collocation* is also an option, though the meaning is broader than requested. > > In corpus linguistics, collocation defines a sequence of words or terms that co-occur more often than would be expected by chance. > > > A pair or group of words that are juxtaposed in such a way > > > * “strong coffee” and “heav...
The label for the concept that you are looking for is a > > **set phrase** > > > or > > **idiom** > > > a phrase, collocation, locution (a sequence of words) that has more meaning to it than the combination of meanings of its constituents. That is, the literal meaning of its parts does not give the meaning ...
6,198,092
I am using SQLite.NET with C#[ visual studio 2008] and added the 'System.Data.SQLite.dll' as reference. The following code works with Windows Application for fetching data from my database file into a datagrid. ``` private void SetConnection() { sql_con = new SQLiteConnection("Data Source=emp.db;Versio...
2011/06/01
[ "https://Stackoverflow.com/questions/6198092", "https://Stackoverflow.com", "https://Stackoverflow.com/users/711140/" ]
I'm not sure if this is what is causing your issue, but we've had issues in the past with mobile devices and sqlite where this solved it: For an application using the compact framework, you need to include SQLite.Interop.xxx.DLL in your project (in addition to the regular System.Data.SQLite.DLL). Make sure you set the...
``` sql_con = new SQLiteConnection("Data Source=emp.db;Version=3;"); ``` I think you need to specify the full path here, and make sure it's correct. If the path is to a non-existent file, it will create a new emp.db database file there instead. This new file will obviously be empty and without any tables, hence it wo...
6,198,092
I am using SQLite.NET with C#[ visual studio 2008] and added the 'System.Data.SQLite.dll' as reference. The following code works with Windows Application for fetching data from my database file into a datagrid. ``` private void SetConnection() { sql_con = new SQLiteConnection("Data Source=emp.db;Versio...
2011/06/01
[ "https://Stackoverflow.com/questions/6198092", "https://Stackoverflow.com", "https://Stackoverflow.com/users/711140/" ]
Thank You Guys, I've resolved the Problem. As 'siyw' said, the problem was the application could not find the "db file". **For windows application,** The db file has to be located in debug folder where the .exe file is generated. So that, no need to specify the path of the DB file. **For Smart Device Application,*...
I'm not sure if this is what is causing your issue, but we've had issues in the past with mobile devices and sqlite where this solved it: For an application using the compact framework, you need to include SQLite.Interop.xxx.DLL in your project (in addition to the regular System.Data.SQLite.DLL). Make sure you set the...
6,198,092
I am using SQLite.NET with C#[ visual studio 2008] and added the 'System.Data.SQLite.dll' as reference. The following code works with Windows Application for fetching data from my database file into a datagrid. ``` private void SetConnection() { sql_con = new SQLiteConnection("Data Source=emp.db;Versio...
2011/06/01
[ "https://Stackoverflow.com/questions/6198092", "https://Stackoverflow.com", "https://Stackoverflow.com/users/711140/" ]
Thank You Guys, I've resolved the Problem. As 'siyw' said, the problem was the application could not find the "db file". **For windows application,** The db file has to be located in debug folder where the .exe file is generated. So that, no need to specify the path of the DB file. **For Smart Device Application,*...
``` sql_con = new SQLiteConnection("Data Source=emp.db;Version=3;"); ``` I think you need to specify the full path here, and make sure it's correct. If the path is to a non-existent file, it will create a new emp.db database file there instead. This new file will obviously be empty and without any tables, hence it wo...
38,305
by the etymology of his name, he should be fair-skinned: > > Proto-IE: \*arg'-/\*e- > Meaning: white, brilliant > Hittite: harki- `weiss, hell' (Tischler 177) > Tokharian: A ārki, B arkwi weiss (PT *ārkw(ä)i) (Adams 49-50) > Old Indian: árjuna-`white, clear' > Avestan: arǝzah- n. `Nachmitteg und Abend' (Bed. f...
2020/02/21
[ "https://hinduism.stackexchange.com/questions/38305", "https://hinduism.stackexchange.com", "https://hinduism.stackexchange.com/users/12489/" ]
His being "Arjuna" seems metaphorical (brilliant, rather than white) and in actuality he was dark-skinned: <https://www.sacred-texts.com/hin/m04/m04044.htm> > > "Arjuna said, 'I am Arjuna, called also Partha. Thy father's courtier is Yudhishthira and thy father's cook Vallava is Bhimasena, the groom of horses is Nak...
Mahabharata gives the following description of the Pandava brothers. It does not say if Arjuna was fair or dark. > > Thus addressed, Draupadi replied, ‘Having done this violent deed to > shorten thy life, what will it avail thee now, O fool, to know the > names of these great warriors, for, now, that my heroic husb...
1,417,673
In Analysis, I learned that any number system satisfying all the axioms (commutativity, associativity, identity elements, invertibility, distributivity) is called a field. Then the professor mentioned that the set {0, 1} = F is also a field. Then he drew this: + 0 1 0 0 1 1 1 0 My question is why is 1 + 1 =...
2015/09/01
[ "https://math.stackexchange.com/questions/1417673", "https://math.stackexchange.com", "https://math.stackexchange.com/users/-1/" ]
This is known as the finite field $\mathbb{F}\_2$. Here, we are thinking of doing the operations "[mod](https://en.wikipedia.org/wiki/Modular_arithmetic) 2". Let's look at the field axioms your professor gave: using the addition table he wrote out, we can show that the addition he defines is commutative, associative, a...
In the definition of a field, by "$0$ or $1$" we don't mean the *numbers* $0$ or $1$, we mean the the elements $0$ or $1$ which are the identity elements for addition and multiplication respectively. A field, I repeat, need not have numbers in it and $0$ and $1$ should not be interpreted as numbers.
1,417,673
In Analysis, I learned that any number system satisfying all the axioms (commutativity, associativity, identity elements, invertibility, distributivity) is called a field. Then the professor mentioned that the set {0, 1} = F is also a field. Then he drew this: + 0 1 0 0 1 1 1 0 My question is why is 1 + 1 =...
2015/09/01
[ "https://math.stackexchange.com/questions/1417673", "https://math.stackexchange.com", "https://math.stackexchange.com/users/-1/" ]
This is known as the finite field $\mathbb{F}\_2$. Here, we are thinking of doing the operations "[mod](https://en.wikipedia.org/wiki/Modular_arithmetic) 2". Let's look at the field axioms your professor gave: using the addition table he wrote out, we can show that the addition he defines is commutative, associative, a...
If you interpret these elements as representing the parity of an integer $o$ for ‘even’, for ‘odd’, $1+1=0$ just means odd $+$ odd $=$ even.
2,051,036
I posted this on GAE for Java group, but I hope to get some answers here quicker :) I decided to do some long-run performance tests on my application. I created some small client hitting app every 5-30 minutes and I run 3-5 of threads with such client. I noticed huge differenced in response times and started to inves...
2010/01/12
[ "https://Stackoverflow.com/questions/2051036", "https://Stackoverflow.com", "https://Stackoverflow.com/users/86723/" ]
Use the new [precompilation](http://googleappengine.blogspot.com/2009/12/request-performance-in-java.html) feature. ``` <!-- appengine-web.xml --> <precompilation-enabled>true</precompilation-enabled> ```
This is definitely a tricky issue with AppEngine applications. The purists will tell you to look at why your application takes so long to start up and work backwards from there. In your case, the answer is obvious: you are using Spring, and it has to load many class files and instantiate many objects. The pragmatic an...
2,051,036
I posted this on GAE for Java group, but I hope to get some answers here quicker :) I decided to do some long-run performance tests on my application. I created some small client hitting app every 5-30 minutes and I run 3-5 of threads with such client. I noticed huge differenced in response times and started to inves...
2010/01/12
[ "https://Stackoverflow.com/questions/2051036", "https://Stackoverflow.com", "https://Stackoverflow.com/users/86723/" ]
I know of some people having a keep-alive thing running in order to have an instance of their app always running. I mean, have a client that sends a request every X seconds so your app doesn't get recycled. This is a quick thing to implement but seems to go against the spirit of the platform. Make your numbers and che...
in case folks live in AE-land and want a quick-and-dirty keep-alive pinger, this one works like a charm (windows): <http://www.coretechnologies.com/products/http-ping/>
2,051,036
I posted this on GAE for Java group, but I hope to get some answers here quicker :) I decided to do some long-run performance tests on my application. I created some small client hitting app every 5-30 minutes and I run 3-5 of threads with such client. I noticed huge differenced in response times and started to inves...
2010/01/12
[ "https://Stackoverflow.com/questions/2051036", "https://Stackoverflow.com", "https://Stackoverflow.com/users/86723/" ]
What would be good is if we could serialize the `DispatcherServlet` to the memcache, and then deserialize it from the memcache on a cold start if it is there. Then the instantiation of Spring would be really short. `DispatcherServlet` is already marked as `Serializable`, we just need to find a way to serialize the `We...
[SDK 1.4.0](http://groups.google.com/group/google-appengine/browse_thread/thread/0f90ef8dda3b8400) has this new feature: > > * Developers can now enable Warmup Requests. By specifying a handler in > an app's appengine-web.xml, App > Engine will attempt to to send a > Warmup Request to initialize new > instances b...
2,051,036
I posted this on GAE for Java group, but I hope to get some answers here quicker :) I decided to do some long-run performance tests on my application. I created some small client hitting app every 5-30 minutes and I run 3-5 of threads with such client. I noticed huge differenced in response times and started to inves...
2010/01/12
[ "https://Stackoverflow.com/questions/2051036", "https://Stackoverflow.com", "https://Stackoverflow.com/users/86723/" ]
[SDK 1.4.0](http://groups.google.com/group/google-appengine/browse_thread/thread/0f90ef8dda3b8400) has this new feature: > > * Developers can now enable Warmup Requests. By specifying a handler in > an app's appengine-web.xml, App > Engine will attempt to to send a > Warmup Request to initialize new > instances b...
This is definitely a tricky issue with AppEngine applications. The purists will tell you to look at why your application takes so long to start up and work backwards from there. In your case, the answer is obvious: you are using Spring, and it has to load many class files and instantiate many objects. The pragmatic an...
2,051,036
I posted this on GAE for Java group, but I hope to get some answers here quicker :) I decided to do some long-run performance tests on my application. I created some small client hitting app every 5-30 minutes and I run 3-5 of threads with such client. I noticed huge differenced in response times and started to inves...
2010/01/12
[ "https://Stackoverflow.com/questions/2051036", "https://Stackoverflow.com", "https://Stackoverflow.com/users/86723/" ]
I know of some people having a keep-alive thing running in order to have an instance of their app always running. I mean, have a client that sends a request every X seconds so your app doesn't get recycled. This is a quick thing to implement but seems to go against the spirit of the platform. Make your numbers and che...
Use the new [precompilation](http://googleappengine.blogspot.com/2009/12/request-performance-in-java.html) feature. ``` <!-- appengine-web.xml --> <precompilation-enabled>true</precompilation-enabled> ```
2,051,036
I posted this on GAE for Java group, but I hope to get some answers here quicker :) I decided to do some long-run performance tests on my application. I created some small client hitting app every 5-30 minutes and I run 3-5 of threads with such client. I noticed huge differenced in response times and started to inves...
2010/01/12
[ "https://Stackoverflow.com/questions/2051036", "https://Stackoverflow.com", "https://Stackoverflow.com/users/86723/" ]
Use the new [precompilation](http://googleappengine.blogspot.com/2009/12/request-performance-in-java.html) feature. ``` <!-- appengine-web.xml --> <precompilation-enabled>true</precompilation-enabled> ```
in case folks live in AE-land and want a quick-and-dirty keep-alive pinger, this one works like a charm (windows): <http://www.coretechnologies.com/products/http-ping/>
2,051,036
I posted this on GAE for Java group, but I hope to get some answers here quicker :) I decided to do some long-run performance tests on my application. I created some small client hitting app every 5-30 minutes and I run 3-5 of threads with such client. I noticed huge differenced in response times and started to inves...
2010/01/12
[ "https://Stackoverflow.com/questions/2051036", "https://Stackoverflow.com", "https://Stackoverflow.com/users/86723/" ]
I know of some people having a keep-alive thing running in order to have an instance of their app always running. I mean, have a client that sends a request every X seconds so your app doesn't get recycled. This is a quick thing to implement but seems to go against the spirit of the platform. Make your numbers and che...
[SDK 1.4.0](http://groups.google.com/group/google-appengine/browse_thread/thread/0f90ef8dda3b8400) has this new feature: > > * Developers can now enable Warmup Requests. By specifying a handler in > an app's appengine-web.xml, App > Engine will attempt to to send a > Warmup Request to initialize new > instances b...
2,051,036
I posted this on GAE for Java group, but I hope to get some answers here quicker :) I decided to do some long-run performance tests on my application. I created some small client hitting app every 5-30 minutes and I run 3-5 of threads with such client. I noticed huge differenced in response times and started to inves...
2010/01/12
[ "https://Stackoverflow.com/questions/2051036", "https://Stackoverflow.com", "https://Stackoverflow.com/users/86723/" ]
in case folks live in AE-land and want a quick-and-dirty keep-alive pinger, this one works like a charm (windows): <http://www.coretechnologies.com/products/http-ping/>
This is definitely a tricky issue with AppEngine applications. The purists will tell you to look at why your application takes so long to start up and work backwards from there. In your case, the answer is obvious: you are using Spring, and it has to load many class files and instantiate many objects. The pragmatic an...
2,051,036
I posted this on GAE for Java group, but I hope to get some answers here quicker :) I decided to do some long-run performance tests on my application. I created some small client hitting app every 5-30 minutes and I run 3-5 of threads with such client. I noticed huge differenced in response times and started to inves...
2010/01/12
[ "https://Stackoverflow.com/questions/2051036", "https://Stackoverflow.com", "https://Stackoverflow.com/users/86723/" ]
What would be good is if we could serialize the `DispatcherServlet` to the memcache, and then deserialize it from the memcache on a cold start if it is there. Then the instantiation of Spring would be really short. `DispatcherServlet` is already marked as `Serializable`, we just need to find a way to serialize the `We...
in case folks live in AE-land and want a quick-and-dirty keep-alive pinger, this one works like a charm (windows): <http://www.coretechnologies.com/products/http-ping/>
2,051,036
I posted this on GAE for Java group, but I hope to get some answers here quicker :) I decided to do some long-run performance tests on my application. I created some small client hitting app every 5-30 minutes and I run 3-5 of threads with such client. I noticed huge differenced in response times and started to inves...
2010/01/12
[ "https://Stackoverflow.com/questions/2051036", "https://Stackoverflow.com", "https://Stackoverflow.com/users/86723/" ]
Use the new [precompilation](http://googleappengine.blogspot.com/2009/12/request-performance-in-java.html) feature. ``` <!-- appengine-web.xml --> <precompilation-enabled>true</precompilation-enabled> ```
[SDK 1.4.0](http://groups.google.com/group/google-appengine/browse_thread/thread/0f90ef8dda3b8400) has this new feature: > > * Developers can now enable Warmup Requests. By specifying a handler in > an app's appengine-web.xml, App > Engine will attempt to to send a > Warmup Request to initialize new > instances b...
53,347,830
I have a very simple query like this: ``` SELECT Name FROM Users WHERE Age < 20; ``` I want to implement such a feature: * If the result contains no value, return an empty string ''. * If the result contains only 1 value, return the value. * If the result contains more than 1 value, return a constant string 'Multip...
2018/11/17
[ "https://Stackoverflow.com/questions/53347830", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10665696/" ]
If there is always going to be a double dash `--` you could do this. ``` s = '-2--1' s.replace('--',' -').split(' ') # ['-2', '-1'] ```
Split on the hyphen that comes after a digit: ``` def splitrange(s): return re.split(r'(?<=\d)-', s) ``` Demo: ``` >>> splitrange('-2--5') ['-2', '-5'] >>> splitrange('-2-5') ['-2', '5'] >>> splitrange('2-5') ['2', '5'] >>> splitrange('2--5') ['2', '-5'] ```
53,347,830
I have a very simple query like this: ``` SELECT Name FROM Users WHERE Age < 20; ``` I want to implement such a feature: * If the result contains no value, return an empty string ''. * If the result contains only 1 value, return the value. * If the result contains more than 1 value, return a constant string 'Multip...
2018/11/17
[ "https://Stackoverflow.com/questions/53347830", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10665696/" ]
If there is always going to be a double dash `--` you could do this. ``` s = '-2--1' s.replace('--',' -').split(' ') # ['-2', '-1'] ```
split the numbers: ``` split= str.split('-') ``` Function to apply negations: ``` def actual(ns, minus=False): if not ns: return n, *rest = ns if n == '': yield from actual(rest, not minus) return yield -int(n) if minus else int(n) yield from actual(rest) ``` And now yo...
53,347,830
I have a very simple query like this: ``` SELECT Name FROM Users WHERE Age < 20; ``` I want to implement such a feature: * If the result contains no value, return an empty string ''. * If the result contains only 1 value, return the value. * If the result contains more than 1 value, return a constant string 'Multip...
2018/11/17
[ "https://Stackoverflow.com/questions/53347830", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10665696/" ]
You could use a regex to find all numbers. ``` >>> import re >>> re.findall(r'-?\d+', '-2--1') ['-2', '-1'] ``` This will work for any characters between numbers. e.g. ``` >>> re.findall(r'-?\d+', '-2---$&234---1') ['-2', '234', '-1'] ``` But it assumes a `-` before a number will make it negative, of course
Split on the hyphen that comes after a digit: ``` def splitrange(s): return re.split(r'(?<=\d)-', s) ``` Demo: ``` >>> splitrange('-2--5') ['-2', '-5'] >>> splitrange('-2-5') ['-2', '5'] >>> splitrange('2-5') ['2', '5'] >>> splitrange('2--5') ['2', '-5'] ```
53,347,830
I have a very simple query like this: ``` SELECT Name FROM Users WHERE Age < 20; ``` I want to implement such a feature: * If the result contains no value, return an empty string ''. * If the result contains only 1 value, return the value. * If the result contains more than 1 value, return a constant string 'Multip...
2018/11/17
[ "https://Stackoverflow.com/questions/53347830", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10665696/" ]
You could use a regex to find all numbers. ``` >>> import re >>> re.findall(r'-?\d+', '-2--1') ['-2', '-1'] ``` This will work for any characters between numbers. e.g. ``` >>> re.findall(r'-?\d+', '-2---$&234---1') ['-2', '234', '-1'] ``` But it assumes a `-` before a number will make it negative, of course
split the numbers: ``` split= str.split('-') ``` Function to apply negations: ``` def actual(ns, minus=False): if not ns: return n, *rest = ns if n == '': yield from actual(rest, not minus) return yield -int(n) if minus else int(n) yield from actual(rest) ``` And now yo...
53,347,830
I have a very simple query like this: ``` SELECT Name FROM Users WHERE Age < 20; ``` I want to implement such a feature: * If the result contains no value, return an empty string ''. * If the result contains only 1 value, return the value. * If the result contains more than 1 value, return a constant string 'Multip...
2018/11/17
[ "https://Stackoverflow.com/questions/53347830", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10665696/" ]
``` import re s = '-1--2' result = [int(d) for d in re.findall(r'-?\d+', s)] ```
Split on the hyphen that comes after a digit: ``` def splitrange(s): return re.split(r'(?<=\d)-', s) ``` Demo: ``` >>> splitrange('-2--5') ['-2', '-5'] >>> splitrange('-2-5') ['-2', '5'] >>> splitrange('2-5') ['2', '5'] >>> splitrange('2--5') ['2', '-5'] ```
53,347,830
I have a very simple query like this: ``` SELECT Name FROM Users WHERE Age < 20; ``` I want to implement such a feature: * If the result contains no value, return an empty string ''. * If the result contains only 1 value, return the value. * If the result contains more than 1 value, return a constant string 'Multip...
2018/11/17
[ "https://Stackoverflow.com/questions/53347830", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10665696/" ]
``` import re s = '-1--2' result = [int(d) for d in re.findall(r'-?\d+', s)] ```
split the numbers: ``` split= str.split('-') ``` Function to apply negations: ``` def actual(ns, minus=False): if not ns: return n, *rest = ns if n == '': yield from actual(rest, not minus) return yield -int(n) if minus else int(n) yield from actual(rest) ``` And now yo...
53,347,830
I have a very simple query like this: ``` SELECT Name FROM Users WHERE Age < 20; ``` I want to implement such a feature: * If the result contains no value, return an empty string ''. * If the result contains only 1 value, return the value. * If the result contains more than 1 value, return a constant string 'Multip...
2018/11/17
[ "https://Stackoverflow.com/questions/53347830", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10665696/" ]
Split on the hyphen that comes after a digit: ``` def splitrange(s): return re.split(r'(?<=\d)-', s) ``` Demo: ``` >>> splitrange('-2--5') ['-2', '-5'] >>> splitrange('-2-5') ['-2', '5'] >>> splitrange('2-5') ['2', '5'] >>> splitrange('2--5') ['2', '-5'] ```
split the numbers: ``` split= str.split('-') ``` Function to apply negations: ``` def actual(ns, minus=False): if not ns: return n, *rest = ns if n == '': yield from actual(rest, not minus) return yield -int(n) if minus else int(n) yield from actual(rest) ``` And now yo...
24,825,054
Through an ajax call, I am procuring URLs which I need to use to change the `src` of an `img`. However this is taking time. Meanwhile i need to show loading or something. How do i check whether `$("#img#).attr("src","http:\\fsomething ");` has loaded the image on the page or not?
2014/07/18
[ "https://Stackoverflow.com/questions/24825054", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3840570/" ]
[`chrome.storage.sync.QUOTA_BYTES_PER_ITEM`](https://developer.chrome.com/extensions/storage#property-sync-QUOTA_BYTES_PER_ITEM) specifies the maximum size in *bytes*. In Chrome, JavaScript strings are encoded as UTF-8. A UTF-8 "character" has a variable byte length, it is either 1 or 2. Your string contains "Бетономе...
``` /** * Count bytes in a UTF-8 string's representation. * * @param {string} * @return {number} */ function byteLength(str) { str = String(str); // force string type return (new TextEncoder('utf-8').encode(str)).length; } ```
48,481,671
I'm writing my first app with Kivy and am using Buildozer to deploy the app to Android. Although my app resumes when I switch between applications, if ever I lock my screen, the app does not resume at all. Is there anything that I'm missing? The documentation seems to refer to this problem as a "bug" from previous ve...
2018/01/27
[ "https://Stackoverflow.com/questions/48481671", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8900412/" ]
You may try to use a built-in sbt shell for compiling sbt projects: [![enter image description here](https://i.stack.imgur.com/fxSxM.png)](https://i.stack.imgur.com/fxSxM.png)
From my experience one reason for this kind of errors is if you have opened the output folder in shell or something like this. It looks like sometimes IDEA tries to delete the whole folder and if it can't do that because the folder is used, it mysteriously results in such a error.
13,373,206
Is there a function in gnuplot which returns the number of columns in a csv file? I can't find anything in the docs, maybe someone can propose a custom made function for this?
2012/11/14
[ "https://Stackoverflow.com/questions/13373206", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1564449/" ]
As of gnuplot4.6, you can make a little hack script to do this. It is certainly not the most efficient, but it is pure gnuplot: ``` #script col_counter.gp col_count=1 good_data=1 while (good_data){ stats "$0" u (valid(col_count)) if ( STATS_max ){ col_count = col_count+1 } else { col_count = col_c...
Assuming this is related to [this question](https://stackoverflow.com/q/13371449/1331399), and that the content of *infile.csv* is: ``` n,John Smith stats,Sam Williams stats,Joe Jackson stats 1,23.4,44.1,35.1 2,32.1,33.5,38.5 3,42.0,42.1,42.1 ``` You could do it like this: *plot.gp* ```gnuplot nc = "`awk -F, 'N...
13,373,206
Is there a function in gnuplot which returns the number of columns in a csv file? I can't find anything in the docs, maybe someone can propose a custom made function for this?
2012/11/14
[ "https://Stackoverflow.com/questions/13373206", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1564449/" ]
Assuming this is related to [this question](https://stackoverflow.com/q/13371449/1331399), and that the content of *infile.csv* is: ``` n,John Smith stats,Sam Williams stats,Joe Jackson stats 1,23.4,44.1,35.1 2,32.1,33.5,38.5 3,42.0,42.1,42.1 ``` You could do it like this: *plot.gp* ```gnuplot nc = "`awk -F, 'N...
Here is an update and an alternative extended retro-workaround: (of course *gnuplot-only*) **Update:** (gnuplot>=5.0.0, Jan 2015) Since gnuplot 5.0.0, there is the variable `STATS_columns` which will tell you the number of columns of the **first unommented** row. ``` stats FILE u 0 nooutput print STATS_columns ``` ...
13,373,206
Is there a function in gnuplot which returns the number of columns in a csv file? I can't find anything in the docs, maybe someone can propose a custom made function for this?
2012/11/14
[ "https://Stackoverflow.com/questions/13373206", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1564449/" ]
As of gnuplot4.6, you can make a little hack script to do this. It is certainly not the most efficient, but it is pure gnuplot: ``` #script col_counter.gp col_count=1 good_data=1 while (good_data){ stats "$0" u (valid(col_count)) if ( STATS_max ){ col_count = col_count+1 } else { col_count = col_c...
Here is an update and an alternative extended retro-workaround: (of course *gnuplot-only*) **Update:** (gnuplot>=5.0.0, Jan 2015) Since gnuplot 5.0.0, there is the variable `STATS_columns` which will tell you the number of columns of the **first unommented** row. ``` stats FILE u 0 nooutput print STATS_columns ``` ...
6,922,891
Given a set of points in the plane `T={a1,a2,...,an}` then `Graphics[Polygon[T]]` will plot the polygon generated by the points. How can I add labels to the polygon's vertices? Have merely the index as a label would be better then nothing. Any ideas?
2011/08/03
[ "https://Stackoverflow.com/questions/6922891", "https://Stackoverflow.com", "https://Stackoverflow.com/users/671013/" ]
``` pts = {{1, 0}, {0, Sqrt[3]}, {-1, 0}}; Graphics[ {{LightGray, Polygon[pts]}, {pts /. {x_, y_} :> Text[Style[{x, y}, Red], {x, y}]}} ] ``` ![enter image description here](https://i.stack.imgur.com/kyRPY.png) To add point also ``` pts = {{1, 0}, {0, Sqrt[3]}, {-1, 0}}; Graphics[ {{LightGray, Polygon[pts]}, ...
[Nasser's version (update)](https://stackoverflow.com/questions/6922891/labeling-vertices-of-a-polygon-in-mathematica/6923030#6923030) uses [pattern matching](http://reference.wolfram.com/mathematica/guide/RulesAndPatterns.html). This one uses [functional programming](http://reference.wolfram.com/mathematica/guide/Func...
6,922,891
Given a set of points in the plane `T={a1,a2,...,an}` then `Graphics[Polygon[T]]` will plot the polygon generated by the points. How can I add labels to the polygon's vertices? Have merely the index as a label would be better then nothing. Any ideas?
2011/08/03
[ "https://Stackoverflow.com/questions/6922891", "https://Stackoverflow.com", "https://Stackoverflow.com/users/671013/" ]
``` pts = {{1, 0}, {0, Sqrt[3]}, {-1, 0}}; Graphics[ {{LightGray, Polygon[pts]}, {pts /. {x_, y_} :> Text[Style[{x, y}, Red], {x, y}]}} ] ``` ![enter image description here](https://i.stack.imgur.com/kyRPY.png) To add point also ``` pts = {{1, 0}, {0, Sqrt[3]}, {-1, 0}}; Graphics[ {{LightGray, Polygon[pts]}, ...
You can leverage the options of `GraphPlot` for this. Example: ``` c = RandomReal[1, {3, 2}] g = GraphPlot[c, VertexLabeling -> True, VertexCoordinateRules -> c]; Graphics[{Polygon@c, g[[1]]}] ``` This way you can also make use of `VertexLabeling -> Tooltip`, or `VertexRenderingFunction` if you want to. If you do n...
6,922,891
Given a set of points in the plane `T={a1,a2,...,an}` then `Graphics[Polygon[T]]` will plot the polygon generated by the points. How can I add labels to the polygon's vertices? Have merely the index as a label would be better then nothing. Any ideas?
2011/08/03
[ "https://Stackoverflow.com/questions/6922891", "https://Stackoverflow.com", "https://Stackoverflow.com/users/671013/" ]
[Nasser's version (update)](https://stackoverflow.com/questions/6922891/labeling-vertices-of-a-polygon-in-mathematica/6923030#6923030) uses [pattern matching](http://reference.wolfram.com/mathematica/guide/RulesAndPatterns.html). This one uses [functional programming](http://reference.wolfram.com/mathematica/guide/Func...
You can leverage the options of `GraphPlot` for this. Example: ``` c = RandomReal[1, {3, 2}] g = GraphPlot[c, VertexLabeling -> True, VertexCoordinateRules -> c]; Graphics[{Polygon@c, g[[1]]}] ``` This way you can also make use of `VertexLabeling -> Tooltip`, or `VertexRenderingFunction` if you want to. If you do n...
10,955,547
The question says it all. I've ever put indexes for columns that I used on WHERE statements for optimization and help sites scale nicely. I'm talking with my co-worker who says it's best to not put those indexes and leave place for optimization when needed. What do you think it's the best practice here?
2012/06/08
[ "https://Stackoverflow.com/questions/10955547", "https://Stackoverflow.com", "https://Stackoverflow.com/users/425741/" ]
The answer, as always, is "it depends". If the WHERE clause uses a column in such a way that indexing is broken, then why bother? You'll want to rewrite those, if possible. Indexes have to be calculated when you INSERT, so there's a cost to be weighed against querying. If you read mostly, then indexing might make se...
I think the best practice here is to put a few indexes in initially, as best-guesses for what indexes will be needed. But after that, you want to actually measure which queries are slow and index those. Maybe your where clauses, or even your entire queries will change as requirements change. This could be as easy as u...
10,955,547
The question says it all. I've ever put indexes for columns that I used on WHERE statements for optimization and help sites scale nicely. I'm talking with my co-worker who says it's best to not put those indexes and leave place for optimization when needed. What do you think it's the best practice here?
2012/06/08
[ "https://Stackoverflow.com/questions/10955547", "https://Stackoverflow.com", "https://Stackoverflow.com/users/425741/" ]
I think the best practice here is to put a few indexes in initially, as best-guesses for what indexes will be needed. But after that, you want to actually measure which queries are slow and index those. Maybe your where clauses, or even your entire queries will change as requirements change. This could be as easy as u...
**No.** It depends on the selectivity of the column. For example, there is no use indexing a column EMPLOYEE.GENDER. Probably not for COLLEGE\_STUDENT.YEAR\_IN\_SCHOOL\_STATUS (4 likely values) either. If there are a few rare values scattered with one or two common values, you could have a partial index. I would defi...
10,955,547
The question says it all. I've ever put indexes for columns that I used on WHERE statements for optimization and help sites scale nicely. I'm talking with my co-worker who says it's best to not put those indexes and leave place for optimization when needed. What do you think it's the best practice here?
2012/06/08
[ "https://Stackoverflow.com/questions/10955547", "https://Stackoverflow.com", "https://Stackoverflow.com/users/425741/" ]
The answer, as always, is "it depends". If the WHERE clause uses a column in such a way that indexing is broken, then why bother? You'll want to rewrite those, if possible. Indexes have to be calculated when you INSERT, so there's a cost to be weighed against querying. If you read mostly, then indexing might make se...
I'd have to say no: It's not a good practice to simply index every column because it happens to appear in a `WHERE` clause. To start with, if you have two columns in a particular `WHERE` clause, you might have a decision as to whether to index both in the same index and which one to be the first column. Just with a si...
10,955,547
The question says it all. I've ever put indexes for columns that I used on WHERE statements for optimization and help sites scale nicely. I'm talking with my co-worker who says it's best to not put those indexes and leave place for optimization when needed. What do you think it's the best practice here?
2012/06/08
[ "https://Stackoverflow.com/questions/10955547", "https://Stackoverflow.com", "https://Stackoverflow.com/users/425741/" ]
The answer, as always, is "it depends". If the WHERE clause uses a column in such a way that indexing is broken, then why bother? You'll want to rewrite those, if possible. Indexes have to be calculated when you INSERT, so there's a cost to be weighed against querying. If you read mostly, then indexing might make se...
**No.** It depends on the selectivity of the column. For example, there is no use indexing a column EMPLOYEE.GENDER. Probably not for COLLEGE\_STUDENT.YEAR\_IN\_SCHOOL\_STATUS (4 likely values) either. If there are a few rare values scattered with one or two common values, you could have a partial index. I would defi...
10,955,547
The question says it all. I've ever put indexes for columns that I used on WHERE statements for optimization and help sites scale nicely. I'm talking with my co-worker who says it's best to not put those indexes and leave place for optimization when needed. What do you think it's the best practice here?
2012/06/08
[ "https://Stackoverflow.com/questions/10955547", "https://Stackoverflow.com", "https://Stackoverflow.com/users/425741/" ]
I'd have to say no: It's not a good practice to simply index every column because it happens to appear in a `WHERE` clause. To start with, if you have two columns in a particular `WHERE` clause, you might have a decision as to whether to index both in the same index and which one to be the first column. Just with a si...
**No.** It depends on the selectivity of the column. For example, there is no use indexing a column EMPLOYEE.GENDER. Probably not for COLLEGE\_STUDENT.YEAR\_IN\_SCHOOL\_STATUS (4 likely values) either. If there are a few rare values scattered with one or two common values, you could have a partial index. I would defi...
39,309,253
I'm using SVG sprite and referencing fragment identifiers in it for CSS background image. The CSS code looks like this: `background: url(sprite.svg#icon-1);`. It works on Firefox/Win7, Google Chrome/Win7, IE11/Win7, IE10/Win8, Firefox/Android 4.4.2, and Google Chrome/Android 4.4.2. However, it does not work on iOS 9.3...
2016/09/03
[ "https://Stackoverflow.com/questions/39309253", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1091014/" ]
[Can I Use](http://caniuse.com/#feat=svg-fragment) tells us that this is not supported on Safari (Mac or iOS). Also note that it wasn't supported on Android browser up to 4.4.4, which are still quite common, and some other browsers have limitations.
I found [a polyfill](https://github.com/preciousforever/SVG-Stacker/blob/master/fixsvgstack.jquery.js) which fixes WebKit browsers' this issue. And it works for me. Please check its [demonstration](https://github.com/preciousforever/SVG-Stacker/blob/master/examples/tango-icon-theme/devices/stack/stack-demo-jsfix.html)...
70,740,246
NestJS URI Versioning for HTTP REST applications can be easily enabled when following the docs [here](https://docs.nestjs.com/techniques/versioning). The docs do however not explain how to make URI versioning optional. **Example:** `/api/v1/users` `/api/v2/users` `/api/users` -> should be mapped to v1 to allow exi...
2022/01/17
[ "https://Stackoverflow.com/questions/70740246", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6853836/" ]
You should use the `VERSION_NEUTRAL` version on `defaultVersion` option like: ```js app.enableVersioning({ type: VersioningType.URI, defaultVersion: [VERSION_NEUTRAL, '1', '2'], }); ``` <https://docs.nestjs.com/techniques/versioning>
**UPDATE:** The following is a hack and results in the global prefix for URI versioning no longer working, please use the accepted answer. **Original Answer:** To make versioning optional, set the versioning prefix to an empty string (default is `v`) and set the versioning string including the prefix explicitly. In...