qid
int64
1
74.7M
question
stringlengths
0
58.3k
date
stringlengths
10
10
metadata
list
response_j
stringlengths
2
48.3k
response_k
stringlengths
2
40.5k
9,740
I work at a very young start-up company. We have had turn-over rates (mass resignation of staff, thrice) in the past but changes in the system have led to a more a stable employee retention and better technical-skilled employees. We do games, and I don't know with other software fields, but the "[death march](http://ar...
2013/02/18
[ "https://workplace.stackexchange.com/questions/9740", "https://workplace.stackexchange.com", "https://workplace.stackexchange.com/users/7817/" ]
The link you included in your question contains really all the information and references you need. Especially the Evan Robinson's well-known paper [Why Crunch Modes Doesn't Work](https://web.archive.org/web/20160304165322/http://www.igda.org/?page=crunchsixlessons), together with the supporting material and references...
Other replies list why it's a bad idea to work extreme hours. Let me focus on a different aspect instead. What you're attempting to do is basically a culture transformation. This is impossible to do without a heavy management sponsorship. You don't just need to *convince* the management. You need to transform them in...
9,740
I work at a very young start-up company. We have had turn-over rates (mass resignation of staff, thrice) in the past but changes in the system have led to a more a stable employee retention and better technical-skilled employees. We do games, and I don't know with other software fields, but the "[death march](http://ar...
2013/02/18
[ "https://workplace.stackexchange.com/questions/9740", "https://workplace.stackexchange.com", "https://workplace.stackexchange.com/users/7817/" ]
The simple answer is to simply begin working 40 hour work weeks and make sure YOU are efficient for those 40 hours. If you aren't already burned out then the results will become apparent fairly quickly. If you are already burned out then 40 hour weeks probably won't make a difference, so keep working your 60-90 hour wo...
**Seems to be working** If you're meeting the deadlines, I don't see how you can justify calling them impossible. Your boss thinks he's the next Steve Jobs. Just push for more-it's really that simple. **Negative Consequences** I haven't found any mention of what happens when deadlines aren't met. Has anyone been fired...
9,740
I work at a very young start-up company. We have had turn-over rates (mass resignation of staff, thrice) in the past but changes in the system have led to a more a stable employee retention and better technical-skilled employees. We do games, and I don't know with other software fields, but the "[death march](http://ar...
2013/02/18
[ "https://workplace.stackexchange.com/questions/9740", "https://workplace.stackexchange.com", "https://workplace.stackexchange.com/users/7817/" ]
The simple answer is to simply begin working 40 hour work weeks and make sure YOU are efficient for those 40 hours. If you aren't already burned out then the results will become apparent fairly quickly. If you are already burned out then 40 hour weeks probably won't make a difference, so keep working your 60-90 hour wo...
Other replies list why it's a bad idea to work extreme hours. Let me focus on a different aspect instead. What you're attempting to do is basically a culture transformation. This is impossible to do without a heavy management sponsorship. You don't just need to *convince* the management. You need to transform them in...
9,740
I work at a very young start-up company. We have had turn-over rates (mass resignation of staff, thrice) in the past but changes in the system have led to a more a stable employee retention and better technical-skilled employees. We do games, and I don't know with other software fields, but the "[death march](http://ar...
2013/02/18
[ "https://workplace.stackexchange.com/questions/9740", "https://workplace.stackexchange.com", "https://workplace.stackexchange.com/users/7817/" ]
**Seems to be working** If you're meeting the deadlines, I don't see how you can justify calling them impossible. Your boss thinks he's the next Steve Jobs. Just push for more-it's really that simple. **Negative Consequences** I haven't found any mention of what happens when deadlines aren't met. Has anyone been fired...
Other replies list why it's a bad idea to work extreme hours. Let me focus on a different aspect instead. What you're attempting to do is basically a culture transformation. This is impossible to do without a heavy management sponsorship. You don't just need to *convince* the management. You need to transform them in...
11,154,289
I'm wanting to change the tab that is open when the app is opened from a push notification. At the moment, I have the app registering the notification in the app delegate and running a method in the 1st view controller: **AppDelegate.m** ``` - (void)application:(UIApplication *)application didReceiveRemoteNotificati...
2012/06/22
[ "https://Stackoverflow.com/questions/11154289", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1223400/" ]
Luc is right, although it's `self.view.window.rootViewController` instead of `self.rootviewcontroller`. However I don't think it's the perfect solution since the `TabBarController` doesn't always have to be the rootViewController... Do you have your `TabBarController` in the app delegate/mainwindow or in another viewC...
Can we also get the code from the method `application:didFinishLaunchingWithOptions:`? I would like to see how you are creating the tabBarController. Also try to call `self.tabBarController.selectedIndex = 2;` in the method `application:didFinishLaunchingWithOptions:` and check if the correct view controller becomes a...
88,404
1. Suppose Alice and Bob have specified an elliptic curve, for example, secp256k1. Alice has a secret number $s$ (can be seen as secret key), Bob choose a point $g$ on the curve and send it to Alice. After receiving the point, Alice computes $g^s$ and sends it the Bob. $\text{Whether the interaction will reveal Alice's...
2021/02/22
[ "https://crypto.stackexchange.com/questions/88404", "https://crypto.stackexchange.com", "https://crypto.stackexchange.com/users/86713/" ]
For the second question, it depends on whether we can trust Bob to generate $a$ uniformly at random and without any “hidden structure.” If we can trust him, then this is secure assuming RLWE is hard; what Bob gets is merely one properly distributed RLWE sample. However, if Bob may choose $a$ in a malicious or “sneaky”...
> > 1. Whether the interaction will reveal Alice's secret key? > > > I'm reading this like, Bob chose the base point $G$ and sends it to Alice then Alice sends back to Bob $[s]G$. The reason is simple, the elliptic curves use scalar multiplication, not exponentiation. This notation is used for multiplicative group...
88,404
1. Suppose Alice and Bob have specified an elliptic curve, for example, secp256k1. Alice has a secret number $s$ (can be seen as secret key), Bob choose a point $g$ on the curve and send it to Alice. After receiving the point, Alice computes $g^s$ and sends it the Bob. $\text{Whether the interaction will reveal Alice's...
2021/02/22
[ "https://crypto.stackexchange.com/questions/88404", "https://crypto.stackexchange.com", "https://crypto.stackexchange.com/users/86713/" ]
For the second question, it depends on whether we can trust Bob to generate $a$ uniformly at random and without any “hidden structure.” If we can trust him, then this is secure assuming RLWE is hard; what Bob gets is merely one properly distributed RLWE sample. However, if Bob may choose $a$ in a malicious or “sneaky”...
Correction to kelalaka's answer: > > Bob chooses a polynomial $a\in R\_q$ and sends it to Alice, Alice compute $as+e$, where $e\leftarrow \chi$ is a secure distribution in RLWE, then in this situation, whether Bob will learn the secret $s$? > > > If Bob is limited to a single interaction, then no, Bob cannot reco...
60,625,390
I can't sort my array of objects "datoa" so that if I sort x values, corresponding y values change too. The variable myJSON is structured like: ``` var myJSON = [ { "": 0, "Comune": "BONDENO", "PUNTEGGIOSCUOLA1516": 4.25, "Value 1": 63, "Value 2": 8, "Value 3": 17, "DANNO": 6, "Somma...
2020/03/10
[ "https://Stackoverflow.com/questions/60625390", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11988923/" ]
You could sort by the "*square root of the sum of squares*" with [`Math.hypot`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/hypot), which moves smaller `x` and `y` elements to top. ```js var data = [{ "": 0, Comune: "BONDENO", PUNTEGGIOSCUOLA1516: 4.25, "Value 1": 63, "Value 2...
I believe your issue is in the syntax `if` statement of your `sort` function. Add curly braces `{}` around your first return statement, and it should work. ``` datoa.sort(function(a, b) { if(a.x == b.x) { return a.y - b.y } return a.x - b.x; }) ``` Alternately, you could use a ternary function to...
60,625,390
I can't sort my array of objects "datoa" so that if I sort x values, corresponding y values change too. The variable myJSON is structured like: ``` var myJSON = [ { "": 0, "Comune": "BONDENO", "PUNTEGGIOSCUOLA1516": 4.25, "Value 1": 63, "Value 2": 8, "Value 3": 17, "DANNO": 6, "Somma...
2020/03/10
[ "https://Stackoverflow.com/questions/60625390", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11988923/" ]
You could sort by the "*square root of the sum of squares*" with [`Math.hypot`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/hypot), which moves smaller `x` and `y` elements to top. ```js var data = [{ "": 0, Comune: "BONDENO", PUNTEGGIOSCUOLA1516: 4.25, "Value 1": 63, "Value 2...
You only need a single map over the source data, then the sort can keep everything together: ``` const datoa = myJSON .map(itm => ({ x: (itm['Value 1'] + itm['Value 2']) / itm['numero_di_scuole'], y: itm['PUNTEGGIOSCUOLA1516'] })) .sort((a, b) => (a.x === b.x) ? a.y - b.y : a.x - b.x)); ``...
56,234,374
Good Morning! I want to export a few dataset's to excel using SAS, But I have a few challenges here. Both datasets are unique and which we cannot merge or append. There are 2 programs that create 2 dataset's each, however, I want to export program1 output datasets(2 datasets) to excel sheet1 and Program2 output datase...
2019/05/21
[ "https://Stackoverflow.com/questions/56234374", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10852206/" ]
Your method already has a 5 seconds timeout. All you need to do now is to add some kind a loop with 3 repeats. You need a counter of timeouts and a break after successful attempt. Not sure what you want to do when other exceptions happen, added breaks there as well. Following code should do the job: ``` private Connec...
First of all, I'd put the execution of that long command into a new thread so it will not block the Main Thread with the UI etc. an approach: ``` Thread thr = new Thread() { public void run() { boolean error =false; boolean success=false; int time =0; ...
4,694,444
I am using the following code for Highlighting the text in the Iframe but i cant get it to work ``` function getSelectedText() { if (window.getSelection) {; return window.getSelection().toString(); } else if (document.getSelection) {; return document.getSelection(); }...
2011/01/14
[ "https://Stackoverflow.com/questions/4694444", "https://Stackoverflow.com", "https://Stackoverflow.com/users/571319/" ]
If `iframe1` is the ID of the `<iframe>`, you need to place it in quotation marks for your selector. So instead of: ``` $(#iframe1).live("mouseup", function () { //... ``` you need: ``` $('#iframe1').live("mouseup", function () { //... ```
``` $( function() { var myiframe = $($.browser.msie ? frames["iframe1"] : "#iframe1"); // doesn't work in Opera < 9 myiframe.load( function() { selection = getSelectedText(); //below code works but i dont know about $(this) will work or not but you can try your code //var w = this.content...
63,607,308
I'm using Absinthe and have a sign in mutation. When users send over valid credentials, I'd like to set a session cookie in the response via `put_session`. The problem I'm facing is that I'm not able to access the `conn` from within a resolver function. That tells me that I'm not supposed to update the connection's pr...
2020/08/27
[ "https://Stackoverflow.com/questions/63607308", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1911755/" ]
It looks like one solution is: ------------------------------ 1. In the resolver, resolve either an `{:ok, _}` or an `{:error, _}` as normal 2. Add [middleware after the resolver](https://elixirforum.com/t/modify-absinthe-resolution-context-in-a-resolver/29602) to pattern match that `resolution.value` returned from st...
Not sure why you want to use a session, can't this be solved using a bearer? Please disregard the interfaces. :-) Mutation. ``` object :user_token_payload do field(:user, :user) field(:token, :string) end object :login_user_mutation_response, is_type_of: :login_user do interface(:straw_hat_mutatio...
69,575,364
I'm trying to make an algorithm where the computer tries to guess your number, knowing a maximum and minimum value, and each time it guesses, you tell it if it's guess is too low or too high(too low = troppetit, too high = tropgrand). I'm trying to solve this using dichotomy, but without using a list, the problem I'm ...
2021/10/14
[ "https://Stackoverflow.com/questions/69575364", "https://Stackoverflow.com", "https://Stackoverflow.com/users/17152602/" ]
> > if I input "tropgrand" then "troppetit", or the opposite, it just returns the same number each time > > > Step through the code Example, ``` min=0, max=10 proposition = 5 input: tropgrand proposition=(0+10)//2 == 5 max = 5 proposition=(0+5)//2 == 2 max = 2 input: troppetit proposition=(2+2)//2 == 2 min = 2...
Your code has a very simple logic problem, you must store the greater or lesser value before changing it. Below is the correction: ``` max=int(input("max")) min=int(input("min")) proposition=(min+max)//2 print(proposition) reponse="" while reponse != "juste": reponse=input("le nombre est-il trop grand, trop petit,...
69,575,364
I'm trying to make an algorithm where the computer tries to guess your number, knowing a maximum and minimum value, and each time it guesses, you tell it if it's guess is too low or too high(too low = troppetit, too high = tropgrand). I'm trying to solve this using dichotomy, but without using a list, the problem I'm ...
2021/10/14
[ "https://Stackoverflow.com/questions/69575364", "https://Stackoverflow.com", "https://Stackoverflow.com/users/17152602/" ]
> > if I input "tropgrand" then "troppetit", or the opposite, it just returns the same number each time > > > Step through the code Example, ``` min=0, max=10 proposition = 5 input: tropgrand proposition=(0+10)//2 == 5 max = 5 proposition=(0+5)//2 == 2 max = 2 input: troppetit proposition=(2+2)//2 == 2 min = 2...
You are assigning the max/min variables AFTER modifying the proposition. You should set the new max BEFORE changing the proposition. ``` if reponse == "tropgrand" : max=proposition-1 # the number is less than proposition proposition=(min+proposition)//2 print(proposition) elif reponse ==...
10,384,312
I'm having trouble connecting to my mysql server with C# from a remote machine. I know the server is working, because I can access all of the tables through phpmyadmin. I have the firewall turned off on the server, I have the user configured for any host, and the connection string is formatted as: ``` Server=ip addres...
2012/04/30
[ "https://Stackoverflow.com/questions/10384312", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1011847/" ]
It sounds like your using `SqlConnection`, which connects to **Microsoft SQL Server** databases. You need to use a MySQL client library.
The `SqlConnection` class is used for connecting exclusively to Microsoft SQL Server. To connect to a MySQL database, you need to download the [MySQL Connector/NET](http://forums.mysql.com/list.php?47), then use the `MySqlConnection` class, which mirrors the `SqlConnection` and related classes fairly well.
100,473
I have a first (and only) and self occupied home. Mortgage is fully paid. Home is with four rooms. Considering expenses I done on home so far including my share in mortgage, taxes so far, total interest paid etc. I will be in profit by 1000000. Prices of property are not growing considerably anymore; growth rate is m...
2018/09/27
[ "https://money.stackexchange.com/questions/100473", "https://money.stackexchange.com", "https://money.stackexchange.com/users/73868/" ]
No one can answer this but yourself.... 1) Have you considered closing cost (you'll pay the closing cost for at least 1 property if you sell yours and buy another. 2) Assuming you didn't spend a bunch of money on renovations it would seem that your profit comes mostly from the average home price rising. As such a 3 ...
If i understand you correctly you are thinkinh to move from a big home to a small one, this usually reducing your living cost (less things which could broke, less cleaning and less air to cool down/heat etc.) Also you gain profit (or luxory) from the free and possible working money, from the price difference from the h...
100,473
I have a first (and only) and self occupied home. Mortgage is fully paid. Home is with four rooms. Considering expenses I done on home so far including my share in mortgage, taxes so far, total interest paid etc. I will be in profit by 1000000. Prices of property are not growing considerably anymore; growth rate is m...
2018/09/27
[ "https://money.stackexchange.com/questions/100473", "https://money.stackexchange.com", "https://money.stackexchange.com/users/73868/" ]
No one can answer this but yourself.... 1) Have you considered closing cost (you'll pay the closing cost for at least 1 property if you sell yours and buy another. 2) Assuming you didn't spend a bunch of money on renovations it would seem that your profit comes mostly from the average home price rising. As such a 3 ...
> > I do not need this much big home. Three rooms should be enough for me. > > > This is the only real tick mark in favor of selling your current home. > > By booking the profit, I can invest the amount (other than my share in new home) in some good investments. > > > Any profit you make from the sell will e...
100,473
I have a first (and only) and self occupied home. Mortgage is fully paid. Home is with four rooms. Considering expenses I done on home so far including my share in mortgage, taxes so far, total interest paid etc. I will be in profit by 1000000. Prices of property are not growing considerably anymore; growth rate is m...
2018/09/27
[ "https://money.stackexchange.com/questions/100473", "https://money.stackexchange.com", "https://money.stackexchange.com/users/73868/" ]
No one can answer this but yourself.... 1) Have you considered closing cost (you'll pay the closing cost for at least 1 property if you sell yours and buy another. 2) Assuming you didn't spend a bunch of money on renovations it would seem that your profit comes mostly from the average home price rising. As such a 3 ...
There is no *profit* here, and there is no *investment*. It is your home and since everybody pays for the bed they sleep in, it is a cost, not an investment. If the house you are in has gone up in value, then so has the identical house next door and by the same amount, so moving from one to the other would not realize ...
100,473
I have a first (and only) and self occupied home. Mortgage is fully paid. Home is with four rooms. Considering expenses I done on home so far including my share in mortgage, taxes so far, total interest paid etc. I will be in profit by 1000000. Prices of property are not growing considerably anymore; growth rate is m...
2018/09/27
[ "https://money.stackexchange.com/questions/100473", "https://money.stackexchange.com", "https://money.stackexchange.com/users/73868/" ]
> > I do not need this much big home. Three rooms should be enough for me. > > > This is the only real tick mark in favor of selling your current home. > > By booking the profit, I can invest the amount (other than my share in new home) in some good investments. > > > Any profit you make from the sell will e...
If i understand you correctly you are thinkinh to move from a big home to a small one, this usually reducing your living cost (less things which could broke, less cleaning and less air to cool down/heat etc.) Also you gain profit (or luxory) from the free and possible working money, from the price difference from the h...
100,473
I have a first (and only) and self occupied home. Mortgage is fully paid. Home is with four rooms. Considering expenses I done on home so far including my share in mortgage, taxes so far, total interest paid etc. I will be in profit by 1000000. Prices of property are not growing considerably anymore; growth rate is m...
2018/09/27
[ "https://money.stackexchange.com/questions/100473", "https://money.stackexchange.com", "https://money.stackexchange.com/users/73868/" ]
> > I do not need this much big home. Three rooms should be enough for me. > > > This is the only real tick mark in favor of selling your current home. > > By booking the profit, I can invest the amount (other than my share in new home) in some good investments. > > > Any profit you make from the sell will e...
There is no *profit* here, and there is no *investment*. It is your home and since everybody pays for the bed they sleep in, it is a cost, not an investment. If the house you are in has gone up in value, then so has the identical house next door and by the same amount, so moving from one to the other would not realize ...
3,924,990
This is the text: Solve the following differential eqution: $$(2x^3+3x^2y+y^2-y^3)~dx+(2y^3+3x^2y+x^2-x^3)~dy=0$$ This particular differential equation has to be solved by finding an integrating factor. I first tried making this equation into a Darboux differential eqaution, and didn't find any luck. These are the in...
2020/11/27
[ "https://math.stackexchange.com/questions/3924990", "https://math.stackexchange.com", "https://math.stackexchange.com/users/811108/" ]
Have you tried using $(x+y)^{-2}~$?
$(2x^3+3x^2y+y^2-y^3)~dx+(2y^3+3x^2y+x^2-x^3)~dy=0$ $\dfrac{dy}{dx}=-\dfrac{2x^3+3x^2y+y^2-y^3}{2y^3+3x^2y+x^2-x^3}$ Let $y=xu$ , Then $\dfrac{dy}{dx}=x\dfrac{du}{dx}+u$ $\therefore x\dfrac{du}{dx}+u=-\dfrac{2x^3+3x^3u+x^2u^2-x^3u^3}{2x^3u^3+3x^3u+x^2-x^3}$ $x\dfrac{du}{dx}=\dfrac{(u^3-3u-2)x-u^2}{(2u^3+3u-1)x+1}-...
25,464,614
I'm trying to use this simple tutorial: ``` http://socket.io/socket-io-with-apache-cordova/ ``` My node.js is working fine and i'm emulating to iOS without problem, but the socket.io isn't working, here is my javascript(the same way as the tutorial above): > > > ``` > app.initialize(); > > document.addEventListe...
2014/08/23
[ "https://Stackoverflow.com/questions/25464614", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3221955/" ]
I made it, this tutorial is very good but it's not totally right. You have to connect the socket to your server first (i'm using localhost and port 3000, but if you're using some server outside, i think you've to just put the ip and port): ``` var socket = io.connect('http://localhost:3000'); ``` and after that, yo...
``` <script src="http://localhost:3000/socket.io/socket.io.js"></script> var socketHost = "http://localhost:3000"; var socket = io.connect(socketHost); ```
27,556,769
I am working in SQL Server 2008. I have a stored proc that takes a parameter, called @test. This parameter is varchar(255). In this stored proc, I need to parse this string, convert each value into a string itself (there will be a variable number of values), and build a list to use in a NOT IN statement. For example, ...
2014/12/18
[ "https://Stackoverflow.com/questions/27556769", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3100444/" ]
You can use dynamic sql for this. Use the replace function to get the correct `NOT IN()` argument: ``` DECLARE @test VARCHAR(10) = 'a,b,c,d' DECLARE @sql NVARCHAR(MAX) SELECT @sql = 'SELECT * FROM #temp WHERE label NOT IN (''' + REPLACE( @test ,',',''',''') + ''')' EXEC sp_executesql @sql ```
Use Split function something along with NOT EXISTS operator almost always faster than NOT IN operator Split Function -------------- ``` CREATE FUNCTION [dbo].[split] ( @delimited NVARCHAR(MAX), @delimiter NVARCHAR(100) ) RETURNS @t TABLE (id INT IDENTITY(1,1), val NVARCHAR(MAX)) AS BEGIN DECL...
27,556,769
I am working in SQL Server 2008. I have a stored proc that takes a parameter, called @test. This parameter is varchar(255). In this stored proc, I need to parse this string, convert each value into a string itself (there will be a variable number of values), and build a list to use in a NOT IN statement. For example, ...
2014/12/18
[ "https://Stackoverflow.com/questions/27556769", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3100444/" ]
You can use dynamic sql for this. Use the replace function to get the correct `NOT IN()` argument: ``` DECLARE @test VARCHAR(10) = 'a,b,c,d' DECLARE @sql NVARCHAR(MAX) SELECT @sql = 'SELECT * FROM #temp WHERE label NOT IN (''' + REPLACE( @test ,',',''',''') + ''')' EXEC sp_executesql @sql ```
you can find the char or string in the whole string having delimiter as comma (,) ``` DECLARE @code VARCHAR(50) = 'c', @text varchar(100) = 'a,b,c,d,e' SELECT CHARINDEX(',' + @code + ',', ',' + @text + ',') > 0 ```
27,556,769
I am working in SQL Server 2008. I have a stored proc that takes a parameter, called @test. This parameter is varchar(255). In this stored proc, I need to parse this string, convert each value into a string itself (there will be a variable number of values), and build a list to use in a NOT IN statement. For example, ...
2014/12/18
[ "https://Stackoverflow.com/questions/27556769", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3100444/" ]
Use Split function something along with NOT EXISTS operator almost always faster than NOT IN operator Split Function -------------- ``` CREATE FUNCTION [dbo].[split] ( @delimited NVARCHAR(MAX), @delimiter NVARCHAR(100) ) RETURNS @t TABLE (id INT IDENTITY(1,1), val NVARCHAR(MAX)) AS BEGIN DECL...
you can find the char or string in the whole string having delimiter as comma (,) ``` DECLARE @code VARCHAR(50) = 'c', @text varchar(100) = 'a,b,c,d,e' SELECT CHARINDEX(',' + @code + ',', ',' + @text + ',') > 0 ```
38,459,298
I'm using the Ionic v2 for create an app and I now want to add Facebook /Google plus login API. I already implemented a Facebook login on my website using OAuth. But Now wanting to implement it in Ionic-2 application. in simple want to implement register screen with Facebook in my app with Like, [Click for understa...
2016/07/19
[ "https://Stackoverflow.com/questions/38459298", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5109857/" ]
Auth0 developer here. Have you tried following this comprehensive tutorial? <https://auth0.com/blog/ionic-2-authentication-how-to-secure-your-mobile-app-with-jwt/>. It covers implementing Facebook and Google login for your Ionic 2 app. You might also want to check out this <https://auth0.com/docs/quickstart/native/io...
Finally i succeed in Facebook login API. i refer <http://ionicframework.com/docs/v2/native/facebook/> for the achiving this. ``` onFBLoginClick() { Facebook.login(['email']).then(data=>{ this.faceBookToken=data.authResponse.accessToken; this.faceBookUserId=data.authResponse.userID; //Call getter f...
12,446,266
We are implementing a Web App using JPA2.0 and Hibernate3.0. Connection pool configurations are set in persistence.xml located in META-INF folder. --- persistence.xml: ``` <persistence xmlns="http://java.sun.com/xml/ns/persistence" version="2.0"> <persistence-unit name="MyPU" transaction-type="RESOURCE_LOCAL"> ...
2012/09/16
[ "https://Stackoverflow.com/questions/12446266", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1641864/" ]
Good question, bad title. :) I think I answered this question on your re-post: [Best configuration of c3p0](https://stackoverflow.com/questions/12507021/best-configuration-of-c3p0/12531444#12531444)
I had the same exact issue, my problem was that my web application container (Tomcat) was managing my database connections. I had to move the c3p0 configuration from my persistence.xml file to Tomcat's context.xml. The link Domenic D provided is a great place to start if that's your problem.
12,446,266
We are implementing a Web App using JPA2.0 and Hibernate3.0. Connection pool configurations are set in persistence.xml located in META-INF folder. --- persistence.xml: ``` <persistence xmlns="http://java.sun.com/xml/ns/persistence" version="2.0"> <persistence-unit name="MyPU" transaction-type="RESOURCE_LOCAL"> ...
2012/09/16
[ "https://Stackoverflow.com/questions/12446266", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1641864/" ]
Good question, bad title. :) I think I answered this question on your re-post: [Best configuration of c3p0](https://stackoverflow.com/questions/12507021/best-configuration-of-c3p0/12531444#12531444)
There is a typo in your settings, it should be `idle_test_period` not `idle_test_periods`. See this post for information about the setting: [The use of c3p0.idle\_test\_period.](https://stackoverflow.com/questions/10175957/the-use-of-c3p0-idle-test-period#10176231)
12,446,266
We are implementing a Web App using JPA2.0 and Hibernate3.0. Connection pool configurations are set in persistence.xml located in META-INF folder. --- persistence.xml: ``` <persistence xmlns="http://java.sun.com/xml/ns/persistence" version="2.0"> <persistence-unit name="MyPU" transaction-type="RESOURCE_LOCAL"> ...
2012/09/16
[ "https://Stackoverflow.com/questions/12446266", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1641864/" ]
I had this same problem with the proprieties that I put in persistence.xml didn't affect c3p0. Looking into <http://www.mchange.com/projects/c3p0/index.html#configuration_files> I tried to put an xml file named `c3p0-config.xml` and put it in `WEB-INF/classes` and it work perfectly. Here is an example of a `c3p0-conf...
I had the same exact issue, my problem was that my web application container (Tomcat) was managing my database connections. I had to move the c3p0 configuration from my persistence.xml file to Tomcat's context.xml. The link Domenic D provided is a great place to start if that's your problem.
12,446,266
We are implementing a Web App using JPA2.0 and Hibernate3.0. Connection pool configurations are set in persistence.xml located in META-INF folder. --- persistence.xml: ``` <persistence xmlns="http://java.sun.com/xml/ns/persistence" version="2.0"> <persistence-unit name="MyPU" transaction-type="RESOURCE_LOCAL"> ...
2012/09/16
[ "https://Stackoverflow.com/questions/12446266", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1641864/" ]
I had this same problem with the proprieties that I put in persistence.xml didn't affect c3p0. Looking into <http://www.mchange.com/projects/c3p0/index.html#configuration_files> I tried to put an xml file named `c3p0-config.xml` and put it in `WEB-INF/classes` and it work perfectly. Here is an example of a `c3p0-conf...
There is a typo in your settings, it should be `idle_test_period` not `idle_test_periods`. See this post for information about the setting: [The use of c3p0.idle\_test\_period.](https://stackoverflow.com/questions/10175957/the-use-of-c3p0-idle-test-period#10176231)
54,186,583
Consider a simple HTTP trigger that throws an exception. When I make a call to this trigger via Postman, it return a 500 Internal Server Error, but the body is empty. As a developer, I want to see the stacktrace so that I can quickly debug what's going on. ``` // Azure Functions v2 [FunctionName("HttpTrigger2")] publ...
2019/01/14
[ "https://Stackoverflow.com/questions/54186583", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2272514/" ]
It should be by design that v2 function doesn't return stack trace anymore like v1 does. And on remote Azure site, neither v1 nor v2 function returns stack trace. The design is reasonable, stack trace is used for debug while the response body is apparently not. With stack trace returned as response, we seem to expose l...
You can also add the env variable CLI\_DEBUG to 1 in your machine to get full exceptions in local env, debugging etc
163,382
This question is similar to [Biggest Square in a grid](https://codegolf.stackexchange.com/questions/152305/biggest-square-in-a-grid). **Challenge** Given a matrix of `1` and `0` in a string format `"xxxx,xxxxx,xxxx,xx.."` or array format `["xxxx","xxxx","xxxx",...]`, You will create a function that determines the are...
2018/04/25
[ "https://codegolf.stackexchange.com/questions/163382", "https://codegolf.stackexchange.com", "https://codegolf.stackexchange.com/users/78039/" ]
[Haskell](https://www.haskell.org/), ~~113 121 118~~ 117 bytes ============================================================== ```hs x!s=[0..length x-s] t#d=take t.drop d f x=last$1:[s*s|s<-min(x!0)$x!!0!0,i<-x!!0!s,j<-x!s,all(>'0')$s#i=<<(s#j)x,s>0] ``` [Try it online!](https://tio.run/##HcbBCoMgGADgu0/xS0I1TPQ6tBeJ...
[Python 2](https://docs.python.org/2/), ~~117~~ 109 bytes ========================================================= Credit to @etene for pointing out an inefficiency that cost me an additional byte. ```python lambda s:max(i*i for i in range(len(s))if re.search(("."*(s.find(',')-i+1)).join(["1"*i]*i),s))or 1 import re...
163,382
This question is similar to [Biggest Square in a grid](https://codegolf.stackexchange.com/questions/152305/biggest-square-in-a-grid). **Challenge** Given a matrix of `1` and `0` in a string format `"xxxx,xxxxx,xxxx,xx.."` or array format `["xxxx","xxxx","xxxx",...]`, You will create a function that determines the are...
2018/04/25
[ "https://codegolf.stackexchange.com/questions/163382", "https://codegolf.stackexchange.com", "https://codegolf.stackexchange.com/users/78039/" ]
[Jelly](https://github.com/DennisMitchell/jelly), 18 [bytes](https://github.com/DennisMitchell/jelly/wiki/Code-page) ==================================================================================================================== +2 to handle no-all-1 sublist present output ``` ẆZṡ¥"L€$ẎȦÐfL€Ṁ²»1 ``` **[Try it ...
[Ruby](https://www.ruby-lang.org/) `-n`, 63 bytes ================================================= ```ruby p (1..l=$_=~/,|$/).map{|i|/#{[?1*i]*i*(?.*(l-i+1))}/?i*i:1}.max ``` [Try it online!](https://tio.run/##KypNqvz/v0BBw1BPL8dWJd62Tl@nRkVfUy83saC6JrNGX7k62t5QKzNWK1NLw15PSyNHN1PbUFOzVt8@UyvTyrAWqLDi/39DA0MDAx0gaW...
163,382
This question is similar to [Biggest Square in a grid](https://codegolf.stackexchange.com/questions/152305/biggest-square-in-a-grid). **Challenge** Given a matrix of `1` and `0` in a string format `"xxxx,xxxxx,xxxx,xx.."` or array format `["xxxx","xxxx","xxxx",...]`, You will create a function that determines the are...
2018/04/25
[ "https://codegolf.stackexchange.com/questions/163382", "https://codegolf.stackexchange.com", "https://codegolf.stackexchange.com/users/78039/" ]
[APL (Dyalog Classic)](https://www.dyalog.com/), ~~21~~ 20 bytes ================================================================ ```apl ×⍨{1∊⍵:1+∇2×/2×⌿⍵⋄0} ``` [Try it online!](https://tio.run/##SyzI0U2pTMzJT9dNzkksLs5M/v@ob2pm/qO2CQb/04Dk4emPeldUGz7q6HrUu9XKUPtRR7vR4en6QPyoZz9Q6FF3i0Ht//8lQKXVIG7nwiIgM@1R7y4r9fxs...
[Python 2](https://docs.python.org/2/), ~~138~~ 128 bytes ========================================================= ```python def f(m):j=''.join;L=j(m);k=map(j,zip(*m));return len(L)and max(len(L)*(len(m)**2*'1'==L),f(k[1:]),f(k[:-1]),f(m[1:]),f(m[:-1])) ``` [Try it online!](https://tio.run/##bY5BDoIwEEX3noLddBo0HZa...
163,382
This question is similar to [Biggest Square in a grid](https://codegolf.stackexchange.com/questions/152305/biggest-square-in-a-grid). **Challenge** Given a matrix of `1` and `0` in a string format `"xxxx,xxxxx,xxxx,xx.."` or array format `["xxxx","xxxx","xxxx",...]`, You will create a function that determines the are...
2018/04/25
[ "https://codegolf.stackexchange.com/questions/163382", "https://codegolf.stackexchange.com", "https://codegolf.stackexchange.com/users/78039/" ]
[J](http://jsoftware.com/), 33 27 bytes ======================================= -6 bytes thanks to FrownyFrog! ``` [:>./@,,~@#\(#**/)@,;._3"$] ``` [Try it online!](https://tio.run/##y/qfVmyrp2CgYKVg8D/ayk5P30FHp85BOUZDWUtLX9NBx1ov3lhJJfa/JpeSnoJ6mq2euoKOQq2VQloxF1dqcka@QpqCsYKpiiHQCBCGkIYYECoD02KiYKKCTRkSRJiOqhTJhv...
[Perl 6](https://github.com/nxadm/rakudo-pkg), ~~61~~ ~~60~~ 58 bytes ===================================================================== ```perl6 {(^$_ X.. ^$_).max({[~&](.[|$^r||*])~~/$(1 x$r)/&&+$r})²} ``` [Try it online!](https://tio.run/##K0gtyjH7n1upoJamYPu/WiNOJV4hQk9PAUhr6uUmVmhUR9epxWroRdeoxBXV1GjFatbV6at...
163,382
This question is similar to [Biggest Square in a grid](https://codegolf.stackexchange.com/questions/152305/biggest-square-in-a-grid). **Challenge** Given a matrix of `1` and `0` in a string format `"xxxx,xxxxx,xxxx,xx.."` or array format `["xxxx","xxxx","xxxx",...]`, You will create a function that determines the are...
2018/04/25
[ "https://codegolf.stackexchange.com/questions/163382", "https://codegolf.stackexchange.com", "https://codegolf.stackexchange.com/users/78039/" ]
JavaScript, 92 bytes ==================== ``` a=>(g=w=>a.match(Array(w).fill(`1{${w}}`).join(`..{${W-w}}`))?w*w:g(w-1))(W=a.indexOf`,`)||1 ``` ```js f= a=>(g=w=>a.match(Array(w).fill(`1{${w}}`).join(`..{${W-w}}`))?w*w:g(w-1))(W=a.indexOf`,`)||1 console.log(f('0111,1111,1111,1111')); console.log(f('10100,10111,111...
[Perl 6](https://github.com/nxadm/rakudo-pkg), ~~61~~ ~~60~~ 58 bytes ===================================================================== ```perl6 {(^$_ X.. ^$_).max({[~&](.[|$^r||*])~~/$(1 x$r)/&&+$r})²} ``` [Try it online!](https://tio.run/##K0gtyjH7n1upoJamYPu/WiNOJV4hQk9PAUhr6uUmVmhUR9epxWroRdeoxBXV1GjFatbV6at...
163,382
This question is similar to [Biggest Square in a grid](https://codegolf.stackexchange.com/questions/152305/biggest-square-in-a-grid). **Challenge** Given a matrix of `1` and `0` in a string format `"xxxx,xxxxx,xxxx,xx.."` or array format `["xxxx","xxxx","xxxx",...]`, You will create a function that determines the are...
2018/04/25
[ "https://codegolf.stackexchange.com/questions/163382", "https://codegolf.stackexchange.com", "https://codegolf.stackexchange.com/users/78039/" ]
[Jelly](https://github.com/DennisMitchell/jelly), 18 [bytes](https://github.com/DennisMitchell/jelly/wiki/Code-page) ==================================================================================================================== +2 to handle no-all-1 sublist present output ``` ẆZṡ¥"L€$ẎȦÐfL€Ṁ²»1 ``` **[Try it ...
[APL (Dyalog Classic)](https://www.dyalog.com/), ~~21~~ 20 bytes ================================================================ ```apl ×⍨{1∊⍵:1+∇2×/2×⌿⍵⋄0} ``` [Try it online!](https://tio.run/##SyzI0U2pTMzJT9dNzkksLs5M/v@ob2pm/qO2CQb/04Dk4emPeldUGz7q6HrUu9XKUPtRR7vR4en6QPyoZz9Q6FF3i0Ht//8lQKXVIG7nwiIgM@1R7y4r9fxs...
163,382
This question is similar to [Biggest Square in a grid](https://codegolf.stackexchange.com/questions/152305/biggest-square-in-a-grid). **Challenge** Given a matrix of `1` and `0` in a string format `"xxxx,xxxxx,xxxx,xx.."` or array format `["xxxx","xxxx","xxxx",...]`, You will create a function that determines the are...
2018/04/25
[ "https://codegolf.stackexchange.com/questions/163382", "https://codegolf.stackexchange.com", "https://codegolf.stackexchange.com/users/78039/" ]
[Jelly](https://github.com/DennisMitchell/jelly), 18 [bytes](https://github.com/DennisMitchell/jelly/wiki/Code-page) ==================================================================================================================== +2 to handle no-all-1 sublist present output ``` ẆZṡ¥"L€$ẎȦÐfL€Ṁ²»1 ``` **[Try it ...
[Python 2](https://docs.python.org/2/), ~~117~~ 109 bytes ========================================================= Credit to @etene for pointing out an inefficiency that cost me an additional byte. ```python lambda s:max(i*i for i in range(len(s))if re.search(("."*(s.find(',')-i+1)).join(["1"*i]*i),s))or 1 import re...
163,382
This question is similar to [Biggest Square in a grid](https://codegolf.stackexchange.com/questions/152305/biggest-square-in-a-grid). **Challenge** Given a matrix of `1` and `0` in a string format `"xxxx,xxxxx,xxxx,xx.."` or array format `["xxxx","xxxx","xxxx",...]`, You will create a function that determines the are...
2018/04/25
[ "https://codegolf.stackexchange.com/questions/163382", "https://codegolf.stackexchange.com", "https://codegolf.stackexchange.com/users/78039/" ]
[APL (Dyalog Classic)](https://www.dyalog.com/), ~~21~~ 20 bytes ================================================================ ```apl ×⍨{1∊⍵:1+∇2×/2×⌿⍵⋄0} ``` [Try it online!](https://tio.run/##SyzI0U2pTMzJT9dNzkksLs5M/v@ob2pm/qO2CQb/04Dk4emPeldUGz7q6HrUu9XKUPtRR7vR4en6QPyoZz9Q6FF3i0Ht//8lQKXVIG7nwiIgM@1R7y4r9fxs...
[Perl 6](https://github.com/nxadm/rakudo-pkg), ~~61~~ ~~60~~ 58 bytes ===================================================================== ```perl6 {(^$_ X.. ^$_).max({[~&](.[|$^r||*])~~/$(1 x$r)/&&+$r})²} ``` [Try it online!](https://tio.run/##K0gtyjH7n1upoJamYPu/WiNOJV4hQk9PAUhr6uUmVmhUR9epxWroRdeoxBXV1GjFatbV6at...
163,382
This question is similar to [Biggest Square in a grid](https://codegolf.stackexchange.com/questions/152305/biggest-square-in-a-grid). **Challenge** Given a matrix of `1` and `0` in a string format `"xxxx,xxxxx,xxxx,xx.."` or array format `["xxxx","xxxx","xxxx",...]`, You will create a function that determines the are...
2018/04/25
[ "https://codegolf.stackexchange.com/questions/163382", "https://codegolf.stackexchange.com", "https://codegolf.stackexchange.com/users/78039/" ]
[APL (Dyalog Classic)](https://www.dyalog.com/), ~~21~~ 20 bytes ================================================================ ```apl ×⍨{1∊⍵:1+∇2×/2×⌿⍵⋄0} ``` [Try it online!](https://tio.run/##SyzI0U2pTMzJT9dNzkksLs5M/v@ob2pm/qO2CQb/04Dk4emPeldUGz7q6HrUu9XKUPtRR7vR4en6QPyoZz9Q6FF3i0Ht//8lQKXVIG7nwiIgM@1R7y4r9fxs...
Clojure, 193 bytes ------------------ ``` #(apply max(for [f[(fn[a b](take-while seq(iterate a b)))]R(f next %)R(f butlast R)n[(count R)]c(for[i(range(-(count(first R))n -1)):when(apply = 1(for[r R c(subvec r i(+ i n))]c))](* n n))]c)) ``` Wow, things escalated :o Less golfed: ``` (def f #(for [rows (->> % (ite...
163,382
This question is similar to [Biggest Square in a grid](https://codegolf.stackexchange.com/questions/152305/biggest-square-in-a-grid). **Challenge** Given a matrix of `1` and `0` in a string format `"xxxx,xxxxx,xxxx,xx.."` or array format `["xxxx","xxxx","xxxx",...]`, You will create a function that determines the are...
2018/04/25
[ "https://codegolf.stackexchange.com/questions/163382", "https://codegolf.stackexchange.com", "https://codegolf.stackexchange.com/users/78039/" ]
[Jelly](https://github.com/DennisMitchell/jelly), 18 [bytes](https://github.com/DennisMitchell/jelly/wiki/Code-page) ==================================================================================================================== +2 to handle no-all-1 sublist present output ``` ẆZṡ¥"L€$ẎȦÐfL€Ṁ²»1 ``` **[Try it ...
[Perl 6](https://github.com/nxadm/rakudo-pkg), ~~61~~ ~~60~~ 58 bytes ===================================================================== ```perl6 {(^$_ X.. ^$_).max({[~&](.[|$^r||*])~~/$(1 x$r)/&&+$r})²} ``` [Try it online!](https://tio.run/##K0gtyjH7n1upoJamYPu/WiNOJV4hQk9PAUhr6uUmVmhUR9epxWroRdeoxBXV1GjFatbV6at...
30,323,687
I am using HttpUrlConnection to post some data to my server here is the function: ``` private String register(String myurl) throws IOException { String resp = null; try { JSONObject parameters = new JSONObject(); // parameters.put("jsonArray", ((makeJSON()))); param...
2015/05/19
[ "https://Stackoverflow.com/questions/30323687", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1806099/" ]
I reckon the problem here is not at the Java side, If the parameters is of fixed type like in json in your case, the JSON Object as POST params method will work if collected this way on the php side: ``` <?php $json = file_get_contents('php://input'); $obj = json_decode($json); print_r($obj); print_r("...
The problem here was not with the Java side, it was with the php side, the JSON Object as POST params method will work if collected this way on the php side: ``` <?php $json = file_get_contents('php://input'); $obj = json_decode($json); print_r($obj); print_r("this is a test"); ?> ```
22,097,441
On my website, users click on an image. However, in the code they're actually clicking on an `<a>` with an `<img>` in it. I want there to appear a red ring around the image when the user clicks it. The `<img>` and the `<a>` have the same id and class. Is it possible to have `$(this).addClass('SelectedService');` add a...
2014/02/28
[ "https://Stackoverflow.com/questions/22097441", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3290485/" ]
No need to go for the jquery use css Your html ``` <img src="http://static.adzerk.net/Advertisers/12f0cc69cd9742faa9c8ee0f7b0d210e.jpg"/> ``` and css ``` img:active { border:3px solid red; } ``` **[Demo](http://jsfiddle.net/JPYYu/)** Checkout upper link for the demo
``` $('#ahref1').bind('click', function(){ $(this).find('img').first().addClass("SelectedService"); }); ``` If your html is something like: ``` <a id="ahref1" href="..."><img src="..." /></a> ```
22,097,441
On my website, users click on an image. However, in the code they're actually clicking on an `<a>` with an `<img>` in it. I want there to appear a red ring around the image when the user clicks it. The `<img>` and the `<a>` have the same id and class. Is it possible to have `$(this).addClass('SelectedService');` add a...
2014/02/28
[ "https://Stackoverflow.com/questions/22097441", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3290485/" ]
``` $('#ahref1').bind('click', function(){ $(this).find('img').first().addClass("SelectedService"); }); ``` If your html is something like: ``` <a id="ahref1" href="..."><img src="..." /></a> ```
Instead of selecting `$(this)`, you should use like this to work. ``` $('img').addClass('SelectedService'); ``` this will select `img` tag inside `a` tag and add class to `img`
22,097,441
On my website, users click on an image. However, in the code they're actually clicking on an `<a>` with an `<img>` in it. I want there to appear a red ring around the image when the user clicks it. The `<img>` and the `<a>` have the same id and class. Is it possible to have `$(this).addClass('SelectedService');` add a...
2014/02/28
[ "https://Stackoverflow.com/questions/22097441", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3290485/" ]
No need to go for the jquery use css Your html ``` <img src="http://static.adzerk.net/Advertisers/12f0cc69cd9742faa9c8ee0f7b0d210e.jpg"/> ``` and css ``` img:active { border:3px solid red; } ``` **[Demo](http://jsfiddle.net/JPYYu/)** Checkout upper link for the demo
No need for javascript. If you just want to change the style once an anchor tag is clicked, you can use the pseudo-class `:active`. [**Example**](http://jsfiddle.net/LW9y6/)
22,097,441
On my website, users click on an image. However, in the code they're actually clicking on an `<a>` with an `<img>` in it. I want there to appear a red ring around the image when the user clicks it. The `<img>` and the `<a>` have the same id and class. Is it possible to have `$(this).addClass('SelectedService');` add a...
2014/02/28
[ "https://Stackoverflow.com/questions/22097441", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3290485/" ]
No need for javascript. If you just want to change the style once an anchor tag is clicked, you can use the pseudo-class `:active`. [**Example**](http://jsfiddle.net/LW9y6/)
Instead of selecting `$(this)`, you should use like this to work. ``` $('img').addClass('SelectedService'); ``` this will select `img` tag inside `a` tag and add class to `img`
22,097,441
On my website, users click on an image. However, in the code they're actually clicking on an `<a>` with an `<img>` in it. I want there to appear a red ring around the image when the user clicks it. The `<img>` and the `<a>` have the same id and class. Is it possible to have `$(this).addClass('SelectedService');` add a...
2014/02/28
[ "https://Stackoverflow.com/questions/22097441", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3290485/" ]
No need to go for the jquery use css Your html ``` <img src="http://static.adzerk.net/Advertisers/12f0cc69cd9742faa9c8ee0f7b0d210e.jpg"/> ``` and css ``` img:active { border:3px solid red; } ``` **[Demo](http://jsfiddle.net/JPYYu/)** Checkout upper link for the demo
Instead of selecting `$(this)`, you should use like this to work. ``` $('img').addClass('SelectedService'); ``` this will select `img` tag inside `a` tag and add class to `img`
22,097,441
On my website, users click on an image. However, in the code they're actually clicking on an `<a>` with an `<img>` in it. I want there to appear a red ring around the image when the user clicks it. The `<img>` and the `<a>` have the same id and class. Is it possible to have `$(this).addClass('SelectedService');` add a...
2014/02/28
[ "https://Stackoverflow.com/questions/22097441", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3290485/" ]
No need to go for the jquery use css Your html ``` <img src="http://static.adzerk.net/Advertisers/12f0cc69cd9742faa9c8ee0f7b0d210e.jpg"/> ``` and css ``` img:active { border:3px solid red; } ``` **[Demo](http://jsfiddle.net/JPYYu/)** Checkout upper link for the demo
``` <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js"></script> $('#id_link').click(function(){ $(this).toggleClass('SelectedService'); }); ``` assuming that class is a red ring
22,097,441
On my website, users click on an image. However, in the code they're actually clicking on an `<a>` with an `<img>` in it. I want there to appear a red ring around the image when the user clicks it. The `<img>` and the `<a>` have the same id and class. Is it possible to have `$(this).addClass('SelectedService');` add a...
2014/02/28
[ "https://Stackoverflow.com/questions/22097441", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3290485/" ]
``` <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js"></script> $('#id_link').click(function(){ $(this).toggleClass('SelectedService'); }); ``` assuming that class is a red ring
Instead of selecting `$(this)`, you should use like this to work. ``` $('img').addClass('SelectedService'); ``` this will select `img` tag inside `a` tag and add class to `img`
34,143,857
I'm using a linq query to output an int array. But I need to pass this into a method that only accepts int?[]. So after searching on ways to convert int[] to int?[] I found something that seemed might work [here](https://stackoverflow.com/a/28611320/1814739) The following code is a simplified example that shows what...
2015/12/07
[ "https://Stackoverflow.com/questions/34143857", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1814739/" ]
`int?[]` is an array of `int?`. All you need is change lambda in `Select`, to return an `int?`: ``` int?[] vids2 = new[] { "", "1", "2", "3" } .Where(x => !String.IsNullOrWhiteSpace(x)) .Select(x => (int?)Convert.ToInt32(x)) .ToArray(); ``` If you already have an `int[]`, you can use `Cast()` to cast the...
How about this using `Cast<>` and a type constraint making `T` a `struct`: ``` public static IEnumerable<T?> ToArrayOrNull<T>(this IEnumerable<T> seq) where T : struct { if (seq.Count() == 0) return null; return seq.Cast<T?>().ToArray(); } ```
34,143,857
I'm using a linq query to output an int array. But I need to pass this into a method that only accepts int?[]. So after searching on ways to convert int[] to int?[] I found something that seemed might work [here](https://stackoverflow.com/a/28611320/1814739) The following code is a simplified example that shows what...
2015/12/07
[ "https://Stackoverflow.com/questions/34143857", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1814739/" ]
`int?[]` is an array of `int?`. All you need is change lambda in `Select`, to return an `int?`: ``` int?[] vids2 = new[] { "", "1", "2", "3" } .Where(x => !String.IsNullOrWhiteSpace(x)) .Select(x => (int?)Convert.ToInt32(x)) .ToArray(); ``` If you already have an `int[]`, you can use `Cast()` to cast the...
This extension method, `ToArrayOrNull`, does not change the type of the contents. `seq` is an `IEnumerable` of `T`. `result` is an array of `T` (which you sometimes return as `null`, but that's still an array of `T`. If you really want to convert an `IEnumerable<T>` to an `IEnumerable<T?>` (or an array of `T?`), you s...
34,143,857
I'm using a linq query to output an int array. But I need to pass this into a method that only accepts int?[]. So after searching on ways to convert int[] to int?[] I found something that seemed might work [here](https://stackoverflow.com/a/28611320/1814739) The following code is a simplified example that shows what...
2015/12/07
[ "https://Stackoverflow.com/questions/34143857", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1814739/" ]
`int?[]` is an array of `int?`. All you need is change lambda in `Select`, to return an `int?`: ``` int?[] vids2 = new[] { "", "1", "2", "3" } .Where(x => !String.IsNullOrWhiteSpace(x)) .Select(x => (int?)Convert.ToInt32(x)) .ToArray(); ``` If you already have an `int[]`, you can use `Cast()` to cast the...
I know that it's not correct answer for your question but there is a bit different solution - if you want to keep order and collection length. ``` public static class EnumerableExtensions { public delegate bool ParseDelegate<T>(string input, out T value) where T : struct; public static T?[] ToNullable<T>(this...
34,143,857
I'm using a linq query to output an int array. But I need to pass this into a method that only accepts int?[]. So after searching on ways to convert int[] to int?[] I found something that seemed might work [here](https://stackoverflow.com/a/28611320/1814739) The following code is a simplified example that shows what...
2015/12/07
[ "https://Stackoverflow.com/questions/34143857", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1814739/" ]
Don't do the wrong thing first, and then fix it up afterwards. Do the right thing straigtaway. You know you need an `int?[]`. So create an `int?[]`. Don't first create an `int[]` and then fix it up. You can get it to work, but it's pointlessly complicated. ``` int?[] vids1 = new[] { "", "1", "2", "3" } .Where(x =>...
How about this using `Cast<>` and a type constraint making `T` a `struct`: ``` public static IEnumerable<T?> ToArrayOrNull<T>(this IEnumerable<T> seq) where T : struct { if (seq.Count() == 0) return null; return seq.Cast<T?>().ToArray(); } ```
34,143,857
I'm using a linq query to output an int array. But I need to pass this into a method that only accepts int?[]. So after searching on ways to convert int[] to int?[] I found something that seemed might work [here](https://stackoverflow.com/a/28611320/1814739) The following code is a simplified example that shows what...
2015/12/07
[ "https://Stackoverflow.com/questions/34143857", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1814739/" ]
Don't do the wrong thing first, and then fix it up afterwards. Do the right thing straigtaway. You know you need an `int?[]`. So create an `int?[]`. Don't first create an `int[]` and then fix it up. You can get it to work, but it's pointlessly complicated. ``` int?[] vids1 = new[] { "", "1", "2", "3" } .Where(x =>...
This extension method, `ToArrayOrNull`, does not change the type of the contents. `seq` is an `IEnumerable` of `T`. `result` is an array of `T` (which you sometimes return as `null`, but that's still an array of `T`. If you really want to convert an `IEnumerable<T>` to an `IEnumerable<T?>` (or an array of `T?`), you s...
34,143,857
I'm using a linq query to output an int array. But I need to pass this into a method that only accepts int?[]. So after searching on ways to convert int[] to int?[] I found something that seemed might work [here](https://stackoverflow.com/a/28611320/1814739) The following code is a simplified example that shows what...
2015/12/07
[ "https://Stackoverflow.com/questions/34143857", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1814739/" ]
Don't do the wrong thing first, and then fix it up afterwards. Do the right thing straigtaway. You know you need an `int?[]`. So create an `int?[]`. Don't first create an `int[]` and then fix it up. You can get it to work, but it's pointlessly complicated. ``` int?[] vids1 = new[] { "", "1", "2", "3" } .Where(x =>...
I know that it's not correct answer for your question but there is a bit different solution - if you want to keep order and collection length. ``` public static class EnumerableExtensions { public delegate bool ParseDelegate<T>(string input, out T value) where T : struct; public static T?[] ToNullable<T>(this...
34,143,857
I'm using a linq query to output an int array. But I need to pass this into a method that only accepts int?[]. So after searching on ways to convert int[] to int?[] I found something that seemed might work [here](https://stackoverflow.com/a/28611320/1814739) The following code is a simplified example that shows what...
2015/12/07
[ "https://Stackoverflow.com/questions/34143857", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1814739/" ]
This extension method, `ToArrayOrNull`, does not change the type of the contents. `seq` is an `IEnumerable` of `T`. `result` is an array of `T` (which you sometimes return as `null`, but that's still an array of `T`. If you really want to convert an `IEnumerable<T>` to an `IEnumerable<T?>` (or an array of `T?`), you s...
How about this using `Cast<>` and a type constraint making `T` a `struct`: ``` public static IEnumerable<T?> ToArrayOrNull<T>(this IEnumerable<T> seq) where T : struct { if (seq.Count() == 0) return null; return seq.Cast<T?>().ToArray(); } ```
34,143,857
I'm using a linq query to output an int array. But I need to pass this into a method that only accepts int?[]. So after searching on ways to convert int[] to int?[] I found something that seemed might work [here](https://stackoverflow.com/a/28611320/1814739) The following code is a simplified example that shows what...
2015/12/07
[ "https://Stackoverflow.com/questions/34143857", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1814739/" ]
This extension method, `ToArrayOrNull`, does not change the type of the contents. `seq` is an `IEnumerable` of `T`. `result` is an array of `T` (which you sometimes return as `null`, but that's still an array of `T`. If you really want to convert an `IEnumerable<T>` to an `IEnumerable<T?>` (or an array of `T?`), you s...
I know that it's not correct answer for your question but there is a bit different solution - if you want to keep order and collection length. ``` public static class EnumerableExtensions { public delegate bool ParseDelegate<T>(string input, out T value) where T : struct; public static T?[] ToNullable<T>(this...
46,993,890
I have created a simple webview app. But there is a small problem and I can not fix it. It loads the first page without issue. [![enter image description here](https://i.stack.imgur.com/qKmrY.png)](https://i.stack.imgur.com/qKmrY.png) When I click to the first input, the program crashes and the error code is below: ...
2017/10/28
[ "https://Stackoverflow.com/questions/46993890", "https://Stackoverflow.com", "https://Stackoverflow.com/users/753456/" ]
In general you should follow next flow 1. Add webView as a subview to `UIViewController`'s view (you might have done it in XIB or Storyboard) 2. Add Autolayout constraints between webView and `UIViewController`'s view in code or in Interface Builder 3. Also, please remove `view.translatesAutoresizingMaskIntoConstrain...
It might be interesting to note this happens to a lot of people. I have a clean project running, no additional controls and get the same problem: layout constraints when clicking Search (keyboard popup). It might be indicated as an iOS 11 bug here: [WKWebView constrains issue when keyboard pops up](https://stackoverfl...
46,993,890
I have created a simple webview app. But there is a small problem and I can not fix it. It loads the first page without issue. [![enter image description here](https://i.stack.imgur.com/qKmrY.png)](https://i.stack.imgur.com/qKmrY.png) When I click to the first input, the program crashes and the error code is below: ...
2017/10/28
[ "https://Stackoverflow.com/questions/46993890", "https://Stackoverflow.com", "https://Stackoverflow.com/users/753456/" ]
Based on the following captures from Reveal, it seems like an Auto Layout issue in Apple’s code. I bet they will fix it at some point. [![broken constraint](https://i.stack.imgur.com/M5uU3.png)](https://i.stack.imgur.com/M5uU3.png) [![view hierarchy](https://i.stack.imgur.com/0nA11.png)](https://i.stack.imgur.com/0nA1...
It might be interesting to note this happens to a lot of people. I have a clean project running, no additional controls and get the same problem: layout constraints when clicking Search (keyboard popup). It might be indicated as an iOS 11 bug here: [WKWebView constrains issue when keyboard pops up](https://stackoverfl...
148,175
I have a turret, displayed below, which I would like to duplicate and mirror across the global Y axis. [![Blender in object mode, view pointing in the negative z direction at the global y axis, with an object to the left of the global y-axis, rotated 15 degrees.](https://i.stack.imgur.com/jLpcv.png)](https://i.stack.i...
2019/08/10
[ "https://blender.stackexchange.com/questions/148175", "https://blender.stackexchange.com", "https://blender.stackexchange.com/users/78174/" ]
If you are doing this so that they could be animated I would add a Copy Rotation Constraint and then invert the Y axis. Or if you are modelling, Create a new collection with the left side (M) and then place a Collection Instance (Shift-A) of that and mirror the Instance. The collection instance has it's origin in the ...
You have rotated your object in *Object* mode. If you mirror, it will mirror on the object own local axis, not the global, that's what happened. So if you want to have an object that looks mirrored on the global axis you first need to apply the rotation with `ctrl``A`, so that its current local axis aligns to the globa...
23,515,358
I've wasted numerous hours on this and cannot seem to get it to work, I've read many answers on here already but none seem to be helping. I have a header DIV then then two DIV's underneath floated Left of eachother. the menu on the left and content on the right. the right i have set Overflow: hidden so it sits next to...
2014/05/07
[ "https://Stackoverflow.com/questions/23515358", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3611752/" ]
please, try this one ``` SELECT * FROM table1 t1 WHERE EXISTS(SELECT * FROM table2 t2 WHERE closureflag = 'N' AND t1.ID = t2.ID); ```
I would try it with a join select id, name, location from table1 join table2 on table1.id=table2.id where table2.closureflg = 'N' group by id
57,118,773
I want to delete every row that has cell with `?` value in it. I do not know where `?` value is (i do not know name of the column). Any idea how to do this: ``` df = pd.DataFrame({'A': [1,4,6,"?",3], 'B': ["?",3,5,1,4], 'C': [13,5,61,5, "?"]}) ``` Desired output: ``` A B ...
2019/07/19
[ "https://Stackoverflow.com/questions/57118773", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9749124/" ]
You can use below code: ``` df=df.replace('?',np.nan) df.dropna(inplace=True) A B C 1 4.0 3.0 5.0 2 6.0 5.0 61.0 ``` For more information please see [`https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.DataFrame.dropna.html`](https://pandas.pydata.org/pandas-docs/stable/reference/api/panda...
you could do : ```py df[df == "?"] = None df = df.dropna(axis = 0) ```
57,118,773
I want to delete every row that has cell with `?` value in it. I do not know where `?` value is (i do not know name of the column). Any idea how to do this: ``` df = pd.DataFrame({'A': [1,4,6,"?",3], 'B': ["?",3,5,1,4], 'C': [13,5,61,5, "?"]}) ``` Desired output: ``` A B ...
2019/07/19
[ "https://Stackoverflow.com/questions/57118773", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9749124/" ]
you could do : ```py df[df == "?"] = None df = df.dropna(axis = 0) ```
One line version : ``` result = df.replace('?', pd.np.nan).dropna() ```
57,118,773
I want to delete every row that has cell with `?` value in it. I do not know where `?` value is (i do not know name of the column). Any idea how to do this: ``` df = pd.DataFrame({'A': [1,4,6,"?",3], 'B': ["?",3,5,1,4], 'C': [13,5,61,5, "?"]}) ``` Desired output: ``` A B ...
2019/07/19
[ "https://Stackoverflow.com/questions/57118773", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9749124/" ]
You can use below code: ``` df=df.replace('?',np.nan) df.dropna(inplace=True) A B C 1 4.0 3.0 5.0 2 6.0 5.0 61.0 ``` For more information please see [`https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.DataFrame.dropna.html`](https://pandas.pydata.org/pandas-docs/stable/reference/api/panda...
One line version : ``` result = df.replace('?', pd.np.nan).dropna() ```
196,244
A week ago, 2 of the most gigantic cruise ships in the world docked near my city. If you have seen one, or been on one, you will know how large they are. [![Giant Cruise Ship](https://i.stack.imgur.com/UFRPU.jpg)](https://i.stack.imgur.com/UFRPU.jpg) They look extremely unsafe to me, although obviously safety feature...
2015/07/27
[ "https://physics.stackexchange.com/questions/196244", "https://physics.stackexchange.com", "https://physics.stackexchange.com/users/-1/" ]
Some dimensions I was able to dig up (mostly from Wikipedia). Draft of the Allure of the Seas: 31 ft (10 m) Length: 1181 ft (360 m) Beam at waterline: 47 m Height: 72 m above waterline Let's just draw the section based on these simple numbers: [![enter image description here](https://i.stack.imgur.com/mxR9d.pn...
I doubt it is all fluid dynamics. The have to stay upright even with dead engines. If the integral of the lever below the water line is bigger than above then it should stay upright. Ballast at the bottom goes a long way as it has a long lever. Stuff like engines below deck tends to be heavy anyway. Weight is not a big...
196,244
A week ago, 2 of the most gigantic cruise ships in the world docked near my city. If you have seen one, or been on one, you will know how large they are. [![Giant Cruise Ship](https://i.stack.imgur.com/UFRPU.jpg)](https://i.stack.imgur.com/UFRPU.jpg) They look extremely unsafe to me, although obviously safety feature...
2015/07/27
[ "https://physics.stackexchange.com/questions/196244", "https://physics.stackexchange.com", "https://physics.stackexchange.com/users/-1/" ]
I doubt it is all fluid dynamics. The have to stay upright even with dead engines. If the integral of the lever below the water line is bigger than above then it should stay upright. Ballast at the bottom goes a long way as it has a long lever. Stuff like engines below deck tends to be heavy anyway. Weight is not a big...
As I understand it many seagoing vessels also use gyroscopes spinning on a vertical axis attached to the main components of the vessel's structure to null out much of the motion on the vessel's roll axis. Gyroscopes are also popular among motor yachts. I'm not Shure if they're used on giant cruise ships or not but, gyr...
196,244
A week ago, 2 of the most gigantic cruise ships in the world docked near my city. If you have seen one, or been on one, you will know how large they are. [![Giant Cruise Ship](https://i.stack.imgur.com/UFRPU.jpg)](https://i.stack.imgur.com/UFRPU.jpg) They look extremely unsafe to me, although obviously safety feature...
2015/07/27
[ "https://physics.stackexchange.com/questions/196244", "https://physics.stackexchange.com", "https://physics.stackexchange.com/users/-1/" ]
I doubt it is all fluid dynamics. The have to stay upright even with dead engines. If the integral of the lever below the water line is bigger than above then it should stay upright. Ballast at the bottom goes a long way as it has a long lever. Stuff like engines below deck tends to be heavy anyway. Weight is not a big...
a large lever attached with a ship will give a huge effort on other side that it can heat the water by driving an engine made of dc motor and emf give to heating element which operate on dc voltage so it may work on either side to produce steam engine can produce electricity at a constant speed to provide for grid oper...
196,244
A week ago, 2 of the most gigantic cruise ships in the world docked near my city. If you have seen one, or been on one, you will know how large they are. [![Giant Cruise Ship](https://i.stack.imgur.com/UFRPU.jpg)](https://i.stack.imgur.com/UFRPU.jpg) They look extremely unsafe to me, although obviously safety feature...
2015/07/27
[ "https://physics.stackexchange.com/questions/196244", "https://physics.stackexchange.com", "https://physics.stackexchange.com/users/-1/" ]
Some dimensions I was able to dig up (mostly from Wikipedia). Draft of the Allure of the Seas: 31 ft (10 m) Length: 1181 ft (360 m) Beam at waterline: 47 m Height: 72 m above waterline Let's just draw the section based on these simple numbers: [![enter image description here](https://i.stack.imgur.com/mxR9d.pn...
As I understand it many seagoing vessels also use gyroscopes spinning on a vertical axis attached to the main components of the vessel's structure to null out much of the motion on the vessel's roll axis. Gyroscopes are also popular among motor yachts. I'm not Shure if they're used on giant cruise ships or not but, gyr...
196,244
A week ago, 2 of the most gigantic cruise ships in the world docked near my city. If you have seen one, or been on one, you will know how large they are. [![Giant Cruise Ship](https://i.stack.imgur.com/UFRPU.jpg)](https://i.stack.imgur.com/UFRPU.jpg) They look extremely unsafe to me, although obviously safety feature...
2015/07/27
[ "https://physics.stackexchange.com/questions/196244", "https://physics.stackexchange.com", "https://physics.stackexchange.com/users/-1/" ]
Some dimensions I was able to dig up (mostly from Wikipedia). Draft of the Allure of the Seas: 31 ft (10 m) Length: 1181 ft (360 m) Beam at waterline: 47 m Height: 72 m above waterline Let's just draw the section based on these simple numbers: [![enter image description here](https://i.stack.imgur.com/mxR9d.pn...
a large lever attached with a ship will give a huge effort on other side that it can heat the water by driving an engine made of dc motor and emf give to heating element which operate on dc voltage so it may work on either side to produce steam engine can produce electricity at a constant speed to provide for grid oper...
196,244
A week ago, 2 of the most gigantic cruise ships in the world docked near my city. If you have seen one, or been on one, you will know how large they are. [![Giant Cruise Ship](https://i.stack.imgur.com/UFRPU.jpg)](https://i.stack.imgur.com/UFRPU.jpg) They look extremely unsafe to me, although obviously safety feature...
2015/07/27
[ "https://physics.stackexchange.com/questions/196244", "https://physics.stackexchange.com", "https://physics.stackexchange.com/users/-1/" ]
As I understand it many seagoing vessels also use gyroscopes spinning on a vertical axis attached to the main components of the vessel's structure to null out much of the motion on the vessel's roll axis. Gyroscopes are also popular among motor yachts. I'm not Shure if they're used on giant cruise ships or not but, gyr...
a large lever attached with a ship will give a huge effort on other side that it can heat the water by driving an engine made of dc motor and emf give to heating element which operate on dc voltage so it may work on either side to produce steam engine can produce electricity at a constant speed to provide for grid oper...
5,072,516
I am trying to match a string that has the form: ``` abcd:vxyz ``` That is: 4 chars followed by a colon then followed by three (or maximum) 4 chars. I want to do case INSENSITIVE matches. Can anyone help with the pattern?
2011/02/21
[ "https://Stackoverflow.com/questions/5072516", "https://Stackoverflow.com", "https://Stackoverflow.com/users/589927/" ]
``` /^[a-z]{4}:[a-z]{3,4}$/i ``` ........
The following regex should work: ``` "^[a-zA-Z]{4}:[a-zA-Z]{3,4}$" ``` The {4} part indicates that it should match exactly four copies of the previous symbol, which can be any character between 'a' and 'z', as well as 'A' and 'Z', inclusive. The {3,4} part creates a range of copies between 3 and 4 inclusive, while ...
5,072,516
I am trying to match a string that has the form: ``` abcd:vxyz ``` That is: 4 chars followed by a colon then followed by three (or maximum) 4 chars. I want to do case INSENSITIVE matches. Can anyone help with the pattern?
2011/02/21
[ "https://Stackoverflow.com/questions/5072516", "https://Stackoverflow.com", "https://Stackoverflow.com/users/589927/" ]
``` /^[a-z]{4}:[a-z]{3,4}$/i ``` ........
Your example was alphabetical, but it was unclear if your desired regex should be limited to that. If you wanted to match *any* characters in those groups: ``` /^.{4}:.{3,4}$/i ```
5,072,516
I am trying to match a string that has the form: ``` abcd:vxyz ``` That is: 4 chars followed by a colon then followed by three (or maximum) 4 chars. I want to do case INSENSITIVE matches. Can anyone help with the pattern?
2011/02/21
[ "https://Stackoverflow.com/questions/5072516", "https://Stackoverflow.com", "https://Stackoverflow.com/users/589927/" ]
``` /^[a-z]{4}:[a-z]{3,4}$/i ``` ........
Another non-regex way to do this would be to `split()` on the colon. Check for length 4 on the first element, and length 3 or 4 on the second element. ``` var foo = 'abcd:123a'; var bar = 'fds:0'; var af = foo.split(':'); var isMatch = ((af[0].length==4) && (af[1].length==3 || af[1].length==4)); alert (isMatch); var...
5,072,516
I am trying to match a string that has the form: ``` abcd:vxyz ``` That is: 4 chars followed by a colon then followed by three (or maximum) 4 chars. I want to do case INSENSITIVE matches. Can anyone help with the pattern?
2011/02/21
[ "https://Stackoverflow.com/questions/5072516", "https://Stackoverflow.com", "https://Stackoverflow.com/users/589927/" ]
The following regex should work: ``` "^[a-zA-Z]{4}:[a-zA-Z]{3,4}$" ``` The {4} part indicates that it should match exactly four copies of the previous symbol, which can be any character between 'a' and 'z', as well as 'A' and 'Z', inclusive. The {3,4} part creates a range of copies between 3 and 4 inclusive, while ...
Another non-regex way to do this would be to `split()` on the colon. Check for length 4 on the first element, and length 3 or 4 on the second element. ``` var foo = 'abcd:123a'; var bar = 'fds:0'; var af = foo.split(':'); var isMatch = ((af[0].length==4) && (af[1].length==3 || af[1].length==4)); alert (isMatch); var...
5,072,516
I am trying to match a string that has the form: ``` abcd:vxyz ``` That is: 4 chars followed by a colon then followed by three (or maximum) 4 chars. I want to do case INSENSITIVE matches. Can anyone help with the pattern?
2011/02/21
[ "https://Stackoverflow.com/questions/5072516", "https://Stackoverflow.com", "https://Stackoverflow.com/users/589927/" ]
Your example was alphabetical, but it was unclear if your desired regex should be limited to that. If you wanted to match *any* characters in those groups: ``` /^.{4}:.{3,4}$/i ```
Another non-regex way to do this would be to `split()` on the colon. Check for length 4 on the first element, and length 3 or 4 on the second element. ``` var foo = 'abcd:123a'; var bar = 'fds:0'; var af = foo.split(':'); var isMatch = ((af[0].length==4) && (af[1].length==3 || af[1].length==4)); alert (isMatch); var...
53,264,809
function anagrams(s1, s2) is a Boolean valued function, which returns true just in case the string s1 contains the same letters as string s2 but in a different order. The function should be case insensitive --- in other words it should return the same value if any letters in either s1 or s2 are changed from upper to lo...
2018/11/12
[ "https://Stackoverflow.com/questions/53264809", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10581944/" ]
You can simply set the [`maxlength`](https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XUL/Attribute/maxlength) attribute. > > The `maxlength` attribute specifies the maximum number of characters allowed in the *input* element. > > > **Demo:** ```html <input maxlength="10" type="text"/> ```
There are 2 attributes that allow you to add a minimum and maximum to your input they are **min** and **max** so just add max ="10" into your input tag
12,948
We watched Beautiful Creatures last night, I've read the book and even I was confused at points. Extra ideas were added, large amounts were cut. From memory * Marilyn and Ama's characters were merged * Macon was made a caster instead of an incubus * Boo Radley didn't appear at all * Ethan found the necklace at a diff...
2013/08/05
[ "https://movies.stackexchange.com/questions/12948", "https://movies.stackexchange.com", "https://movies.stackexchange.com/users/574/" ]
I think it could boil down to any of several different reasons: 1. Writer of the original book was not involved in the making of the movie, and therefor the movie script takes different directions than the book. 2. Producer thinks they know better and forces divergent changes in the script. (Same could be said for the...
This response is more then probably late, but majority of the big chunks that were cut would have EASILY pushed the movies rating over PG-13 standing the creators wanted. Though this isn't a big enough excuse for all the cuts I feel this PG-13 desire held back a fair bit of the book.
30,084,862
I got a code snippet for a date and time picker i found in this place: [Date and Time Picker](http://tarruda.github.io/bootstrap-datetimepicker/ "DateTimePicker") I didn't manage to insert it into my code normally from some reason so i just used the demo code on the bottom and pasted it in my ASP.NET site and this is ...
2015/05/06
[ "https://Stackoverflow.com/questions/30084862", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2996635/" ]
You have several approaches, you haven't indicated your technology so I'll cover several approaches. * Hidden * Ajax * Query String * runat The simplest approach would be the hidden or `runat`. To demonstrate, I'll start with the `runat` approach: ``` // Front End: <input type="text" id="txtDate" runat="server" /> ...
add this code to java script : ``` document.getElementsByName('mydate').value = picker.getLocalDate(); ``` add this code between form tag : ``` <asp:HiddenField ClientIDMode="Static" runat="server" id="mydate" /> ``` use this code in you'r code behind : ``` string myDate = mydate.Value; ``` but be careful use ...
29,944,913
I have weird issue with vim - for some files it doesn't color the syntax and opens it readonly mode by default, even if I use sudo. chmod for this file are 664, I am also owner of this file, so normally i shouldn't. I have no `set ro` in my vimrc. I noticed also that it often happens after removing .swp for this file...
2015/04/29
[ "https://Stackoverflow.com/questions/29944913", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1383935/" ]
I found solution - it was more trivial than I expected. I read the vim messages more carefully and I saw at the end: ``` if you did this already, delete the swap file `~/.vimswap/urls.py.swp` ``` So i did small investigation and i found `.vimviews` inside my /home directory. I just removed it's content and ...it ...
Probably spf13. There are WAY too many problems caused by spf13 in my opinion. Try doing `:verbose set readonly?` when you see the problem, to see where it happened from. My guess: 1. I think I remember spf13 having some kind of automatic session management built in, this would restore 'readonly' on a file if it had e...
53,346,445
I am creating come server-client application and I want to get the certificate. I tried to find some tutorials, for example I found this: ``` openssl req -x509 -out localhost.crt -keyout localhost.key \ -newkey rsa:2048 -nodes -sha256 \ -subj '/CN=localhost' -extensions EXT -config <( \ printf "[dn]\nCN=localhost\...
2018/11/16
[ "https://Stackoverflow.com/questions/53346445", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10401960/" ]
Might be easiest to use EasyRSA, that way you setup a CA and you can then sign as many certificates as you need and get a key you can insert into your clients so they stop whining about the self-signed certificate. It's distributed with OpenVPN, but can easily be used without OpenVPN. Just remember that modern browse...
Generate certificate using the below codes. Create these files in a folder. Using command prompt navigate ("cd") to that folder and then run "bash generate.sh" without quotes. Please note you need to have bash installed. If you have installed git-scm then you should have bash already. Then a folder named certificates s...
60,094,697
I'm trying to get second object inside `data` if this id is equals with the id of another object. With the code below, I'm able to get only ID and not the whole ``` data: { 0: { id: 1234, name: 'Name 1' }, 2: { id: 4321, name: 'Name 2' }, 3: { id: 876, name: 'Name 3' } } instanceID: 4321 con...
2020/02/06
[ "https://Stackoverflow.com/questions/60094697", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9378116/" ]
Try this : ``` defaultInstance: response.data.filter(d=> d.id == response.instanceID) ```
This will help you. ```js let data = { 0: { id: 1234, name: 'Name 1' }, 2: { id: 4321, name: 'Name 2' }, 3: { id: 876, name: 'Name 3' } }; let instanceID = 4321; let result = Object.values(data).filter(chunk => chunk.id === instanceID); console.log(result); ```
29,459,556
I am building a website using wordpress theme. I have two elements (one floated left, second floated right) in the footer. I need to make it centered (the second one below the first one) when I resize the browser window. I guess I need to set `float:none;` in the media queries and center it somehow, but I wasn't able t...
2015/04/05
[ "https://Stackoverflow.com/questions/29459556", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4532872/" ]
This is not a loss of polymorphism. This is a lack of [duck typing](https://stackoverflow.com/questions/1079785/whats-an-example-of-duck-typing-in-java). When the compiler, statically, only knows that it's a `Student` it wont allow you to call non `Student` methods. Even though you know that, at run time, it will be av...
`std` is of type `Student`, and it may hold refrences to objects that are not an `AthleteStudent`. Therefore, you can't call `std.changeDepartement()` without an explicit cast to `AthleteStudent`.
6,284,911
I'm trying to make my layouts more landscape friendly, and a common pattern I have is to add a `LinearLayout` with some buttons (e.g. OK | Cancel) and just set a value for `layout_weight` so that the space is evenly distributed. The problem is that when you use a phone or (especially) a tablet in landscape mode, you en...
2011/06/08
[ "https://Stackoverflow.com/questions/6284911", "https://Stackoverflow.com", "https://Stackoverflow.com/users/642161/" ]
I don't have Eclipse here to test it, but I would use a RelativeLayout instead, something like: ``` <RelativeLayout android:layout_width="fill_parent" android:layout_height="wrap_content" > <View android:id="@+id/centerView" android:layout_width="0dp" android:layout_height="wrap_content" androi...
``` <RelativeLayout android:id="@+id/rlMain" android:layout_width="match_parent" android:layout_height="match_parent" android:layout_marginLeft="12dp" android:layout_marginRight="12dp"> <View android:id="@+id/vCenter" android:layout_width="0dp" android:layout_height="0dp" and...
6,284,911
I'm trying to make my layouts more landscape friendly, and a common pattern I have is to add a `LinearLayout` with some buttons (e.g. OK | Cancel) and just set a value for `layout_weight` so that the space is evenly distributed. The problem is that when you use a phone or (especially) a tablet in landscape mode, you en...
2011/06/08
[ "https://Stackoverflow.com/questions/6284911", "https://Stackoverflow.com", "https://Stackoverflow.com/users/642161/" ]
After messing around quite a bit with relative layouts, I stumbled upon [this answer](https://stackoverflow.com/questions/5875877/setting-max-width-of-linearlayout-or-other-viewgroup-on-android), which is what I ended up using.
``` <RelativeLayout android:id="@+id/rlMain" android:layout_width="match_parent" android:layout_height="match_parent" android:layout_marginLeft="12dp" android:layout_marginRight="12dp"> <View android:id="@+id/vCenter" android:layout_width="0dp" android:layout_height="0dp" and...
37,487,400
I want to be able to to be able to set padding values if a boolean is true. The problem is that Android studio cannot parse the layout because it thinks 2dp is a decimal with a value of 2 and then doesn't know what to do with the p. how do I format this so that it understands i mean 2 density pixels. Data layout: ```...
2016/05/27
[ "https://Stackoverflow.com/questions/37487400", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3887945/" ]
For anyone looking to set margins via DataBinding, you'll have to use `BindingAdapter` as well: ``` @BindingAdapter("layoutMarginBottom") fun setLayoutMarginBottom(view: View, dimen: Float) { val layoutParams = view.layoutParams as MarginLayoutParams layoutParams.bottomMargin = dimen.toInt() view.layoutPar...
Use a blank view ``` <View android:layout_width = "8dp" android:layout_height = "8dp" > ``` Now constraint this view to the layout you want to control the visibility of . Now disappear this view depending on the condition. would work the same as a margin
37,487,400
I want to be able to to be able to set padding values if a boolean is true. The problem is that Android studio cannot parse the layout because it thinks 2dp is a decimal with a value of 2 and then doesn't know what to do with the p. how do I format this so that it understands i mean 2 density pixels. Data layout: ```...
2016/05/27
[ "https://Stackoverflow.com/questions/37487400", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3887945/" ]
For anyone looking to set margins via DataBinding, you'll have to use `BindingAdapter` as well: ``` @BindingAdapter("layoutMarginBottom") fun setLayoutMarginBottom(view: View, dimen: Float) { val layoutParams = view.layoutParams as MarginLayoutParams layoutParams.bottomMargin = dimen.toInt() view.layoutPar...
@Ravi's answer is correct. But for more flexibility you can also try this: ``` @BindingAdapter({"padding", "shouldAdd"}) public static void setPadding(AppCompatImageView imageView, boolean shouldAdd, int padding){ if (shouldAdd){ imageView.setPadding(padding, padding, padding, padding); } } ``` The...
37,487,400
I want to be able to to be able to set padding values if a boolean is true. The problem is that Android studio cannot parse the layout because it thinks 2dp is a decimal with a value of 2 and then doesn't know what to do with the p. how do I format this so that it understands i mean 2 density pixels. Data layout: ```...
2016/05/27
[ "https://Stackoverflow.com/questions/37487400", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3887945/" ]
@Ravi's answer is correct. But for more flexibility you can also try this: ``` @BindingAdapter({"padding", "shouldAdd"}) public static void setPadding(AppCompatImageView imageView, boolean shouldAdd, int padding){ if (shouldAdd){ imageView.setPadding(padding, padding, padding, padding); } } ``` The...
Use a blank view ``` <View android:layout_width = "8dp" android:layout_height = "8dp" > ``` Now constraint this view to the layout you want to control the visibility of . Now disappear this view depending on the condition. would work the same as a margin
37,487,400
I want to be able to to be able to set padding values if a boolean is true. The problem is that Android studio cannot parse the layout because it thinks 2dp is a decimal with a value of 2 and then doesn't know what to do with the p. how do I format this so that it understands i mean 2 density pixels. Data layout: ```...
2016/05/27
[ "https://Stackoverflow.com/questions/37487400", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3887945/" ]
Store padding value in `dimen.xml` and use it. Please keep habit to write binding string with " " (double quotes) ``` android:paddingBottom="@{isGroupType ? @dimen/padding_normal : @dimen/padding_null}" ``` and so on for other paddings also.
@Ravi's answer is good, but it's working only for padding. If You want to simply add margin, create empty view e.g TextView with padding.
37,487,400
I want to be able to to be able to set padding values if a boolean is true. The problem is that Android studio cannot parse the layout because it thinks 2dp is a decimal with a value of 2 and then doesn't know what to do with the p. how do I format this so that it understands i mean 2 density pixels. Data layout: ```...
2016/05/27
[ "https://Stackoverflow.com/questions/37487400", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3887945/" ]
For anyone looking to set margins via DataBinding, you'll have to use `BindingAdapter` as well: ``` @BindingAdapter("layoutMarginBottom") fun setLayoutMarginBottom(view: View, dimen: Float) { val layoutParams = view.layoutParams as MarginLayoutParams layoutParams.bottomMargin = dimen.toInt() view.layoutPar...
You can use logic and ternary statements in xml-binding, but you really shouldn't. It will come back to haunt you when you're looking the usual places you have logic and don't see what's going on. BindingAdapter for all your margin needs: ``` fun bindingSetMargins(view: View, start: Float?, top: Float?, end: Float?, b...
37,487,400
I want to be able to to be able to set padding values if a boolean is true. The problem is that Android studio cannot parse the layout because it thinks 2dp is a decimal with a value of 2 and then doesn't know what to do with the p. how do I format this so that it understands i mean 2 density pixels. Data layout: ```...
2016/05/27
[ "https://Stackoverflow.com/questions/37487400", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3887945/" ]
Just as a heads-up this does not work with `layout_margin`'s :( Not sure why, but think it's due to the parent layout needs to be remeasured..
You can use logic and ternary statements in xml-binding, but you really shouldn't. It will come back to haunt you when you're looking the usual places you have logic and don't see what's going on. BindingAdapter for all your margin needs: ``` fun bindingSetMargins(view: View, start: Float?, top: Float?, end: Float?, b...
37,487,400
I want to be able to to be able to set padding values if a boolean is true. The problem is that Android studio cannot parse the layout because it thinks 2dp is a decimal with a value of 2 and then doesn't know what to do with the p. how do I format this so that it understands i mean 2 density pixels. Data layout: ```...
2016/05/27
[ "https://Stackoverflow.com/questions/37487400", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3887945/" ]
Just as a heads-up this does not work with `layout_margin`'s :( Not sure why, but think it's due to the parent layout needs to be remeasured..
Use a blank view ``` <View android:layout_width = "8dp" android:layout_height = "8dp" > ``` Now constraint this view to the layout you want to control the visibility of . Now disappear this view depending on the condition. would work the same as a margin
37,487,400
I want to be able to to be able to set padding values if a boolean is true. The problem is that Android studio cannot parse the layout because it thinks 2dp is a decimal with a value of 2 and then doesn't know what to do with the p. how do I format this so that it understands i mean 2 density pixels. Data layout: ```...
2016/05/27
[ "https://Stackoverflow.com/questions/37487400", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3887945/" ]
Store padding value in `dimen.xml` and use it. Please keep habit to write binding string with " " (double quotes) ``` android:paddingBottom="@{isGroupType ? @dimen/padding_normal : @dimen/padding_null}" ``` and so on for other paddings also.
For anyone looking to set margins via DataBinding, you'll have to use `BindingAdapter` as well: ``` @BindingAdapter("layoutMarginBottom") fun setLayoutMarginBottom(view: View, dimen: Float) { val layoutParams = view.layoutParams as MarginLayoutParams layoutParams.bottomMargin = dimen.toInt() view.layoutPar...
37,487,400
I want to be able to to be able to set padding values if a boolean is true. The problem is that Android studio cannot parse the layout because it thinks 2dp is a decimal with a value of 2 and then doesn't know what to do with the p. how do I format this so that it understands i mean 2 density pixels. Data layout: ```...
2016/05/27
[ "https://Stackoverflow.com/questions/37487400", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3887945/" ]
Just as a heads-up this does not work with `layout_margin`'s :( Not sure why, but think it's due to the parent layout needs to be remeasured..
@Ravi's answer is correct. But for more flexibility you can also try this: ``` @BindingAdapter({"padding", "shouldAdd"}) public static void setPadding(AppCompatImageView imageView, boolean shouldAdd, int padding){ if (shouldAdd){ imageView.setPadding(padding, padding, padding, padding); } } ``` The...
37,487,400
I want to be able to to be able to set padding values if a boolean is true. The problem is that Android studio cannot parse the layout because it thinks 2dp is a decimal with a value of 2 and then doesn't know what to do with the p. how do I format this so that it understands i mean 2 density pixels. Data layout: ```...
2016/05/27
[ "https://Stackoverflow.com/questions/37487400", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3887945/" ]
Store padding value in `dimen.xml` and use it. Please keep habit to write binding string with " " (double quotes) ``` android:paddingBottom="@{isGroupType ? @dimen/padding_normal : @dimen/padding_null}" ``` and so on for other paddings also.
Just as a heads-up this does not work with `layout_margin`'s :( Not sure why, but think it's due to the parent layout needs to be remeasured..
11,005
Is it possible to force a search crawler to crawl through the recycle bin(s) on a SharePoint 2010 system? I'd like to allow my users to delete files/folders in document libraries but if someone accidentally removes a file that they shouldn't it would make everyone's life a lot easier if items in the recycle bin(s) cou...
2011/04/11
[ "https://sharepoint.stackexchange.com/questions/11005", "https://sharepoint.stackexchange.com", "https://sharepoint.stackexchange.com/users/2766/" ]
Don't know if there is an OOTB solution for this. I couldn't find one. I was able to find something interesting though. you can search Recycle bin using PowerShell example : `(Get-SPSite "http://SERVERNAME:PORT/").RecycleBin | ?{$_.Title -match "DeletedFile"}` [Source](http://markviky.blogspot.com/2010/12/get-files-s...
As Shoban stated. Powershell is your best bet. ``` (Get-SPSite "https://SITECOLLECTION/").RecycleBin | ?{$_.Web -match "Sub Site"} ``` or ``` (Get-SPSite "https://SITECOLLECTION/").RecycleBin | ?{($_.DeletedDate -gt "5/13/2019") -and ($_.DeletedDate -lt "5/15/2019")} ``` You should be able to filter by any of the...
1,636,765
I use netbeans 6.8 beta and when i load .sh (bash) file it's not colored at all. i can add a new file association for the .sh extension but it doesn't seem that there is a known associated mime type.
2009/10/28
[ "https://Stackoverflow.com/questions/1636765", "https://Stackoverflow.com", "https://Stackoverflow.com/users/80932/" ]
I have not tried this myself but you can get shell script support in Netbeans if you install the **C/C++ plugin**.
This is very odd. I have NB6.8beta installed with the C/C++ plugin. When I open a .sh file I *do* see syntax high lighting. Quotes strings show up in orange, commands are in blue.
1,636,765
I use netbeans 6.8 beta and when i load .sh (bash) file it's not colored at all. i can add a new file association for the .sh extension but it doesn't seem that there is a known associated mime type.
2009/10/28
[ "https://Stackoverflow.com/questions/1636765", "https://Stackoverflow.com", "https://Stackoverflow.com/users/80932/" ]
I have not tried this myself but you can get shell script support in Netbeans if you install the **C/C++ plugin**.
old question, time for an update **(tested for 8.0.2,8.1,8.2)**. Here's what worked for me 1. **Install C/C++** plugin. This will recognize .sh extensions as bash files 2. **Install nb-noext-mime-resolver** (for 8.2 you'll find it as [No Extension MIME Resolver](http://plugins.netbeans.org/plugin/55076/no-extension-...
1,636,765
I use netbeans 6.8 beta and when i load .sh (bash) file it's not colored at all. i can add a new file association for the .sh extension but it doesn't seem that there is a known associated mime type.
2009/10/28
[ "https://Stackoverflow.com/questions/1636765", "https://Stackoverflow.com", "https://Stackoverflow.com/users/80932/" ]
old question, time for an update **(tested for 8.0.2,8.1,8.2)**. Here's what worked for me 1. **Install C/C++** plugin. This will recognize .sh extensions as bash files 2. **Install nb-noext-mime-resolver** (for 8.2 you'll find it as [No Extension MIME Resolver](http://plugins.netbeans.org/plugin/55076/no-extension-...
This is very odd. I have NB6.8beta installed with the C/C++ plugin. When I open a .sh file I *do* see syntax high lighting. Quotes strings show up in orange, commands are in blue.
223,261
I have a GPG-key. This key is unlimited valid. I thought recently, that this isn't the best idea. That's why my question: Can I add an expiration-date to an existant GPG-key? Or is my only option, to create a new key?
2010/12/17
[ "https://superuser.com/questions/223261", "https://superuser.com", "https://superuser.com/users/9249/" ]
If you're doing this from the commandline, you can do it with `gpg`:- ``` [andys@daedalus ~]$ gpg --edit-key 0xA762A666 <...> Command> expire Changing expiration time for the primary key. Please specify how long the key should be valid. 0 = key does not expire <n> = key expires in n days <n>w =...
Yes, you can edit it. The process will depend on the software you're using. I use GPGkeys for Windows, where all you have to do is right-click on your private key, and choose `edit > expiration date`. There is probably a similar method in your software. You can also manually revoke a key at any time.
965,215
I've searched all over, and I'm unable to find anything regarding copying multiple cells from different rows & columns to a single row in another sheet. Eg, Copy Cells, A10, F2, F3 & F34 from Sheet 1, to A2 in Sheet 2 and start a new row. The purpose is to copy certain information from an Invoice (Sheet 1) * A10 - ...
2015/08/31
[ "https://superuser.com/questions/965215", "https://superuser.com", "https://superuser.com/users/490503/" ]
I'm the Newrez author. Being that this is just a script, there are lots of options. One is just to execute it during login as a startup app. As long as X is up, you are all set. There is no dependency on Gnome or Nautilus. It should run on anything.
The solution is just plain simple, but it's not that perfect: * First just download newrez's here (yes, you've heard it) <http://gtk-apps.org/content/show.php/newrez+-+Increase+Screen+Rez+For+Netbook?content=134686> * Then, put it somewhere and make it executable from GUI * Just simply double-click on it and put you...