qid
int64
1
74.7M
question
stringlengths
0
58.3k
date
stringlengths
10
10
metadata
list
response_j
stringlengths
2
48.3k
response_k
stringlengths
2
40.5k
15,081
So I have a polygon feature classes with unique identifying names to them that I want to use to rename some other feature classes that are of the point feature type and have the same geography of one of the matching polygon feature classes. Basically the points from the second feature class fit within the polygon featu...
2011/09/28
[ "https://gis.stackexchange.com/questions/15081", "https://gis.stackexchange.com", "https://gis.stackexchange.com/users/405/" ]
Cartographic rules to represent the relief as contours are presented in [Imhof's famous book on relief representation, chapter C](http://esripress.esri.com/display/index.cfm?fuseaction=display&websiteID=118&moduleID=1). Some of these rules are given on [this wikipedia page](http://en.wikipedia.org/wiki/Cartographic_rel...
There is a easy way using gdal\_contour. After setting all option in the dialog window you can then edit the command line and instead the "-i interval" you can use fixed levels "-fl levels". Like the image shows bellow. You can check other options here <http://www.gdal.org/gdal_contour.html> [![enter image description...
4,247,782
I'm trying to evaluate $\frac{\partial (Wx)^T A (Wx)}{\partial W}$, where * W is a $m \times n$ matrix * x is a $n \times 1$ vector * A is a $m \times m$ symmetric positive semi-definite matrix (e.g. a covariance matrix) I did some calculations with simple concrete examples and it looks the answer can be $2AWxx^T$, b...
2021/09/11
[ "https://math.stackexchange.com/questions/4247782", "https://math.stackexchange.com", "https://math.stackexchange.com/users/348916/" ]
For positives $x$, $y$ and $z$ we need to prove that $$\sum\_{cyc}\frac{x+y+z}{x}-3\geq4\sum\_{cyc}\frac{x+y+z}{x+y}-12$$ or $$\sum\_{cyc}\frac{1}{x}+\frac{9}{x+y+z}\geq4\sum\_{cyc}\frac {1}{x+y}$$ or $$\sum\_{cyc}\frac{1}{x}+\frac{3}{\frac{x+y+z}{3}}\geq2\sum\_{cyc}\frac {1}{\frac{x+y}{2}},$$which is Popovicui for the...
We dont really need Popoviciu's Inequality here,Basically use the following lemma. If $x,y,z>0\in \mathbb{R}$ $$\dfrac{x}{y}+\dfrac{x}{z}\geq \dfrac{4x}{y+z}$$ Proof : Note that this is equivalent to $x\left(\dfrac{1}{y}+\dfrac{1}{z}-\dfrac{4}{y+z}\right)\Longleftrightarrow\dfrac{x(y-z)^2}{yz(y+z)}\geq 0$ which is clea...
4,538
Is it possible to have a custom distance metric defined to determine the distance between two clusters in Agglomerative clustering in Mathematica? I have a 3 dimension data with string values along all three dimensions. I want to define my own way of measuring the distance between any two clusters (Strings here...) ...
2012/04/19
[ "https://mathematica.stackexchange.com/questions/4538", "https://mathematica.stackexchange.com", "https://mathematica.stackexchange.com/users/1109/" ]
The tutorial [tutorial/PartitioningDataIntoClusters](http://reference.wolfram.com/mathematica/tutorial/PartitioningDataIntoClusters.html) has information on Distance functions (also for Strings, e.g. HammingDistance).
Not as a built in function. You will have to write your own. Fortunately it's quite easy and the benefit is you now have a function that provides the custom distance important to your data. ``` euclidianDistance[{x_List, y_List, z_List}, {xX_List, xY_List, xZ_List}] := Block[{ed, dist, len, lenp}, len = Le...
6,523
I want to import the Sitecore packages in Sitecore through code. Is there way to do this?
2017/07/08
[ "https://sitecore.stackexchange.com/questions/6523", "https://sitecore.stackexchange.com", "https://sitecore.stackexchange.com/users/2176/" ]
Here is a nice blog post from Akshay Sura describing how to export and import packages: <http://www.webdatasource.com/2011/08/exporting-and-importing-packages-from-sitecore-through-code-using-sitecore-api/> Code for import is: ``` using (new SecurityDisabler()) { using (new ProxyDisabler()) { using (...
You can use Sitecore API to import the packages. You can use the code like ``` using (new ProxyDisabler()) { using (new SyncOperationContext()) { IProcessingContext context = new SimpleProcessingContext(); IItemInstallerEvents events = new DefaultItemInstallerEvent...
6,523
I want to import the Sitecore packages in Sitecore through code. Is there way to do this?
2017/07/08
[ "https://sitecore.stackexchange.com/questions/6523", "https://sitecore.stackexchange.com", "https://sitecore.stackexchange.com/users/2176/" ]
Your question did not specify which language the code needed to be written in, so here is an example in PowerShell. ``` PS master:\> Install-Package -Path YourPackageName.zip -InstallMode Merge -MergeMode Merge ``` Unless you have a really good reason to use C# code to install the packages, I would recommend you use...
You can use Sitecore API to import the packages. You can use the code like ``` using (new ProxyDisabler()) { using (new SyncOperationContext()) { IProcessingContext context = new SimpleProcessingContext(); IItemInstallerEvents events = new DefaultItemInstallerEvent...
6,523
I want to import the Sitecore packages in Sitecore through code. Is there way to do this?
2017/07/08
[ "https://sitecore.stackexchange.com/questions/6523", "https://sitecore.stackexchange.com", "https://sitecore.stackexchange.com/users/2176/" ]
Here is a nice blog post from Akshay Sura describing how to export and import packages: <http://www.webdatasource.com/2011/08/exporting-and-importing-packages-from-sitecore-through-code-using-sitecore-api/> Code for import is: ``` using (new SecurityDisabler()) { using (new ProxyDisabler()) { using (...
Your question did not specify which language the code needed to be written in, so here is an example in PowerShell. ``` PS master:\> Install-Package -Path YourPackageName.zip -InstallMode Merge -MergeMode Merge ``` Unless you have a really good reason to use C# code to install the packages, I would recommend you use...
25,268,763
I am trying to get the drop folder location for TFS within my MsBuild script for a particular project. I have tried to use the $(DropLocation) property but this is empty. What is the best way to get the drop folder location used by TFS in an MSBuild script?
2014/08/12
[ "https://Stackoverflow.com/questions/25268763", "https://Stackoverflow.com", "https://Stackoverflow.com/users/148361/" ]
If you were using TFS 2013, you have the nice TF\_BUILD\_DROPLOCATION environment variable at hand, which you can use just like any property. In 2012 and earlier, you can customize the TFS Build Template: pick the [BuildDetail.DropLocation](http://msdn.microsoft.com/en-us/library/microsoft.teamfoundation.build.server....
(I did this in ts2010, still works with tfs2012) add to your msbuild .proj, something like this ``` <Project DefaultTargets="SetEnv" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="3.5"> <Import Project="$(MSBuildExtensionsPath)\Microsoft\VisualStudio\TeamBuild\Microsoft.TeamFoundation.Buil...
11,329,683
I know that many threads has been created here & on the internet about this topic. But I really can't get the final point on the difference between the two statements! I mean, trying and trying I can reach all the results I need with my queries, but I really don't have full control of the knife! I'm considering myself...
2012/07/04
[ "https://Stackoverflow.com/questions/11329683", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1047141/" ]
To make your query to work as you intended, put the condition into the `ON` clause: ``` FROM category LEFT JOIN web_page ON web_page.category_id = category and web_page.active = "Y" ``` The reason this works is (with most databases, but not all) the `WHERE` clause filters the rows *After* they are joined. If the...
This happens because SQL is being processed in stages: 1. `FROM` clause (all joins are here); 2. `WHERE` clause; 3. `GROUP BY` clause; 4. Window functions (not related to the MySQL though); 5. `ORDER BY` clause. So this really is important, if you want to *filter* on `web_page.active='Y'` or you want to *join* with t...
11,329,683
I know that many threads has been created here & on the internet about this topic. But I really can't get the final point on the difference between the two statements! I mean, trying and trying I can reach all the results I need with my queries, but I really don't have full control of the knife! I'm considering myself...
2012/07/04
[ "https://Stackoverflow.com/questions/11329683", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1047141/" ]
To make your query to work as you intended, put the condition into the `ON` clause: ``` FROM category LEFT JOIN web_page ON web_page.category_id = category and web_page.active = "Y" ``` The reason this works is (with most databases, but not all) the `WHERE` clause filters the rows *After* they are joined. If the...
Trying to help you on the understanding part. Consider is a facet of the SQL Language that when the criteria is specified within the `LEFT JOIN`, it applies when finding the records to match against. When the criteria is specified in the WHERE clause at the bottom, it applies to all of the records - after the join ha...
11,329,683
I know that many threads has been created here & on the internet about this topic. But I really can't get the final point on the difference between the two statements! I mean, trying and trying I can reach all the results I need with my queries, but I really don't have full control of the knife! I'm considering myself...
2012/07/04
[ "https://Stackoverflow.com/questions/11329683", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1047141/" ]
This happens because SQL is being processed in stages: 1. `FROM` clause (all joins are here); 2. `WHERE` clause; 3. `GROUP BY` clause; 4. Window functions (not related to the MySQL though); 5. `ORDER BY` clause. So this really is important, if you want to *filter* on `web_page.active='Y'` or you want to *join* with t...
Trying to help you on the understanding part. Consider is a facet of the SQL Language that when the criteria is specified within the `LEFT JOIN`, it applies when finding the records to match against. When the criteria is specified in the WHERE clause at the bottom, it applies to all of the records - after the join ha...
63,538,396
I want to extract the value of a span via a CSS selector ``` soup = BeautifulSoup("<body><main><div class='rentalprice'><span>3.000</span></div></main></body>") pagecontent = soup.find('body') price = pagecontent.main.div.span.text # this line works although it's not suitable for production since I've now ignored the...
2020/08/22
[ "https://Stackoverflow.com/questions/63538396", "https://Stackoverflow.com", "https://Stackoverflow.com/users/769449/" ]
`select` returns a list of elements, but you can only use `.text` on a single element. If you're sure that there's only 1 span that matches, you can target the first element in the list returned by `select`: ``` price = pagecontent.select('main div.rentalprice span')[0].text print(price) # 3.000 ``` Otherwise, you ...
use `.find()` ``` from bs4 import BeautifulSoup soup = BeautifulSoup("<body><main><div class='rentalprice'><span>3.000</span></div></main></body>", 'html.parser') pagecontent = soup.find('body') price = pagecontent.find('span').text print(price) # 3.000 ```
329,669
The selling point of Documentation, and what made it so attractive and sexy was this: > > Documentation will complement documentation where it falls through > > > I'm unsure where I read it, there's another quote that is more recent: > > Docs is intended to **solve the problem of bad documentation** for various...
2016/07/26
[ "https://meta.stackoverflow.com/questions/329669", "https://meta.stackoverflow.com", "https://meta.stackoverflow.com/users/792066/" ]
Being as it is my *first post*, I wanted to take the opportunity to introduce myself. I am Vasudha, the new product manager for SO Documentation. Am super thrilled to be here and I can’t wait to work with all of you to get Documentation to the right place! The question you raise is a good one and one that we have been...
Here is a suggestion of a light-weight way to do this. I think we actually need two distinct ways of sending the reader to the right place. * A Topic Alias is just an alternative name for an existing topic in the same "Book". It shows up in the "topic finder", but when the reader clicks on it, they end up on the prima...
7,687
I'm having a very peculiar bug with pagination :( I'm trying to display 4 posts per page for a category with slug "lastest-news". The pagination function seems to work correctly. There are 33 posts. The pagination gets constructed correctly with 9 pages and links of following format: /category/lastest-news/page// The...
2011/01/25
[ "https://wordpress.stackexchange.com/questions/7687", "https://wordpress.stackexchange.com", "https://wordpress.stackexchange.com/users/1343/" ]
WordPress does its own query on every page. You should modify that query instead of creating a new one. What happens now is that WordPress does a query with the standard posts per page of 10, but you don't do anything with these results and do your own query. This works... until WordPress goes beyond post #33, which is...
Based on @Jan Fabry reply I've change the syntax a bit. It works well. Thanks Jan for the explanation!!! ``` add_action( 'pre_get_posts', 'wpse7687_pre_get_posts' ); function wpse7687_pre_get_posts( &$wp_query ) { if ($wp_query->query_vars['category_name'] == 'latest-news'){ $wp_query->query_vars['posts_per_page...
857,681
I am in the process of upgrading my computer to a larger SSD as Windows system drive. My problem is that the old SSD has a very annoying trait of choosing some random old data to present for deleted sectors - and over time a lot of this has accumulated at the tail end of files that don't fill the last cluster complete...
2014/12/28
[ "https://superuser.com/questions/857681", "https://superuser.com", "https://superuser.com/users/402501/" ]
I'm really not quite sure what the problem is your referencing and, to be honest, I wonder if you're suffering from a case of "A little knowledge...". Hard drives do accumulate dead data, but it's unlikely to be of any concern whatsoever while the file system is doing its job. Even less on on an SSD where seek times ar...
What's you're looking for it's a driver's backup and restore. Check there: [Windows Driver Backup and Restore](http://www.techsupportalert.com/best-free-windows-driver-backup.htm)
864,631
I need to write a a query that gets a set of information from a table, but if there is no information for that specific client, then use the default set. I was wondering if there is a way to avoid query duplication in an if(exists()) statement. For example: ``` IF( EXISTS( SELECT * FROM UserTable WHERE Name = @UserNa...
2009/05/14
[ "https://Stackoverflow.com/questions/864631", "https://Stackoverflow.com", "https://Stackoverflow.com/users/98947/" ]
You can select into a variable check the variable if it comes back null run the get default query something like this: ``` Declare @uID int; SELECT @uID = UserID FROM UserTable WHERE Name = @UserName IF (@uID is null) begin 'Select default here' End select @uID ```
You don't say what DBMS you are using, but it clearly isn't Oracle (which is the one I know). However, I would expect your DBMS would allow you to do something like this pseudo-code: ``` SELECT UserID FROM UserTable WHERE Name = @UserName IF <no data returned by that> BEGIN SELECT UserID FROM UserTable WHERE Name...
864,631
I need to write a a query that gets a set of information from a table, but if there is no information for that specific client, then use the default set. I was wondering if there is a way to avoid query duplication in an if(exists()) statement. For example: ``` IF( EXISTS( SELECT * FROM UserTable WHERE Name = @UserNa...
2009/05/14
[ "https://Stackoverflow.com/questions/864631", "https://Stackoverflow.com", "https://Stackoverflow.com/users/98947/" ]
You could do this: ``` SELECT TOP 1 UserID FROM UserTable WHERE Name IN (@UserName, 'John Skeet') ORDER BY CASE WHEN Name = 'John Skeet' THEN 2 ELSE 1 END ``` (or use LIMIT or whatever the method is for your RDBMS) Or you could do this: ``` DECLARE @UserID INT SELECT @UserID = UserID FROM...
You don't say what DBMS you are using, but it clearly isn't Oracle (which is the one I know). However, I would expect your DBMS would allow you to do something like this pseudo-code: ``` SELECT UserID FROM UserTable WHERE Name = @UserName IF <no data returned by that> BEGIN SELECT UserID FROM UserTable WHERE Name...
864,631
I need to write a a query that gets a set of information from a table, but if there is no information for that specific client, then use the default set. I was wondering if there is a way to avoid query duplication in an if(exists()) statement. For example: ``` IF( EXISTS( SELECT * FROM UserTable WHERE Name = @UserNa...
2009/05/14
[ "https://Stackoverflow.com/questions/864631", "https://Stackoverflow.com", "https://Stackoverflow.com/users/98947/" ]
You can select into a variable check the variable if it comes back null run the get default query something like this: ``` Declare @uID int; SELECT @uID = UserID FROM UserTable WHERE Name = @UserName IF (@uID is null) begin 'Select default here' End select @uID ```
Unless you are going to define a set of variables for each field you are returning (and it's only one record) I think the most efficent way is to make the call twice. The temp table would probably cost more.
864,631
I need to write a a query that gets a set of information from a table, but if there is no information for that specific client, then use the default set. I was wondering if there is a way to avoid query duplication in an if(exists()) statement. For example: ``` IF( EXISTS( SELECT * FROM UserTable WHERE Name = @UserNa...
2009/05/14
[ "https://Stackoverflow.com/questions/864631", "https://Stackoverflow.com", "https://Stackoverflow.com/users/98947/" ]
If you are concerned about performance, I think you probably don't need to be - most DBMSes should optimize away the duplication. If you are still concerned about performance, run it both ways to see if your DBMS has any problem with it. If you're concerned about code - maintainability of duplicate code sections, read...
You don't say what DBMS you are using, but it clearly isn't Oracle (which is the one I know). However, I would expect your DBMS would allow you to do something like this pseudo-code: ``` SELECT UserID FROM UserTable WHERE Name = @UserName IF <no data returned by that> BEGIN SELECT UserID FROM UserTable WHERE Name...
864,631
I need to write a a query that gets a set of information from a table, but if there is no information for that specific client, then use the default set. I was wondering if there is a way to avoid query duplication in an if(exists()) statement. For example: ``` IF( EXISTS( SELECT * FROM UserTable WHERE Name = @UserNa...
2009/05/14
[ "https://Stackoverflow.com/questions/864631", "https://Stackoverflow.com", "https://Stackoverflow.com/users/98947/" ]
You could do this: ``` SELECT TOP 1 UserID FROM UserTable WHERE Name IN (@UserName, 'John Skeet') ORDER BY CASE WHEN Name = 'John Skeet' THEN 2 ELSE 1 END ``` (or use LIMIT or whatever the method is for your RDBMS) Or you could do this: ``` DECLARE @UserID INT SELECT @UserID = UserID FROM...
If you are concerned about performance, I think you probably don't need to be - most DBMSes should optimize away the duplication. If you are still concerned about performance, run it both ways to see if your DBMS has any problem with it. If you're concerned about code - maintainability of duplicate code sections, read...
864,631
I need to write a a query that gets a set of information from a table, but if there is no information for that specific client, then use the default set. I was wondering if there is a way to avoid query duplication in an if(exists()) statement. For example: ``` IF( EXISTS( SELECT * FROM UserTable WHERE Name = @UserNa...
2009/05/14
[ "https://Stackoverflow.com/questions/864631", "https://Stackoverflow.com", "https://Stackoverflow.com/users/98947/" ]
You could do this: ``` SELECT TOP 1 UserID FROM UserTable WHERE Name IN (@UserName, 'John Skeet') ORDER BY CASE WHEN Name = 'John Skeet' THEN 2 ELSE 1 END ``` (or use LIMIT or whatever the method is for your RDBMS) Or you could do this: ``` DECLARE @UserID INT SELECT @UserID = UserID FROM...
How about: ``` DECLARE @UserID int; SELECT @UserID = UserID FROM UserTable WHERE Name = @UserName IF(@UserID IS NULL) BEGIN SELECT @UserID=UserID FROM UserTable WHERE Name = 'Jon Skeet')) END SELECT @UserID ```
864,631
I need to write a a query that gets a set of information from a table, but if there is no information for that specific client, then use the default set. I was wondering if there is a way to avoid query duplication in an if(exists()) statement. For example: ``` IF( EXISTS( SELECT * FROM UserTable WHERE Name = @UserNa...
2009/05/14
[ "https://Stackoverflow.com/questions/864631", "https://Stackoverflow.com", "https://Stackoverflow.com/users/98947/" ]
You could do this: ``` SELECT TOP 1 UserID FROM UserTable WHERE Name IN (@UserName, 'John Skeet') ORDER BY CASE WHEN Name = 'John Skeet' THEN 2 ELSE 1 END ``` (or use LIMIT or whatever the method is for your RDBMS) Or you could do this: ``` DECLARE @UserID INT SELECT @UserID = UserID FROM...
You can select into a variable check the variable if it comes back null run the get default query something like this: ``` Declare @uID int; SELECT @uID = UserID FROM UserTable WHERE Name = @UserName IF (@uID is null) begin 'Select default here' End select @uID ```
864,631
I need to write a a query that gets a set of information from a table, but if there is no information for that specific client, then use the default set. I was wondering if there is a way to avoid query duplication in an if(exists()) statement. For example: ``` IF( EXISTS( SELECT * FROM UserTable WHERE Name = @UserNa...
2009/05/14
[ "https://Stackoverflow.com/questions/864631", "https://Stackoverflow.com", "https://Stackoverflow.com/users/98947/" ]
You could do this: ``` SELECT TOP 1 UserID FROM UserTable WHERE Name IN (@UserName, 'John Skeet') ORDER BY CASE WHEN Name = 'John Skeet' THEN 2 ELSE 1 END ``` (or use LIMIT or whatever the method is for your RDBMS) Or you could do this: ``` DECLARE @UserID INT SELECT @UserID = UserID FROM...
Unless you are going to define a set of variables for each field you are returning (and it's only one record) I think the most efficent way is to make the call twice. The temp table would probably cost more.
864,631
I need to write a a query that gets a set of information from a table, but if there is no information for that specific client, then use the default set. I was wondering if there is a way to avoid query duplication in an if(exists()) statement. For example: ``` IF( EXISTS( SELECT * FROM UserTable WHERE Name = @UserNa...
2009/05/14
[ "https://Stackoverflow.com/questions/864631", "https://Stackoverflow.com", "https://Stackoverflow.com/users/98947/" ]
If you are concerned about performance, I think you probably don't need to be - most DBMSes should optimize away the duplication. If you are still concerned about performance, run it both ways to see if your DBMS has any problem with it. If you're concerned about code - maintainability of duplicate code sections, read...
Unless you are going to define a set of variables for each field you are returning (and it's only one record) I think the most efficent way is to make the call twice. The temp table would probably cost more.
864,631
I need to write a a query that gets a set of information from a table, but if there is no information for that specific client, then use the default set. I was wondering if there is a way to avoid query duplication in an if(exists()) statement. For example: ``` IF( EXISTS( SELECT * FROM UserTable WHERE Name = @UserNa...
2009/05/14
[ "https://Stackoverflow.com/questions/864631", "https://Stackoverflow.com", "https://Stackoverflow.com/users/98947/" ]
How about: ``` DECLARE @UserID int; SELECT @UserID = UserID FROM UserTable WHERE Name = @UserName IF(@UserID IS NULL) BEGIN SELECT @UserID=UserID FROM UserTable WHERE Name = 'Jon Skeet')) END SELECT @UserID ```
If you are concerned about performance, I think you probably don't need to be - most DBMSes should optimize away the duplication. If you are still concerned about performance, run it both ways to see if your DBMS has any problem with it. If you're concerned about code - maintainability of duplicate code sections, read...
14,697
Hi Just wanted to ask how to make my bike faster. Do I change the front chainring to a larger one, if so do I have to get a whole new drive train or can I just get another shimano large ring. Can I get a smaller cog at the back, will that make my bike faster? Please take a look at my bike. here are the specs Shift...
2013/03/03
[ "https://bicycles.stackexchange.com/questions/14697", "https://bicycles.stackexchange.com", "https://bicycles.stackexchange.com/users/6272/" ]
There's a nice [gear calculator](http://sheldonbrown.com/gears/) at Sheldon's site. I did a quick calculation for you, and at 50/12, at 90 RPM, you should be going 47.4 km/h. If you upgraded your front chainring to a 54, and your back cassette to go down to 11, at the same RPM you could go 55.8 km/h, which is a signifi...
By far the easiest option is change the cassette to an 26\*11. Reducing the smallest cog from 12 to 11 will give you about 9% more speed for the same cadence. To get the same out the front, you would need to go to a 54 large chain ring. An other option would be to go to a 52/12 - quite a common size. You failed to me...
1,393,840
I've an annoying ASP.NET problem: I have a Perl script (see below), which gets the form\_info variable. Now unfortunately, it's http POST, and not http GET, so Request.Querystring doesn't work... Now I have to replace the Perl Script with an asp.net page/app, but my problem is that I cannot process the string form\_i...
2009/09/08
[ "https://Stackoverflow.com/questions/1393840", "https://Stackoverflow.com", "https://Stackoverflow.com/users/155077/" ]
Use "\n" for a newline (or maybe <br /> if the textfield is htmltext). Make sure it is set to multiline though.
if you want the textfield to automatically go to multiple lines set wordWrap to true and define the tf width
1,393,840
I've an annoying ASP.NET problem: I have a Perl script (see below), which gets the form\_info variable. Now unfortunately, it's http POST, and not http GET, so Request.Querystring doesn't work... Now I have to replace the Perl Script with an asp.net page/app, but my problem is that I cannot process the string form\_i...
2009/09/08
[ "https://Stackoverflow.com/questions/1393840", "https://Stackoverflow.com", "https://Stackoverflow.com/users/155077/" ]
Actually the problem is I am reading the text from XML file, example: ``` <filename>02.jpg</filename> <str1>Well-trained legs \n polycarbonate blends</str1> <str2>Secure his ski-glide</str2> ``` "\n" and " " is not working so that the only solution that I found is passing the my text to this small function ``` fu...
Use "\n" for a newline (or maybe <br /> if the textfield is htmltext). Make sure it is set to multiline though.
1,393,840
I've an annoying ASP.NET problem: I have a Perl script (see below), which gets the form\_info variable. Now unfortunately, it's http POST, and not http GET, so Request.Querystring doesn't work... Now I have to replace the Perl Script with an asp.net page/app, but my problem is that I cannot process the string form\_i...
2009/09/08
[ "https://Stackoverflow.com/questions/1393840", "https://Stackoverflow.com", "https://Stackoverflow.com/users/155077/" ]
Use "\n" for a newline (or maybe <br /> if the textfield is htmltext). Make sure it is set to multiline though.
If you want to add a newline at the top of an HTML textfield, and the source text is in an XML file, try this: ``` <![CDATA[<br/> TextField text with a newline at the top (normally discarded by Flash)]]> ```
1,393,840
I've an annoying ASP.NET problem: I have a Perl script (see below), which gets the form\_info variable. Now unfortunately, it's http POST, and not http GET, so Request.Querystring doesn't work... Now I have to replace the Perl Script with an asp.net page/app, but my problem is that I cannot process the string form\_i...
2009/09/08
[ "https://Stackoverflow.com/questions/1393840", "https://Stackoverflow.com", "https://Stackoverflow.com/users/155077/" ]
Use "\n" for a newline (or maybe <br /> if the textfield is htmltext). Make sure it is set to multiline though.
``` trace ('Hisham'+String.fromCharCode(13)+'Shaaban'); ```
1,393,840
I've an annoying ASP.NET problem: I have a Perl script (see below), which gets the form\_info variable. Now unfortunately, it's http POST, and not http GET, so Request.Querystring doesn't work... Now I have to replace the Perl Script with an asp.net page/app, but my problem is that I cannot process the string form\_i...
2009/09/08
[ "https://Stackoverflow.com/questions/1393840", "https://Stackoverflow.com", "https://Stackoverflow.com/users/155077/" ]
Actually the problem is I am reading the text from XML file, example: ``` <filename>02.jpg</filename> <str1>Well-trained legs \n polycarbonate blends</str1> <str2>Secure his ski-glide</str2> ``` "\n" and " " is not working so that the only solution that I found is passing the my text to this small function ``` fu...
if you want the textfield to automatically go to multiple lines set wordWrap to true and define the tf width
1,393,840
I've an annoying ASP.NET problem: I have a Perl script (see below), which gets the form\_info variable. Now unfortunately, it's http POST, and not http GET, so Request.Querystring doesn't work... Now I have to replace the Perl Script with an asp.net page/app, but my problem is that I cannot process the string form\_i...
2009/09/08
[ "https://Stackoverflow.com/questions/1393840", "https://Stackoverflow.com", "https://Stackoverflow.com/users/155077/" ]
if you want the textfield to automatically go to multiple lines set wordWrap to true and define the tf width
If you want to add a newline at the top of an HTML textfield, and the source text is in an XML file, try this: ``` <![CDATA[<br/> TextField text with a newline at the top (normally discarded by Flash)]]> ```
1,393,840
I've an annoying ASP.NET problem: I have a Perl script (see below), which gets the form\_info variable. Now unfortunately, it's http POST, and not http GET, so Request.Querystring doesn't work... Now I have to replace the Perl Script with an asp.net page/app, but my problem is that I cannot process the string form\_i...
2009/09/08
[ "https://Stackoverflow.com/questions/1393840", "https://Stackoverflow.com", "https://Stackoverflow.com/users/155077/" ]
if you want the textfield to automatically go to multiple lines set wordWrap to true and define the tf width
``` trace ('Hisham'+String.fromCharCode(13)+'Shaaban'); ```
1,393,840
I've an annoying ASP.NET problem: I have a Perl script (see below), which gets the form\_info variable. Now unfortunately, it's http POST, and not http GET, so Request.Querystring doesn't work... Now I have to replace the Perl Script with an asp.net page/app, but my problem is that I cannot process the string form\_i...
2009/09/08
[ "https://Stackoverflow.com/questions/1393840", "https://Stackoverflow.com", "https://Stackoverflow.com/users/155077/" ]
Actually the problem is I am reading the text from XML file, example: ``` <filename>02.jpg</filename> <str1>Well-trained legs \n polycarbonate blends</str1> <str2>Secure his ski-glide</str2> ``` "\n" and " " is not working so that the only solution that I found is passing the my text to this small function ``` fu...
If you want to add a newline at the top of an HTML textfield, and the source text is in an XML file, try this: ``` <![CDATA[<br/> TextField text with a newline at the top (normally discarded by Flash)]]> ```
1,393,840
I've an annoying ASP.NET problem: I have a Perl script (see below), which gets the form\_info variable. Now unfortunately, it's http POST, and not http GET, so Request.Querystring doesn't work... Now I have to replace the Perl Script with an asp.net page/app, but my problem is that I cannot process the string form\_i...
2009/09/08
[ "https://Stackoverflow.com/questions/1393840", "https://Stackoverflow.com", "https://Stackoverflow.com/users/155077/" ]
Actually the problem is I am reading the text from XML file, example: ``` <filename>02.jpg</filename> <str1>Well-trained legs \n polycarbonate blends</str1> <str2>Secure his ski-glide</str2> ``` "\n" and " " is not working so that the only solution that I found is passing the my text to this small function ``` fu...
``` trace ('Hisham'+String.fromCharCode(13)+'Shaaban'); ```
22,348,195
In an ssis Dataflow there is a lookup component ,which lookup on a table with 18 million records.I have configured the lookup with full cache. ``` Default buffer size :20485760 Default Buffer Max rows: 100000 The lookup join is based on an ID column of varchar(13)type ``` It gives an error as shown below.What l...
2014/03/12
[ "https://Stackoverflow.com/questions/22348195", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1254579/" ]
Your Query is wrong. It should be like this. ``` Query = "SELECT MemberID FROM tblMember WHERE [MemberID] = " & MemberSelectedID ``` OR ``` Query = "SELECT MemberID FROM tblMember WHERE [MemberID] = '" & MemberSelectedID & "'" ``` MemberID field is Integer so no need to specify it as string. In SQL Server single ...
You are getting the `MemberSelectedID` from the `DataGridView` as `String` and then using it to query the database, on which I assume that it is defined as `Numeric`. That's the reason of the data type mismatch error Try: ``` Dim MemberSelectedID As Integer = DataGridView1.Rows(e.RowIndex).Cells(0).Value ``` And `...
45,278,146
How to get week of particular selected date? For Example: My week will start from Monday and ends on Sunday. So lets say i have selected 25 July 2017. So i want what was the date on monday of that week and what is the date on upcoming Sunday of that week. The answer should be :: Monday -- 24 July 2017 AND Sunday-- 30...
2017/07/24
[ "https://Stackoverflow.com/questions/45278146", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5653768/" ]
```css #pentagram {margin: 250px auto;} #pentagram div { position:absolute;height:5px;border-radius:2px; } #star_1{transform:rotate(180deg) translateY(77px);background:#bb0000;width:476px;} #star_2{transform:rotate(-36deg) translateY(77px);background:#bb0000;width:476px;} #star_3{transform:rotate(36deg) transl...
```css #pentagram{margin:0 auto;margin-top:45px;margin-bottom:75px;height:500px;width:500px;border-radius:500px;border:5px solid #bb0000;position:relative;}#pentagram div{position:absolute;background:#bb0000;width:476px;height:5px;} #star_1{top:328px;left:12px;} #star_2{top:183px;left:-38px;transform:rotate(-37deg);-...
36,275,852
In a scenario like below ![scenario](https://i.stack.imgur.com/SX8Ig.jpg) assignee and assigner are keys of developer and tester. how to map the emp\_id as a foreign key without getting duplicated?
2016/03/29
[ "https://Stackoverflow.com/questions/36275852", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5614342/" ]
start a service and your alarm code in that.Once the alarm is done start your application through notification or as per your logic.
You should use Service, Open your activity through service. [Service](http://developer.android.com/guide/components/services.html)
25,782,885
I have problem making CodeIgniter pagination when i click on link i get 404 page not found my code in controler is ``` class Records extends CI_Controller { public function index() { $this->load->library('pagination'); $config['base_url']= 'localhost/records'; $config['total_rows']=...
2014/09/11
[ "https://Stackoverflow.com/questions/25782885", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3950864/" ]
As far I understand you can't access your next page pagination? So I think it's because of this `$config['base_url']= 'localhost/records';` you should put your complete url(including the controller name and function name), so it should be `$config['base_url']= 'localhost/records/index.php/controller_name/function';` ...
try may be change uri segment ``` $this->load->library('pagination'); $config['base_url']= base_url().'/records/index'; $config['total_rows']= $this->db->get('pages')->num_rows; $config['uri_segment'] = 3; $config['per_page']= 2; $config['num_links']= 5; $this->pagination->initialize($conf...
25,782,885
I have problem making CodeIgniter pagination when i click on link i get 404 page not found my code in controler is ``` class Records extends CI_Controller { public function index() { $this->load->library('pagination'); $config['base_url']= 'localhost/records'; $config['total_rows']=...
2014/09/11
[ "https://Stackoverflow.com/questions/25782885", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3950864/" ]
As far I understand you can't access your next page pagination? So I think it's because of this `$config['base_url']= 'localhost/records';` you should put your complete url(including the controller name and function name), so it should be `$config['base_url']= 'localhost/records/index.php/controller_name/function';` ...
Base Url needs to be ``` $config['base_url']= 'records/index'; ```
25,782,885
I have problem making CodeIgniter pagination when i click on link i get 404 page not found my code in controler is ``` class Records extends CI_Controller { public function index() { $this->load->library('pagination'); $config['base_url']= 'localhost/records'; $config['total_rows']=...
2014/09/11
[ "https://Stackoverflow.com/questions/25782885", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3950864/" ]
As far I understand you can't access your next page pagination? So I think it's because of this `$config['base_url']= 'localhost/records';` you should put your complete url(including the controller name and function name), so it should be `$config['base_url']= 'localhost/records/index.php/controller_name/function';` ...
Base url in must be contain the same function that is used to fetch data it means $config['base\_url']='localhost/project/records/index';
33,773,515
I am trying to validate Item No.s from user input. If the plus symbol is placed at the first place then the is\_numeric function does not gives error but on placing the + symbol anywhere else it gives the error. **Case 1 :** ``` $ItemNumber = '+123456789'; if(!is_numeric($ItemNumber)) { echo 'Sorry! Invalid Item...
2015/11/18
[ "https://Stackoverflow.com/questions/33773515", "https://Stackoverflow.com", "https://Stackoverflow.com/users/613929/" ]
`'+123456789'` is valid numeric string.Check the manual [is\_numeric](http://php.net/manual/en/function.is-numeric.php), but `'123456789+'` is not
Use [ctype\_digit](http://php.net/ctype_digit) php function to get a valid number ``` $ItemNumber = '+123456789'; echo ctype_digit($ItemNumber);//false $ItemNumber = '123456789+'; echo ctype_digit($ItemNumber);//false $ItemNumber = '123456789'; echo ctype_digit($ItemNumber);//true ```
33,773,515
I am trying to validate Item No.s from user input. If the plus symbol is placed at the first place then the is\_numeric function does not gives error but on placing the + symbol anywhere else it gives the error. **Case 1 :** ``` $ItemNumber = '+123456789'; if(!is_numeric($ItemNumber)) { echo 'Sorry! Invalid Item...
2015/11/18
[ "https://Stackoverflow.com/questions/33773515", "https://Stackoverflow.com", "https://Stackoverflow.com/users/613929/" ]
`'+123456789'` is valid numeric string.Check the manual [is\_numeric](http://php.net/manual/en/function.is-numeric.php), but `'123456789+'` is not
Try this.. ``` <?php $value = "+12345655539997"; (or) $value = "+12345655539997+"; (or) $value = "12345655539997+"; if(!preg_match('/^[0-9+]+$/', $value) ) { echo 'Please enter a valid number'; }else{ echo "valid"; } ``` Demo:<https://eval.in/470901>
33,773,515
I am trying to validate Item No.s from user input. If the plus symbol is placed at the first place then the is\_numeric function does not gives error but on placing the + symbol anywhere else it gives the error. **Case 1 :** ``` $ItemNumber = '+123456789'; if(!is_numeric($ItemNumber)) { echo 'Sorry! Invalid Item...
2015/11/18
[ "https://Stackoverflow.com/questions/33773515", "https://Stackoverflow.com", "https://Stackoverflow.com/users/613929/" ]
`'+123456789'` is valid numeric string.Check the manual [is\_numeric](http://php.net/manual/en/function.is-numeric.php), but `'123456789+'` is not
``` $ItemNumber = '+123456789'; if(is_numeric($ItemNumber)){ echo 'Numeric string value.'; }else{ echo 'fail'; } ``` that gives `Numeric string value` because `+123456789` valid numeric string but `123456789+` is not. And `is_numeric` returns `TRUE` if `var` is a number or a numeric string,otherwise it returns `...
11,540,753
I am trying to use `IIF()` in a select statement. The boolean expression checks to see if a fields value is equal to an empty string. The syntax is like so: ``` SELECT IIF(field = '','ONe action','Another') ``` I am getting the error "syntax error near =" I tried a simple test: ``` SELECT IIF(2 > 1, 'yes','no') ...
2012/07/18
[ "https://Stackoverflow.com/questions/11540753", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1001495/" ]
As noted, `IIF` is a SQL2012 feature. Replace your `IIF` with a `CASE` ( Which is what SQL 2012 would do anyway ) ``` SELECT CASE field WHEN '' THEN 'ONe action' ELSE 'Another' END ```
`IIF` was [introduced in SQL Server 2012](http://msdn.microsoft.com/en-us/library/hh213574.aspx), so that is why it does not work in SQL Server 2008 or SQL Server 2008 R2.
11,540,753
I am trying to use `IIF()` in a select statement. The boolean expression checks to see if a fields value is equal to an empty string. The syntax is like so: ``` SELECT IIF(field = '','ONe action','Another') ``` I am getting the error "syntax error near =" I tried a simple test: ``` SELECT IIF(2 > 1, 'yes','no') ...
2012/07/18
[ "https://Stackoverflow.com/questions/11540753", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1001495/" ]
`IFF` is available starting from SQL Server 2012. So use 'Case' instead. **If you are looking for a more compact form** (function instead of case) in SQL Server 2008 you can use: ``` isnull((select 'yes' where 2 > 1),'no') ``` instead of: ``` SELECT IIF(2 > 1, 'yes','no') ``` Then your statement will be: `SELEC...
`IIF` was [introduced in SQL Server 2012](http://msdn.microsoft.com/en-us/library/hh213574.aspx), so that is why it does not work in SQL Server 2008 or SQL Server 2008 R2.
11,540,753
I am trying to use `IIF()` in a select statement. The boolean expression checks to see if a fields value is equal to an empty string. The syntax is like so: ``` SELECT IIF(field = '','ONe action','Another') ``` I am getting the error "syntax error near =" I tried a simple test: ``` SELECT IIF(2 > 1, 'yes','no') ...
2012/07/18
[ "https://Stackoverflow.com/questions/11540753", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1001495/" ]
`IIF` was [introduced in SQL Server 2012](http://msdn.microsoft.com/en-us/library/hh213574.aspx), so that is why it does not work in SQL Server 2008 or SQL Server 2008 R2.
``` DECLARE @a int=45 DECLARE @b int=40 SELECT CASE WHEN @A>@B THEN 'True' ELSE 'FALSE' END ``` You can use this solution instead of `IIF`.
11,540,753
I am trying to use `IIF()` in a select statement. The boolean expression checks to see if a fields value is equal to an empty string. The syntax is like so: ``` SELECT IIF(field = '','ONe action','Another') ``` I am getting the error "syntax error near =" I tried a simple test: ``` SELECT IIF(2 > 1, 'yes','no') ...
2012/07/18
[ "https://Stackoverflow.com/questions/11540753", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1001495/" ]
As noted, `IIF` is a SQL2012 feature. Replace your `IIF` with a `CASE` ( Which is what SQL 2012 would do anyway ) ``` SELECT CASE field WHEN '' THEN 'ONe action' ELSE 'Another' END ```
`IFF` is available starting from SQL Server 2012. So use 'Case' instead. **If you are looking for a more compact form** (function instead of case) in SQL Server 2008 you can use: ``` isnull((select 'yes' where 2 > 1),'no') ``` instead of: ``` SELECT IIF(2 > 1, 'yes','no') ``` Then your statement will be: `SELEC...
11,540,753
I am trying to use `IIF()` in a select statement. The boolean expression checks to see if a fields value is equal to an empty string. The syntax is like so: ``` SELECT IIF(field = '','ONe action','Another') ``` I am getting the error "syntax error near =" I tried a simple test: ``` SELECT IIF(2 > 1, 'yes','no') ...
2012/07/18
[ "https://Stackoverflow.com/questions/11540753", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1001495/" ]
As noted, `IIF` is a SQL2012 feature. Replace your `IIF` with a `CASE` ( Which is what SQL 2012 would do anyway ) ``` SELECT CASE field WHEN '' THEN 'ONe action' ELSE 'Another' END ```
``` DECLARE @a int=45 DECLARE @b int=40 SELECT CASE WHEN @A>@B THEN 'True' ELSE 'FALSE' END ``` You can use this solution instead of `IIF`.
11,540,753
I am trying to use `IIF()` in a select statement. The boolean expression checks to see if a fields value is equal to an empty string. The syntax is like so: ``` SELECT IIF(field = '','ONe action','Another') ``` I am getting the error "syntax error near =" I tried a simple test: ``` SELECT IIF(2 > 1, 'yes','no') ...
2012/07/18
[ "https://Stackoverflow.com/questions/11540753", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1001495/" ]
`IFF` is available starting from SQL Server 2012. So use 'Case' instead. **If you are looking for a more compact form** (function instead of case) in SQL Server 2008 you can use: ``` isnull((select 'yes' where 2 > 1),'no') ``` instead of: ``` SELECT IIF(2 > 1, 'yes','no') ``` Then your statement will be: `SELEC...
``` DECLARE @a int=45 DECLARE @b int=40 SELECT CASE WHEN @A>@B THEN 'True' ELSE 'FALSE' END ``` You can use this solution instead of `IIF`.
67,756,167
i am trying to make a CLIish server in node.js. but I need a way to parse a string and run a function from an object. what I mean is... I don't want to nest a million switch statements just to have the commands I need. using 2 other StackOverflow answers, I got 1 part done. inputs. now i just need to figure out how to...
2021/05/29
[ "https://Stackoverflow.com/questions/67756167", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
You can use a generator expression. ```py list1 = [1, 2, 3, 4, 5] list2 = [1, 7, 9, 4, 5] num_equal = sum(i == j for i, j in zip(list1, list2)) print(num_equal) # 3 ``` `zip(list1, list2)` returns an iterator containing tuples of each value in `list1` and `list2`, essentially forming pairs of corresponding items f...
Just loop over both lists and check if the values are the same: ``` list1 = [1, 2, 3, 4, 5] list2 = [1, 7, 9, 4, 5] same = 0 for i in range(len(list1)): # assuming the lists are the same length if list1[i] == list2[i]: same += 1 print(same) ``` Output: `3`
67,756,167
i am trying to make a CLIish server in node.js. but I need a way to parse a string and run a function from an object. what I mean is... I don't want to nest a million switch statements just to have the commands I need. using 2 other StackOverflow answers, I got 1 part done. inputs. now i just need to figure out how to...
2021/05/29
[ "https://Stackoverflow.com/questions/67756167", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
You can use a generator expression. ```py list1 = [1, 2, 3, 4, 5] list2 = [1, 7, 9, 4, 5] num_equal = sum(i == j for i, j in zip(list1, list2)) print(num_equal) # 3 ``` `zip(list1, list2)` returns an iterator containing tuples of each value in `list1` and `list2`, essentially forming pairs of corresponding items f...
You can do a different approach. If both numbers equal then both are substrated the value will be zero. So, we can count the value of zero. NB: This approach will only work for numbers. ``` In [13]: list(map(int.__sub__, list1, list2)).count(0) Out[13]: 3 ```
56,995,155
I have multiple issues with adding maven jar files to the osgi bundle, but let's start with the most important: I'd like to include all dependent jar files in the osgi bundle. I know that is not ideal and all but bear with me. So my pom.xml lists all dependencies, all can be compiled in Eclipse. When I run maven with...
2019/07/11
[ "https://Stackoverflow.com/questions/56995155", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8082161/" ]
First make sure which of the transitive dependencies are OSGi bundles. Add them as explicit dependencies with scope runtime, but exlude them in the Embed-Dependency instruction. The 3 non-OSGi dependency should have the scope "provided" so they are only considered during the build. Make sure with the Embed-Dependency ...
Okay, one part I found out. The maven goal is dependency:copy-dependencies to copy the dependencies. :sight: Now the folder contains the jar files....
5,538,018
I'm messing around with the Ruby Git gem... seeing how I can use it to manage/access a Gitosis server I'm running. Does anyone know if it is possible to add/commit files to a local bare repo, or will I need to set up a local 'normal' repo and use SSH to push it to the bare repo on the localhost?
2011/04/04
[ "https://Stackoverflow.com/questions/5538018", "https://Stackoverflow.com", "https://Stackoverflow.com/users/451664/" ]
You should be able to do this using low level **plumbing** commands: ``` $ *generate\_contents* | [git hash-object](http://www.kernel.org/pub/software/scm/git/docs/git-hash-object.html) -t blob -w --stdin $ [git update-index](http://www.kernel.org/pub/software/scm/git/docs/git-update-index.html) --cacheinfo 100644 *s...
You need a working tree to add a file to the index and commit it. While it might be possible to change directly the internal content of a bare git repo through plumbing commands, I would really recommend setting up a normal clone, modify it and push the resulting commit back to the bare repo.
5,538,018
I'm messing around with the Ruby Git gem... seeing how I can use it to manage/access a Gitosis server I'm running. Does anyone know if it is possible to add/commit files to a local bare repo, or will I need to set up a local 'normal' repo and use SSH to push it to the bare repo on the localhost?
2011/04/04
[ "https://Stackoverflow.com/questions/5538018", "https://Stackoverflow.com", "https://Stackoverflow.com/users/451664/" ]
You need a working tree to add a file to the index and commit it. While it might be possible to change directly the internal content of a bare git repo through plumbing commands, I would really recommend setting up a normal clone, modify it and push the resulting commit back to the bare repo.
Since [`git update-index --add --cachinfo`](http://git-scm.com/docs/git-update-index) is important to add a file to the index, note that cacheinfo has a new syntax: ``` --cacheinfo <mode>,<object>,<path> --cacheinfo <mode> <object> <path> ``` > > Directly insert the specified info into the index. > > For backwa...
5,538,018
I'm messing around with the Ruby Git gem... seeing how I can use it to manage/access a Gitosis server I'm running. Does anyone know if it is possible to add/commit files to a local bare repo, or will I need to set up a local 'normal' repo and use SSH to push it to the bare repo on the localhost?
2011/04/04
[ "https://Stackoverflow.com/questions/5538018", "https://Stackoverflow.com", "https://Stackoverflow.com/users/451664/" ]
You should be able to do this using low level **plumbing** commands: ``` $ *generate\_contents* | [git hash-object](http://www.kernel.org/pub/software/scm/git/docs/git-hash-object.html) -t blob -w --stdin $ [git update-index](http://www.kernel.org/pub/software/scm/git/docs/git-update-index.html) --cacheinfo 100644 *s...
Since [`git update-index --add --cachinfo`](http://git-scm.com/docs/git-update-index) is important to add a file to the index, note that cacheinfo has a new syntax: ``` --cacheinfo <mode>,<object>,<path> --cacheinfo <mode> <object> <path> ``` > > Directly insert the specified info into the index. > > For backwa...
14,949,537
I have a knowledge base that consists of students database in a file 'students.pl' like this: ``` % student(Name,Percent,List_of_Marks_in_3_subjects). student('abc',83,[80,80,90]). student('pqr',70,[70,60,80]). student('xyz',76,[80,70,80]). ``` I want to access each student predicate from the knowledge base and calc...
2013/02/19
[ "https://Stackoverflow.com/questions/14949537", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1710765/" ]
``` %solution for sum of percents, you can replace with any other calculation sum_percent predicate. listing(student/3, convert_to_list/2, sum_percent, sum_percent/2). % student(Name,Percent,List_of_Marks_in_3_subjects). student('abc',83,[80,80,90]). student('pqr',70,[70,60,80]). student('xyz',76,[80,70,80]). convert...
if you want to add to a list then you should use findall, or better, library([aggregate](http://www.swi-prolog.org/pldoc/doc_for?object=section%282,%27A.1%27,swi%28%27/doc/Manual/aggregate.html%27%29%29)). But if you fear about efficiency, you could use something like this ``` integrate(ave, Goal, Ave) :- State = ...
95,334
Why didn't Elrond send one of his sons in the company?
2015/07/13
[ "https://scifi.stackexchange.com/questions/95334", "https://scifi.stackexchange.com", "https://scifi.stackexchange.com/users/48137/" ]
This isn't explained in-universe, but there are a few factors that may have contributed: * **They were busy doing behind-the-scenes work for the fellowship.** In *Fellowship of the Ring* we learn that Elladan and Elrohir were part of a large-scale scouting effort before the fellowship left Rivendell: > > Some of the...
To supplement, rather than supplant, Jason Baker's excellent answer above, I can only offer the following note. In a sense, Elrond *did* send his son on the quest. In *The Tale of Aragorn and Arwen*, which is found in the Appendices to *The Lord of the Rings*, we read this passage: > > [After his father Arathorn's de...
95,334
Why didn't Elrond send one of his sons in the company?
2015/07/13
[ "https://scifi.stackexchange.com/questions/95334", "https://scifi.stackexchange.com", "https://scifi.stackexchange.com/users/48137/" ]
This isn't explained in-universe, but there are a few factors that may have contributed: * **They were busy doing behind-the-scenes work for the fellowship.** In *Fellowship of the Ring* we learn that Elladan and Elrohir were part of a large-scale scouting effort before the fellowship left Rivendell: > > Some of the...
According to their [wiki page](http://lotr.wikia.com/wiki/Elrohir) The WERE a part of the fellowship....sort of. It was their job to scout out ahead of the fellowship before they even set out. Later, they joined [The grey company](http://lotr.wikia.com/wiki/Grey_Company) , the greatest mortal soldiers of middle earth....
95,334
Why didn't Elrond send one of his sons in the company?
2015/07/13
[ "https://scifi.stackexchange.com/questions/95334", "https://scifi.stackexchange.com", "https://scifi.stackexchange.com/users/48137/" ]
This isn't explained in-universe, but there are a few factors that may have contributed: * **They were busy doing behind-the-scenes work for the fellowship.** In *Fellowship of the Ring* we learn that Elladan and Elrohir were part of a large-scale scouting effort before the fellowship left Rivendell: > > Some of the...
Don't forget also that Gandalf states that the hope of the fellowship lies in secrecy and not in strength and that even having Glorfindel in their ranks would help. Seeing as Legolas was already going to be travelling that direction(ish) it makes sense that he would be the one of elf kind in the fellowship
95,334
Why didn't Elrond send one of his sons in the company?
2015/07/13
[ "https://scifi.stackexchange.com/questions/95334", "https://scifi.stackexchange.com", "https://scifi.stackexchange.com/users/48137/" ]
To supplement, rather than supplant, Jason Baker's excellent answer above, I can only offer the following note. In a sense, Elrond *did* send his son on the quest. In *The Tale of Aragorn and Arwen*, which is found in the Appendices to *The Lord of the Rings*, we read this passage: > > [After his father Arathorn's de...
According to their [wiki page](http://lotr.wikia.com/wiki/Elrohir) The WERE a part of the fellowship....sort of. It was their job to scout out ahead of the fellowship before they even set out. Later, they joined [The grey company](http://lotr.wikia.com/wiki/Grey_Company) , the greatest mortal soldiers of middle earth....
95,334
Why didn't Elrond send one of his sons in the company?
2015/07/13
[ "https://scifi.stackexchange.com/questions/95334", "https://scifi.stackexchange.com", "https://scifi.stackexchange.com/users/48137/" ]
To supplement, rather than supplant, Jason Baker's excellent answer above, I can only offer the following note. In a sense, Elrond *did* send his son on the quest. In *The Tale of Aragorn and Arwen*, which is found in the Appendices to *The Lord of the Rings*, we read this passage: > > [After his father Arathorn's de...
Don't forget also that Gandalf states that the hope of the fellowship lies in secrecy and not in strength and that even having Glorfindel in their ranks would help. Seeing as Legolas was already going to be travelling that direction(ish) it makes sense that he would be the one of elf kind in the fellowship
95,334
Why didn't Elrond send one of his sons in the company?
2015/07/13
[ "https://scifi.stackexchange.com/questions/95334", "https://scifi.stackexchange.com", "https://scifi.stackexchange.com/users/48137/" ]
According to their [wiki page](http://lotr.wikia.com/wiki/Elrohir) The WERE a part of the fellowship....sort of. It was their job to scout out ahead of the fellowship before they even set out. Later, they joined [The grey company](http://lotr.wikia.com/wiki/Grey_Company) , the greatest mortal soldiers of middle earth....
Don't forget also that Gandalf states that the hope of the fellowship lies in secrecy and not in strength and that even having Glorfindel in their ranks would help. Seeing as Legolas was already going to be travelling that direction(ish) it makes sense that he would be the one of elf kind in the fellowship
38,401,545
I have a simple problem to solve. I need to get data from MS SQL and I cannot figure out what I have done wrong and missing. I have 1 table called "Deliveries" with columns: dID, sNumber and Team. dID is unique number. I should get following list: sNumber , max(dID), Team. There are several sNumber values and I nee...
2016/07/15
[ "https://Stackoverflow.com/questions/38401545", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4480702/" ]
The `el` option should provide Vue with an existing DOM element to mount on. You have provided a CSS selector for body, so Vue will try to mount on the `body` element. Otherwise your code is correct. Just wrap your HTML in `body` tags and it works! ```js var vm = new Vue({ el: 'body', data:{ 'choice...
If you get your data from the backend, you need to follow another way. For example, I have a category list, which comes from the backend. ``` <el-select v-model="categorySelect.selected" size="large" name="category_id" single v-bind:placeholder="$t...
244,641
In a few hours I will have a quiz and while studying I had some questions. Could you please help me? Thanks in advance > > Question 1: Let $(X, d)$ be a metric space and $(x\_n)$ be a > sequence in $X$. Let $(x\_n)$ be a Cauchy sequence, prove that if > $(x\_n)$ has a cluster point $z$, then $(x\_n) \to z$. > > ...
2012/11/26
[ "https://math.stackexchange.com/questions/244641", "https://math.stackexchange.com", "https://math.stackexchange.com/users/42996/" ]
**Lemma.** If $\alpha\in\mathbb R$, $m\in\mathbb N$, there exist $a,b\in\mathbb Z$ with $1\le a\le m$ and $|a\alpha-b|<\frac 1m$. *Proof:* Partition the interval $[0,1)$ into $m$ subintervals $\left[\frac km,\frac{k+1}m\right)$, $0\le k<m$. By the pigeon-hole principle, there exist $0\le i<j\le m$ such that $i\alpha-\...
If $x$ is irrational, the values $e^{in\pi x}$ are dense on the unit circle. Similarly for $y$.
46,167
I am using `\usepackage[osf]{mathpazo}` for oldstyle figures and the `dcolumn` package to align the contents of tables at their decimal point. The problem is that `dcolumn` automatically sets the aligned content in math mode which sometimes results in a strange mixture of oldstyle numbers and lining numbers. Is there ...
2012/02/28
[ "https://tex.stackexchange.com/questions/46167", "https://tex.stackexchange.com", "https://tex.stackexchange.com/users/11984/" ]
I don't know how you might achieve your objective using the functionality of the `dcolumn` package. Fortunately, it's fairly straightforward to do if you're willing to use the `siunitx` package and its `S` column type. In the example below, I've taken your code and made a few changes that instruct `siunitx` how to de...
As mentioned in my earlier comment, you can use the [`mathastext` package](http://www.ctan.org/tex-archive/macros/latex/contrib/mathastext). It will allow you to typeset basic math with the same font and options as text; however, it will affect all math throughout your document (so I would only recommend it for a mainl...
46,167
I am using `\usepackage[osf]{mathpazo}` for oldstyle figures and the `dcolumn` package to align the contents of tables at their decimal point. The problem is that `dcolumn` automatically sets the aligned content in math mode which sometimes results in a strange mixture of oldstyle numbers and lining numbers. Is there ...
2012/02/28
[ "https://tex.stackexchange.com/questions/46167", "https://tex.stackexchange.com", "https://tex.stackexchange.com/users/11984/" ]
I don't know how you might achieve your objective using the functionality of the `dcolumn` package. Fortunately, it's fairly straightforward to do if you're willing to use the `siunitx` package and its `S` column type. In the example below, I've taken your code and made a few changes that instruct `siunitx` how to de...
You may consider to switch to another mathversion: ``` \documentclass[11pt,a4paper]{article} \usepackage[osf]{mathpazo} \usepackage{dcolumn} \DeclareMathVersion{oldstyle}% \SetSymbolFont{operators}{oldstyle}{OML}{zplmj}{m}{it} \newenvironment{oldstyletabs}{\mathversion{oldstyle}}{} \begin{document} \begin{tabular}{*...
30,377,894
What is **TProperty** in c#? I saw a code like this: ``` public abstract class Myclass<T, TProperty> : .... ``` I know that **T** is a generic type for the type we are passing. Is **TProperty** also the same as **T**.
2015/05/21
[ "https://Stackoverflow.com/questions/30377894", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3925766/" ]
Anything inside the `<>` is a generic type indicator. It's name does not make any difference to the compiler, but it should be meaningful for code readability. Just like in `Dictionary<TKey, TValue>`. Of course it has to be unique to it's scope, inclusive of variable names in that scope. Note that type indicat...
From the description of the class you provide: ``` public abstract class Myclass<T, TProperty> : .... ``` It appears the person who created the class intends for an object (T) and an object property (TProperty) to be supplied whenever creating the class. A best guess would be something like this: ``` var mine = n...
30,377,894
What is **TProperty** in c#? I saw a code like this: ``` public abstract class Myclass<T, TProperty> : .... ``` I know that **T** is a generic type for the type we are passing. Is **TProperty** also the same as **T**.
2015/05/21
[ "https://Stackoverflow.com/questions/30377894", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3925766/" ]
Anything inside the `<>` is a generic type indicator. It's name does not make any difference to the compiler, but it should be meaningful for code readability. Just like in `Dictionary<TKey, TValue>`. Of course it has to be unique to it's scope, inclusive of variable names in that scope. Note that type indicat...
`TProperty` is a second generic parameter. * Like object parameters on methods, the names have to be unique to distinguish them * Generics can have more than one parameter + According to the C# language spec, *any* number - see [`Tuple<T1...T7, TRest>`](https://msdn.microsoft.com/en-us/library/dd383325(v=vs.110).asp...
30,377,894
What is **TProperty** in c#? I saw a code like this: ``` public abstract class Myclass<T, TProperty> : .... ``` I know that **T** is a generic type for the type we are passing. Is **TProperty** also the same as **T**.
2015/05/21
[ "https://Stackoverflow.com/questions/30377894", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3925766/" ]
`TProperty` is a second generic parameter. * Like object parameters on methods, the names have to be unique to distinguish them * Generics can have more than one parameter + According to the C# language spec, *any* number - see [`Tuple<T1...T7, TRest>`](https://msdn.microsoft.com/en-us/library/dd383325(v=vs.110).asp...
From the description of the class you provide: ``` public abstract class Myclass<T, TProperty> : .... ``` It appears the person who created the class intends for an object (T) and an object property (TProperty) to be supplied whenever creating the class. A best guess would be something like this: ``` var mine = n...
26,512,629
I'm programming a web page that will need to parse data from XML derived from an API call, but the XML is formatted into a data-header, data-body type schema. I need to be able to parse this for an ASP.net C# page, where I will be importing the data into a SQL Server table... Any help would be appreciated! The XML i...
2014/10/22
[ "https://Stackoverflow.com/questions/26512629", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4170831/" ]
You can use Linq-to-XML or XPath to parse the xml and then use Entity Framework (or straight ADO.NET) to insert it into the database.
If your goal is to display this XML in an HTML page you could use XSLT to transform the XML in HTML. This was what Windows Live Messenger used for conversation logs and what IIS uses for tracing logs. After creating the XSLT with the transform instructions you only need to add an reference in the XML to the XSLT and m...
26,512,629
I'm programming a web page that will need to parse data from XML derived from an API call, but the XML is formatted into a data-header, data-body type schema. I need to be able to parse this for an ASP.net C# page, where I will be importing the data into a SQL Server table... Any help would be appreciated! The XML i...
2014/10/22
[ "https://Stackoverflow.com/questions/26512629", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4170831/" ]
I was able to resolve this with this function: ``` public DataTable parseReport(List<zapi.ClientReportResultItem> reportItems) { StringBuilder sb = new StringBuilder(); XmlDocument xmlDoc = new XmlDocument(); xmlDoc.LoadXml(reportItems[0].body); StringReader sReader = new StringReader(xmlDoc.InnerXml);...
If your goal is to display this XML in an HTML page you could use XSLT to transform the XML in HTML. This was what Windows Live Messenger used for conversation logs and what IIS uses for tracing logs. After creating the XSLT with the transform instructions you only need to add an reference in the XML to the XSLT and m...
26,512,629
I'm programming a web page that will need to parse data from XML derived from an API call, but the XML is formatted into a data-header, data-body type schema. I need to be able to parse this for an ASP.net C# page, where I will be importing the data into a SQL Server table... Any help would be appreciated! The XML i...
2014/10/22
[ "https://Stackoverflow.com/questions/26512629", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4170831/" ]
You can use Linq-to-XML or XPath to parse the xml and then use Entity Framework (or straight ADO.NET) to insert it into the database.
I was able to resolve this with this function: ``` public DataTable parseReport(List<zapi.ClientReportResultItem> reportItems) { StringBuilder sb = new StringBuilder(); XmlDocument xmlDoc = new XmlDocument(); xmlDoc.LoadXml(reportItems[0].body); StringReader sReader = new StringReader(xmlDoc.InnerXml);...
349,459
Say I have a table called "xml" that stores XML files in a single column "data". How would I write a MySQL query that run an XPath and return only rows matching that XPath?
2008/12/08
[ "https://Stackoverflow.com/questions/349459", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11236/" ]
``` SELECT * FROM xml WHERE EXTRACTVALUE(data, '<xpath-expr>') != ''; ``` You should note, however, that there are limitations to MySQL's support of XPath. * `EXTRACTVALUE()` returns only CDATA. * Not all XPath constructions are supported. Details under the heading "XPath limitations" on the doc [page](http://dev.my...
I just got the answer from a colleague, it seems trimming the xml often helps: ``` select * from xml where trim(both '\r\n' from ExtractValue(xml, '/some/xpath')) = 'value'; ```
4,692,441
I'm writing a simple Windows Forms utility to screenshot either the entire screen or an active window and save the file. The winform has a button called 'Capture' that, when clicked, takes the screenshot. I have the code entirely working for the entire screen but can't figure it out for the active window. By my curre...
2011/01/14
[ "https://Stackoverflow.com/questions/4692441", "https://Stackoverflow.com", "https://Stackoverflow.com/users/315828/" ]
I ended up taking a different route. I allow the user to resize my form window to cover exactly the area they need to screenshot, and then when they click the button, the form hides itself, takes a screenshot of the area it was covering and appears again. Contrary to my initial plan, I believe this will be more benefi...
You need to borrow the design of commercially available screen capturing apps, such as Psp. I think you need to use a 'hot' key to trigger the capturing of the active window. Instead of doing it on Capture\_Click event. This way, you can hide your application's window so that it does not become the active window. Then ...
4,692,441
I'm writing a simple Windows Forms utility to screenshot either the entire screen or an active window and save the file. The winform has a button called 'Capture' that, when clicked, takes the screenshot. I have the code entirely working for the entire screen but can't figure it out for the active window. By my curre...
2011/01/14
[ "https://Stackoverflow.com/questions/4692441", "https://Stackoverflow.com", "https://Stackoverflow.com/users/315828/" ]
In your `button_Click` method, to capture a window other than the one which is doing the capturing, the only possible way I can see is to make use of the `user32` Windows API. You will first need to platform invoke some methods like this: ``` [DllImport("user32.dll", SetLastError = true)] private static extern int Ge...
I ended up taking a different route. I allow the user to resize my form window to cover exactly the area they need to screenshot, and then when they click the button, the form hides itself, takes a screenshot of the area it was covering and appears again. Contrary to my initial plan, I believe this will be more benefi...
4,692,441
I'm writing a simple Windows Forms utility to screenshot either the entire screen or an active window and save the file. The winform has a button called 'Capture' that, when clicked, takes the screenshot. I have the code entirely working for the entire screen but can't figure it out for the active window. By my curre...
2011/01/14
[ "https://Stackoverflow.com/questions/4692441", "https://Stackoverflow.com", "https://Stackoverflow.com/users/315828/" ]
In your `button_Click` method, to capture a window other than the one which is doing the capturing, the only possible way I can see is to make use of the `user32` Windows API. You will first need to platform invoke some methods like this: ``` [DllImport("user32.dll", SetLastError = true)] private static extern int Ge...
You need to borrow the design of commercially available screen capturing apps, such as Psp. I think you need to use a 'hot' key to trigger the capturing of the active window. Instead of doing it on Capture\_Click event. This way, you can hide your application's window so that it does not become the active window. Then ...
4,692,441
I'm writing a simple Windows Forms utility to screenshot either the entire screen or an active window and save the file. The winform has a button called 'Capture' that, when clicked, takes the screenshot. I have the code entirely working for the entire screen but can't figure it out for the active window. By my curre...
2011/01/14
[ "https://Stackoverflow.com/questions/4692441", "https://Stackoverflow.com", "https://Stackoverflow.com/users/315828/" ]
As far as I can see your code uses the bounds of its own form to capture the "active" window. That is probably not what you intend. If you want to use the mouse to "print" a window (and not hotkey which probably is easier to implement) you need to be able to from your own form let the user point to another window to c...
What about SendKeys? ``` Windows.Forms.SendKeys.Send("%{PRTSC}"); ``` It will copy currently selected window in to Clipboard object. Than calling ``` BitmapSource image = Clipboard.GetImage(); ``` you can get your image back
4,692,441
I'm writing a simple Windows Forms utility to screenshot either the entire screen or an active window and save the file. The winform has a button called 'Capture' that, when clicked, takes the screenshot. I have the code entirely working for the entire screen but can't figure it out for the active window. By my curre...
2011/01/14
[ "https://Stackoverflow.com/questions/4692441", "https://Stackoverflow.com", "https://Stackoverflow.com/users/315828/" ]
As far as I can see your code uses the bounds of its own form to capture the "active" window. That is probably not what you intend. If you want to use the mouse to "print" a window (and not hotkey which probably is easier to implement) you need to be able to from your own form let the user point to another window to c...
You need to borrow the design of commercially available screen capturing apps, such as Psp. I think you need to use a 'hot' key to trigger the capturing of the active window. Instead of doing it on Capture\_Click event. This way, you can hide your application's window so that it does not become the active window. Then ...
4,692,441
I'm writing a simple Windows Forms utility to screenshot either the entire screen or an active window and save the file. The winform has a button called 'Capture' that, when clicked, takes the screenshot. I have the code entirely working for the entire screen but can't figure it out for the active window. By my curre...
2011/01/14
[ "https://Stackoverflow.com/questions/4692441", "https://Stackoverflow.com", "https://Stackoverflow.com/users/315828/" ]
Your comments seem to understand that once your app gets the focus (when you click on it) the other app has lost it and is no longer 'active'. A possible alternative: your application gets a [WM\_SETFOCUS](http://msdn.microsoft.com/en-us/library/ms646283%28v=vs.85%29.aspx) message when it gets focus. The wParam of tha...
What about SendKeys? ``` Windows.Forms.SendKeys.Send("%{PRTSC}"); ``` It will copy currently selected window in to Clipboard object. Than calling ``` BitmapSource image = Clipboard.GetImage(); ``` you can get your image back
4,692,441
I'm writing a simple Windows Forms utility to screenshot either the entire screen or an active window and save the file. The winform has a button called 'Capture' that, when clicked, takes the screenshot. I have the code entirely working for the entire screen but can't figure it out for the active window. By my curre...
2011/01/14
[ "https://Stackoverflow.com/questions/4692441", "https://Stackoverflow.com", "https://Stackoverflow.com/users/315828/" ]
In your `button_Click` method, to capture a window other than the one which is doing the capturing, the only possible way I can see is to make use of the `user32` Windows API. You will first need to platform invoke some methods like this: ``` [DllImport("user32.dll", SetLastError = true)] private static extern int Ge...
What about SendKeys? ``` Windows.Forms.SendKeys.Send("%{PRTSC}"); ``` It will copy currently selected window in to Clipboard object. Than calling ``` BitmapSource image = Clipboard.GetImage(); ``` you can get your image back
4,692,441
I'm writing a simple Windows Forms utility to screenshot either the entire screen or an active window and save the file. The winform has a button called 'Capture' that, when clicked, takes the screenshot. I have the code entirely working for the entire screen but can't figure it out for the active window. By my curre...
2011/01/14
[ "https://Stackoverflow.com/questions/4692441", "https://Stackoverflow.com", "https://Stackoverflow.com/users/315828/" ]
In your `button_Click` method, to capture a window other than the one which is doing the capturing, the only possible way I can see is to make use of the `user32` Windows API. You will first need to platform invoke some methods like this: ``` [DllImport("user32.dll", SetLastError = true)] private static extern int Ge...
Your comments seem to understand that once your app gets the focus (when you click on it) the other app has lost it and is no longer 'active'. A possible alternative: your application gets a [WM\_SETFOCUS](http://msdn.microsoft.com/en-us/library/ms646283%28v=vs.85%29.aspx) message when it gets focus. The wParam of tha...
4,692,441
I'm writing a simple Windows Forms utility to screenshot either the entire screen or an active window and save the file. The winform has a button called 'Capture' that, when clicked, takes the screenshot. I have the code entirely working for the entire screen but can't figure it out for the active window. By my curre...
2011/01/14
[ "https://Stackoverflow.com/questions/4692441", "https://Stackoverflow.com", "https://Stackoverflow.com/users/315828/" ]
As far as I can see your code uses the bounds of its own form to capture the "active" window. That is probably not what you intend. If you want to use the mouse to "print" a window (and not hotkey which probably is easier to implement) you need to be able to from your own form let the user point to another window to c...
Your comments seem to understand that once your app gets the focus (when you click on it) the other app has lost it and is no longer 'active'. A possible alternative: your application gets a [WM\_SETFOCUS](http://msdn.microsoft.com/en-us/library/ms646283%28v=vs.85%29.aspx) message when it gets focus. The wParam of tha...
4,692,441
I'm writing a simple Windows Forms utility to screenshot either the entire screen or an active window and save the file. The winform has a button called 'Capture' that, when clicked, takes the screenshot. I have the code entirely working for the entire screen but can't figure it out for the active window. By my curre...
2011/01/14
[ "https://Stackoverflow.com/questions/4692441", "https://Stackoverflow.com", "https://Stackoverflow.com/users/315828/" ]
Your comments seem to understand that once your app gets the focus (when you click on it) the other app has lost it and is no longer 'active'. A possible alternative: your application gets a [WM\_SETFOCUS](http://msdn.microsoft.com/en-us/library/ms646283%28v=vs.85%29.aspx) message when it gets focus. The wParam of tha...
You need to borrow the design of commercially available screen capturing apps, such as Psp. I think you need to use a 'hot' key to trigger the capturing of the active window. Instead of doing it on Capture\_Click event. This way, you can hide your application's window so that it does not become the active window. Then ...
9,573,633
I am trying to use an ashx page as a http handler for images stored in an SQL server database. These Images are to be displayed in a gridview on an aspx page. ``` <%@ WebHandler Language="C#" Class="LinqHandler" %> using System; using System.Web; using System.Drawing.Imaging; using System.Collections.Generic; using ...
2012/03/05
[ "https://Stackoverflow.com/questions/9573633", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1170109/" ]
you can use Handler.ashx for show image. For example: ``` <img src="Handler.ashx?roomID=1" /> ``` this way you can show image of the one number room. If you want to do it another way, you can use base64 in css. You dont need to use handler. For example: ``` <img runat="server" ID="image"/> //code behind var bytes...
Try as below: ``` <ItemTemplate> <asp:Image ID="pic1" runat="server" ImageUrl='<%# Eval("roomID", "LinqHandler.ashx?roomID={0}") %>' Height="100px" Width="80px" /> </ItemTemplate> ```
9,573,633
I am trying to use an ashx page as a http handler for images stored in an SQL server database. These Images are to be displayed in a gridview on an aspx page. ``` <%@ WebHandler Language="C#" Class="LinqHandler" %> using System; using System.Web; using System.Drawing.Imaging; using System.Collections.Generic; using ...
2012/03/05
[ "https://Stackoverflow.com/questions/9573633", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1170109/" ]
you can use Handler.ashx for show image. For example: ``` <img src="Handler.ashx?roomID=1" /> ``` this way you can show image of the one number room. If you want to do it another way, you can use base64 in css. You dont need to use handler. For example: ``` <img runat="server" ID="image"/> //code behind var bytes...
It turns out that my problems stem from inserting garbage into my SQL BLOB fields. There is nothing wrong with the retrieval mechanism posted in my source code. If you are curious to see the insert statements I used, let me know and I will be glad to post them.
18,800,058
I am quite new to segment tree and would like to make myself busy by doing some more exercise on segment tree. The problem's actually more ACM like and have following conditions: There are n numbers and m operations, n,m<=10,000, each operation can be one of the following: 1. Update an interval by minus a number x, ...
2013/09/14
[ "https://Stackoverflow.com/questions/18800058", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2185825/" ]
Nice Problem:) I think for a while but still can't work out this problem with segment tree, but I've tried using "**Bucket Method**" to solve this problem. We can divide the initial n numbers into B buckets, sort the number in each buckets and maintain the total add val in each bucket. Then for each query: * "Add" ...
Try applying a Binary Index Trees (BIT) instead of a segmented tree. Here's the link to the [tutorial](http://community.topcoder.com/tc?module=Static&d1=tutorials&d2=binaryIndexedTrees)
41,078,171
I am quite new at JQuery (in fact, new to JS too) and I am trying to add a fade in effect to a JS function wich I wrote to change images in a photo gallery when the "thumbnail" of another image is selected. Code is: ``` //For HTML - the "thumbs" area: <img id="g1" class="thg" onclick="trocafoto(this.id)" src="fo...
2016/12/10
[ "https://Stackoverflow.com/questions/41078171", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7065362/" ]
Try this: ```js var $alvo = $('#alvo'); $('.thg').on('click', function(){ var clickedImgSrc = $(this).attr('src'); // first hide alvo $alvo.fadeOut( "slow", function() { // fadeOut Animation is complete. // Add the new src to alvo and fadeIn $(this).attr('src', clickedImgSrc).fadeIn(); ...
Instead of this ``` document.getElementById("alvo") ``` You can reach an element using ``` $("#alvo") ``` So in your case ``` $("#alvo").fadeOut(); ``` would work for example.
41,078,171
I am quite new at JQuery (in fact, new to JS too) and I am trying to add a fade in effect to a JS function wich I wrote to change images in a photo gallery when the "thumbnail" of another image is selected. Code is: ``` //For HTML - the "thumbs" area: <img id="g1" class="thg" onclick="trocafoto(this.id)" src="fo...
2016/12/10
[ "https://Stackoverflow.com/questions/41078171", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7065362/" ]
Try this: ```js var $alvo = $('#alvo'); $('.thg').on('click', function(){ var clickedImgSrc = $(this).attr('src'); // first hide alvo $alvo.fadeOut( "slow", function() { // fadeOut Animation is complete. // Add the new src to alvo and fadeIn $(this).attr('src', clickedImgSrc).fadeIn(); ...
If you're using **thumbnails** than probably you do have **higher resolution images** too. That's good for faster page loading! So in that case store the higher quality image path inside a `data-*` attribute like: ```js var $alvo = $("#alvo"); // The larger target image $(".thg").on("click", function(){ // Fir...
39,058,979
I've just recently noticed some of the code in the framework I am working with converts certain variables to doubles and then back when they are accessed by the framework. In the C++11 standard, is this guaranteed to work without loss of precision for any integral types? If so, which? Are there any additional types tha...
2016/08/20
[ "https://Stackoverflow.com/questions/39058979", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5079428/" ]
`T(double(T_value))==T_value` is guaranteed when the range of integral type `T` is a subrange of the range of exact integral values of type `double`. Since no implementation of `double` has 16 bits or less for the mantissa, and since as far as I know there's no extant C++ implementation with more than 16 bits per byte...
Well, I (mostly) figured out the second part of my question: ``` #include <limits> static_assert(T(double(std::numeric_limits<T>::max()))==std::numeric_limits::max(),"ERROR MESSAGE."); ```
243,352
The heat proved too much for a few people who'd gone off too fast for their capabilities and ended up suffering from exhaustion. Does prove mean this to show a particular quality after a period of time like in this example The new treatment has proved to be very effective or this is a special phrase which you should us...
2020/04/02
[ "https://ell.stackexchange.com/questions/243352", "https://ell.stackexchange.com", "https://ell.stackexchange.com/users/112210/" ]
"Proved" or "proven" in these contexts means "turned out to be". There is an initial unknown situation (how would the runners fare in the heat? How would the new treatment go?), and as the situation is played out, the result becomes clear - the result is proven, like a scientific experiment. That is what the "end up"...
To prove something means to show it is true but can also mean “found to be” Adding ing to a word means you are doing that thing at the moment. So proving would mean you are currently in the act of showing truth.
29,486,679
I heard that simple ``` R*=f; G*=f; B*=f; ``` where f is a scalar value 0 .. 1.0 or more Is not to much proper way of changing brightnes of the color, but i cannot find some code snippet to obtain something better (without to much studying of a color theory) Could maybe someone give me such snipped here? TNX
2015/04/07
[ "https://Stackoverflow.com/questions/29486679", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2214913/" ]
Convert the colour to HSL or HSV, then adjust the lightness (L) or value (V). If needed, convert back to RGB.
Because 0,0,0 is black and 255,255,255 is white, (with a grayscale inbetween) your formula is indeed a very good approximation for changing the *brightness* of a given color value. It is not *exact* in terms of *perceived* brightness but works well enough for most applications. A simple conversion from RGB to Lightne...
4,070,339
In Android Spinner, I can set selection to a particular Item in the code (using setSelection(int)). This will end up calling OnItemSelectedListener, which is fine. But when the user selects an item from the screen, by clicking the spinner and the item, I want to handle this as a different event, because the logic in m...
2010/11/01
[ "https://Stackoverflow.com/questions/4070339", "https://Stackoverflow.com", "https://Stackoverflow.com/users/284606/" ]
Yes, you should commit those files as they contain Visual Studio unit testing and code coverage settings for the project.
I tested here and I found out that while those files aren't regenerated while running tests, they aren't missed. The only error I ran into with their absention was that when I try to open them it shows an error message box. I think I will commit them to source control from now on.
4,070,339
In Android Spinner, I can set selection to a particular Item in the code (using setSelection(int)). This will end up calling OnItemSelectedListener, which is fine. But when the user selects an item from the screen, by clicking the spinner and the item, I want to handle this as a different event, because the logic in m...
2010/11/01
[ "https://Stackoverflow.com/questions/4070339", "https://Stackoverflow.com", "https://Stackoverflow.com/users/284606/" ]
Yes, you should commit those files as they contain Visual Studio unit testing and code coverage settings for the project.
Absolutely. They contain test execution settings, test lists etc. As such, they are an integral part of your project, just like e.g. App.config. Thomas
4,070,339
In Android Spinner, I can set selection to a particular Item in the code (using setSelection(int)). This will end up calling OnItemSelectedListener, which is fine. But when the user selects an item from the screen, by clicking the spinner and the item, I want to handle this as a different event, because the logic in m...
2010/11/01
[ "https://Stackoverflow.com/questions/4070339", "https://Stackoverflow.com", "https://Stackoverflow.com/users/284606/" ]
Yes, you should commit those files as they contain Visual Studio unit testing and code coverage settings for the project.
I found a [contrary opinion](http://web.archive.org/web/20110308085203/http://arcware.net/vs2005-vsmdi-file-should-not-be-under-source-control/) while researching this. To be honest I'm a bit torn as the fellow in the link makes a good bit of sense. EDIT: Updated link to archive.org version, as the original post seems...
4,070,339
In Android Spinner, I can set selection to a particular Item in the code (using setSelection(int)). This will end up calling OnItemSelectedListener, which is fine. But when the user selects an item from the screen, by clicking the spinner and the item, I want to handle this as a different event, because the logic in m...
2010/11/01
[ "https://Stackoverflow.com/questions/4070339", "https://Stackoverflow.com", "https://Stackoverflow.com/users/284606/" ]
I found a [contrary opinion](http://web.archive.org/web/20110308085203/http://arcware.net/vs2005-vsmdi-file-should-not-be-under-source-control/) while researching this. To be honest I'm a bit torn as the fellow in the link makes a good bit of sense. EDIT: Updated link to archive.org version, as the original post seems...
I tested here and I found out that while those files aren't regenerated while running tests, they aren't missed. The only error I ran into with their absention was that when I try to open them it shows an error message box. I think I will commit them to source control from now on.
4,070,339
In Android Spinner, I can set selection to a particular Item in the code (using setSelection(int)). This will end up calling OnItemSelectedListener, which is fine. But when the user selects an item from the screen, by clicking the spinner and the item, I want to handle this as a different event, because the logic in m...
2010/11/01
[ "https://Stackoverflow.com/questions/4070339", "https://Stackoverflow.com", "https://Stackoverflow.com/users/284606/" ]
I found a [contrary opinion](http://web.archive.org/web/20110308085203/http://arcware.net/vs2005-vsmdi-file-should-not-be-under-source-control/) while researching this. To be honest I'm a bit torn as the fellow in the link makes a good bit of sense. EDIT: Updated link to archive.org version, as the original post seems...
Absolutely. They contain test execution settings, test lists etc. As such, they are an integral part of your project, just like e.g. App.config. Thomas
1,160,539
I know glassfish can authenticate against an LDAP server, I also know it can authenticate against my own database. What I would like to do is authenticate users against LDAP, but get their roles from my own database. Where would I start learning how to create my own custom authentication module?
2009/07/21
[ "https://Stackoverflow.com/questions/1160539", "https://Stackoverflow.com", "https://Stackoverflow.com/users/74894/" ]
[HERE](http://x-techteam.blogspot.com/2008/03/glassfish-login-module-simple-example.html) is the step-by-step instructions of how to do this.
See the [Glassfish security FAQ](https://glassfish.dev.java.net/javaee5/security/faq.html), specifically "How do I write/configure my own login module and plug it into GlassFish?" and [this sun document](http://developers.sun.com/appserver/reference/techart/as8_authentication/)
1,687,984
I've seen this exercise around to motivate the definition for complete variety, but I seem to have trouble proving it (and can't find any hints). The statement I want to show is: $X$ is compact if and only if the projection $X \times Y \to Y$ is closed for any space $Y$. I'm stuck on both directions, though assuming...
2016/03/08
[ "https://math.stackexchange.com/questions/1687984", "https://math.stackexchange.com", "https://math.stackexchange.com/users/139189/" ]
**Corrected** One direction is just the [tube lemma](https://dantopology.wordpress.com/2011/05/01/the-tube-lemma/). For the other direction, suppose that $X$ is not compact; we want to find a space $Y$ such that the projection $\pi:X\times Y\to Y$ is not closed. Let $\mathscr{U}$ be an open cover of $X$ that has no f...
For variety, here's a proof in a dramatically different style. This is using [synthetic topology](http://www.cs.bham.ac.uk/~mhe/papers/barbados.pdf). "Synthetic" approaches in general are about working in an [internal language](https://ncatlab.org/nlab/show/internal+logic), in this case a [simply typed lambda calculus]...
17,064
``` echo -e 'one two three\nfour five six\nseven eight nine' one two three four five six seven eight nine ``` how can I do some "MAGIC" do get this output?: ``` three six nine ``` UPDATE: I don't need it in this specific way, I need a general solution so that no matter how many columns are in a row, e.g.: awk alwa...
2011/07/20
[ "https://unix.stackexchange.com/questions/17064", "https://unix.stackexchange.com", "https://unix.stackexchange.com/users/6960/" ]
It can also be done using `'sed'`: ``` echo -e 'one two three\nfour five six\nseven eight nine' | sed -e 's/^.* \([^ ]*\)$/\1/' ``` **Update:** or more simply: ``` echo -e 'one two three\nfour five six\nseven eight nine' | sed -e 's/^.* //' ```
In perl this can be done as follows: ``` #!/usr/bin/perl #create a line of arbitrary data $line = "1 2 3 4 5"; # splt the line into an array (we call the array 'array', for lolz) @array = split(' ', $line); # print the last element in the array, followed by a newline character; print "$array[-1]\n"; ``` output: ...
17,064
``` echo -e 'one two three\nfour five six\nseven eight nine' one two three four five six seven eight nine ``` how can I do some "MAGIC" do get this output?: ``` three six nine ``` UPDATE: I don't need it in this specific way, I need a general solution so that no matter how many columns are in a row, e.g.: awk alwa...
2011/07/20
[ "https://unix.stackexchange.com/questions/17064", "https://unix.stackexchange.com", "https://unix.stackexchange.com/users/6960/" ]
It can even be done only with `'bash'`, without `'sed'`, `'awk'` or `'perl'`: ``` echo -e 'one two three\nfour five six\nseven eight nine' | while IFS=" " read -r -a line; do nb=${#line[@]} echo ${line[$((nb - 1))]} done ```
Using `awk` you can first check if there is at least one column. ``` echo | awk '{if (NF >= 1) print $NF}' echo 1 2 3 | awk '{if (NF >= 1) print $NF}' ```