qid
int64
1
74.7M
question
stringlengths
15
58.3k
date
stringlengths
10
10
metadata
list
response_j
stringlengths
4
30.2k
response_k
stringlengths
11
36.5k
2,273,679
I am having a problem with a linked image. ``` <TR class="a"> <TD><A href="http://CA_NB_1_1-pr.jpg" rel="lightbox"><IMG src="CA_NB_1_1-th-pr.jpg"><BR><BR></A></TD> <TD class="hdsmlbr"><A href="http://127.0.0.1/odds/aptrqr2/view/1">35 Savoie Drive, Moncton, New Brunswick, Canada</A></TD> </TR> ``` This ima...
2010/02/16
[ "https://Stackoverflow.com/questions/2273679", "https://Stackoverflow.com", "https://Stackoverflow.com/users/202184/" ]
It might be the two `<br>`'s...
you have two newlines in your a tag? try this. ``` <TR class="a"> <TD><A href="http://CA_NB_1_1-pr.jpg" rel="lightbox"><IMG src="CA_NB_1_1-th-pr.jpg"></A></TD> <TD class="hdsmlbr"><A href="http://127.0.0.1/odds/aptrqr2/view/1">35 Savoie Drive, Moncton, New Brunswick, Canada</A></TD> </TR> ```
53,560,009
I had installed sensenet using nuget package manager and visual studio and able to run sensenet using visual studio. But when i tried using IIS and same packages, error is coming. i didnt find any installation guide to run on IIS local host. I had installed all the modules (Web pages, Work space using visual studio) ...
2018/11/30
[ "https://Stackoverflow.com/questions/53560009", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10639620/" ]
There are some 'Hacky' ways to achieve what you desire. You can use express.Route to register middlewares on each route instead, but I think that you may want more specific logs about GraphQL rather than the request in particular. context() --------- Available as a callback inside ApolloServer, it receives an object ...
With apollo server v2, its really simple to use it only on a single route. apply it as middleware. i.e ``` const app = require('express')(); const apolloServer = new ApolloServer ({ typeDefs, resolvers }) // then use it on a particular route apolloServer.applyMiddleware({ app, path: '/specialUrl' }); ```
53,560,009
I had installed sensenet using nuget package manager and visual studio and able to run sensenet using visual studio. But when i tried using IIS and same packages, error is coming. i didnt find any installation guide to run on IIS local host. I had installed all the modules (Web pages, Work space using visual studio) ...
2018/11/30
[ "https://Stackoverflow.com/questions/53560009", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10639620/" ]
There are some 'Hacky' ways to achieve what you desire. You can use express.Route to register middlewares on each route instead, but I think that you may want more specific logs about GraphQL rather than the request in particular. context() --------- Available as a callback inside ApolloServer, it receives an object ...
``` const express = require("express"); const router = express.Router(); const { ApolloServer, gql } = require('apollo-server-express'); const server = new ApolloServer({ schema: schema, introspection: true }); server.applyMiddleware({ app:router }); module.exports = router; ```
53,560,009
I had installed sensenet using nuget package manager and visual studio and able to run sensenet using visual studio. But when i tried using IIS and same packages, error is coming. i didnt find any installation guide to run on IIS local host. I had installed all the modules (Web pages, Work space using visual studio) ...
2018/11/30
[ "https://Stackoverflow.com/questions/53560009", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10639620/" ]
There are some 'Hacky' ways to achieve what you desire. You can use express.Route to register middlewares on each route instead, but I think that you may want more specific logs about GraphQL rather than the request in particular. context() --------- Available as a callback inside ApolloServer, it receives an object ...
There is a npm package [GraphQL-Router-Ware](https://www.npmjs.com/package/graphql-router-ware) Using this you can add router level middlewares to your resolvers in a much similar way like we do in express. You can setup your resolver something like this : ```js import Router from 'graphql-router-ware'; import { che...
53,560,009
I had installed sensenet using nuget package manager and visual studio and able to run sensenet using visual studio. But when i tried using IIS and same packages, error is coming. i didnt find any installation guide to run on IIS local host. I had installed all the modules (Web pages, Work space using visual studio) ...
2018/11/30
[ "https://Stackoverflow.com/questions/53560009", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10639620/" ]
With apollo server v2, its really simple to use it only on a single route. apply it as middleware. i.e ``` const app = require('express')(); const apolloServer = new ApolloServer ({ typeDefs, resolvers }) // then use it on a particular route apolloServer.applyMiddleware({ app, path: '/specialUrl' }); ```
There is a npm package [GraphQL-Router-Ware](https://www.npmjs.com/package/graphql-router-ware) Using this you can add router level middlewares to your resolvers in a much similar way like we do in express. You can setup your resolver something like this : ```js import Router from 'graphql-router-ware'; import { che...
53,560,009
I had installed sensenet using nuget package manager and visual studio and able to run sensenet using visual studio. But when i tried using IIS and same packages, error is coming. i didnt find any installation guide to run on IIS local host. I had installed all the modules (Web pages, Work space using visual studio) ...
2018/11/30
[ "https://Stackoverflow.com/questions/53560009", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10639620/" ]
``` const express = require("express"); const router = express.Router(); const { ApolloServer, gql } = require('apollo-server-express'); const server = new ApolloServer({ schema: schema, introspection: true }); server.applyMiddleware({ app:router }); module.exports = router; ```
There is a npm package [GraphQL-Router-Ware](https://www.npmjs.com/package/graphql-router-ware) Using this you can add router level middlewares to your resolvers in a much similar way like we do in express. You can setup your resolver something like this : ```js import Router from 'graphql-router-ware'; import { che...
66,589,462
Trying to select one row per day table idea below: ``` ID|PageID|DateTime |Value|SiteID 1 | 1 |2021/03/06| 2001| 1 1 | 1 |2021/03/06| 2002| 1 1 | 2 |2021/03/06| 2003| 1 1 | 3 |2021/03/06| 2004| 1 1 | 4 |2021/03/06| 2004| 1 1 | 1 |2021/03/07| 2004| 1 1 | 2 |2021/03/07| 2005| 1 1 | 3 |2021/03/07...
2021/03/11
[ "https://Stackoverflow.com/questions/66589462", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10038284/" ]
until you provide desired output , here is one way : ``` select * from (select * , row_number() over (partition by SiteId,Date) rn from table) tt where tt.rn = 1 ```
It might help you: ``` select top (1) with ties t.* from table t order by Row_Number() Over(Partition By SiteId,convert(date, datetime) Order by (select null)) ```
66,589,462
Trying to select one row per day table idea below: ``` ID|PageID|DateTime |Value|SiteID 1 | 1 |2021/03/06| 2001| 1 1 | 1 |2021/03/06| 2002| 1 1 | 2 |2021/03/06| 2003| 1 1 | 3 |2021/03/06| 2004| 1 1 | 4 |2021/03/06| 2004| 1 1 | 1 |2021/03/07| 2004| 1 1 | 2 |2021/03/07| 2005| 1 1 | 3 |2021/03/07...
2021/03/11
[ "https://Stackoverflow.com/questions/66589462", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10038284/" ]
You can use window functions. But if the value is a `datetime`, you need to extract the date: ``` select * from (select t.* , row_number() over (partition by SiteId, convert(date, datetime) order by (select null)) as seqnum from t ) t where seqnum = 1; ``` EDIT: If performance is an issue, t...
It might help you: ``` select top (1) with ties t.* from table t order by Row_Number() Over(Partition By SiteId,convert(date, datetime) Order by (select null)) ```
53,961,170
I have two forms in my access database, "Adjustment Form" and "Final Form". On "Final Form", there is a button that when clicked, I would like it to close the current form and open the Adjustment Form to a new record. FYI- The Adjustment Form will likely already be open, so if this is the case, just close the "Final ...
2018/12/28
[ "https://Stackoverflow.com/questions/53961170", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4021184/" ]
It worked for me. My ansible version is `ansible 2.9.18` and below is my playbook worked for ignoring the unreachable servers. ``` --- - name: Install the package serial: 1 hosts: dev become: yes gather_facts: false become_user: root tasks: - name: Install amazon efs package yum: name...
You can also disable the debugger and the playbook will run undisturbed: ```yaml - name: Play hosts: all debugger: never ``` More on the debugger [here](https://docs.ansible.com/ansible/latest/user_guide/playbooks_debugger.html)
56,960,167
Here's what I am trying to do, I would like to create a batch file to compress multiple folders and files into one 7zip file for archival purposes. I have external drives we can call [SOURCE DISK] and [DESTINATION DISK]. The File & Folders I want to compress are in the root of the [SOURCE DISK]. I would like to add ...
2019/07/09
[ "https://Stackoverflow.com/questions/56960167", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9711276/" ]
``` "C:\Program Files\7-Zip\7z.exe" a -pSECRET "[DESTINATION DISK]\[ARCHIVE NAME] %DATE:~10,4%%DATE:~4,2%%DATE:~7,2%_%TIME:~0,2%%TIME:~3,2%%TIME:~6,2%.7z" "[SOURCE DISK][FIRST FOLDER]" [SOURCE DISK][SECONDFOLDER] "[SOURCE DISK]\[EXCEL DOCUMENT]" -mhe=on -mx5 ``` I figured it out. Thanks for the support! After a bunch...
`C:\Program Files\7-Zip\7za` attempts to execute `C:\Program`. You need to quote it `"C:\Program Files\7-Zip\7za"` as you did in your "I've used" example. Possibly one should draw your attention to the `-r` switch to recurse the archiving - and I believe all of the switches (like `-mx5`) should appear before the archi...
56,960,167
Here's what I am trying to do, I would like to create a batch file to compress multiple folders and files into one 7zip file for archival purposes. I have external drives we can call [SOURCE DISK] and [DESTINATION DISK]. The File & Folders I want to compress are in the root of the [SOURCE DISK]. I would like to add ...
2019/07/09
[ "https://Stackoverflow.com/questions/56960167", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9711276/" ]
``` "C:\Program Files\7-Zip\7z.exe" a -pSECRET "[DESTINATION DISK]\[ARCHIVE NAME] %DATE:~10,4%%DATE:~4,2%%DATE:~7,2%_%TIME:~0,2%%TIME:~3,2%%TIME:~6,2%.7z" "[SOURCE DISK][FIRST FOLDER]" [SOURCE DISK][SECONDFOLDER] "[SOURCE DISK]\[EXCEL DOCUMENT]" -mhe=on -mx5 ``` I figured it out. Thanks for the support! After a bunch...
You just need to have the correct options specified and make sure all of your paths are quoted ``` @( SetLocal Echo Off SET "_Src="C:\Source\Path" ) REM Get The Date Tokens and Time in ISO Format: FOR /F "Tokens=1-7 delims=MTWFSmtwfsouehrandit:-\/. " %%A IN ( "%DATE% %TIME: =0%" ) DO ( FOR /F "Tokens=2-4 S...
56,960,167
Here's what I am trying to do, I would like to create a batch file to compress multiple folders and files into one 7zip file for archival purposes. I have external drives we can call [SOURCE DISK] and [DESTINATION DISK]. The File & Folders I want to compress are in the root of the [SOURCE DISK]. I would like to add ...
2019/07/09
[ "https://Stackoverflow.com/questions/56960167", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9711276/" ]
``` "C:\Program Files\7-Zip\7z.exe" a -pSECRET "[DESTINATION DISK]\[ARCHIVE NAME] %DATE:~10,4%%DATE:~4,2%%DATE:~7,2%_%TIME:~0,2%%TIME:~3,2%%TIME:~6,2%.7z" "[SOURCE DISK][FIRST FOLDER]" [SOURCE DISK][SECONDFOLDER] "[SOURCE DISK]\[EXCEL DOCUMENT]" -mhe=on -mx5 ``` I figured it out. Thanks for the support! After a bunch...
You can use text file containing a list of source paths as described [here](https://sevenzip.osdn.jp/chm/cmdline/syntax.htm). Create `list.txt` with paths: ``` My programs\*.cpp Src\*.cpp ``` Then use this file in the archive command: ``` 7z a archive.7z @list.txt ```
42,477
I was thinking of using some Aluminum coating/blanket but the temperatures can reach 550C+ in the Chamber I work at. I am concerned about melting. Let me know. P.S: I am an entry level Engineer. Please no judging.
2021/04/08
[ "https://engineering.stackexchange.com/questions/42477", "https://engineering.stackexchange.com", "https://engineering.stackexchange.com/users/32553/" ]
Polish the stainless. Depending how long at maximum temperature it will tint pink then blue . If necessary it could be repolished. If it will have long exposure with no repolish, maybe a thin sheet of gold or platinum. Gold foil is old technology if there is no abrasion or other physical contact. I doubt there is exist...
There are a number of factors to consider here, namely: ability to coat and bond to the stainless steel, corrosion, abrasion resistance, maintenance, how dirty the plate will get, melting point and how heat is absorbed by the steel substrate. If you want to reflect as much heat as possible, you would want a material w...
31,212,087
I've searched everywhere for this situation and can't find a solution **except for Dynamic SQL, which I don't want to use**. Here is the table I want to UPDATE on server 2: ``` (Stuff Id UNIQUEIDENTIFIER , stuffname NVARCHAR(64)) ``` I need to update it from server 1. So I have been attempting this: ``` DECLARE @...
2015/07/03
[ "https://Stackoverflow.com/questions/31212087", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1738572/" ]
You can use dynamic SQL with parameters using sp\_executesql on the remote side. ``` declare @SQL nvarchar(max); set @SQL = 'UPDATE database2.dbo.Stuff SET stuffname=@newstuff WHERE stuffId=''4893CD93-08B3-4981-851B-5DC972288290''' exec [server2].master.dbo.sp_executesql @SQL, N'@newstuff nva...
I would do it like this. Rather than sending the actual `UPDATE` query to execute to server2, I would make a stored procedure on server2 with the necessary parameters and call it from server1. Inside the stored procedure you can tweak the query as needed using all capabilities of server2 to make it run fast (like `OP...
31,212,087
I've searched everywhere for this situation and can't find a solution **except for Dynamic SQL, which I don't want to use**. Here is the table I want to UPDATE on server 2: ``` (Stuff Id UNIQUEIDENTIFIER , stuffname NVARCHAR(64)) ``` I need to update it from server 1. So I have been attempting this: ``` DECLARE @...
2015/07/03
[ "https://Stackoverflow.com/questions/31212087", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1738572/" ]
You can use dynamic SQL with parameters using sp\_executesql on the remote side. ``` declare @SQL nvarchar(max); set @SQL = 'UPDATE database2.dbo.Stuff SET stuffname=@newstuff WHERE stuffId=''4893CD93-08B3-4981-851B-5DC972288290''' exec [server2].master.dbo.sp_executesql @SQL, N'@newstuff nva...
The solution to this should be that you ensure that the parameters you're using match the length and type of the columns. For instance, make sure that the NVARCHAR(64) column is targeted by a "DECLARE @var AS NVARCHAR(64)". In your sample that seems to be the case, but when testing this in a local setup (with a SQLEXP...
31,212,087
I've searched everywhere for this situation and can't find a solution **except for Dynamic SQL, which I don't want to use**. Here is the table I want to UPDATE on server 2: ``` (Stuff Id UNIQUEIDENTIFIER , stuffname NVARCHAR(64)) ``` I need to update it from server 1. So I have been attempting this: ``` DECLARE @...
2015/07/03
[ "https://Stackoverflow.com/questions/31212087", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1738572/" ]
You can use dynamic SQL with parameters using sp\_executesql on the remote side. ``` declare @SQL nvarchar(max); set @SQL = 'UPDATE database2.dbo.Stuff SET stuffname=@newstuff WHERE stuffId=''4893CD93-08B3-4981-851B-5DC972288290''' exec [server2].master.dbo.sp_executesql @SQL, N'@newstuff nva...
Perhaps the issue has to do with the unique identifier column. Have you tried: On server2 define the following stored procedure: ``` CREATE PROCEDURE updateStuff( @newstuff nvarchar(30), @stuffid varchar(36)) AS UPDATE Stuff SET stuffname=@newstuff WHERE stuffId=convert(uniqueidentifier, @stuffid)) ``` The fr...
31,212,087
I've searched everywhere for this situation and can't find a solution **except for Dynamic SQL, which I don't want to use**. Here is the table I want to UPDATE on server 2: ``` (Stuff Id UNIQUEIDENTIFIER , stuffname NVARCHAR(64)) ``` I need to update it from server 1. So I have been attempting this: ``` DECLARE @...
2015/07/03
[ "https://Stackoverflow.com/questions/31212087", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1738572/" ]
You can use dynamic SQL with parameters using sp\_executesql on the remote side. ``` declare @SQL nvarchar(max); set @SQL = 'UPDATE database2.dbo.Stuff SET stuffname=@newstuff WHERE stuffId=''4893CD93-08B3-4981-851B-5DC972288290''' exec [server2].master.dbo.sp_executesql @SQL, N'@newstuff nva...
You can try setting the value right in the variable declaration: ``` DECLARE @newstuff nvarchar(64) = 'new stuff' UPDATE [server2].database2.dbo.Stuff SET stuffname=@newstuff WHERE stuffId='4893CD93-08B3-4981-851B-5DC972288290' ``` I think deleting the `select` part would help.
31,212,087
I've searched everywhere for this situation and can't find a solution **except for Dynamic SQL, which I don't want to use**. Here is the table I want to UPDATE on server 2: ``` (Stuff Id UNIQUEIDENTIFIER , stuffname NVARCHAR(64)) ``` I need to update it from server 1. So I have been attempting this: ``` DECLARE @...
2015/07/03
[ "https://Stackoverflow.com/questions/31212087", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1738572/" ]
I believe your problem is related to the permissions that you are running the connection to the LINKED server with. there are links where this case has been explained and I have had similar experiences. here are a couple of links: [OPENQUERY when executing linked server queries in SQL Server](http://blogs.msdn.com/b/...
I would do it like this. Rather than sending the actual `UPDATE` query to execute to server2, I would make a stored procedure on server2 with the necessary parameters and call it from server1. Inside the stored procedure you can tweak the query as needed using all capabilities of server2 to make it run fast (like `OP...
31,212,087
I've searched everywhere for this situation and can't find a solution **except for Dynamic SQL, which I don't want to use**. Here is the table I want to UPDATE on server 2: ``` (Stuff Id UNIQUEIDENTIFIER , stuffname NVARCHAR(64)) ``` I need to update it from server 1. So I have been attempting this: ``` DECLARE @...
2015/07/03
[ "https://Stackoverflow.com/questions/31212087", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1738572/" ]
I believe your problem is related to the permissions that you are running the connection to the LINKED server with. there are links where this case has been explained and I have had similar experiences. here are a couple of links: [OPENQUERY when executing linked server queries in SQL Server](http://blogs.msdn.com/b/...
The solution to this should be that you ensure that the parameters you're using match the length and type of the columns. For instance, make sure that the NVARCHAR(64) column is targeted by a "DECLARE @var AS NVARCHAR(64)". In your sample that seems to be the case, but when testing this in a local setup (with a SQLEXP...
31,212,087
I've searched everywhere for this situation and can't find a solution **except for Dynamic SQL, which I don't want to use**. Here is the table I want to UPDATE on server 2: ``` (Stuff Id UNIQUEIDENTIFIER , stuffname NVARCHAR(64)) ``` I need to update it from server 1. So I have been attempting this: ``` DECLARE @...
2015/07/03
[ "https://Stackoverflow.com/questions/31212087", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1738572/" ]
I believe your problem is related to the permissions that you are running the connection to the LINKED server with. there are links where this case has been explained and I have had similar experiences. here are a couple of links: [OPENQUERY when executing linked server queries in SQL Server](http://blogs.msdn.com/b/...
Perhaps the issue has to do with the unique identifier column. Have you tried: On server2 define the following stored procedure: ``` CREATE PROCEDURE updateStuff( @newstuff nvarchar(30), @stuffid varchar(36)) AS UPDATE Stuff SET stuffname=@newstuff WHERE stuffId=convert(uniqueidentifier, @stuffid)) ``` The fr...
31,212,087
I've searched everywhere for this situation and can't find a solution **except for Dynamic SQL, which I don't want to use**. Here is the table I want to UPDATE on server 2: ``` (Stuff Id UNIQUEIDENTIFIER , stuffname NVARCHAR(64)) ``` I need to update it from server 1. So I have been attempting this: ``` DECLARE @...
2015/07/03
[ "https://Stackoverflow.com/questions/31212087", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1738572/" ]
I believe your problem is related to the permissions that you are running the connection to the LINKED server with. there are links where this case has been explained and I have had similar experiences. here are a couple of links: [OPENQUERY when executing linked server queries in SQL Server](http://blogs.msdn.com/b/...
You can try setting the value right in the variable declaration: ``` DECLARE @newstuff nvarchar(64) = 'new stuff' UPDATE [server2].database2.dbo.Stuff SET stuffname=@newstuff WHERE stuffId='4893CD93-08B3-4981-851B-5DC972288290' ``` I think deleting the `select` part would help.
61,479,529
I have created the following dummy data frame, called **aa** : ``` a b 1 5 2 6 3 7 4 8 ``` and the following code: ``` aa_ <- aa %>% mutate_at(.vars = vars("a"), .funs = list(.*b)) ``` throws the following error: > > Error: expecting a one sided formula, a function, or a function name. > >...
2020/04/28
[ "https://Stackoverflow.com/questions/61479529", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13314495/" ]
When using `.` in `mutate_at` you need to specify `~`. Try : ``` library(dplyr) aa %>% mutate_at(.vars = vars("a"),.funs = list(~. * b)) ``` However, `mutate_at` is used when you have a function to apply for more than one column. For only one column, you can directly do : ``` aa %>% mutate(a = a * b) ```
We can use `mutate_` without the `list` ``` library(dplyr) aa %>% mutate_at(vars('a'), ~ . * b) ```
36,313,122
In C#, I have a string array that I have written full full of "getter" method calls. They call methods in another class so that the array is populated with the needed strings. It looks something like this: ``` string[] mCalls = {c.get1(), c.get2(), c.get3()}; ``` I'm sure this situation could apply to any program. H...
2016/03/30
[ "https://Stackoverflow.com/questions/36313122", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6046887/" ]
You could change your array to contain functions instead of strings like this: ``` Func<string>[] mCalls = { c.get1, c.get2, c.get3...}; ``` And then use it this way: ``` string c2 = mCalls[1](); ``` But note that this way *every* access is a method call. I'm not sure what you are really trying to achieve, there ...
Couple of options: Create an array of lambdas: ``` var mCalls = new Func<object, string>[] { (object o) => o.ToString() , (object o) => o.GetHashCode().ToString(), (object o) => o.GetType().ToString(), }; ``` If the input to each lambda is the same you can create a lambda that returns an array: ``` ...
36,313,122
In C#, I have a string array that I have written full full of "getter" method calls. They call methods in another class so that the array is populated with the needed strings. It looks something like this: ``` string[] mCalls = {c.get1(), c.get2(), c.get3()}; ``` I'm sure this situation could apply to any program. H...
2016/03/30
[ "https://Stackoverflow.com/questions/36313122", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6046887/" ]
You want something like this: ``` public string[] MCalls { get { return new string[]{c.get1(), c.get2(), c.get3()}; } private set; } ``` and then use MCalls as if it is a regular variable whenever you want to access the arrays
Couple of options: Create an array of lambdas: ``` var mCalls = new Func<object, string>[] { (object o) => o.ToString() , (object o) => o.GetHashCode().ToString(), (object o) => o.GetType().ToString(), }; ``` If the input to each lambda is the same you can create a lambda that returns an array: ``` ...
36,313,122
In C#, I have a string array that I have written full full of "getter" method calls. They call methods in another class so that the array is populated with the needed strings. It looks something like this: ``` string[] mCalls = {c.get1(), c.get2(), c.get3()}; ``` I'm sure this situation could apply to any program. H...
2016/03/30
[ "https://Stackoverflow.com/questions/36313122", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6046887/" ]
You want something like this: ``` public string[] MCalls { get { return new string[]{c.get1(), c.get2(), c.get3()}; } private set; } ``` and then use MCalls as if it is a regular variable whenever you want to access the arrays
You could change your array to contain functions instead of strings like this: ``` Func<string>[] mCalls = { c.get1, c.get2, c.get3...}; ``` And then use it this way: ``` string c2 = mCalls[1](); ``` But note that this way *every* access is a method call. I'm not sure what you are really trying to achieve, there ...
36,313,122
In C#, I have a string array that I have written full full of "getter" method calls. They call methods in another class so that the array is populated with the needed strings. It looks something like this: ``` string[] mCalls = {c.get1(), c.get2(), c.get3()}; ``` I'm sure this situation could apply to any program. H...
2016/03/30
[ "https://Stackoverflow.com/questions/36313122", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6046887/" ]
You could change your array to contain functions instead of strings like this: ``` Func<string>[] mCalls = { c.get1, c.get2, c.get3...}; ``` And then use it this way: ``` string c2 = mCalls[1](); ``` But note that this way *every* access is a method call. I'm not sure what you are really trying to achieve, there ...
What you could do is loop thorugh with reflection and get all methods from the class and from here you can get a list of method names. With this list you can assign to an array or run the methods by name or whatever. You can also filter the list to get your specific method names only: ``` var methodNames = typeof(MyCl...
36,313,122
In C#, I have a string array that I have written full full of "getter" method calls. They call methods in another class so that the array is populated with the needed strings. It looks something like this: ``` string[] mCalls = {c.get1(), c.get2(), c.get3()}; ``` I'm sure this situation could apply to any program. H...
2016/03/30
[ "https://Stackoverflow.com/questions/36313122", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6046887/" ]
You want something like this: ``` public string[] MCalls { get { return new string[]{c.get1(), c.get2(), c.get3()}; } private set; } ``` and then use MCalls as if it is a regular variable whenever you want to access the arrays
What you could do is loop thorugh with reflection and get all methods from the class and from here you can get a list of method names. With this list you can assign to an array or run the methods by name or whatever. You can also filter the list to get your specific method names only: ``` var methodNames = typeof(MyCl...
303,702
I've two identical 5V akku packs and need a 10V Power supply. So is it possible to connect these two akku packs in series to reach this or are there any critical issues, that can occur? Thank you!
2017/05/06
[ "https://electronics.stackexchange.com/questions/303702", "https://electronics.stackexchange.com", "https://electronics.stackexchange.com/users/148337/" ]
You would not be connecting two Li-ion batteries in series. Li-ion batteries have a 3.6V output not 5V. Whether they are in series is less of an issue than the current draw. You should be fine as long as you do not discharge the batteries too fast. That should not be an issue because li-ion batteries are very regula...
There shouldn't be problem as long as batteries provide same voltage. If one battery in chain is weak, that would stress it, would cause unexpected voltage and current drop. Thus you should not connect batteries of different capacity or "age" for that reason, because one would discharge at different rate. Large "chains...
1,125,084
How can I make a visitor's browser go fullscreen using JavaScript, in a way that works with IE, Firefox and Opera?
2009/07/14
[ "https://Stackoverflow.com/questions/1125084", "https://Stackoverflow.com", "https://Stackoverflow.com/users/63898/" ]
Simple example from: <http://www.longtailvideo.com/blog/26517/using-the-browsers-new-html5-fullscreen-capabilities/> ``` <script type="text/javascript"> function goFullscreen(id) { // Get the element that we want to take into fullscreen mode var element = document.getElementById(id); // These function w...
``` <!DOCTYPE html> <html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> </head> <body> <h2>Fullscreen with JavaScript</h2> <p>Click on the button to open the video in fullscreen mode.</p> <button onclick="openFullscreen();">Open Video in Fullscreen Mode</...
1,125,084
How can I make a visitor's browser go fullscreen using JavaScript, in a way that works with IE, Firefox and Opera?
2009/07/14
[ "https://Stackoverflow.com/questions/1125084", "https://Stackoverflow.com", "https://Stackoverflow.com/users/63898/" ]
Try this script ``` <script language="JavaScript"> function fullScreen(theURL) { window.open(theURL, '', 'fullscreen=yes, scrollbars=auto' ); } </script> ``` For calling from script use this code, ``` window.fullScreen('fullscreen.jsp'); ``` or with hyperlink use this ``` <a href="javascript:void(0);" onclick="f...
`function fs(){plr.requestFullscreen();document.exitFullscreen()};` or `function fs(){(plr.offsetWidth==360)?plr.requestFullscreen():document.exitFullscreen()}` ``` <!DOCTYPE html><html><head> <style> body{background:#000} #plr{position:relative;background:#fff;width:360px} #vd{width:100%;background:grey} button{widt...
1,125,084
How can I make a visitor's browser go fullscreen using JavaScript, in a way that works with IE, Firefox and Opera?
2009/07/14
[ "https://Stackoverflow.com/questions/1125084", "https://Stackoverflow.com", "https://Stackoverflow.com/users/63898/" ]
Try [screenfull.js](https://github.com/sindresorhus/screenfull.js). It's a nice cross-browser solution that should work for Opera browser as well. > > Simple wrapper for cross-browser usage of the JavaScript Fullscreen API, which lets you bring the page or any element into fullscreen. Smoothens out the browser implem...
`function fs(){plr.requestFullscreen();document.exitFullscreen()};` or `function fs(){(plr.offsetWidth==360)?plr.requestFullscreen():document.exitFullscreen()}` ``` <!DOCTYPE html><html><head> <style> body{background:#000} #plr{position:relative;background:#fff;width:360px} #vd{width:100%;background:grey} button{widt...
1,125,084
How can I make a visitor's browser go fullscreen using JavaScript, in a way that works with IE, Firefox and Opera?
2009/07/14
[ "https://Stackoverflow.com/questions/1125084", "https://Stackoverflow.com", "https://Stackoverflow.com/users/63898/" ]
**This will works to show your window in full screen** ***Note:*** *For this to work, you need Query from <http://code.jquery.com/jquery-2.1.1.min.js>* Or make have javascript link like this. ``` <script src="http://code.jquery.com/jquery-2.1.1.min.js"></script> <div id="demo-element"> <span>Full Screen ...
Try this script ``` <script language="JavaScript"> function fullScreen(theURL) { window.open(theURL, '', 'fullscreen=yes, scrollbars=auto' ); } </script> ``` For calling from script use this code, ``` window.fullScreen('fullscreen.jsp'); ``` or with hyperlink use this ``` <a href="javascript:void(0);" onclick="f...
1,125,084
How can I make a visitor's browser go fullscreen using JavaScript, in a way that works with IE, Firefox and Opera?
2009/07/14
[ "https://Stackoverflow.com/questions/1125084", "https://Stackoverflow.com", "https://Stackoverflow.com/users/63898/" ]
Try [screenfull.js](https://github.com/sindresorhus/screenfull.js). It's a nice cross-browser solution that should work for Opera browser as well. > > Simple wrapper for cross-browser usage of the JavaScript Fullscreen API, which lets you bring the page or any element into fullscreen. Smoothens out the browser implem...
Can you Try: ```html <script type="text/javascript"> function go_full_screen(){ var elem = document.documentElement; if (elem.requestFullscreen) { elem.requestFullscreen(); } else if (elem.msRequestFullscreen) { elem.msRequestFullscreen(); } else if (elem.mozRequestFu...
1,125,084
How can I make a visitor's browser go fullscreen using JavaScript, in a way that works with IE, Firefox and Opera?
2009/07/14
[ "https://Stackoverflow.com/questions/1125084", "https://Stackoverflow.com", "https://Stackoverflow.com/users/63898/" ]
Simple example from: <http://www.longtailvideo.com/blog/26517/using-the-browsers-new-html5-fullscreen-capabilities/> ``` <script type="text/javascript"> function goFullscreen(id) { // Get the element that we want to take into fullscreen mode var element = document.getElementById(id); // These function w...
Now that the full screen APIs are more widespread and appear to be maturing, why not try [Screenfull.js](https://sindresorhus.com/screenfull.js/)? I used it for the first time yesterday and today our app goes truly full screen in (almost) all browsers! Be sure to couple it with the `:fullscreen` pseudo-class in CSS. S...
1,125,084
How can I make a visitor's browser go fullscreen using JavaScript, in a way that works with IE, Firefox and Opera?
2009/07/14
[ "https://Stackoverflow.com/questions/1125084", "https://Stackoverflow.com", "https://Stackoverflow.com/users/63898/" ]
In newer browsers such as Chrome 15, Firefox 10, Safari 5.1, IE 10 this is possible. It's also possible for older IE's via ActiveX depending on their browser settings. Here's how to do it: ``` function requestFullScreen(element) { // Supports most browsers and their versions. var requestMethod = element.reque...
In Firefox 10, you can make the current page go fullscreen (real fullscreen with no window chrome) using this javascript: ``` window.fullScreen = true; ```
1,125,084
How can I make a visitor's browser go fullscreen using JavaScript, in a way that works with IE, Firefox and Opera?
2009/07/14
[ "https://Stackoverflow.com/questions/1125084", "https://Stackoverflow.com", "https://Stackoverflow.com/users/63898/" ]
In newer browsers such as Chrome 15, Firefox 10, Safari 5.1, IE 10 this is possible. It's also possible for older IE's via ActiveX depending on their browser settings. Here's how to do it: ``` function requestFullScreen(element) { // Supports most browsers and their versions. var requestMethod = element.reque...
**This will works to show your window in full screen** ***Note:*** *For this to work, you need Query from <http://code.jquery.com/jquery-2.1.1.min.js>* Or make have javascript link like this. ``` <script src="http://code.jquery.com/jquery-2.1.1.min.js"></script> <div id="demo-element"> <span>Full Screen ...
1,125,084
How can I make a visitor's browser go fullscreen using JavaScript, in a way that works with IE, Firefox and Opera?
2009/07/14
[ "https://Stackoverflow.com/questions/1125084", "https://Stackoverflow.com", "https://Stackoverflow.com/users/63898/" ]
Here is a complete solution to get in and out of full screen mode (aka cancel, exit, escape) ``` function cancelFullScreen() { var el = document; var requestMethod = el.cancelFullScreen||el.webkitCancelFullScreen||el.mozCancelFullScreen||el.exitFullscreen||el.webkitExitFullscreen; ...
Can you Try: ```html <script type="text/javascript"> function go_full_screen(){ var elem = document.documentElement; if (elem.requestFullscreen) { elem.requestFullscreen(); } else if (elem.msRequestFullscreen) { elem.msRequestFullscreen(); } else if (elem.mozRequestFu...
1,125,084
How can I make a visitor's browser go fullscreen using JavaScript, in a way that works with IE, Firefox and Opera?
2009/07/14
[ "https://Stackoverflow.com/questions/1125084", "https://Stackoverflow.com", "https://Stackoverflow.com/users/63898/" ]
Luckily for unsuspecting web users this cannot be done with just javascript. You would need to write browser specific plugins, if they didn't already exist, and then somehow get people to download them. The closest you can get is a maximized window with no tool or navigation bars but users will still be able to see the...
``` <!DOCTYPE html> <html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> </head> <body> <h2>Fullscreen with JavaScript</h2> <p>Click on the button to open the video in fullscreen mode.</p> <button onclick="openFullscreen();">Open Video in Fullscreen Mode</...
11,239,937
I am doing an e-learning application using CakePHP. The problem is that I need to use the word "class" in the Controller so I can get a class link <http://www.site.com/class/> Is there a way to use the word "class" or not? I am currently using classroom (http://www.site.com/classroom) but the word itself is long. T...
2012/06/28
[ "https://Stackoverflow.com/questions/11239937", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1386587/" ]
I wouldn't recommend it. Check out <http://www.php.net/manual/en/reserved.keywords.php> > > You cannot use any of the following words as constants, class names, function or method names. Using them as variable names is generally OK, but could lead to confusion. > > > Pick a different name, like 'rooms', or leave ...
You cannot have a controller named `class` because that's a PHP restriction, but you can use [routing](http://book.cakephp.org/2.0/en/development/routing.html#connecting-routes) to make the URL `/class` correspond to a controller that has any name you like.
68,008,678
In my understanding, a select value will set default value in 2 ways: 1. Check if "selected" attribute for any option 2. Else place first option as selected ``` <select name="gender"> <option>Select Gender</option> <option value="1">Male</option> <option value="2">Female</option> <option value="3">Other</opti...
2021/06/16
[ "https://Stackoverflow.com/questions/68008678", "https://Stackoverflow.com", "https://Stackoverflow.com/users/14023365/" ]
Your issue likely comes from this line: ``` (...args) => event.execute(...args, client) ``` Which means basically "take all of the parameters and pass them to `event.execute`" so you are passing an undetermined amount of parameters (depending on the event type) and the `client` is not guaranteed to be the second one...
``` module.exports = { name: "eg", description: "not ready", category: "test", execute(message, args, client){ const channel = client.channels.cache.get('853031094054944798'); channel.send('test'); } } ``` it was the addition of args, before client that fixed it. so in this ex...
14,505,405
I know that it is not recommended to block in the `receive` method of an actor, but I believe it can be done (as long as it is not done in too many actors at once). [This post](http://letitcrash.com/post/29773618510/an-akka-2-terminator) suggests blocking in `preStart` as one way to solve a problem, so presumably bloc...
2013/01/24
[ "https://Stackoverflow.com/questions/14505405", "https://Stackoverflow.com", "https://Stackoverflow.com/users/495796/" ]
try to remove the transaction-type="RESOURCE\_LOCAL" works on my machine without this code
Good luck for your graded exercise, try code underneath ;) ``` public class PersistenceManager { private static final EntityManagerFactory emf; private static final ThreadLocal<EntityManager> threadLocal; private static final Logger logger; static { emf = Persistence.createEntityManagerFactor...
20,130,986
one part of my form is an input-hidden-field: ``` <input type="hidden" name="dump" id="dump" value=""> ``` in this hidden-field an array is saved, now i wanted to ask you which is the best way to check if this array is empty or does the array contain value´s ? here is what i did: ``` if($_POST["dump"] == "") { ...
2013/11/21
[ "https://Stackoverflow.com/questions/20130986", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2999787/" ]
``` $dump = $_POST['dump']; if (!empty($dump)) { $arr = json_decode($dump, true); if (!empty($arr)) { // data is correct }//add else }//add else ``` `empty()` will only be false (in this case) if `$arr` is an array with at least one element. Also it will be true if `json_decode` fails (will return...
Consider using [PHP empty() function](http://php.net/manual/en/function.empty.php) **PHP.net Reports:** > > Returns FALSE if var exists and has a non-empty, non-zero value. Otherwise returns TRUE. > > > The following things are considered to be empty: > > > "" (an empty string) > > > 0 (0 as an integer) > > ...
20,130,986
one part of my form is an input-hidden-field: ``` <input type="hidden" name="dump" id="dump" value=""> ``` in this hidden-field an array is saved, now i wanted to ask you which is the best way to check if this array is empty or does the array contain value´s ? here is what i did: ``` if($_POST["dump"] == "") { ...
2013/11/21
[ "https://Stackoverflow.com/questions/20130986", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2999787/" ]
Consider using [PHP empty() function](http://php.net/manual/en/function.empty.php) **PHP.net Reports:** > > Returns FALSE if var exists and has a non-empty, non-zero value. Otherwise returns TRUE. > > > The following things are considered to be empty: > > > "" (an empty string) > > > 0 (0 as an integer) > > ...
ok this works fine, is it ok? : ``` if(empty($_POST["dump"])) { $arr = json_decode($_POST["dump"], true); if(count($arr) == 0) { $url = "http://test80948.test-account.com/tweetmilliono/test.php"; header("Location:".$url); exit(); } } ```
20,130,986
one part of my form is an input-hidden-field: ``` <input type="hidden" name="dump" id="dump" value=""> ``` in this hidden-field an array is saved, now i wanted to ask you which is the best way to check if this array is empty or does the array contain value´s ? here is what i did: ``` if($_POST["dump"] == "") { ...
2013/11/21
[ "https://Stackoverflow.com/questions/20130986", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2999787/" ]
``` $dump = $_POST['dump']; if (!empty($dump)) { $arr = json_decode($dump, true); if (!empty($arr)) { // data is correct }//add else }//add else ``` `empty()` will only be false (in this case) if `$arr` is an array with at least one element. Also it will be true if `json_decode` fails (will return...
ok this works fine, is it ok? : ``` if(empty($_POST["dump"])) { $arr = json_decode($_POST["dump"], true); if(count($arr) == 0) { $url = "http://test80948.test-account.com/tweetmilliono/test.php"; header("Location:".$url); exit(); } } ```
2,431,725
Let $X\sim U([1,2])$ and $Y=\frac{1}{X}$ How do I calculate the mean of Y? I know that $$f(x)=\begin{cases}1 & \text{ if } 1\leq x\leq 2 \\ 0& \text{ otherwise } \end{cases}$$ Does that mean that $$f(y)=\begin{cases}1 & \text{ if } 1\leq \frac{1}{y}\leq 2 \Leftrightarrow \frac{1}{2}\leq y\leq 1\\ 0& \text{ ...
2017/09/16
[ "https://math.stackexchange.com/questions/2431725", "https://math.stackexchange.com", "https://math.stackexchange.com/users/481273/" ]
By the [Law of the unconscious statistician](https://en.wikipedia.org/wiki/Law_of_the_unconscious_statistician), $$ \mathbb{E}[Y] = \mathbb{E}\left[\frac{1}{X}\right] = \int\_\mathbb{R} \frac{1}{x} f\_X(x)dx = \int\_1^2 \frac{1}{x} dx = \ln 2 $$ since $f\_X(x) = \begin{cases}1 &\text{ if } 1\leq x\leq 2\\0& \text {oth...
Use the transformation formula $$p(Y)=p(X)\left|\frac{dX}{dY}\right|=\frac{1}{Y^2}$$ where $Y \in [\frac{1}{2},1]$ So $$E[Y]=\int\_{1/2}^1 Y\frac{1}{Y^2}dY=\int\_{1/2}^1\frac{1}{Y}dY=\ln1-\ln\frac{1}{2}=\ln 2$$
31,603,398
How can I get the email of a user from the facebook LoginButton widget? I am getting null. The App Id I am using is correct. I can also get the correct name, but the email is missing. I do have permissions. This is my code: ``` import com.facebook.model.GraphUser; import com.facebook.widget.LoginButton; import com.f...
2015/07/24
[ "https://Stackoverflow.com/questions/31603398", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4823878/" ]
``` public class Login extends ActionBarActivity { private CallbackManager callbackManager; String emailid, gender, bday, username; private LoginButton loginButton; ProfilePictureView profilePictureView; TextView info; private AccessTokenTracker accessTokenTracker; private ProgressDialog...
You can fetch user email by sending `Request.newMeRequest` request. For this you need `UiLifecycleHelper` callback `UiLifecycleHelper fbUiHelper = new UiLifecycleHelper(this, fbUiHelperCallback);` ``` private Session.StatusCallback fbUiHelperCallback = new Session.StatusCallback() { @Override public...
167,110
With pretty much every circuit in a home needing one of the two types of protection (AFCI or GFCI), why don't all new homes have combination breakers installed just to be safe? Would it hurt anything using both types of protections for every breaker? I know that based on code we technically don't NEED both types of pro...
2019/06/12
[ "https://diy.stackexchange.com/questions/167110", "https://diy.stackexchange.com", "https://diy.stackexchange.com/users/45053/" ]
Sure, go for it --------------- There's no basic problem with what you propose. Feel free to put CAFCIs in all breaker positions. You may have a problem finding AFCIs larger than 20/30 amps, and you may have trouble finding 2-pole AFCIs in some cases. In this instance, for equivalent protection where AFCI is not man...
AFCI breakers (which NEC now requires on new houses) make a lot of sense. Issues with wires going bad are pretty rare and there's not too many things outside that that can trip one. The likelihood of a nuisance AFCI trip is fairly low. AFCIs also protect against hidden dangers. Arcing events can happen in hidden loca...
23,362
Your program must take as input a line of characters, like this: ``` @+.0 ``` And output the characters sorted by how dark they are, like this: ``` .+0@ ``` Requirements: * You must use a monospaced font for darkness detection. * You must find out how many pixels each character takes up. You must actually draw t...
2014/03/07
[ "https://codegolf.stackexchange.com/questions/23362", "https://codegolf.stackexchange.com", "https://codegolf.stackexchange.com/users/3808/" ]
Java, 584 ========= Wow... This was not a good language to do this in. ``` import java.awt.geom.*;import java.util.*;class F{static void n(final String f,List<Character> s){Collections.sort(s,new Comparator<Character>(){public int compare(Character a,Character b){return d(f,""+a) - d(f,""+b);}});}static int d(String ...
PHP - 485 ========= Demo: ``` $ php pcg-23362.php "@+.0" .+0@ ``` Code: ``` <?php $f='x.ttf';$d=array();foreach(str_split($argv[1]) as$_){$B=imagettfbbox(50,0,$f,$_);$w=abs($B[4]-$B[0]);$h=abs($B[5]-$B[1]);$im=imagecreate($w,$h);imagecolorallocate($im,255,255,255);imagettftext($im,50,0,0,$h-$B[1],imagecolorallocat...
23,362
Your program must take as input a line of characters, like this: ``` @+.0 ``` And output the characters sorted by how dark they are, like this: ``` .+0@ ``` Requirements: * You must use a monospaced font for darkness detection. * You must find out how many pixels each character takes up. You must actually draw t...
2014/03/07
[ "https://codegolf.stackexchange.com/questions/23362", "https://codegolf.stackexchange.com", "https://codegolf.stackexchange.com/users/3808/" ]
Mathematica, 112 110 108 bytes ------------------------------ This can still likely be golfed further. Assumes the string is in variable s. And now uses a correct syntax to sort one list by another list. Lucky test cases -> "Oh yeah, that works" -> *Facepalm* Thanks for the sharp eyes, David Carraher. **Update...
Javascript + Canvas and Browser DOM (280 237 235 bytes) ======================================================= *Updated version with suggetions from Fors and toothbrush in comments:* ``` function m(x){a=document.createElement('canvas').getContext('2d');a.font='9px Monaco';a.fillText(x,y=i=0,20);for(;i<3600;)y+=a.get...
23,362
Your program must take as input a line of characters, like this: ``` @+.0 ``` And output the characters sorted by how dark they are, like this: ``` .+0@ ``` Requirements: * You must use a monospaced font for darkness detection. * You must find out how many pixels each character takes up. You must actually draw t...
2014/03/07
[ "https://codegolf.stackexchange.com/questions/23362", "https://codegolf.stackexchange.com", "https://codegolf.stackexchange.com/users/3808/" ]
Mathematica, 112 110 108 bytes ------------------------------ This can still likely be golfed further. Assumes the string is in variable s. And now uses a correct syntax to sort one list by another list. Lucky test cases -> "Oh yeah, that works" -> *Facepalm* Thanks for the sharp eyes, David Carraher. **Update...
Postscript, 381 --------------- Here's something completely different, just for fun. As most fonts are vector anyway, 'counting pixels' is a little odd, isn't it. Calculating glyph shape area, while being correct way, is not that easy. An alternative can be scanning a rectangle and counting 'hits' when a point is insi...
23,362
Your program must take as input a line of characters, like this: ``` @+.0 ``` And output the characters sorted by how dark they are, like this: ``` .+0@ ``` Requirements: * You must use a monospaced font for darkness detection. * You must find out how many pixels each character takes up. You must actually draw t...
2014/03/07
[ "https://codegolf.stackexchange.com/questions/23362", "https://codegolf.stackexchange.com", "https://codegolf.stackexchange.com/users/3808/" ]
Java - ~~468 450~~ 444 ---------------------- ```java public static void main(String[]a){class c implements Comparable<c>{char d;c(char e){d=e;}public int compareTo(c o){return e(d)>e(o.d)?1:-1;}int e(char f){int a=0,x,y;BufferedImage img=new BufferedImage(99,99,1);img.getGraphics().drawString(""+f,9,80);for(y=0;y<99;...
### R, 195 characters ``` A=strsplit(scan(,""),"")[[1]];cat(A[order(sapply(A,function(x){png('a',a='none',fa='monospace');frame();text(0,0,x);dev.off();sum(apply(png::readPNG('a'),c(1,2),function(x)any(x!=1)))}))],sep="") ``` Indented with comments: ```r A=strsplit(scan(,""),"")[[1]] #Take characters as strings and...
23,362
Your program must take as input a line of characters, like this: ``` @+.0 ``` And output the characters sorted by how dark they are, like this: ``` .+0@ ``` Requirements: * You must use a monospaced font for darkness detection. * You must find out how many pixels each character takes up. You must actually draw t...
2014/03/07
[ "https://codegolf.stackexchange.com/questions/23362", "https://codegolf.stackexchange.com", "https://codegolf.stackexchange.com/users/3808/" ]
Mathematica, 112 110 108 bytes ------------------------------ This can still likely be golfed further. Assumes the string is in variable s. And now uses a correct syntax to sort one list by another list. Lucky test cases -> "Oh yeah, that works" -> *Facepalm* Thanks for the sharp eyes, David Carraher. **Update...
PHP, 298 characters =================== I've added a few line breaks so you can see it in all its hideousness: ``` <?php $s=@$_GET[s];$a=array();$v=imagecreate(16,16);$f='imagecolorallocate'; $f($v,0,0,0);for($i=0;$i<strlen($s);$i++){$c=$f($v,$i,0,1); imagechar($v,5,2,$n=0,$s[$i],$c);for($y=16;$y--;) for($x=16;$x--;)...
23,362
Your program must take as input a line of characters, like this: ``` @+.0 ``` And output the characters sorted by how dark they are, like this: ``` .+0@ ``` Requirements: * You must use a monospaced font for darkness detection. * You must find out how many pixels each character takes up. You must actually draw t...
2014/03/07
[ "https://codegolf.stackexchange.com/questions/23362", "https://codegolf.stackexchange.com", "https://codegolf.stackexchange.com/users/3808/" ]
### R, 195 characters ``` A=strsplit(scan(,""),"")[[1]];cat(A[order(sapply(A,function(x){png('a',a='none',fa='monospace');frame();text(0,0,x);dev.off();sum(apply(png::readPNG('a'),c(1,2),function(x)any(x!=1)))}))],sep="") ``` Indented with comments: ```r A=strsplit(scan(,""),"")[[1]] #Take characters as strings and...
PHP - 485 ========= Demo: ``` $ php pcg-23362.php "@+.0" .+0@ ``` Code: ``` <?php $f='x.ttf';$d=array();foreach(str_split($argv[1]) as$_){$B=imagettfbbox(50,0,$f,$_);$w=abs($B[4]-$B[0]);$h=abs($B[5]-$B[1]);$im=imagecreate($w,$h);imagecolorallocate($im,255,255,255);imagettftext($im,50,0,0,$h-$B[1],imagecolorallocat...
23,362
Your program must take as input a line of characters, like this: ``` @+.0 ``` And output the characters sorted by how dark they are, like this: ``` .+0@ ``` Requirements: * You must use a monospaced font for darkness detection. * You must find out how many pixels each character takes up. You must actually draw t...
2014/03/07
[ "https://codegolf.stackexchange.com/questions/23362", "https://codegolf.stackexchange.com", "https://codegolf.stackexchange.com/users/3808/" ]
PHP, 298 characters =================== I've added a few line breaks so you can see it in all its hideousness: ``` <?php $s=@$_GET[s];$a=array();$v=imagecreate(16,16);$f='imagecolorallocate'; $f($v,0,0,0);for($i=0;$i<strlen($s);$i++){$c=$f($v,$i,0,1); imagechar($v,5,2,$n=0,$s[$i],$c);for($y=16;$y--;) for($x=16;$x--;)...
### R, 195 characters ``` A=strsplit(scan(,""),"")[[1]];cat(A[order(sapply(A,function(x){png('a',a='none',fa='monospace');frame();text(0,0,x);dev.off();sum(apply(png::readPNG('a'),c(1,2),function(x)any(x!=1)))}))],sep="") ``` Indented with comments: ```r A=strsplit(scan(,""),"")[[1]] #Take characters as strings and...
23,362
Your program must take as input a line of characters, like this: ``` @+.0 ``` And output the characters sorted by how dark they are, like this: ``` .+0@ ``` Requirements: * You must use a monospaced font for darkness detection. * You must find out how many pixels each character takes up. You must actually draw t...
2014/03/07
[ "https://codegolf.stackexchange.com/questions/23362", "https://codegolf.stackexchange.com", "https://codegolf.stackexchange.com/users/3808/" ]
Java - ~~468 450~~ 444 ---------------------- ```java public static void main(String[]a){class c implements Comparable<c>{char d;c(char e){d=e;}public int compareTo(c o){return e(d)>e(o.d)?1:-1;}int e(char f){int a=0,x,y;BufferedImage img=new BufferedImage(99,99,1);img.getGraphics().drawString(""+f,9,80);for(y=0;y<99;...
PHP - 485 ========= Demo: ``` $ php pcg-23362.php "@+.0" .+0@ ``` Code: ``` <?php $f='x.ttf';$d=array();foreach(str_split($argv[1]) as$_){$B=imagettfbbox(50,0,$f,$_);$w=abs($B[4]-$B[0]);$h=abs($B[5]-$B[1]);$im=imagecreate($w,$h);imagecolorallocate($im,255,255,255);imagettftext($im,50,0,0,$h-$B[1],imagecolorallocat...
23,362
Your program must take as input a line of characters, like this: ``` @+.0 ``` And output the characters sorted by how dark they are, like this: ``` .+0@ ``` Requirements: * You must use a monospaced font for darkness detection. * You must find out how many pixels each character takes up. You must actually draw t...
2014/03/07
[ "https://codegolf.stackexchange.com/questions/23362", "https://codegolf.stackexchange.com", "https://codegolf.stackexchange.com/users/3808/" ]
QBasic, 259 bytes ----------------- ``` SCREEN 1 DIM a(255) FOR i = 32 TO 255 CLS PRINT CHR$(i); FOR p = 0 TO 64 a(i) = a(i) + POINT(p MOD 8, p \ 8) NEXT p NEXT i FOR p = 0 TO 96 FOR i = 32 TO 255 IF a(i) = p THEN PRINT CHR$(i); NEXT i NEXT p ``` I did this for fun, so it's te...
Java, 584 ========= Wow... This was not a good language to do this in. ``` import java.awt.geom.*;import java.util.*;class F{static void n(final String f,List<Character> s){Collections.sort(s,new Comparator<Character>(){public int compare(Character a,Character b){return d(f,""+a) - d(f,""+b);}});}static int d(String ...
23,362
Your program must take as input a line of characters, like this: ``` @+.0 ``` And output the characters sorted by how dark they are, like this: ``` .+0@ ``` Requirements: * You must use a monospaced font for darkness detection. * You must find out how many pixels each character takes up. You must actually draw t...
2014/03/07
[ "https://codegolf.stackexchange.com/questions/23362", "https://codegolf.stackexchange.com", "https://codegolf.stackexchange.com/users/3808/" ]
[GTB](http://timtechsoftware.com/gtb "GTB") ------------------------------------------- This has code to be the second hardest code I've ever written for a calculator. No hard-coded pixel values, it actually draws the text on a graph and loops to count each pixel. ``` 0→I`_%I<l?_T;1,1,s;_,I,1 C;pT;{0,1,2,3,4,5},{0,1,...
PHP - 485 ========= Demo: ``` $ php pcg-23362.php "@+.0" .+0@ ``` Code: ``` <?php $f='x.ttf';$d=array();foreach(str_split($argv[1]) as$_){$B=imagettfbbox(50,0,$f,$_);$w=abs($B[4]-$B[0]);$h=abs($B[5]-$B[1]);$im=imagecreate($w,$h);imagecolorallocate($im,255,255,255);imagettftext($im,50,0,0,$h-$B[1],imagecolorallocat...
13,931,720
I want to add two picture slider at same page by JavaScript only. But only one slider is working and another is static. Here is my code so far what I got from a website. ``` <script type="text/javascript"> window.onload = function() { var rotator = document.getElementById("rotator"); var imag...
2012/12/18
[ "https://Stackoverflow.com/questions/13931720", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1765171/" ]
I have managed to resolve this issue using the following code mentioned in [this SO post](https://stackoverflow.com/questions/6033638/an-object-with-the-same-key-already-exists-in-the-objectstatemanager-the-object) which shows how to save only the new values: ``` db.Entry(activeCitizen).CurrentValues.SetValues(citizen...
Try This ``` [HttpPost] public ActionResult Edit(CitizenEntryViewModel citizenDetails) { ActiveCitizen activeCitizen = db.ActiveCitizen.SingleOrDefault(m => m.ID == citizenDetails.ActiveCitizen.ID); if (activeCitizen != null) { UpdateModel(activeCitizen); db.SaveChanges(); } ```
57,123,043
Im working with Microsoft Dynamics 365 Business Central. (ERP Software). Im attempting to create build agents on my local server to set up Continious Integration with my projects. On the buildserver i am running Docker Enterprise on Windows 2019. When i spin up my dockeragent to facilitate the builds im experiencing...
2019/07/20
[ "https://Stackoverflow.com/questions/57123043", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1053445/" ]
in this case the answer was to use the named pipes like so: ``` -v \.\pipe\docker_engine:\\.\pipe\docker_engine ``` and to install the docker client into the container so it can talk to the docker engine
I was having trouble with the install, so I used one of the docker provided windows images from [docker hub](https://hub.docker.com/_/docker) as my base image instead of a microsoft one. Followed the remained of the microsoft [instructions](https://learn.microsoft.com/en-us/azure/devops/pipelines/agents/docker?view=azu...
46,490,229
I'd like to know whether it is possible to get the "original id" of an object as the result of the query. Whenever I make a request to the server, it returns the node "global identifier", something like `U29saWNpdGFjYW9UeXBlOjEzNTkxOA==` . The query is similar to this one: ``` { allPatients(active: true) { ed...
2017/09/29
[ "https://Stackoverflow.com/questions/46490229", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2500462/" ]
Overriding default to\_global\_id method in Node object worked out for me: ``` class CustomNode(graphene.Node): class Meta: name = 'Node' @staticmethod def to_global_id(type, id): return id class ExampleType(DjangoObjectType): class Meta: model = Example interfaces...
First option, remove relay.Node as interface of your objectNode declaration. Second option, use custom resolve\_id fonction to return id original value. Example ``` class objectNode(djangoObjectType): .... Meta .... id = graphene.Int(source="id") def resolve_id("commons args ...."): return sel...
46,490,229
I'd like to know whether it is possible to get the "original id" of an object as the result of the query. Whenever I make a request to the server, it returns the node "global identifier", something like `U29saWNpdGFjYW9UeXBlOjEzNTkxOA==` . The query is similar to this one: ``` { allPatients(active: true) { ed...
2017/09/29
[ "https://Stackoverflow.com/questions/46490229", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2500462/" ]
Overriding default to\_global\_id method in Node object worked out for me: ``` class CustomNode(graphene.Node): class Meta: name = 'Node' @staticmethod def to_global_id(type, id): return id class ExampleType(DjangoObjectType): class Meta: model = Example interfaces...
To expand on the top answer and for those using SQLAlchemy Object Types, this worked for me: ``` class CustomNode(graphene.Node): class Meta: name = 'myNode' @staticmethod def to_global_id(type, id): return id class ExampleType(SQLAlchemyObjectType): class Meta: model = Exampl...
46,490,229
I'd like to know whether it is possible to get the "original id" of an object as the result of the query. Whenever I make a request to the server, it returns the node "global identifier", something like `U29saWNpdGFjYW9UeXBlOjEzNTkxOA==` . The query is similar to this one: ``` { allPatients(active: true) { ed...
2017/09/29
[ "https://Stackoverflow.com/questions/46490229", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2500462/" ]
Overriding default to\_global\_id method in Node object worked out for me: ``` class CustomNode(graphene.Node): class Meta: name = 'Node' @staticmethod def to_global_id(type, id): return id class ExampleType(DjangoObjectType): class Meta: model = Example interfaces...
With this you can retrive the real id in database: ``` def get_real_id(node_id: str): _, product_id_real = relay.Node.from_global_id(global_id=node_id) return product_id_real ```
22,496,913
I have used EditText in my application, the problem is the entered text is not aligned properly, check it out my screen shot for what exactly my issue is. ![enter image description here](https://i.stack.imgur.com/qvYM9.png) My EditText XML file is ``` <EditText android:id="@+id/signupFullName" ...
2014/03/19
[ "https://Stackoverflow.com/questions/22496913", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1621926/" ]
add this line into your edit text ``` android:padding="5dp" ```
use this ``` android:paddingRight="10dip" ```
22,496,913
I have used EditText in my application, the problem is the entered text is not aligned properly, check it out my screen shot for what exactly my issue is. ![enter image description here](https://i.stack.imgur.com/qvYM9.png) My EditText XML file is ``` <EditText android:id="@+id/signupFullName" ...
2014/03/19
[ "https://Stackoverflow.com/questions/22496913", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1621926/" ]
It appears that your background image is smaller than your hard-coded width. Adding padding reserves some "unused room" at the end of your EditText. It would be better if you converted your background image to a 9-patch image so that it could resize automatically.
add this line into your edit text ``` android:padding="5dp" ```
22,496,913
I have used EditText in my application, the problem is the entered text is not aligned properly, check it out my screen shot for what exactly my issue is. ![enter image description here](https://i.stack.imgur.com/qvYM9.png) My EditText XML file is ``` <EditText android:id="@+id/signupFullName" ...
2014/03/19
[ "https://Stackoverflow.com/questions/22496913", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1621926/" ]
It appears that your background image is smaller than your hard-coded width. Adding padding reserves some "unused room" at the end of your EditText. It would be better if you converted your background image to a 9-patch image so that it could resize automatically.
use this ``` android:paddingRight="10dip" ```
16,028,705
On page 321 of *Real World Haskell* There are these codes, ... ``` {-# LANGUAGE GeneralizedNewtypeDeriving #-} newtype AInt = A { unA::Int } deriving (Show, Eq, Num) instance Monoid AInt where mempty = 0 ``` My confusion is why it is ``` mempty = 0 ``` but not ``` mempty = A 0 ``` ? --- I also no...
2013/04/16
[ "https://Stackoverflow.com/questions/16028705", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1391960/" ]
The trick here is with the `GeneralizedNewtypeDeriving` extension. In particular, this lets us derive *any* class for a `newtype` as long as the underlying type is an instance. All this does is copy over the instance from the old type to the new type. In this particular case, `AInt` derives `Num`. This means that `AIn...
Numeric literals like `0` are overloaded and have the type `0 :: Num a => a`, which means that they can be any type for which there is a `Num` instance, depending on the context. This happens via the `fromInteger` function in the `Num` type class, so when you type `0` it is treated as if you'd written `fromInteger 0`. ...
386,675
Let $A\_j,j\in\mathbb Z^+$ be finite sets with at least two distinct elements. How to show that $\prod\_{j=1}^\infty A\_j$ is uncountable?
2013/05/09
[ "https://math.stackexchange.com/questions/386675", "https://math.stackexchange.com", "https://math.stackexchange.com/users/52197/" ]
**Hint:** Replace each $A\_j$ by $B\_j=\{0,\ldots,n-1\}$, where $n=|A\_j|$, using the axiom of choice. Now we have: $$\left|\prod\_{j\in\Bbb N}\{0,1\}\right|\leq\left|\prod\_{j\in\Bbb N}B\_j\right|=\left|\prod\_{j\in\Bbb N}A\_j\right|.$$ You can bound this from the right by the product of copies of $\Bbb N$ and calcu...
Identify a subset of each set with {0,1} using AC, and map the corresponding subset of the product onto binary expansions of reals in the interval [0,1], hence uncountable.
19,091,013
I have make virtual subdomain in my code.like below ``` RewriteCond %{HTTP_HOST} ^(.*)\.mysitename\.com RewriteRule ^(.*)$ agent.php?asitename=%1 [L,NC,QSA] ``` it works fine, but it did not work for pages like ``` RewriteCond %{HTTP_HOST} ^(.*)\.mysitename\.com RewriteRule ^(.*)/ag_buy.html ag_buy.php?sitename=%1...
2013/09/30
[ "https://Stackoverflow.com/questions/19091013", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2341915/" ]
HuwD, A good resource might be my [module template installation video](http://www.dotnetnuclear.com/articles/tabid/88/ID/11/MVP-Module-Development-Template-Installation-Configuration-Troubleshooting.aspx) which gives good information on setting up your development environment and debugging issues (regardless of the te...
You may want to give a try a free module called [Users Importer](http://usersimporter.codeplex.com/) - A bit old but worth a try. Here is a paid alternative: [Bulk User Manager](http://store.dnnsoftware.com/home/product-details/bulk-user-manager-v33?r=73311e2a326b411fbbb4)
19,091,013
I have make virtual subdomain in my code.like below ``` RewriteCond %{HTTP_HOST} ^(.*)\.mysitename\.com RewriteRule ^(.*)$ agent.php?asitename=%1 [L,NC,QSA] ``` it works fine, but it did not work for pages like ``` RewriteCond %{HTTP_HOST} ^(.*)\.mysitename\.com RewriteRule ^(.*)/ag_buy.html ag_buy.php?sitename=%1...
2013/09/30
[ "https://Stackoverflow.com/questions/19091013", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2341915/" ]
This is a common problem with my VS templates, though not for everyone, and it doesn't happen all the time. It stems from Visual Studio, so it shouldn't ever be a problem on your production servers, unless you upload source and try to compile there, than it might be an issue.
You may want to give a try a free module called [Users Importer](http://usersimporter.codeplex.com/) - A bit old but worth a try. Here is a paid alternative: [Bulk User Manager](http://store.dnnsoftware.com/home/product-details/bulk-user-manager-v33?r=73311e2a326b411fbbb4)
19,091,013
I have make virtual subdomain in my code.like below ``` RewriteCond %{HTTP_HOST} ^(.*)\.mysitename\.com RewriteRule ^(.*)$ agent.php?asitename=%1 [L,NC,QSA] ``` it works fine, but it did not work for pages like ``` RewriteCond %{HTTP_HOST} ^(.*)\.mysitename\.com RewriteRule ^(.*)/ag_buy.html ag_buy.php?sitename=%1...
2013/09/30
[ "https://Stackoverflow.com/questions/19091013", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2341915/" ]
This is a common problem with my VS templates, though not for everyone, and it doesn't happen all the time. It stems from Visual Studio, so it shouldn't ever be a problem on your production servers, unless you upload source and try to compile there, than it might be an issue.
HuwD, A good resource might be my [module template installation video](http://www.dotnetnuclear.com/articles/tabid/88/ID/11/MVP-Module-Development-Template-Installation-Configuration-Troubleshooting.aspx) which gives good information on setting up your development environment and debugging issues (regardless of the te...
18,747,504
I am trying to get list of **WebApplication** in a Given Server. ***Get-SpWebapplication*** retrieves all the WebApplication in the Current machine. I need to get the list of WebApplication in a particual server. How to Do it. Please help me with this.
2013/09/11
[ "https://Stackoverflow.com/questions/18747504", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2654209/" ]
To get a list of all SharePoint Web Apps, use the following: ``` Get-SPWebApplication | Select DisplayName, Url ```
Go to **"C:\windows\system32\inetsrv"** folder and try this: **.\appcmd list wp**
9,286,927
I am trying to find some text in my document that only appears in "Heading 1" styles. So far, no avail. **Sample Code:** ``` With ThisDocument.Range.Find .Text = "The Heading" .Style = "Heading 1" 'Does not work .Execute If .Found Then Debug.Print "Found" End With ``` Just a note, it keeps stopping ...
2012/02/15
[ "https://Stackoverflow.com/questions/9286927", "https://Stackoverflow.com", "https://Stackoverflow.com/users/718341/" ]
Your code looks good to me. My best guess is that the 'Heading 1' style exists in your table of contents? The code below should continue the find, finding all occurrences: ``` Dim blnFound As Boolean With ThisDocument.Range.Find .Text = "The Heading" .Style = "Heading 1" Do blnFound = .Execute ...
I found this question on Google and the code in the question did not work for me. I have made the following changes to fix it: * I changed `Selection.Find.Style = "Heading 1"` to an object. * I changed the code to grab the boolean result of the search from `.Execute` rather than `.Found` I hope this helps some other ...
9,286,927
I am trying to find some text in my document that only appears in "Heading 1" styles. So far, no avail. **Sample Code:** ``` With ThisDocument.Range.Find .Text = "The Heading" .Style = "Heading 1" 'Does not work .Execute If .Found Then Debug.Print "Found" End With ``` Just a note, it keeps stopping ...
2012/02/15
[ "https://Stackoverflow.com/questions/9286927", "https://Stackoverflow.com", "https://Stackoverflow.com/users/718341/" ]
Your code looks good to me. My best guess is that the 'Heading 1' style exists in your table of contents? The code below should continue the find, finding all occurrences: ``` Dim blnFound As Boolean With ThisDocument.Range.Find .Text = "The Heading" .Style = "Heading 1" Do blnFound = .Execute ...
The reason I think it is not working is because you have to set the ``` .format = true ``` flag, and you *may* have to specify the style via the .Styles method: ``` With ThisDocument.Range.Find .Text = "The Heading" .Format = true <<< -------- Tells Word to look for a special formatting .Style = ThisD...
23,278,279
Here is my jfiddle: <http://jsfiddle.net/D3zyt/8/> html: ``` <div class="board"> <table id="mastermind_table_one"> <td></td> <td></td> <td></td> <td></td> </table> <table id="mastermind_table_two"> <td></td> <td></td> <td></td> <td></td> </table> <table id="mastermind_table_three...
2014/04/24
[ "https://Stackoverflow.com/questions/23278279", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3007294/" ]
This does it by storing the current table in a variable and using `.next()` to find the next table: [Fiddle](http://jsfiddle.net/rK3LA/) ``` var current; $('.next_round').click(function() { if(typeof current == 'undefined' || current.next('table').length == 0){ current = $('.board table').first(); }...
Something like this helps? ``` var tables = $('.board table'); var currentTable = 0; $('.next_round').click(function() { var table = tables[currentTable]; table.find('td').each(function() { $(this).css("background-color", setRandomColor); }); currentTable++; if(currentTable > tables.le...
23,278,279
Here is my jfiddle: <http://jsfiddle.net/D3zyt/8/> html: ``` <div class="board"> <table id="mastermind_table_one"> <td></td> <td></td> <td></td> <td></td> </table> <table id="mastermind_table_two"> <td></td> <td></td> <td></td> <td></td> </table> <table id="mastermind_table_three...
2014/04/24
[ "https://Stackoverflow.com/questions/23278279", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3007294/" ]
This does it by storing the current table in a variable and using `.next()` to find the next table: [Fiddle](http://jsfiddle.net/rK3LA/) ``` var current; $('.next_round').click(function() { if(typeof current == 'undefined' || current.next('table').length == 0){ current = $('.board table').first(); }...
**Note: this post contains a bad practice, I left it maybe someone could learn from it, read the comment** just use one table like: ``` <table id="mastermind_table_three"> <td></td> <td></td> <td></td> <td></td> </table> ``` and then add a button `<button onclick="nextRound(this)` /> with the function as: ``` fun...
23,278,279
Here is my jfiddle: <http://jsfiddle.net/D3zyt/8/> html: ``` <div class="board"> <table id="mastermind_table_one"> <td></td> <td></td> <td></td> <td></td> </table> <table id="mastermind_table_two"> <td></td> <td></td> <td></td> <td></td> </table> <table id="mastermind_table_three...
2014/04/24
[ "https://Stackoverflow.com/questions/23278279", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3007294/" ]
This does it by storing the current table in a variable and using `.next()` to find the next table: [Fiddle](http://jsfiddle.net/rK3LA/) ``` var current; $('.next_round').click(function() { if(typeof current == 'undefined' || current.next('table').length == 0){ current = $('.board table').first(); }...
This is a solution that implements event data in jquery. And here is a fiddle: <http://jsfiddle.net/D3zyt/10/> ``` var randomColor = ["red", "blue", "green", "#9CBA7F", "yellow", "#BF5FFF"]; function setRandomColor() { return randomColor[Math.floor(Math.random() * randomColor.length)]; } $('.next_round').on("cl...
1,267,071
I'm creating an intranet asp.net mvc application that everyone in the company should have access to. I need to run the website impersonated for database access etc., but I want to know who each user is. When I look at `Page.User.Identity.Name` it's blank. Is it possible to get the user's windows account name even thou...
2009/08/12
[ "https://Stackoverflow.com/questions/1267071", "https://Stackoverflow.com", "https://Stackoverflow.com/users/34720/" ]
try this ``` System.Security.Principal.WindowsIdentity.GetCurrent().Name ``` It should return a string with the users login name
Unless this functionality has changed under the MVC framework, and I don't think it has, Page.User.Identity.Name should still work. Sounds like your site is set up to allow anonymous authentication. If so, try disabling it.
1,267,071
I'm creating an intranet asp.net mvc application that everyone in the company should have access to. I need to run the website impersonated for database access etc., but I want to know who each user is. When I look at `Page.User.Identity.Name` it's blank. Is it possible to get the user's windows account name even thou...
2009/08/12
[ "https://Stackoverflow.com/questions/1267071", "https://Stackoverflow.com", "https://Stackoverflow.com/users/34720/" ]
With `<authentication mode="Windows"/>` in your application and Anonymous access enabled in IIS, you will see the following results: ``` System.Environment.UserName: Computer Name Page.User.Identity.Name: Blank System.Security.Principal.WindowsIdentity.GetCurrent().Name: Computer Name ``` With `<authentication mode...
try this ``` System.Security.Principal.WindowsIdentity.GetCurrent().Name ``` It should return a string with the users login name
1,267,071
I'm creating an intranet asp.net mvc application that everyone in the company should have access to. I need to run the website impersonated for database access etc., but I want to know who each user is. When I look at `Page.User.Identity.Name` it's blank. Is it possible to get the user's windows account name even thou...
2009/08/12
[ "https://Stackoverflow.com/questions/1267071", "https://Stackoverflow.com", "https://Stackoverflow.com/users/34720/" ]
try this ``` System.Security.Principal.WindowsIdentity.GetCurrent().Name ``` It should return a string with the users login name
I just wanted to post my fix, because no one else had said anything about it. I was having the same issue when I published the site to the server, but not on my local. All the settings were the same. However, in IIS the "Default Website" had never been turned off. It was running and intercepting traffic, even though t...
1,267,071
I'm creating an intranet asp.net mvc application that everyone in the company should have access to. I need to run the website impersonated for database access etc., but I want to know who each user is. When I look at `Page.User.Identity.Name` it's blank. Is it possible to get the user's windows account name even thou...
2009/08/12
[ "https://Stackoverflow.com/questions/1267071", "https://Stackoverflow.com", "https://Stackoverflow.com/users/34720/" ]
With `<authentication mode="Windows"/>` in your application and Anonymous access enabled in IIS, you will see the following results: ``` System.Environment.UserName: Computer Name Page.User.Identity.Name: Blank System.Security.Principal.WindowsIdentity.GetCurrent().Name: Computer Name ``` With `<authentication mode...
Unless this functionality has changed under the MVC framework, and I don't think it has, Page.User.Identity.Name should still work. Sounds like your site is set up to allow anonymous authentication. If so, try disabling it.
1,267,071
I'm creating an intranet asp.net mvc application that everyone in the company should have access to. I need to run the website impersonated for database access etc., but I want to know who each user is. When I look at `Page.User.Identity.Name` it's blank. Is it possible to get the user's windows account name even thou...
2009/08/12
[ "https://Stackoverflow.com/questions/1267071", "https://Stackoverflow.com", "https://Stackoverflow.com/users/34720/" ]
I just wanted to post my fix, because no one else had said anything about it. I was having the same issue when I published the site to the server, but not on my local. All the settings were the same. However, in IIS the "Default Website" had never been turned off. It was running and intercepting traffic, even though t...
Unless this functionality has changed under the MVC framework, and I don't think it has, Page.User.Identity.Name should still work. Sounds like your site is set up to allow anonymous authentication. If so, try disabling it.
1,267,071
I'm creating an intranet asp.net mvc application that everyone in the company should have access to. I need to run the website impersonated for database access etc., but I want to know who each user is. When I look at `Page.User.Identity.Name` it's blank. Is it possible to get the user's windows account name even thou...
2009/08/12
[ "https://Stackoverflow.com/questions/1267071", "https://Stackoverflow.com", "https://Stackoverflow.com/users/34720/" ]
With `<authentication mode="Windows"/>` in your application and Anonymous access enabled in IIS, you will see the following results: ``` System.Environment.UserName: Computer Name Page.User.Identity.Name: Blank System.Security.Principal.WindowsIdentity.GetCurrent().Name: Computer Name ``` With `<authentication mode...
I just wanted to post my fix, because no one else had said anything about it. I was having the same issue when I published the site to the server, but not on my local. All the settings were the same. However, in IIS the "Default Website" had never been turned off. It was running and intercepting traffic, even though t...
17,204,714
* Why, in this query, is the final 'WHERE' clause needed to limit duplicates? * The first LEFT JOIN is linking programs to entities on a UID * The first INNER JOIN is linking programs to a subquery that gets statistics for those programs, by linking on a UID * The subquery (that gets the StatsForDistributorClubs subset...
2013/06/20
[ "https://Stackoverflow.com/questions/17204714", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1549918/" ]
As far as I understand you are trying to delete from the txt file. I would suggest `sed -i` for that. You should see required lines deleted in `${file}.mod` with your command ``` sed -i '/Entrust/d' $file ```
As has been noted, your file contains `Entrust`, yet you are searching for `Entrusted` ```sh sed '/Entrust/d' ```
17,204,714
* Why, in this query, is the final 'WHERE' clause needed to limit duplicates? * The first LEFT JOIN is linking programs to entities on a UID * The first INNER JOIN is linking programs to a subquery that gets statistics for those programs, by linking on a UID * The subquery (that gets the StatsForDistributorClubs subset...
2013/06/20
[ "https://Stackoverflow.com/questions/17204714", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1549918/" ]
You can try: [sed](/questions/tagged/sed "show questions tagged 'sed'") ``` sed -n '/Entrust/!p' $file > ${file}.mod ``` **or** ``` sed '/Entrust/d' $file > ${file}.mod ``` [awk](/questions/tagged/awk "show questions tagged 'awk'") ``` awk '!/Entrust/' $file > ${file}.mod ```
As has been noted, your file contains `Entrust`, yet you are searching for `Entrusted` ```sh sed '/Entrust/d' ```
17,204,714
* Why, in this query, is the final 'WHERE' clause needed to limit duplicates? * The first LEFT JOIN is linking programs to entities on a UID * The first INNER JOIN is linking programs to a subquery that gets statistics for those programs, by linking on a UID * The subquery (that gets the StatsForDistributorClubs subset...
2013/06/20
[ "https://Stackoverflow.com/questions/17204714", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1549918/" ]
As far as I understand you are trying to delete from the txt file. I would suggest `sed -i` for that. You should see required lines deleted in `${file}.mod` with your command ``` sed -i '/Entrust/d' $file ```
``` sed -i 's/<content>This document has been digitally signed with external signatures using Entrust PKI</content>/#<content>This document has been digitally signed with external signatures using Entrust PKI</content>/g' $filename ``` This is the way you can comment the line that will not be noticed/read by the scr...
17,204,714
* Why, in this query, is the final 'WHERE' clause needed to limit duplicates? * The first LEFT JOIN is linking programs to entities on a UID * The first INNER JOIN is linking programs to a subquery that gets statistics for those programs, by linking on a UID * The subquery (that gets the StatsForDistributorClubs subset...
2013/06/20
[ "https://Stackoverflow.com/questions/17204714", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1549918/" ]
As far as I understand you are trying to delete from the txt file. I would suggest `sed -i` for that. You should see required lines deleted in `${file}.mod` with your command ``` sed -i '/Entrust/d' $file ```
``` perl -lne 'print unless(/\bEntrust\b/)' your_file.txt > your_file.mod ```
17,204,714
* Why, in this query, is the final 'WHERE' clause needed to limit duplicates? * The first LEFT JOIN is linking programs to entities on a UID * The first INNER JOIN is linking programs to a subquery that gets statistics for those programs, by linking on a UID * The subquery (that gets the StatsForDistributorClubs subset...
2013/06/20
[ "https://Stackoverflow.com/questions/17204714", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1549918/" ]
As far as I understand you are trying to delete from the txt file. I would suggest `sed -i` for that. You should see required lines deleted in `${file}.mod` with your command ``` sed -i '/Entrust/d' $file ```
To search text outside XML-style tags, use the command below; ``` sed '/^\([^<]*\(<[^<>]*>\)*\)*Entrust/d' ``` Here is an example; ``` $ cat tmp.txt some content 2. some content with Entrust. <tag type='Entrust'/> <tag>Entrust</tag> $ sed '/^\([^<]*\(<[^<>]*>\)*\)*Entrust/d' tmp.txt some content 2. <tag type='Entr...
17,204,714
* Why, in this query, is the final 'WHERE' clause needed to limit duplicates? * The first LEFT JOIN is linking programs to entities on a UID * The first INNER JOIN is linking programs to a subquery that gets statistics for those programs, by linking on a UID * The subquery (that gets the StatsForDistributorClubs subset...
2013/06/20
[ "https://Stackoverflow.com/questions/17204714", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1549918/" ]
As far as I understand you are trying to delete from the txt file. I would suggest `sed -i` for that. You should see required lines deleted in `${file}.mod` with your command ``` sed -i '/Entrust/d' $file ```
You can try: [sed](/questions/tagged/sed "show questions tagged 'sed'") ``` sed -n '/Entrust/!p' $file > ${file}.mod ``` **or** ``` sed '/Entrust/d' $file > ${file}.mod ``` [awk](/questions/tagged/awk "show questions tagged 'awk'") ``` awk '!/Entrust/' $file > ${file}.mod ```
17,204,714
* Why, in this query, is the final 'WHERE' clause needed to limit duplicates? * The first LEFT JOIN is linking programs to entities on a UID * The first INNER JOIN is linking programs to a subquery that gets statistics for those programs, by linking on a UID * The subquery (that gets the StatsForDistributorClubs subset...
2013/06/20
[ "https://Stackoverflow.com/questions/17204714", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1549918/" ]
You can try: [sed](/questions/tagged/sed "show questions tagged 'sed'") ``` sed -n '/Entrust/!p' $file > ${file}.mod ``` **or** ``` sed '/Entrust/d' $file > ${file}.mod ``` [awk](/questions/tagged/awk "show questions tagged 'awk'") ``` awk '!/Entrust/' $file > ${file}.mod ```
``` sed -i 's/<content>This document has been digitally signed with external signatures using Entrust PKI</content>/#<content>This document has been digitally signed with external signatures using Entrust PKI</content>/g' $filename ``` This is the way you can comment the line that will not be noticed/read by the scr...
17,204,714
* Why, in this query, is the final 'WHERE' clause needed to limit duplicates? * The first LEFT JOIN is linking programs to entities on a UID * The first INNER JOIN is linking programs to a subquery that gets statistics for those programs, by linking on a UID * The subquery (that gets the StatsForDistributorClubs subset...
2013/06/20
[ "https://Stackoverflow.com/questions/17204714", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1549918/" ]
You can try: [sed](/questions/tagged/sed "show questions tagged 'sed'") ``` sed -n '/Entrust/!p' $file > ${file}.mod ``` **or** ``` sed '/Entrust/d' $file > ${file}.mod ``` [awk](/questions/tagged/awk "show questions tagged 'awk'") ``` awk '!/Entrust/' $file > ${file}.mod ```
``` perl -lne 'print unless(/\bEntrust\b/)' your_file.txt > your_file.mod ```
17,204,714
* Why, in this query, is the final 'WHERE' clause needed to limit duplicates? * The first LEFT JOIN is linking programs to entities on a UID * The first INNER JOIN is linking programs to a subquery that gets statistics for those programs, by linking on a UID * The subquery (that gets the StatsForDistributorClubs subset...
2013/06/20
[ "https://Stackoverflow.com/questions/17204714", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1549918/" ]
You can try: [sed](/questions/tagged/sed "show questions tagged 'sed'") ``` sed -n '/Entrust/!p' $file > ${file}.mod ``` **or** ``` sed '/Entrust/d' $file > ${file}.mod ``` [awk](/questions/tagged/awk "show questions tagged 'awk'") ``` awk '!/Entrust/' $file > ${file}.mod ```
To search text outside XML-style tags, use the command below; ``` sed '/^\([^<]*\(<[^<>]*>\)*\)*Entrust/d' ``` Here is an example; ``` $ cat tmp.txt some content 2. some content with Entrust. <tag type='Entrust'/> <tag>Entrust</tag> $ sed '/^\([^<]*\(<[^<>]*>\)*\)*Entrust/d' tmp.txt some content 2. <tag type='Entr...
226,599
Using the following code, I make a simple graph that is exported to pdf: ``` format = AxesStyle -> {{Thickness[.01], Arrowheads[{0.0, 0.05}]}, { Arrowheads[{0.0, 0.05}]} } graph = ListLinePlot[Table[{t, 2*t}, {t, 0, 100}], format, AspectRatio -> .2] Export[StringJoin[NotebookDirectory[], "\\ext.pdf"], graph]; ``` Wh...
2020/07/27
[ "https://mathematica.stackexchange.com/questions/226599", "https://mathematica.stackexchange.com", "https://mathematica.stackexchange.com/users/22432/" ]
The cut off in the head of the arrow appeared due to the assigned thickness of the axes, to check this we can change the position of the arrow and examine it closely as follow: ``` format = AxesStyle -> {{Thickness[0.02], Arrowheads[{{0.09, 0.8}}]}, {Arrowheads[{0.0, 0.05}]}}; graph = ListLinePlot[Table[{t, 2*t}...
Add a little padding in a `Show` and export it as SVG. If you look at the SVG it's still broken. But then reimport it using `ResourceFunction["SVGImport"]`, then export it back out again as PDF. This seems to magically work and the PDF has the full arrow ... don't ask me why though: ``` svgi = ResourceFunction["SVGImp...
226,599
Using the following code, I make a simple graph that is exported to pdf: ``` format = AxesStyle -> {{Thickness[.01], Arrowheads[{0.0, 0.05}]}, { Arrowheads[{0.0, 0.05}]} } graph = ListLinePlot[Table[{t, 2*t}, {t, 0, 100}], format, AspectRatio -> .2] Export[StringJoin[NotebookDirectory[], "\\ext.pdf"], graph]; ``` Wh...
2020/07/27
[ "https://mathematica.stackexchange.com/questions/226599", "https://mathematica.stackexchange.com", "https://mathematica.stackexchange.com/users/22432/" ]
Add a little padding in a `Show` and export it as SVG. If you look at the SVG it's still broken. But then reimport it using `ResourceFunction["SVGImport"]`, then export it back out again as PDF. This seems to magically work and the PDF has the full arrow ... don't ask me why though: ``` svgi = ResourceFunction["SVGImp...
[Export to PDF - scaling grids of plots and text size](https://mathematica.stackexchange.com/questions/2475/export-to-pdf-scaling-grids-of-plots-and-text-size) should answer this question already. ``` lots = GraphicsGrid[ Table[With[{a = RandomInteger[{1, 17}], b = RandomInteger[{1, 17}]}, ParametricPl...
226,599
Using the following code, I make a simple graph that is exported to pdf: ``` format = AxesStyle -> {{Thickness[.01], Arrowheads[{0.0, 0.05}]}, { Arrowheads[{0.0, 0.05}]} } graph = ListLinePlot[Table[{t, 2*t}, {t, 0, 100}], format, AspectRatio -> .2] Export[StringJoin[NotebookDirectory[], "\\ext.pdf"], graph]; ``` Wh...
2020/07/27
[ "https://mathematica.stackexchange.com/questions/226599", "https://mathematica.stackexchange.com", "https://mathematica.stackexchange.com/users/22432/" ]
The cut off in the head of the arrow appeared due to the assigned thickness of the axes, to check this we can change the position of the arrow and examine it closely as follow: ``` format = AxesStyle -> {{Thickness[0.02], Arrowheads[{{0.09, 0.8}}]}, {Arrowheads[{0.0, 0.05}]}}; graph = ListLinePlot[Table[{t, 2*t}...
[Export to PDF - scaling grids of plots and text size](https://mathematica.stackexchange.com/questions/2475/export-to-pdf-scaling-grids-of-plots-and-text-size) should answer this question already. ``` lots = GraphicsGrid[ Table[With[{a = RandomInteger[{1, 17}], b = RandomInteger[{1, 17}]}, ParametricPl...
56,783,408
How to have pass the value of a selected tableView to a public variable that can be accessed by multiple ViewControllers? Currently, in didSelectRowAt, I define the row selected as `portfolio` doing `let portfolio = structure[indexPath.row]` Now how can I save this value to perhaps some sort of variable that makes it a...
2019/06/27
[ "https://Stackoverflow.com/questions/56783408", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
You can use a function to pass an optional Value inside an `extension`, try the following: From what I understood you want to pass values from your `viewController` and be able to get it from any other `viewController`.. ``` extension UIViewController { func passData(row: Int?) -> Int? { var myValue = Int()...
You can use NSNotificationCenter and post value after selection and every subscribed controller will received a new value. For more info read this [NSNotificationCenter addObserver in Swift](https://stackoverflow.com/questions/24049020/nsnotificationcenter-addobserver-in-swift)
292,332
I was reading a question on Stack Overflow, and noticed that in the right side there was an empty ad, which consisted only of clouds over a blue sky: ![Sky ad](https://i.stack.imgur.com/OqiRW.png) It seemed curious to me that there were no info in the ad: no logo, no text, just a sky full of clouds. So I checked the ...
2015/05/04
[ "https://meta.stackoverflow.com/questions/292332", "https://meta.stackoverflow.com", "https://meta.stackoverflow.com/users/806975/" ]
While I like @Mitchell Carroll's answer, that is incorrect. The clouds are due to an ad tag being implemented improperly. The error is fixed, so you will no longer see any [happy clouds](https://www.youtube.com/watch?v=raXanYjTF18).
It's likely the result of someone who is very well versed in HTML and CSS, and also believes that SO deserves to run without ads. Instead of just straight donating to SO, they bought up an ad in order to contribute to SO's development and upkeep, while also preventing an amount of real (possibly invasive and annoying) ...
62,071,886
maybe one of you can help me. I've written a feature in javascript that adds underlining to all "a" selectors. The function is called with the "onclick" attribute. I would like to reverse the effect, i.e. remove the underscore at second click on the same button. The question is how to do it ? HTML code: ``` <button t...
2020/05/28
[ "https://Stackoverflow.com/questions/62071886", "https://Stackoverflow.com", "https://Stackoverflow.com/users/12267943/" ]
You can create a CSS class with the decoration underline ``` .class { text-decoration: underline } ``` and use toggle in the JS. Toggle will add the class if it isn't applied to your link and remove the class if it is applied to your link ``` function underlineLinks() { const links = document.querySelector...
you could do this ``` function getUnderLineLinksSetter() { let areLinksUnderlines = false; return () => { const links = document.querySelectorAll('a'); areLinksUnderlines = !areLinksUnderlines; links.forEach(a => { if (areLinksUnderlines) { a.style.textDecoration = 'initial'; } else...
62,071,886
maybe one of you can help me. I've written a feature in javascript that adds underlining to all "a" selectors. The function is called with the "onclick" attribute. I would like to reverse the effect, i.e. remove the underscore at second click on the same button. The question is how to do it ? HTML code: ``` <button t...
2020/05/28
[ "https://Stackoverflow.com/questions/62071886", "https://Stackoverflow.com", "https://Stackoverflow.com/users/12267943/" ]
You can create a CSS class with the decoration underline ``` .class { text-decoration: underline } ``` and use toggle in the JS. Toggle will add the class if it isn't applied to your link and remove the class if it is applied to your link ``` function underlineLinks() { const links = document.querySelector...
``` function underlineLinks() { const links = document.querySelectorAll("a"); var toChange = "underline" if(links[0].style.textDecoration != "underline")) toChange = "none" links.forEach(a => a.style.textDecoration = toChange); } ``` Probably there is an easier way but idk, I shoot my shot
6,160
*Acabar com o problema* ou *acabar o problema*? Qual está correto? Têm os mesmos significados? Pelo o que eu percebi, *acabar com o problema* significa ’terminar o problema’.
2019/08/28
[ "https://portuguese.stackexchange.com/questions/6160", "https://portuguese.stackexchange.com", "https://portuguese.stackexchange.com/users/2747/" ]
*Acabar com qualquer coisa* é por-lhe termo, extingui-la; *acabar alguma coisa* é terminá-la, concluí-la. A forma correta depende portanto do contexto. Se estou a resolver um problema de matemática, quando o terminar terei *acabado o problema*. Se o problema é, por exemplo, um cano roto, ao resolver o problema terei ...
Imagine o seguinte! Há um encanamento quebrado que vaza água constantemente. Para "terminar o problema" você tenta tampar o buraco, com as mãos ou de alguma outra forma. Porém para "acabar com o problema" você apenas tranca o registro. Então, "acabar com o problema" é ir até a fonte de origem do problema e dar um fim a...
287,181
I have a gigantic list of files on a text files. This list is passed to tar, like this: cat list.txt | xargs tar rvf archive.tar --ignore-failed-read The problem is that some files that are on the list don't exist anymore. So tar keeps saying "Cannot stat: No such file or directory...". I have no problems with that, ...
2011/07/05
[ "https://serverfault.com/questions/287181", "https://serverfault.com", "https://serverfault.com/users/48713/" ]
How big is the list and how many files are gone? Can you filter the missing files? ``` % cat list.txt foo/bar foo/baz foo/fred foo/wilma betty % for file in `cat list.txt`; do [ -f $file ] && echo $file; done | xargs tar rvf archive.tar foo/bar foo/fred betty % tar tvf archive.tar -rw-r--r-- scott/scott 0 2011...
I don't know if it's the best way, but I've found out that using the parameter `-T`, tar will be much happier. `tar rvf archive.tar --ignore-failed-read -T filelist.txt`