qid
int64
1
74.7M
question
stringlengths
15
58.3k
date
stringlengths
10
10
metadata
list
response_j
stringlengths
4
30.2k
response_k
stringlengths
11
36.5k
2,091,724
AFAIK it's done like this: Product: ``` <Merge Id ="HelpInstaller" SourceFile="HelpInstaller.msm" Language="1033" DiskId="1"> <ConfigurationData Name="SurpressInstallation_Config" Value="&amp;HelpFeature"/> </Merge> ``` Merge Module: ``` <Property Id="SupressInstallation" Value='0' /> <Substitut...
2010/01/19
[ "https://Stackoverflow.com/questions/2091724", "https://Stackoverflow.com", "https://Stackoverflow.com/users/232999/" ]
You have to define Configuration node under module: ``` <Property Id="SupressInstallation" Value='0' /> <Configuration Name="SupressInstallation_Config" Format="Text"/> <Substitution Table='CustomAction' Row='SetSupressInstallationProperty' Column='Target' Value='[=SupressInstallation_Config]'/> <CustomAction Id='Set...
That sounds like a bug. You should at least get a more descriptive error message explaining what went wrong. Feel free to file the bug at <http://wixtoolset.org/bugs>
26,829,254
How can I check the uploaded files extension in the following code(I already wrote a file type checking)? I want to prevent uploading image files with wrong extension, like \*.jpg.exe. My code: ``` <?php class Uploader { private $fileName; private $fileData; private $destination; public function __...
2014/11/09
[ "https://Stackoverflow.com/questions/26829254", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4158448/" ]
If you run on your server(s) linux I would check the file content type with the command [`file`](http://en.wikipedia.org/wiki/File_%28command%29) that returns the real mime type of the file. Than you can be sure what that content is (in most cases). That programm uses that magic bytes. The orginal idea is to check the...
Use getimagesize which checks the first three bits in the file. Note that $\_FILES isn't secure as it reads the extension (which people can change of course), vs getimagesize which reads permission bits. Usage: ``` $image = getimagesize($_FILES['image']['tmp_name']); $filetype = $image['mime']; ``` Hope this help...
26,829,254
How can I check the uploaded files extension in the following code(I already wrote a file type checking)? I want to prevent uploading image files with wrong extension, like \*.jpg.exe. My code: ``` <?php class Uploader { private $fileName; private $fileData; private $destination; public function __...
2014/11/09
[ "https://Stackoverflow.com/questions/26829254", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4158448/" ]
If you run on your server(s) linux I would check the file content type with the command [`file`](http://en.wikipedia.org/wiki/File_%28command%29) that returns the real mime type of the file. Than you can be sure what that content is (in most cases). That programm uses that magic bytes. The orginal idea is to check the...
I think you already do this on `(exif_imagetype($this->fileData) == IMAGETYPE_JPEG)`, but there's a really good discussion on this here: <https://security.stackexchange.com/questions/57856/is-there-a-way-to-check-the-filetype-of-a-file-uploaded-using-php>
26,829,254
How can I check the uploaded files extension in the following code(I already wrote a file type checking)? I want to prevent uploading image files with wrong extension, like \*.jpg.exe. My code: ``` <?php class Uploader { private $fileName; private $fileData; private $destination; public function __...
2014/11/09
[ "https://Stackoverflow.com/questions/26829254", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4158448/" ]
If you run on your server(s) linux I would check the file content type with the command [`file`](http://en.wikipedia.org/wiki/File_%28command%29) that returns the real mime type of the file. Than you can be sure what that content is (in most cases). That programm uses that magic bytes. The orginal idea is to check the...
I know this won't necessarily answer your specific question, but a good way to prevent "PHP images" to be "executed" is to have images served from a place that doesn't execute PHP scripts and only serves static images (ie: nginx, if properly configured). It could even be an external CDN or just a simple directory that...
26,829,254
How can I check the uploaded files extension in the following code(I already wrote a file type checking)? I want to prevent uploading image files with wrong extension, like \*.jpg.exe. My code: ``` <?php class Uploader { private $fileName; private $fileData; private $destination; public function __...
2014/11/09
[ "https://Stackoverflow.com/questions/26829254", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4158448/" ]
I think you already do this on `(exif_imagetype($this->fileData) == IMAGETYPE_JPEG)`, but there's a really good discussion on this here: <https://security.stackexchange.com/questions/57856/is-there-a-way-to-check-the-filetype-of-a-file-uploaded-using-php>
Use getimagesize which checks the first three bits in the file. Note that $\_FILES isn't secure as it reads the extension (which people can change of course), vs getimagesize which reads permission bits. Usage: ``` $image = getimagesize($_FILES['image']['tmp_name']); $filetype = $image['mime']; ``` Hope this help...
26,829,254
How can I check the uploaded files extension in the following code(I already wrote a file type checking)? I want to prevent uploading image files with wrong extension, like \*.jpg.exe. My code: ``` <?php class Uploader { private $fileName; private $fileData; private $destination; public function __...
2014/11/09
[ "https://Stackoverflow.com/questions/26829254", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4158448/" ]
I think you already do this on `(exif_imagetype($this->fileData) == IMAGETYPE_JPEG)`, but there's a really good discussion on this here: <https://security.stackexchange.com/questions/57856/is-there-a-way-to-check-the-filetype-of-a-file-uploaded-using-php>
I know this won't necessarily answer your specific question, but a good way to prevent "PHP images" to be "executed" is to have images served from a place that doesn't execute PHP scripts and only serves static images (ie: nginx, if properly configured). It could even be an external CDN or just a simple directory that...
49,888,156
Looking at the MSDN docs for [Seq.nth](https://msdn.microsoft.com/en-us/visualfsharpdocs/conceptual/seq.nth%5B't%5D-function-%5Bfsharp%5D) and [Seq.item](https://msdn.microsoft.com/en-us/visualfsharpdocs/conceptual/seq.item%5B%27t%5D-function-%5Bfsharp%5D?f=255&MSPPError=-2147217396), they appear to do exactly the same...
2018/04/17
[ "https://Stackoverflow.com/questions/49888156", "https://Stackoverflow.com", "https://Stackoverflow.com/users/706346/" ]
The reason why `nth` is deprecated is because the type signature for `Seq.nth` and `List.nth` is different, and [so `nth` was deprecated in favor of `item`](https://github.com/fsharp/fslang-design/blob/master/FSharp-4.0/ListSeqArrayAdditions.md) to avoid confusion. (Search for the word "nth" in that document to find th...
You can check the source code of these functions here: <https://github.com/fsharp/fsharp/blob/master/src/fsharp/FSharp.Core/seq.fs> ``` [<CompiledName("Get")>] let nth index (source : seq<'T>) = item index source ``` So they are the same.
5,248,961
Is there a way to execute a piece of code before an event occurs? example when we say Expanded="OnExpand" here the code inside OnExpand occurs after the Expanded event occurs. What if I want to execute a piece of code before that?
2011/03/09
[ "https://Stackoverflow.com/questions/5248961", "https://Stackoverflow.com", "https://Stackoverflow.com/users/538091/" ]
If you're talking about the Expander control, you could subclass it and override the IsExpanded property, raising your own PreviewExpanded event before calling `base.IsExpanded = value;`
You can use the Preview Events A possible work around for the expander not having a PreviewExpanded event is to handle the PreviewMouseDown event and do a hit test to see if its on the Toggle Button. Alternatively it may be possible to extend the Expander Class something along the lines of I did not test this at all ...
5,248,961
Is there a way to execute a piece of code before an event occurs? example when we say Expanded="OnExpand" here the code inside OnExpand occurs after the Expanded event occurs. What if I want to execute a piece of code before that?
2011/03/09
[ "https://Stackoverflow.com/questions/5248961", "https://Stackoverflow.com", "https://Stackoverflow.com/users/538091/" ]
You can use the Preview Events A possible work around for the expander not having a PreviewExpanded event is to handle the PreviewMouseDown event and do a hit test to see if its on the Toggle Button. Alternatively it may be possible to extend the Expander Class something along the lines of I did not test this at all ...
If whatever object you are working with supports this behavior it will be in a matching "Preview" event. So, these two events are a before and after matched set. KeyDown() PreviewKeyDown() Expander does not have a preview event for Expanded, if that is what you are working with.
5,248,961
Is there a way to execute a piece of code before an event occurs? example when we say Expanded="OnExpand" here the code inside OnExpand occurs after the Expanded event occurs. What if I want to execute a piece of code before that?
2011/03/09
[ "https://Stackoverflow.com/questions/5248961", "https://Stackoverflow.com", "https://Stackoverflow.com/users/538091/" ]
If you're talking about the Expander control, you could subclass it and override the IsExpanded property, raising your own PreviewExpanded event before calling `base.IsExpanded = value;`
If whatever object you are working with supports this behavior it will be in a matching "Preview" event. So, these two events are a before and after matched set. KeyDown() PreviewKeyDown() Expander does not have a preview event for Expanded, if that is what you are working with.
66,335,751
I have 2 submit buttons, one for submitting the form and the other for cancelling the submission and redirecting. When clicking the Cancel submit button, it doesn't simply cancel and go back to the processing PHP script. It requires the required fields to be filled for the cancel button to work. I don't understand what...
2021/02/23
[ "https://Stackoverflow.com/questions/66335751", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7321290/" ]
When your cancel button is clicked you can remove `required` attribute from all inputs and then submit your form in this way `$_POST` datas for input will also get send to server . ***Demo Code*** : ```js $(function() { $('#cancel_button').click(function() { $("input , select ").removeAttr("required") //remove ...
Use `<input type="button" ...>` instead that `<input type="submit" ...>` for `cancel` button
102,828
Here's another tetromino minesweeper. I have bolded where the rules differ between this one and my [first tetromino minesweeper](https://puzzling.stackexchange.com/questions/102676/tetromino-minesweeper-the-amphitheater) Rules: ------ * A number indicates how many adjacent (including diagonally adjacent) cells have m...
2020/10/12
[ "https://puzzling.stackexchange.com/questions/102828", "https://puzzling.stackexchange.com", "https://puzzling.stackexchange.com/users/69582/" ]
First: > > [![enter image description here](https://i.stack.imgur.com/FJwNt.png)](https://i.stack.imgur.com/FJwNt.png) > > The 6 in the upper left can have some cells shaded to prevent a run of 5 or more. The tetromino of the 2 in the bottom right needs to satisfy the 1, so the top of the 1 must go unused. > ...
The final grid looks like this: > > [![enter image description here](https://i.stack.imgur.com/gpr2M.png)](https://i.stack.imgur.com/gpr2M.png) > > > EDIT: Here's the promised write-up: To start us off, OP gives us a couple of things for free: > > \* Any 6 can have at most 2 pieces next to it. Since the 3 is...
72,411,425
Okay... so I have a System.Data.DataRow object. I've gotten the column names out into a string collection. Then I want to get the corresponding values into a second collection. I'm sure I'm just doing something dumb here, but I cannot for the life of me figure this out. Take the following code... ``` $cols = $drFrom....
2022/05/27
[ "https://Stackoverflow.com/questions/72411425", "https://Stackoverflow.com", "https://Stackoverflow.com/users/80209/" ]
To dynamically define *properties* via [`Select-Object`](https://learn.microsoft.com/powershell/module/microsoft.powershell.utility/select-object), you must use [calculated properties](https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_Calculated_Properties), which involve a hasht...
You say > > I want to get the corresponding values into a second collection. > > > And you have: ``` $cols = $drFrom.Table.Columns $colNames = $cols | Where-Object { $_.ColumnName -ne "ROWID" } | Select-Object $_.ColumnName ``` Which works (but could be simplified). Now there are 2 things you want ...
6,663,769
Is there any built-in Ordered Collection which support `Move-Up` and `Move-Down` of items ? i wanna have Ordered Collection(could be List) where i can be sure that when i insert items it will be inserted at the end of the Collection, then i want to be able to do something like this ``` Col.MoveUp(Item1);//Takes It...
2011/07/12
[ "https://Stackoverflow.com/questions/6663769", "https://Stackoverflow.com", "https://Stackoverflow.com/users/247402/" ]
The prefix 'Ordered' is usually used for sorted collections, you don't want that. You can use a standard `List<>` and a few lines of code: ``` //untested // Extension method, place in public static class. public static void MoveDown(this IList<T> list, int index) { if (index >= list.Count) ... // error if (i...
I don't think there is anything built in like this, especially when the same could be done by simple swapping, taking into consideration the boundary cases. You may want to implement your own Collection which extends one of the existing collections to add the desired methods.
6,663,769
Is there any built-in Ordered Collection which support `Move-Up` and `Move-Down` of items ? i wanna have Ordered Collection(could be List) where i can be sure that when i insert items it will be inserted at the end of the Collection, then i want to be able to do something like this ``` Col.MoveUp(Item1);//Takes It...
2011/07/12
[ "https://Stackoverflow.com/questions/6663769", "https://Stackoverflow.com", "https://Stackoverflow.com/users/247402/" ]
It is very easy to build up your own. Here I made them as extension methods. Another option is to define your own collection, inherit it from List and insert these methods there. ``` public static class ListExtensions { public static void MoveUp<T>(this List<T> list, T item) { int index = list.IndexOf(...
I don't think there is anything built in like this, especially when the same could be done by simple swapping, taking into consideration the boundary cases. You may want to implement your own Collection which extends one of the existing collections to add the desired methods.
6,663,769
Is there any built-in Ordered Collection which support `Move-Up` and `Move-Down` of items ? i wanna have Ordered Collection(could be List) where i can be sure that when i insert items it will be inserted at the end of the Collection, then i want to be able to do something like this ``` Col.MoveUp(Item1);//Takes It...
2011/07/12
[ "https://Stackoverflow.com/questions/6663769", "https://Stackoverflow.com", "https://Stackoverflow.com/users/247402/" ]
It is very easy to build up your own. Here I made them as extension methods. Another option is to define your own collection, inherit it from List and insert these methods there. ``` public static class ListExtensions { public static void MoveUp<T>(this List<T> list, T item) { int index = list.IndexOf(...
The prefix 'Ordered' is usually used for sorted collections, you don't want that. You can use a standard `List<>` and a few lines of code: ``` //untested // Extension method, place in public static class. public static void MoveDown(this IList<T> list, int index) { if (index >= list.Count) ... // error if (i...
61,519,528
![enter image description here](https://i.stack.imgur.com/6HTTO.png) when I use yaml file to deployment pods like this and use command `kubectl apply -f xx.yaml` ④image : nginx:latest where does come from this Nginx image? Is there any official Kubernetes documents about this? Best Regards
2020/04/30
[ "https://Stackoverflow.com/questions/61519528", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13439505/" ]
[Nginx](https://www.nginx.com/) is a webserver that is used as an example for a pod template here. `nginx:latest` refers to the nginx image on the [Docker hub](https://hub.docker.com/_/nginx). The `:latest` part refers to which version of nginx to use, in this case it picks the latest version. You can read more abo...
The general image name format is `<registry>/<image-name>:<tag>`. Here, `nginx:latest` is in format of `<image-name>:<tag>` which refers registry is [dockerHub](https://hub.docker.com/). If you want to pull image from any other registry you have to put it in `<registry>` section. To learn more about images click [he...
173,703
I understand many wizards don't know much about Muggles, probably because they have no need or desire to. However, Arthur Weasley has always puzzled me. He loves Muggles. He obsesses over them. His hobby is taking apart Muggle objects. Heck, even his job involves Muggle relations! So, why in the world is he so cluele...
2017/11/08
[ "https://scifi.stackexchange.com/questions/173703", "https://scifi.stackexchange.com", "https://scifi.stackexchange.com/users/89771/" ]
Mrs Weasley stopped him from building up his knowledge to any great extent. =========================================================================== Arthur Weasley was an enthusiast for all things Muggle. But his expertise was hindered by a rather suspicious and judgemental wife, who didn't care much for his experi...
This is just a guess since the books don't actually have an answer except for quasi-legal and cultural prohibitions against mixing with muggles. His magiked car is actually forbidden (he got special dispensation for it). I suspect that this is a poke at high society by the author. Mixing with the lower classes is some...
173,703
I understand many wizards don't know much about Muggles, probably because they have no need or desire to. However, Arthur Weasley has always puzzled me. He loves Muggles. He obsesses over them. His hobby is taking apart Muggle objects. Heck, even his job involves Muggle relations! So, why in the world is he so cluele...
2017/11/08
[ "https://scifi.stackexchange.com/questions/173703", "https://scifi.stackexchange.com", "https://scifi.stackexchange.com/users/89771/" ]
Mrs Weasley stopped him from building up his knowledge to any great extent. =========================================================================== Arthur Weasley was an enthusiast for all things Muggle. But his expertise was hindered by a rather suspicious and judgemental wife, who didn't care much for his experi...
For in-universe explanations: 1. I'd say that not everyone approaches their hobbies as having to know everything about it. Some people enjoy acquiring information, while other people enjoy, say, more creative aspects. Example: people who cosplay are less likely to acquire trivia knowledge about their fandom because t...
21,221,782
I am facing the problem plzzz help me out. Here is my manifest.xml file. Plz help me out.......your help is highly appreciated.... ``` <?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.hello.myandroidnew" android:versionCode="1" android...
2014/01/19
[ "https://Stackoverflow.com/questions/21221782", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3202919/" ]
Change your intent filter to the following: ``` <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> </intent-filter> ``` The difference is the action. It must be `android.intent.action.MAIN` in order to be listed in the launcher.
You have to set the action name properly so that android know that it is the main activity. Change ``` <action android:name="android.intent.action.MAINACTIVITY" /> ``` to ``` <action android:name="android.intent.action.MAIN" /> ``` **update:-** You specify name of the class in ``` <activity androi...
298,823
I have created a simple email notification with power automate and I was wondering if we can change the email sender. The email sender is Microsoft Power Apps and Power Automate. [![enter image description here](https://i.stack.imgur.com/FAosx.png)](https://i.stack.imgur.com/FAosx.png)
2021/11/12
[ "https://sharepoint.stackexchange.com/questions/298823", "https://sharepoint.stackexchange.com", "https://sharepoint.stackexchange.com/users/47869/" ]
Calculated columns are going to recalculate every time the item is updated (they aren't fixed values). When an item changes, whatever value is in the calculated field will be reevaluated. This means using calculated columns for historical tracking doesn't work (at least not the way you want it to). You'll need to set ...
You can achieve your needs by creating **Microsoft Flow (Power Automate)**. You can do this by triggering this Flow when the list item changes. You can go to the **[Microsoft Power Automate Community](https://powerusers.microsoft.com/t5/Microsoft-Power-Automate/ct-p/MPACommunity)** to get more ​professional help
278,290
I've looked at other questions "Voltage sources in parallel", but don't answer my specific problem. Imagine the following circuit: ![schematic](https://i.stack.imgur.com/Fvhic.png) [simulate this circuit](/plugins/schematics?image=http%3a%2f%2fi.stack.imgur.com%2fFvhic.png) – Schematic created using [CircuitLab](htt...
2017/01/03
[ "https://electronics.stackexchange.com/questions/278290", "https://electronics.stackexchange.com", "https://electronics.stackexchange.com/users/106040/" ]
"Would all the current and voltage come from the CC, because it has a higher voltage?" **Exactly**. The higher voltage from the CC biases the battery's diode so it will not conduct. (Also, the diodes will reduce the voltage by about .7 volts.)
The voltages of the solar cell will not stay at exactly 14V, but will dip down in voltage as you increase the current drawn. This is because it can deliver only so much power. In this case about 420 watts at best. Same with the battery, the voltage will fluctuate. If your cc cannot deliver the 50 watts for the led, t...
278,290
I've looked at other questions "Voltage sources in parallel", but don't answer my specific problem. Imagine the following circuit: ![schematic](https://i.stack.imgur.com/Fvhic.png) [simulate this circuit](/plugins/schematics?image=http%3a%2f%2fi.stack.imgur.com%2fFvhic.png) – Schematic created using [CircuitLab](htt...
2017/01/03
[ "https://electronics.stackexchange.com/questions/278290", "https://electronics.stackexchange.com", "https://electronics.stackexchange.com/users/106040/" ]
"Would all the current and voltage come from the CC, because it has a higher voltage?" **Exactly**. The higher voltage from the CC biases the battery's diode so it will not conduct. (Also, the diodes will reduce the voltage by about .7 volts.)
The actual behaviour of this circuit will heavily depend on the power supply's voltage in function of current being drawn. And indeed in the case of a solar panel on the amount of light it is receiving. It gets more complicated though if you consider a real circuit! A "smart" switch mode converter that lets the solar ...
51,637,170
I come from an Mean, Express, Angular and Node (MEAN) stack background. I really liked how angular has separate components and then we can style each components and then nest them in each other. It is just more organized and way more shareable when in companies. It gets easier to actually understand the structure. Can ...
2018/08/01
[ "https://Stackoverflow.com/questions/51637170", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5561177/" ]
You can just merge on the first six digits as such: ``` df_entity.merge(df_finance, left_on=df_entity.DISTRICT_NUMBER_E.str[:6], right_on='DISTRICT_NUMBER_F') DISTRICT_NUMBER_E FINANCE_NUMBER_E INTERMEDIATE_NUMBER_E STATE_CD_E \ 0 123456789012 123456 1111 NY ...
``` # create a key which satisfy the condition for joining the dataframes df_entity['key'] = df_entity['DISTRICT_NUMBER_E'].str[:6] # join the both dataframe using the new key into one merged dataframe # optional use caluse how = 'left'/'right'/'outer' for specific join merged_df = pd.merge(df_entity, df_finance, left...
46,365,662
I have select ``` select 'alter table '+so.name+ ' drop '+sdc.name+' go sp_bindefault ''abc'' ,'''+so.name+'.'+sc.name+'''' from sys.objects as so join sys.columns as sc on so.object_id=sc.object_id join sys.default_constraints as sdc on sc.object_id=sdc.parent_object_id ...
2017/09/22
[ "https://Stackoverflow.com/questions/46365662", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6909856/" ]
You have to define a variable to hold your generated queries, and than execute it: ``` DECLARE @SQL NVARCHAR(MAX) SET @SQL = (your_query) EXEC sys.sp_executesql @SQL ``` You should create nvarchar string, so instead of `'alter table '` use `N'alter table '`.
Try this (although untested as I don't have your schema) ``` DECLARE @tableName NVARCHAR(255) DECLARE @constraintName NVARCHAR(255) DECLARE @columnName NVARCHAR(255) DECLARE @sql NVARCHAR(255) SELECT @tableName=so.name, @constraintName=sdc.name, @columnName=sc.name FROM sys.obj...
46,365,662
I have select ``` select 'alter table '+so.name+ ' drop '+sdc.name+' go sp_bindefault ''abc'' ,'''+so.name+'.'+sc.name+'''' from sys.objects as so join sys.columns as sc on so.object_id=sc.object_id join sys.default_constraints as sdc on sc.object_id=sdc.parent_object_id ...
2017/09/22
[ "https://Stackoverflow.com/questions/46365662", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6909856/" ]
You won't be able to dynamically generate the SQL **and** execute it in a single set based query. You'll have to iterate through the results of your select - either in a CURSOR or WHILE loop - and build the generated statement into a variable and then execute that with EXEC or sp\_executesql; e.g. ``` DECLARE @Tab...
You have to define a variable to hold your generated queries, and than execute it: ``` DECLARE @SQL NVARCHAR(MAX) SET @SQL = (your_query) EXEC sys.sp_executesql @SQL ``` You should create nvarchar string, so instead of `'alter table '` use `N'alter table '`.
46,365,662
I have select ``` select 'alter table '+so.name+ ' drop '+sdc.name+' go sp_bindefault ''abc'' ,'''+so.name+'.'+sc.name+'''' from sys.objects as so join sys.columns as sc on so.object_id=sc.object_id join sys.default_constraints as sdc on sc.object_id=sdc.parent_object_id ...
2017/09/22
[ "https://Stackoverflow.com/questions/46365662", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6909856/" ]
You have to define a variable to hold your generated queries, and than execute it: ``` DECLARE @SQL NVARCHAR(MAX) SET @SQL = (your_query) EXEC sys.sp_executesql @SQL ``` You should create nvarchar string, so instead of `'alter table '` use `N'alter table '`.
You can get your string into a cursor e execute both results ``` DECLARE RS CURSOR FOR SELECT TOP 5 'SELECT * FROM [' + NAME + ']' FROM sys.Objects WHERE TYPE = 'U' DECLARE @TEXT VARCHAR(MAX) OPEN RS FETCH NEXT FROM RS INTO @TEXT WHILE @@FETCH_STATUS = 0 BEGIN FETCH NEXT FROM RS INTO @TEXT EX...
46,365,662
I have select ``` select 'alter table '+so.name+ ' drop '+sdc.name+' go sp_bindefault ''abc'' ,'''+so.name+'.'+sc.name+'''' from sys.objects as so join sys.columns as sc on so.object_id=sc.object_id join sys.default_constraints as sdc on sc.object_id=sdc.parent_object_id ...
2017/09/22
[ "https://Stackoverflow.com/questions/46365662", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6909856/" ]
You won't be able to dynamically generate the SQL **and** execute it in a single set based query. You'll have to iterate through the results of your select - either in a CURSOR or WHILE loop - and build the generated statement into a variable and then execute that with EXEC or sp\_executesql; e.g. ``` DECLARE @Tab...
Try this (although untested as I don't have your schema) ``` DECLARE @tableName NVARCHAR(255) DECLARE @constraintName NVARCHAR(255) DECLARE @columnName NVARCHAR(255) DECLARE @sql NVARCHAR(255) SELECT @tableName=so.name, @constraintName=sdc.name, @columnName=sc.name FROM sys.obj...
46,365,662
I have select ``` select 'alter table '+so.name+ ' drop '+sdc.name+' go sp_bindefault ''abc'' ,'''+so.name+'.'+sc.name+'''' from sys.objects as so join sys.columns as sc on so.object_id=sc.object_id join sys.default_constraints as sdc on sc.object_id=sdc.parent_object_id ...
2017/09/22
[ "https://Stackoverflow.com/questions/46365662", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6909856/" ]
You won't be able to dynamically generate the SQL **and** execute it in a single set based query. You'll have to iterate through the results of your select - either in a CURSOR or WHILE loop - and build the generated statement into a variable and then execute that with EXEC or sp\_executesql; e.g. ``` DECLARE @Tab...
You can get your string into a cursor e execute both results ``` DECLARE RS CURSOR FOR SELECT TOP 5 'SELECT * FROM [' + NAME + ']' FROM sys.Objects WHERE TYPE = 'U' DECLARE @TEXT VARCHAR(MAX) OPEN RS FETCH NEXT FROM RS INTO @TEXT WHILE @@FETCH_STATUS = 0 BEGIN FETCH NEXT FROM RS INTO @TEXT EX...
29,806,718
I want to provide zero-copy, move based API. I want to move a string from thread A into thread B. Ideologically it seems that move shall be able to simply pass\move data from instance A into new instance B with minimal to none copy operations (mainly for addresses). So all data like data pointers will be simply copied ...
2015/04/22
[ "https://Stackoverflow.com/questions/29806718", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1973207/" ]
No. There's no requirement for `std::string` to use dynamic allocation or to do anything specific with such an allocation if it has one. In fact, modern implementations usually put short strings into the string object itself and don't allocate anything; then moving is the same as copying. It's important to keep in min...
No, it's not guaranteed. Guaranteeing it would basically prohibit (for one example) the short string optimization, in which the entire body of a short string is stored in the string object itself, rather than being allocated separately on the heap. At least for now, I think SSO is regarded as important enough that th...
29,806,718
I want to provide zero-copy, move based API. I want to move a string from thread A into thread B. Ideologically it seems that move shall be able to simply pass\move data from instance A into new instance B with minimal to none copy operations (mainly for addresses). So all data like data pointers will be simply copied ...
2015/04/22
[ "https://Stackoverflow.com/questions/29806718", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1973207/" ]
No. There's no requirement for `std::string` to use dynamic allocation or to do anything specific with such an allocation if it has one. In fact, modern implementations usually put short strings into the string object itself and don't allocate anything; then moving is the same as copying. It's important to keep in min...
No, but if that is needed, an option is to put the string in `std::unique_ptr`. Personally I would typically not rely on the c\_str() value for more than the local scope. Example, on request: ``` #include <iostream> #include <string> #include <memory> int main() { std::string ss("hello"); auto u_str = std::...
29,806,718
I want to provide zero-copy, move based API. I want to move a string from thread A into thread B. Ideologically it seems that move shall be able to simply pass\move data from instance A into new instance B with minimal to none copy operations (mainly for addresses). So all data like data pointers will be simply copied ...
2015/04/22
[ "https://Stackoverflow.com/questions/29806718", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1973207/" ]
No. There's no requirement for `std::string` to use dynamic allocation or to do anything specific with such an allocation if it has one. In fact, modern implementations usually put short strings into the string object itself and don't allocate anything; then moving is the same as copying. It's important to keep in min...
It is [documented here](https://en.cppreference.com/w/cpp/string/basic_string/c_str), so you can assume that the `c_str()` result is stable under some conditions. You cannot however assume that `c_str()` will remain the same after move. In practice it will stay in case of long string, but it won't stay for short strin...
29,806,718
I want to provide zero-copy, move based API. I want to move a string from thread A into thread B. Ideologically it seems that move shall be able to simply pass\move data from instance A into new instance B with minimal to none copy operations (mainly for addresses). So all data like data pointers will be simply copied ...
2015/04/22
[ "https://Stackoverflow.com/questions/29806718", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1973207/" ]
No, it's not guaranteed. Guaranteeing it would basically prohibit (for one example) the short string optimization, in which the entire body of a short string is stored in the string object itself, rather than being allocated separately on the heap. At least for now, I think SSO is regarded as important enough that th...
It is [documented here](https://en.cppreference.com/w/cpp/string/basic_string/c_str), so you can assume that the `c_str()` result is stable under some conditions. You cannot however assume that `c_str()` will remain the same after move. In practice it will stay in case of long string, but it won't stay for short strin...
29,806,718
I want to provide zero-copy, move based API. I want to move a string from thread A into thread B. Ideologically it seems that move shall be able to simply pass\move data from instance A into new instance B with minimal to none copy operations (mainly for addresses). So all data like data pointers will be simply copied ...
2015/04/22
[ "https://Stackoverflow.com/questions/29806718", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1973207/" ]
No, but if that is needed, an option is to put the string in `std::unique_ptr`. Personally I would typically not rely on the c\_str() value for more than the local scope. Example, on request: ``` #include <iostream> #include <string> #include <memory> int main() { std::string ss("hello"); auto u_str = std::...
It is [documented here](https://en.cppreference.com/w/cpp/string/basic_string/c_str), so you can assume that the `c_str()` result is stable under some conditions. You cannot however assume that `c_str()` will remain the same after move. In practice it will stay in case of long string, but it won't stay for short strin...
50,939,921
I want to parse the image links of webpages.I have tried the below code but its showing some error. ``` #!usr/bin/python import requests from bs4 import BeautifulSoup url=raw_input("enter website") r=requests.get("http://"+ url) data=r.img soup=BeautifulSoup(data) for link in soup.find_all('img'): print link.get('...
2018/06/20
[ "https://Stackoverflow.com/questions/50939921", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9757894/" ]
You can use `parentFragment` as a store owner. Call this in your `Detail` and `Contact` fragments. ``` CustomerViewModel model = ViewModelProviders.of(getParentFragment()).get(CustomerViewModel.class); ```
your scenario is well supported by `ViewModel`. You just need to get ViewModel with activity scope: `ViewModelProviders.of(getActivity).get(...` More info here: <https://developer.android.com/topic/libraries/architecture/viewmodel#sharing>
71,568,163
I've the following table | Result\_Group | Review | | --- | --- | | A | 1 | | B | 4 | | A | 1 | | C | 1 | | D | 5 | | D | 4 | | E | 5 | | C | 1 | | C | 2 | | A | 2 | | B | 3 | | E | 2 | ``` df = structure(list(Result_Group = structure(c(1L, 2L, 1L, 3L, 4L, 4L, 5L, 3L, 3L, 1L, 2L, 5L), .Label = c("A", "B", "C", "D", "...
2022/03/22
[ "https://Stackoverflow.com/questions/71568163", "https://Stackoverflow.com", "https://Stackoverflow.com/users/17888970/" ]
You can do: ``` library(tidyverse) df |> group_by(Result_Group) |> count(Review) |> mutate(prop = n/sum(n)) |> ungroup() |> select(-n) |> pivot_wider(names_from = Result_Group, values_from = prop, values_fill = 0) # A tibble: 5 x 6 Review A B C D E ...
Here is a tidy approach using dplyr and tidyr ```r library(dplyr) df %>% # Add count values (all equal to 1) mutate(count = 1) %>% # Pivot wider to get A, B, C.. as column names, and sum of count as values tidyr::pivot_wider( id_cols = Review, names_from = Result_Group, values_from = count, ...
22,309,041
Based on the [Wikipedia entry](http://en.wikipedia.org/wiki/Control_register#CR4) as well as the Intel manual, `rdpmc` should be available to user-mode processes as long as `bit 8` of `CR4` is set. However, I am still running into `general protection` error when trying to run `rdpmc` from userspace even with that bit s...
2014/03/10
[ "https://Stackoverflow.com/questions/22309041", "https://Stackoverflow.com", "https://Stackoverflow.com/users/391161/" ]
Apparently, when Intel says `Bit 8`, they are referring to the **9th bit** from the right, since their indexing begins at `0`. Replacing `$(1 << 7)` with `$(1 << 8)` globally resolves the issue, and allows `rdpmc` to be called from user mode. Here is the updated kernel module, also using `on_each_cpu` to make sure tha...
Echoing "2" to /sys/bus/event\_source/devices/cpu/rdpmc allows user processes to access performance counters via the rdpmc instruction. Note that behaviour has changed. Prior to 4.0 "1" meant "enabled" while meant "0" disable. Now "1" means allow only for processes that have active perf events. More details: <http://ma...
59,867,219
I am trying to add a grpc protofile to my swagger-ui. I am consuming a grpc webservice which needs a protofile as input. The input to my spring boot restful webservice needs to have that same grpc structure as its interface. I recevied a jar from the individual that made the protofile and imported it to my webserivce. ...
2020/01/22
[ "https://Stackoverflow.com/questions/59867219", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9679664/" ]
Never return entity objects in controller method. in my case. my Controller methods takes this parameter. "@AuthenticationPrincipal UserSession userSession" when i exlude UserSession object swagger back to normal. There were 2 way to do that first is "@ApiIgnore @AuthenticationPrincipal UserSession userSession" se...
Incase someone needs a solution, what I did was as a work around for now. in my service's code (response is a String) ``` return JsonFormat.printer().print(myProtoObject); ``` in my client's code: ``` Builder b = ProtoObject.newBuilder(); JsonFormat.parser().merge(result.getBody(), b); ProtoObject protoObject = b....
127,424
(Cross posted from Stack Overflow [1](https://stackoverflow.com/questions/2539938/on-solaris-how-do-you-mount-a-second-zfs-system-disk-for-diagnostics)) I've got two hard disks in my computer, and have installed Solaris 10u8 on the first and Opensolaris 2010.3 (dev onnv\_134) on the second. Both systems uses ZFS and w...
2010/03/29
[ "https://serverfault.com/questions/127424", "https://serverfault.com", "https://serverfault.com/users/39131/" ]
While running under Solaris 10u8 you won't be able to mount zpools created on a new OpenSolaris build. (snv\_134). Since S10u8 and snv\_134 are using different ZFS On Disk Pool Versions (IIRC [15](http://hub.opensolaris.org/bin/view/Community+Group+zfs/15) and [22](http://hub.opensolaris.org/bin/view/Community+Group+zf...
I've never had to do this so if you have any valuable data I suggest that you backup things before proceeding. I believe you have to use the `zpool import` command. Check the zpool manpage for more details on the import and export commands. Also note that the version of ZFS on OpenSolaris is newer and most likely not ...
15,732
I'm generating some xml files that needs to conform to an xsd file that was given to me. How should I verify they conform?
2008/08/19
[ "https://Stackoverflow.com/questions/15732", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1650/" ]
We build our project using ant, so we can use the schemavalidate task to check our config files: ``` <schemavalidate> <fileset dir="${configdir}" includes="**/*.xml" /> </schemavalidate> ``` Now naughty config files will fail our build! <http://ant.apache.org/manual/Tasks/schemavalidate.html>
If you are generating XML files programatically, you may want to look at the [XMLBeans](http://xmlbeans.apache.org/) library. Using a command line tool, XMLBeans will automatically generate and package up a set of Java objects based on an XSD. You can then use these objects to build an XML document based on this schema...
15,732
I'm generating some xml files that needs to conform to an xsd file that was given to me. How should I verify they conform?
2008/08/19
[ "https://Stackoverflow.com/questions/15732", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1650/" ]
Since this is a popular question, I will point out that java can also validate against "referred to" xsd's, for instance if the .xml file itself specifies XSD's in the header, using `xsi:schemaLocation` or `xsi:noNamespaceSchemaLocation` (or xsi for particular namespaces) [ex](http://www.ibm.com/developerworks/xml/libr...
Using [Woodstox](https://github.com/FasterXML/woodstox), configure the StAX parser to validate against your schema and parse the XML. If exceptions are caught the XML is not valid, otherwise it is valid: ``` // create the XSD schema from your schema file XMLValidationSchemaFactory schemaFactory = XMLValidationSchemaF...
15,732
I'm generating some xml files that needs to conform to an xsd file that was given to me. How should I verify they conform?
2008/08/19
[ "https://Stackoverflow.com/questions/15732", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1650/" ]
Using Java 7 you can follow the documentation provided in [package description](http://docs.oracle.com/javase/7/docs/api/javax/xml/validation/package-summary.html). > > > ``` > // create a SchemaFactory capable of understanding WXS schemas > SchemaFactory factory = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHE...
If you are generating XML files programatically, you may want to look at the [XMLBeans](http://xmlbeans.apache.org/) library. Using a command line tool, XMLBeans will automatically generate and package up a set of Java objects based on an XSD. You can then use these objects to build an XML document based on this schema...
15,732
I'm generating some xml files that needs to conform to an xsd file that was given to me. How should I verify they conform?
2008/08/19
[ "https://Stackoverflow.com/questions/15732", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1650/" ]
We build our project using ant, so we can use the schemavalidate task to check our config files: ``` <schemavalidate> <fileset dir="${configdir}" includes="**/*.xml" /> </schemavalidate> ``` Now naughty config files will fail our build! <http://ant.apache.org/manual/Tasks/schemavalidate.html>
Using [Woodstox](https://github.com/FasterXML/woodstox), configure the StAX parser to validate against your schema and parse the XML. If exceptions are caught the XML is not valid, otherwise it is valid: ``` // create the XSD schema from your schema file XMLValidationSchemaFactory schemaFactory = XMLValidationSchemaF...
15,732
I'm generating some xml files that needs to conform to an xsd file that was given to me. How should I verify they conform?
2008/08/19
[ "https://Stackoverflow.com/questions/15732", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1650/" ]
If you are generating XML files programatically, you may want to look at the [XMLBeans](http://xmlbeans.apache.org/) library. Using a command line tool, XMLBeans will automatically generate and package up a set of Java objects based on an XSD. You can then use these objects to build an XML document based on this schema...
I had to validate an XML against XSD just one time, so I tried XMLFox. I found it to be very confusing and weird. The help instructions didn't seem to match the interface. I ended up using LiquidXML Studio 2008 (v6) which was much easier to use and more immediately familiar (the UI is very similar to Visual Basic 2008...
15,732
I'm generating some xml files that needs to conform to an xsd file that was given to me. How should I verify they conform?
2008/08/19
[ "https://Stackoverflow.com/questions/15732", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1650/" ]
With JAXB, you could use the code below: ``` @Test public void testCheckXmlIsValidAgainstSchema() { logger.info("Validating an XML file against the latest schema..."); MyValidationEventCollector vec = new MyValidationEventCollector(); validateXmlAgainstSchema(vec, inputXmlFileName, inputXmlSchemaName...
I had to validate an XML against XSD just one time, so I tried XMLFox. I found it to be very confusing and weird. The help instructions didn't seem to match the interface. I ended up using LiquidXML Studio 2008 (v6) which was much easier to use and more immediately familiar (the UI is very similar to Visual Basic 2008...
15,732
I'm generating some xml files that needs to conform to an xsd file that was given to me. How should I verify they conform?
2008/08/19
[ "https://Stackoverflow.com/questions/15732", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1650/" ]
Here's how to do it using [Xerces2](http://xerces.apache.org/xerces2-j/). A tutorial for this, [here](http://www.ibm.com/developerworks/edu/x-dw-xvalid-i.html) (req. signup). Original attribution: blatantly copied from [here](http://forums.sun.com/thread.jspa?messageID=3411478): ``` import org.apache.xerces.parsers.D...
One more answer: since you said you need to validate files you are **generating** (writing), you might want to validate content while you are writing, instead of first writing, then reading back for validation. You can probably do that with JDK API for Xml validation, if you use SAX-based writer: if so, just link in va...
15,732
I'm generating some xml files that needs to conform to an xsd file that was given to me. How should I verify they conform?
2008/08/19
[ "https://Stackoverflow.com/questions/15732", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1650/" ]
The Java runtime library supports validation. Last time I checked this was the Apache Xerces parser under the covers. You should probably use a [javax.xml.validation.Validator](http://java.sun.com/j2se/1.5.0/docs/api/javax/xml/validation/Validator.html). ``` import javax.xml.XMLConstants; import javax.xml.transform.So...
If you have a Linux-Machine you could use the free command-line tool SAXCount. I found this very usefull. ``` SAXCount -f -s -n my.xml ``` It validates against dtd and xsd. 5s for a 50MB file. In debian squeeze it is located in the package "libxerces-c-samples". The definition of the dtd and xsd has to be in the x...
15,732
I'm generating some xml files that needs to conform to an xsd file that was given to me. How should I verify they conform?
2008/08/19
[ "https://Stackoverflow.com/questions/15732", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1650/" ]
If you have a Linux-Machine you could use the free command-line tool SAXCount. I found this very usefull. ``` SAXCount -f -s -n my.xml ``` It validates against dtd and xsd. 5s for a 50MB file. In debian squeeze it is located in the package "libxerces-c-samples". The definition of the dtd and xsd has to be in the x...
I had to validate an XML against XSD just one time, so I tried XMLFox. I found it to be very confusing and weird. The help instructions didn't seem to match the interface. I ended up using LiquidXML Studio 2008 (v6) which was much easier to use and more immediately familiar (the UI is very similar to Visual Basic 2008...
15,732
I'm generating some xml files that needs to conform to an xsd file that was given to me. How should I verify they conform?
2008/08/19
[ "https://Stackoverflow.com/questions/15732", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1650/" ]
Since this is a popular question, I will point out that java can also validate against "referred to" xsd's, for instance if the .xml file itself specifies XSD's in the header, using `xsi:schemaLocation` or `xsi:noNamespaceSchemaLocation` (or xsi for particular namespaces) [ex](http://www.ibm.com/developerworks/xml/libr...
One more answer: since you said you need to validate files you are **generating** (writing), you might want to validate content while you are writing, instead of first writing, then reading back for validation. You can probably do that with JDK API for Xml validation, if you use SAX-based writer: if so, just link in va...
24,161,253
``` class B { public: operator B() const{ } // What is this and what is the purpose? private: int m_i; }; ``` So the question is, is that a conversion operator or constructor operator and what is the use of it? Where to use it?
2014/06/11
[ "https://Stackoverflow.com/questions/24161253", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2235661/" ]
It is a conversion function which will never be called implicitly. The Standard actually goes into some depth about this. 12.3.2/1: > > A conversion function is never used to convert a (possibly cv-qualified) object to the (possibly cv-qualified) same object type (or a reference to it), to a (possibly cv-qualified) b...
It's a conversion operator. It allows you to cast an object of type `B` into an object of type `B`.
19,827
Can epistaxis or nosebleeds be a cause of death? ![](https://i.stack.imgur.com/o3wRX.png)
2014/07/21
[ "https://biology.stackexchange.com/questions/19827", "https://biology.stackexchange.com", "https://biology.stackexchange.com/users/8186/" ]
Yes, it can, but it is extremely rare. > > ... nosebleeds are rarely fatal, accounting for only 4 of the 2.4 million deaths in the U.S. in 1999 [1]. > > > The main issue is that epistaxis can be a sign of potentially fatal diseases: > > The instances in which nosebleed is potentially fatal are those in which th...
Any injury, that results in external bleeding can lead to death, since it is a breach in the body's defenses and an entry point for pathogens. Explanation: When you have nose bleeding the blood must be coming from somewhere. Usually from inside your body. That means there is a hole in your body which is big enough ...
11,832,407
I have a large solution with more than 100 projects (C++, Managed C++, C#) and many of them depends on each others. I have a TeamCity server and I want build this solution there. When I build solution in VisualStudio everything goes fine, but with TeamCity I have a CS0006 error. I know why that so - TeamCity uses MS...
2012/08/06
[ "https://Stackoverflow.com/questions/11832407", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1071802/" ]
See [Incorrect solution build ordering when using MSBuild.exe](http://blogs.msdn.com/b/visualstudio/archive/2010/12/21/incorrect-solution-build-ordering-when-using-msbuild-exe/) at The Visual Studio Blog: > > Follow this principle: do not use dependencies expressed in the solution file at all! Better to express depen...
I had a problem much like this. It manifested itself in the solution, by requiring two builds before successfully building the entire solution. As it turns out, I had accidentally added a *Reference* and not a *ProjectReference* (look for this in the .sln file), meaning VS/MSBuild would require and look for the refere...
11,832,407
I have a large solution with more than 100 projects (C++, Managed C++, C#) and many of them depends on each others. I have a TeamCity server and I want build this solution there. When I build solution in VisualStudio everything goes fine, but with TeamCity I have a CS0006 error. I know why that so - TeamCity uses MS...
2012/08/06
[ "https://Stackoverflow.com/questions/11832407", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1071802/" ]
See [Incorrect solution build ordering when using MSBuild.exe](http://blogs.msdn.com/b/visualstudio/archive/2010/12/21/incorrect-solution-build-ordering-when-using-msbuild-exe/) at The Visual Studio Blog: > > Follow this principle: do not use dependencies expressed in the solution file at all! Better to express depen...
The solution above didn't quite work for me when trying to build a .Net Standard project that depended on the output from a .Net Core project. I had to add an additional "SkipGetTargetFrameworkProperties" in order to get the solution to build in VS2017 and MSBuild. ``` <ProjectReference Include="foo.csproj"> <Refe...
11,832,407
I have a large solution with more than 100 projects (C++, Managed C++, C#) and many of them depends on each others. I have a TeamCity server and I want build this solution there. When I build solution in VisualStudio everything goes fine, but with TeamCity I have a CS0006 error. I know why that so - TeamCity uses MS...
2012/08/06
[ "https://Stackoverflow.com/questions/11832407", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1071802/" ]
See [Incorrect solution build ordering when using MSBuild.exe](http://blogs.msdn.com/b/visualstudio/archive/2010/12/21/incorrect-solution-build-ordering-when-using-msbuild-exe/) at The Visual Studio Blog: > > Follow this principle: do not use dependencies expressed in the solution file at all! Better to express depen...
Nothing mentioned above did not help for me. The aolution I used was to build the sln few times, passing /t:1stproject.csproj in the first run, then /t:2ndproject and at the end the sln without /t to comlete the rest of the solution.
11,832,407
I have a large solution with more than 100 projects (C++, Managed C++, C#) and many of them depends on each others. I have a TeamCity server and I want build this solution there. When I build solution in VisualStudio everything goes fine, but with TeamCity I have a CS0006 error. I know why that so - TeamCity uses MS...
2012/08/06
[ "https://Stackoverflow.com/questions/11832407", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1071802/" ]
The solution above didn't quite work for me when trying to build a .Net Standard project that depended on the output from a .Net Core project. I had to add an additional "SkipGetTargetFrameworkProperties" in order to get the solution to build in VS2017 and MSBuild. ``` <ProjectReference Include="foo.csproj"> <Refe...
I had a problem much like this. It manifested itself in the solution, by requiring two builds before successfully building the entire solution. As it turns out, I had accidentally added a *Reference* and not a *ProjectReference* (look for this in the .sln file), meaning VS/MSBuild would require and look for the refere...
11,832,407
I have a large solution with more than 100 projects (C++, Managed C++, C#) and many of them depends on each others. I have a TeamCity server and I want build this solution there. When I build solution in VisualStudio everything goes fine, but with TeamCity I have a CS0006 error. I know why that so - TeamCity uses MS...
2012/08/06
[ "https://Stackoverflow.com/questions/11832407", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1071802/" ]
I had a problem much like this. It manifested itself in the solution, by requiring two builds before successfully building the entire solution. As it turns out, I had accidentally added a *Reference* and not a *ProjectReference* (look for this in the .sln file), meaning VS/MSBuild would require and look for the refere...
Nothing mentioned above did not help for me. The aolution I used was to build the sln few times, passing /t:1stproject.csproj in the first run, then /t:2ndproject and at the end the sln without /t to comlete the rest of the solution.
11,832,407
I have a large solution with more than 100 projects (C++, Managed C++, C#) and many of them depends on each others. I have a TeamCity server and I want build this solution there. When I build solution in VisualStudio everything goes fine, but with TeamCity I have a CS0006 error. I know why that so - TeamCity uses MS...
2012/08/06
[ "https://Stackoverflow.com/questions/11832407", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1071802/" ]
The solution above didn't quite work for me when trying to build a .Net Standard project that depended on the output from a .Net Core project. I had to add an additional "SkipGetTargetFrameworkProperties" in order to get the solution to build in VS2017 and MSBuild. ``` <ProjectReference Include="foo.csproj"> <Refe...
Nothing mentioned above did not help for me. The aolution I used was to build the sln few times, passing /t:1stproject.csproj in the first run, then /t:2ndproject and at the end the sln without /t to comlete the rest of the solution.
47,665,573
It's trivial to search for a set of keywords in a certain website in a specific date range: in the google search box you enter ``` desired-kewords site:desired-website ``` then from the Tools menu you pick the date range. e.g. "arab spring" search term in www.cnn.com between 1th Jan 2011 and 31th Dec 2013: [![ente...
2017/12/06
[ "https://Stackoverflow.com/questions/47665573", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4430895/" ]
I might be late, but for other people searching for the solution, you can try this: ``` from googleapiclient.discovery import build my_api_key = "YOUR_API_KEY" my_cse_id = "YOUR_CSE_ID" def google_results_count(query): service = build("customsearch", "v1", developerKey=my_api_key) result ...
In case you dont want to use SORT parameter you can insert date into your query parameter like: ``` https://customsearch.googleapis.com/customsearch/v1? key=<api_key>& cx=<search_engine_id>& q="<your_search_word> after:<YYYY-MM-DD> before:<YYYY-MM-DD>" ```
1,239,211
I've just fought for a whole day with a strange maven problem: I had a custom property called "deployment.name" that was never to resolved to what I configured for it, but rather the maven filtering mechanism always replaced it by the project's name. I tried the goal "help:expressions" to find out whether this is a...
2009/08/06
[ "https://Stackoverflow.com/questions/1239211", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
The [Maven Super POM](http://maven.apache.org/guides/introduction/introduction-to-the-pom.html) defines the common configuration for all Maven projects. The values in that are accessible as properties (and , so that is where most of the properties you generally use come from (e.g. ${project.build.directory}), these are...
... I just ran help:effective-pom, and there is no trace of "deployment.name" in the output. I can see all the other properties that I defined though (e.g. "deployment.depname"). Maybe "name" is a reserved attribute of some sort? Maybe debugging into m2eclipse will shed light on this riddle.
3,632,579
I'm playing around with scala (scala 2.8). Suppose I have a class with a nested trait, and want to use that nested trait as the type for a parameter in the class's constructor. Is that even possible? This is the closest I've come: ``` class OuterClass(traitParam:OuterClass#InnerTrait) { trait InnerTrait { } val y:...
2010/09/03
[ "https://Stackoverflow.com/questions/3632579", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6209/" ]
You're encountering Scala's *path-dependent types*. your `val y: InnerTrait`'s type is specific to the instance in which it's contained. `OuterClass#InnerTrait` is a supertype of all the `InnerTrait` extant for all instances of `OuterClass`. Try working with this: ``` class OuterClass(traitParam: OuterClass#InnerTrai...
> > OuterClass has type parameters which > would then be used in InnerTrait > > > So it is possible to have `a: OuterClass` and `b: OuterClass` such that these type parameters are different. For instance: ``` abstract class OuterClass[T] { val x: T } val a = new OuterClass[Int] { val x = 5 } val b = new Outer...
3,960,044
I'd like to convert an `Array[String]` to an `Array[Int]`, using map method. What is the shortest way to get a function of type `(String) => Int` to pass as map argument? I'd prefer convert existing builtin ones like `Integer.valueOf` in some way. A method of argument binding to shorten the construction like `def pars...
2010/10/18
[ "https://Stackoverflow.com/questions/3960044", "https://Stackoverflow.com", "https://Stackoverflow.com/users/125562/" ]
``` scala> Array("1", "2", "3") map(_.toInt) res4: Array[Int] = Array(1, 2, 3) ``` or ``` scala> def parseInt(s:String) = Integer.parseInt(s, 10) parseInt: (s: String)Int scala> Array("1", "2", "3") map parseInt res7: Array[Int] = Array(1, 2, 3) ```
``` scala> val strs = Array("1", "2") strs: Array[java.lang.String] = Array(1, 2) scala> strs.map(_.toInt) res0: Array[Int] = Array(1, 2) ```
3,960,044
I'd like to convert an `Array[String]` to an `Array[Int]`, using map method. What is the shortest way to get a function of type `(String) => Int` to pass as map argument? I'd prefer convert existing builtin ones like `Integer.valueOf` in some way. A method of argument binding to shorten the construction like `def pars...
2010/10/18
[ "https://Stackoverflow.com/questions/3960044", "https://Stackoverflow.com", "https://Stackoverflow.com/users/125562/" ]
``` scala> Array("1", "2", "3") map(_.toInt) res4: Array[Int] = Array(1, 2, 3) ``` or ``` scala> def parseInt(s:String) = Integer.parseInt(s, 10) parseInt: (s: String)Int scala> Array("1", "2", "3") map parseInt res7: Array[Int] = Array(1, 2, 3) ```
First, let's define an array of strings: ``` scala> val foo = Array("1", "2", "3") foo: Array[java.lang.String] = Array(1, 2, 3) ``` The most obvious way would be to use Scala's `toInt()`, available on strings: Definition: ``` // StringLike.scala def toInt: Int = java.lang.Integer.parseInt(toString) ``` ...
3,960,044
I'd like to convert an `Array[String]` to an `Array[Int]`, using map method. What is the shortest way to get a function of type `(String) => Int` to pass as map argument? I'd prefer convert existing builtin ones like `Integer.valueOf` in some way. A method of argument binding to shorten the construction like `def pars...
2010/10/18
[ "https://Stackoverflow.com/questions/3960044", "https://Stackoverflow.com", "https://Stackoverflow.com/users/125562/" ]
``` scala> Array("1", "2", "3") map(_.toInt) res4: Array[Int] = Array(1, 2, 3) ``` or ``` scala> def parseInt(s:String) = Integer.parseInt(s, 10) parseInt: (s: String)Int scala> Array("1", "2", "3") map parseInt res7: Array[Int] = Array(1, 2, 3) ```
It's as simple as: ``` Array("1", "2", "3") map Integer.valueOf ```
3,960,044
I'd like to convert an `Array[String]` to an `Array[Int]`, using map method. What is the shortest way to get a function of type `(String) => Int` to pass as map argument? I'd prefer convert existing builtin ones like `Integer.valueOf` in some way. A method of argument binding to shorten the construction like `def pars...
2010/10/18
[ "https://Stackoverflow.com/questions/3960044", "https://Stackoverflow.com", "https://Stackoverflow.com/users/125562/" ]
First, let's define an array of strings: ``` scala> val foo = Array("1", "2", "3") foo: Array[java.lang.String] = Array(1, 2, 3) ``` The most obvious way would be to use Scala's `toInt()`, available on strings: Definition: ``` // StringLike.scala def toInt: Int = java.lang.Integer.parseInt(toString) ``` ...
``` scala> val strs = Array("1", "2") strs: Array[java.lang.String] = Array(1, 2) scala> strs.map(_.toInt) res0: Array[Int] = Array(1, 2) ```
3,960,044
I'd like to convert an `Array[String]` to an `Array[Int]`, using map method. What is the shortest way to get a function of type `(String) => Int` to pass as map argument? I'd prefer convert existing builtin ones like `Integer.valueOf` in some way. A method of argument binding to shorten the construction like `def pars...
2010/10/18
[ "https://Stackoverflow.com/questions/3960044", "https://Stackoverflow.com", "https://Stackoverflow.com/users/125562/" ]
It's as simple as: ``` Array("1", "2", "3") map Integer.valueOf ```
``` scala> val strs = Array("1", "2") strs: Array[java.lang.String] = Array(1, 2) scala> strs.map(_.toInt) res0: Array[Int] = Array(1, 2) ```
5,911,551
I did a post before [here](https://stackoverflow.com/questions/5908685/problem-on-load-a-php-page-in-a-div-with-shadowbox-jquery/5908743#5908743) regarding a problem I had with the shadowbox. In summary, I want to open a subpage.php inside a shadowbox called in page.php. The problem is that the content of the shadowb...
2011/05/06
[ "https://Stackoverflow.com/questions/5911551", "https://Stackoverflow.com", "https://Stackoverflow.com/users/532186/" ]
Because your ajax request is synchronous, and javascript is single-threaded, it will block other activities. I'm not sure why your specific case does not work, since I would expect the `css` method to be completed immediately, but I expect it has to do with the specifics of when a browser actually renders updates the D...
[beforeSend(jqXHR, settings)Function](http://api.jquery.com/jQuery.ajax/) A pre-request callback function that can be used to modify the jqXHR (in jQuery 1.4.x, XMLHTTPRequest) object before it is sent. Use this to set custom headers, etc. The jqXHR and settings maps are passed as arguments. This is an Ajax Event. Ret...
5,911,551
I did a post before [here](https://stackoverflow.com/questions/5908685/problem-on-load-a-php-page-in-a-div-with-shadowbox-jquery/5908743#5908743) regarding a problem I had with the shadowbox. In summary, I want to open a subpage.php inside a shadowbox called in page.php. The problem is that the content of the shadowb...
2011/05/06
[ "https://Stackoverflow.com/questions/5911551", "https://Stackoverflow.com", "https://Stackoverflow.com/users/532186/" ]
Because your ajax request is synchronous, and javascript is single-threaded, it will block other activities. I'm not sure why your specific case does not work, since I would expect the `css` method to be completed immediately, but I expect it has to do with the specifics of when a browser actually renders updates the D...
Have you tried with the `beforeSend(jqXHR, settings)` function for the wait background, the `error(jqXHR, textStatus, errorThrown`) for errors and the `success(data, textStatus, jqXHR)` function if the request succeeds ? <http://api.jquery.com/jQuery.ajax/>
5,911,551
I did a post before [here](https://stackoverflow.com/questions/5908685/problem-on-load-a-php-page-in-a-div-with-shadowbox-jquery/5908743#5908743) regarding a problem I had with the shadowbox. In summary, I want to open a subpage.php inside a shadowbox called in page.php. The problem is that the content of the shadowb...
2011/05/06
[ "https://Stackoverflow.com/questions/5911551", "https://Stackoverflow.com", "https://Stackoverflow.com/users/532186/" ]
Because your ajax request is synchronous, and javascript is single-threaded, it will block other activities. I'm not sure why your specific case does not work, since I would expect the `css` method to be completed immediately, but I expect it has to do with the specifics of when a browser actually renders updates the D...
I have the same issue with jQuery mobile trying to display the $.mobile.loading before i send data and in my case it has to go up sync. Some data must be uploaded before others so if if it was all async it may send up some update records before the inserts happen. My solution was to up at setTimeout around the ajax cal...
13,873,194
From the manual I came to understand that vtksafedowncast is a safe operation. But in my application, sometimes it is crashing when i am trying to convert a vtkactor to vtkprop (This is happening very randomly.). I did check for null before passing vtkactor. Is there any exception handling or some other check to make s...
2012/12/14
[ "https://Stackoverflow.com/questions/13873194", "https://Stackoverflow.com", "https://Stackoverflow.com/users/248674/" ]
My recommendation is to build a base class that holds the current question, then when the user answers a question and advances to the next one, the base class updates the display of the new current question. You don't need to destroy widgets at any point (except when quitting the application), and you can also reuse wi...
Are you sure you have to create a class for a Dialog? Isn't Tkinter built-in dialog class ok? You could provide an iterator of Dialogs to a `next()` function, which every Next button would call when clicked. Did you mean something like that?
486,562
I've tried customizing zsh's prompt with change the font but during it, xterm become not to reflect the `XTerm*faceName` in`~/.Xresources`. Here is my dot files: > > ~/.xinitrc > > > ``` #!/bin/sh # /etc/X11/xinit/xinitrc # # global xinitrc file, used by all X sessions started by xinit(startx) # invoke global ...
2018/12/07
[ "https://unix.stackexchange.com/questions/486562", "https://unix.stackexchange.com", "https://unix.stackexchange.com/users/324714/" ]
The relevant font *family* name is **`ShureTechMono NF`**, which you can find using `fc-list`. Here is a screenshot. [![xterm using ShureTechMono NF](https://i.stack.imgur.com/o7OqY.png)](https://i.stack.imgur.com/o7OqY.png) The `fc-list` manual page suggests this command (**`:`** matches everything, the **`family`** ...
Have you tried using the -fn parameter, and entering the font name using Pango notation e.g. ShureTechMono\ Nerd\ Font\ Regular:px=11 I've done it this way, with a different font, trial-and-error style, before I made the final entry in .Xresources. In this example, I would not use "Complete" but "Regular" as shown exp...
16,153,818
I'm a newbie and this is for the Rails tutorial by Richard Schneeman. This is all that is in my index.html.erb file in my view/products folder. ``` <% first_product = Product.first %> <% lots_of_products = Product.includes(:user).all %> <ul> <% lots_of_products.each do |product| %> <li> Product Name: "<%= ...
2013/04/22
[ "https://Stackoverflow.com/questions/16153818", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2226172/" ]
In your database i suspect some of your product data does not contain sold\_by\_id or user\_id. So its getting product.user nil as no user is associated with the product. Instead of ``` <%= product.user.name %> ``` use ``` <%= product.user.name if product.user %> ``` to skip this exception. So your index.html....
I also came up against this and used a simple if else statement, because I still wanted to show something even if the username didn't exist ``` <!-- SHOW USERNAME IF IT EXISTS --> <% if product.user %> <p><strong><%= product.user.name %></strong></p> <% else %> <p><strong>Anonymous</strong></p> <% end %> ```
16,153,818
I'm a newbie and this is for the Rails tutorial by Richard Schneeman. This is all that is in my index.html.erb file in my view/products folder. ``` <% first_product = Product.first %> <% lots_of_products = Product.includes(:user).all %> <ul> <% lots_of_products.each do |product| %> <li> Product Name: "<%= ...
2013/04/22
[ "https://Stackoverflow.com/questions/16153818", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2226172/" ]
In your database i suspect some of your product data does not contain sold\_by\_id or user\_id. So its getting product.user nil as no user is associated with the product. Instead of ``` <%= product.user.name %> ``` use ``` <%= product.user.name if product.user %> ``` to skip this exception. So your index.html....
A great workaround to this is ruby's safe access operator &. see <http://mitrev.net/ruby/2015/11/13/the-operator-in-ruby/> It was invented by Matz (ruby's founder) for this very situation. In your case it would look like ``` product.user&.name ``` It returns nil if the name attribute is not defined. Keep in mind ...
16,153,818
I'm a newbie and this is for the Rails tutorial by Richard Schneeman. This is all that is in my index.html.erb file in my view/products folder. ``` <% first_product = Product.first %> <% lots_of_products = Product.includes(:user).all %> <ul> <% lots_of_products.each do |product| %> <li> Product Name: "<%= ...
2013/04/22
[ "https://Stackoverflow.com/questions/16153818", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2226172/" ]
You can also try ``` product.user.try(:name) ```
I also came up against this and used a simple if else statement, because I still wanted to show something even if the username didn't exist ``` <!-- SHOW USERNAME IF IT EXISTS --> <% if product.user %> <p><strong><%= product.user.name %></strong></p> <% else %> <p><strong>Anonymous</strong></p> <% end %> ```
16,153,818
I'm a newbie and this is for the Rails tutorial by Richard Schneeman. This is all that is in my index.html.erb file in my view/products folder. ``` <% first_product = Product.first %> <% lots_of_products = Product.includes(:user).all %> <ul> <% lots_of_products.each do |product| %> <li> Product Name: "<%= ...
2013/04/22
[ "https://Stackoverflow.com/questions/16153818", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2226172/" ]
You can also try ``` product.user.try(:name) ```
A great workaround to this is ruby's safe access operator &. see <http://mitrev.net/ruby/2015/11/13/the-operator-in-ruby/> It was invented by Matz (ruby's founder) for this very situation. In your case it would look like ``` product.user&.name ``` It returns nil if the name attribute is not defined. Keep in mind ...
5,187,346
``` def login debugger LOGIN::authenticate(params) end ``` When it hits the line with debugger, I type 'n' and it goes to some other file, and I can't seem to be able to get into the call to `LOGIN::authenticate` Is 'n' not the right way to do this?
2011/03/03
[ "https://Stackoverflow.com/questions/5187346", "https://Stackoverflow.com", "https://Stackoverflow.com/users/39677/" ]
You'll want to use `step` or `s` for shorthand. [Here is a great cheat-sheet on ruby-debug](http://cheat.errtheblog.com/s/rdebug/) as well.
I think you should use `step` to step into the `LOGIN::authenticate` method. `n[ext]` just step over to the next line. Try `help` to have the list of debugger commands, and `help command-name` to have some help for a given command.
11,275,585
My question is maybe repetitive but I really find it hard. (I have read related topics) This is the array : ``` Array ( [0] => Array ( [legend] => 38440 ) [1] => Array ( [bestw] => 9765 ) [2] => Array ( [fiuna] => 38779 ...
2012/06/30
[ "https://Stackoverflow.com/questions/11275585", "https://Stackoverflow.com", "https://Stackoverflow.com/users/263851/" ]
How about iterating your array and counting the values you've got? ``` $occurences = array(); foreach ($data as $row) { foreach ($row as $key => $score) { if (empty($occurences[$key])) { $occurences[$key] = 1; } else { $occurences[$key]++; } } } ``` and then sorting that ``` arsort($occu...
You may try this code. A brute force method indeed. But a quick search made me to find this an useful one: ``` function findDuplicates($data,$dupval) { $nb= 0; foreach($data as $key => $val) if ($val==$dupval) $nb++; return $nb; } ``` **EDIT** : Sorry, I misinterpreted your question! But it might be the first hint o...
69,454,463
i am building an angular site, I need to make a div that cointains other divs scrolable (if it is bigger than the screen). I tried -webkit-overflow-scrolling: touch; but it didn't work. This is my code: ``` <div *ngFor="let playlist of genres" class="scrollable"> <div [id]="playlist.category" (click)="genreSelec...
2021/10/05
[ "https://Stackoverflow.com/questions/69454463", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6726685/" ]
You will need to check the type of each list item to determine if it is merely a value to output or a sublist to expand. Using a list comprehension: ``` Input_List = [['a', 'b'],'c','d',['e', 'f']] Final_List = [v for i in Input_List for v in (i if isinstance(i,list) else [i])] print(Final_List) ['a', 'b', 'c', 'd', ...
this working only for -> multdimensional at the same dimension ``` from itertools import chain ini_list = [[1, 2, 3], [3, 6, 7], [7, 5, 4]] print ("initial list ", str(ini_list)) flatten_list = list(chain.from_iterable(ini_list)) print ("final_result", str(flatten_list)) ``` [![enter imag...
55,580,638
``` type FirstName = String type Surname = String type Age = Int type Id = Int type Student = (FirstName, Surname, Age, Id) testData :: [Student] testData = [("Garry", "Queen", 10, 1), ("Jerry", "Bob", 11, 2), ("Amy", "Big", 9, 3)] ``` I am trying to output each students information on a new line using the te...
2019/04/08
[ "https://Stackoverflow.com/questions/55580638", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7475856/" ]
To convert a character into it's ASCII representation, use `charCodeAt(0)`. For example: ``` 'a'.charCodeAt(0); // 97 ``` To convert a decimal number into a binary number, use `toString(2)`. For example: ``` (122).toString(2); // "1111010" ``` This method has some issues dealing with negative numbers though. let ...
Like this: ``` parseInt("12").toString(2) ``` Result: ``` "1100" ```
3,629,833
I am creating an Android application for a customer which will be pre-installed and distributed together with the handsets. Now the customer asked me to lock down the ROM to prevent the future users from using anything else apart from this one app. I.e. no browsing, no email, nothing which could create any costs etc. ...
2010/09/02
[ "https://Stackoverflow.com/questions/3629833", "https://Stackoverflow.com", "https://Stackoverflow.com/users/400332/" ]
There's not really a whole lot you need to do to make a single-purpose device. If you play your cards right, it should be something you can do without having to tinker with the ROM. The quick-and-easy route would be to deploy your application as a replacement for the stock launcher, just like any of the other home rep...
There was a similar question already somewhere. You can indeed limit the functionality of your device by the amount you want or have to. In order to achieve this you will definitely have to build your own modified ROM. You will have to touch the ROM because you will have to get rid of several applications running in t...
3,629,833
I am creating an Android application for a customer which will be pre-installed and distributed together with the handsets. Now the customer asked me to lock down the ROM to prevent the future users from using anything else apart from this one app. I.e. no browsing, no email, nothing which could create any costs etc. ...
2010/09/02
[ "https://Stackoverflow.com/questions/3629833", "https://Stackoverflow.com", "https://Stackoverflow.com/users/400332/" ]
There's not really a whole lot you need to do to make a single-purpose device. If you play your cards right, it should be something you can do without having to tinker with the ROM. The quick-and-easy route would be to deploy your application as a replacement for the stock launcher, just like any of the other home rep...
Blrfl's answer is great, but it still has a problem: if the user long presses the HOME button, the recent applications popup will appear an the user will be able to launch another app.
105,315
I'm using Ruby+Watir to request pages through Firefox. I would like to record the headers and content of every http request made through the browser. Would it be possible to configure a proxy solution to store this information, either in a file or pipe it into an application? I'm running Ubuntu x64. // Edit: I wo...
2010/02/05
[ "https://superuser.com/questions/105315", "https://superuser.com", "https://superuser.com/users/23365/" ]
If you have access to a Windows virtual machine or any other Windows physical machine, you can run [Fiddler](http://www.fiddler2.com/fiddler2/) which should do exactly what you want. After a brief look, I did find a program called [Charles](http://www.charlesproxy.com/) which some people refer to as "Fiddler for Linux...
Check [Proxy Sniffer](http://www.proxy-sniffer.com/download_en.html) - it has free edition.
105,315
I'm using Ruby+Watir to request pages through Firefox. I would like to record the headers and content of every http request made through the browser. Would it be possible to configure a proxy solution to store this information, either in a file or pipe it into an application? I'm running Ubuntu x64. // Edit: I wo...
2010/02/05
[ "https://superuser.com/questions/105315", "https://superuser.com", "https://superuser.com/users/23365/" ]
If you have access to a Windows virtual machine or any other Windows physical machine, you can run [Fiddler](http://www.fiddler2.com/fiddler2/) which should do exactly what you want. After a brief look, I did find a program called [Charles](http://www.charlesproxy.com/) which some people refer to as "Fiddler for Linux...
I use the [HttpFox](https://addons.mozilla.org/en-US/firefox/addon/6647) extension for this sort of thing. ![alt text](https://i.stack.imgur.com/ORi68.jpg)
105,315
I'm using Ruby+Watir to request pages through Firefox. I would like to record the headers and content of every http request made through the browser. Would it be possible to configure a proxy solution to store this information, either in a file or pipe it into an application? I'm running Ubuntu x64. // Edit: I wo...
2010/02/05
[ "https://superuser.com/questions/105315", "https://superuser.com", "https://superuser.com/users/23365/" ]
If you have access to a Windows virtual machine or any other Windows physical machine, you can run [Fiddler](http://www.fiddler2.com/fiddler2/) which should do exactly what you want. After a brief look, I did find a program called [Charles](http://www.charlesproxy.com/) which some people refer to as "Fiddler for Linux...
Try to use this [Free HTTP Testing tool](http://soft-net.net/default.aspx).
105,315
I'm using Ruby+Watir to request pages through Firefox. I would like to record the headers and content of every http request made through the browser. Would it be possible to configure a proxy solution to store this information, either in a file or pipe it into an application? I'm running Ubuntu x64. // Edit: I wo...
2010/02/05
[ "https://superuser.com/questions/105315", "https://superuser.com", "https://superuser.com/users/23365/" ]
If you have access to a Windows virtual machine or any other Windows physical machine, you can run [Fiddler](http://www.fiddler2.com/fiddler2/) which should do exactly what you want. After a brief look, I did find a program called [Charles](http://www.charlesproxy.com/) which some people refer to as "Fiddler for Linux...
[Burp Proxy](http://www.portswigger.net/proxy/) You can also try the Wireshark sniffer with appropriate filtering options. One general note on Windows self sniffing (sniffing on the loopback device) is that it is hard. But you use Ubuntu so it should work fine.
105,315
I'm using Ruby+Watir to request pages through Firefox. I would like to record the headers and content of every http request made through the browser. Would it be possible to configure a proxy solution to store this information, either in a file or pipe it into an application? I'm running Ubuntu x64. // Edit: I wo...
2010/02/05
[ "https://superuser.com/questions/105315", "https://superuser.com", "https://superuser.com/users/23365/" ]
If you have access to a Windows virtual machine or any other Windows physical machine, you can run [Fiddler](http://www.fiddler2.com/fiddler2/) which should do exactly what you want. After a brief look, I did find a program called [Charles](http://www.charlesproxy.com/) which some people refer to as "Fiddler for Linux...
If it's just Firefox you want, you can use the [Tamper Data addon](https://addons.mozilla.org/en-US/firefox/addon/966) to view (and edit) these requests.
105,315
I'm using Ruby+Watir to request pages through Firefox. I would like to record the headers and content of every http request made through the browser. Would it be possible to configure a proxy solution to store this information, either in a file or pipe it into an application? I'm running Ubuntu x64. // Edit: I wo...
2010/02/05
[ "https://superuser.com/questions/105315", "https://superuser.com", "https://superuser.com/users/23365/" ]
If you have access to a Windows virtual machine or any other Windows physical machine, you can run [Fiddler](http://www.fiddler2.com/fiddler2/) which should do exactly what you want. After a brief look, I did find a program called [Charles](http://www.charlesproxy.com/) which some people refer to as "Fiddler for Linux...
You can access the firefox log to trace each http request. It is not done by default. Instructions are available at [Mozilla](https://developer.mozilla.org/en-US/docs/HTTP_Logging "Mozilla")
69,835,526
``` type Animal = { name: string } function getBear(this: Animal) : Animal { this.name = "hi" return this } console.log(getBear().name) ``` Could any one help me with this , i am not able to call the getBear function
2021/11/04
[ "https://Stackoverflow.com/questions/69835526", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6793637/" ]
You can't do this because the `this` context of `getBear` is not bound to an `Animal` when you call it. Simply telling TypeScript that `this` is an `Animal` isn't enough, you also have to call your function with that context. In this case you would need to call it like this. ``` type Animal = { name: string } fu...
You can call this 3 ways: ``` type Animal = { name: string } function getBear(this: Animal, a: string): Animal { this.name = a return this } // First one // function.call(objcontext,parameters) calls a function under a different object context. // read more at : https://developer.mozilla.org/en-US/docs...
14,205
In Luke 22:38, did Jesus mean that two swords were enough (i.e., sufficient) or did he intend to say, “Enough of this!”? English translation according to the [King James Version](http://www.blueletterbible.org/Bible.cfm?b=Luk&c=22&t=KJV#s=t_conc_995036): > > 36 Then said he unto them, But now, he that hath a purse, ...
2014/12/20
[ "https://hermeneutics.stackexchange.com/questions/14205", "https://hermeneutics.stackexchange.com", "https://hermeneutics.stackexchange.com/users/6509/" ]
**Short Answer:** "Two swords will be sufficient" fits the semantics, but has significant contextual difficulties. "Enough!" fits the broader context better, but has other significant difficulties. The best explanation seems to be that Jesus was not thrilled with their interpretation of His instructions, but this wasn'...
It is **simple** but *complex* at the same time: **Two swords** "it's enough" or one **two-edged sword** (Hebrew 4.12). We all have to carry our sword with us. **Two swords** (Old testament/New testament [Hebrew/Greek]) **it's enough**!
14,205
In Luke 22:38, did Jesus mean that two swords were enough (i.e., sufficient) or did he intend to say, “Enough of this!”? English translation according to the [King James Version](http://www.blueletterbible.org/Bible.cfm?b=Luk&c=22&t=KJV#s=t_conc_995036): > > 36 Then said he unto them, But now, he that hath a purse, ...
2014/12/20
[ "https://hermeneutics.stackexchange.com/questions/14205", "https://hermeneutics.stackexchange.com", "https://hermeneutics.stackexchange.com/users/6509/" ]
**Short Answer:** "Two swords will be sufficient" fits the semantics, but has significant contextual difficulties. "Enough!" fits the broader context better, but has other significant difficulties. The best explanation seems to be that Jesus was not thrilled with their interpretation of His instructions, but this wasn'...
It appears to me that Jesus was concerned for the disciples safety as there was an uprising of those against the new movement. Jesus himself does not need protection, but the disciples away from Jesus would at the very least not appear to be defenseless. The swords were a deterrent for rioters and religious malefactors...
14,205
In Luke 22:38, did Jesus mean that two swords were enough (i.e., sufficient) or did he intend to say, “Enough of this!”? English translation according to the [King James Version](http://www.blueletterbible.org/Bible.cfm?b=Luk&c=22&t=KJV#s=t_conc_995036): > > 36 Then said he unto them, But now, he that hath a purse, ...
2014/12/20
[ "https://hermeneutics.stackexchange.com/questions/14205", "https://hermeneutics.stackexchange.com", "https://hermeneutics.stackexchange.com/users/6509/" ]
It appears to me that Jesus was concerned for the disciples safety as there was an uprising of those against the new movement. Jesus himself does not need protection, but the disciples away from Jesus would at the very least not appear to be defenseless. The swords were a deterrent for rioters and religious malefactors...
It is **simple** but *complex* at the same time: **Two swords** "it's enough" or one **two-edged sword** (Hebrew 4.12). We all have to carry our sword with us. **Two swords** (Old testament/New testament [Hebrew/Greek]) **it's enough**!
40,468,483
I have two asp.net MVC websites. One the front end(mysite.com) and one the backend(admin.mysite.com). They both use the same database and everything is working fine. But, I am facing the issue in upload. I want to upload images in front end **content** folder from the admin website. How can that be achieved? Using `...
2016/11/07
[ "https://Stackoverflow.com/questions/40468483", "https://Stackoverflow.com", "https://Stackoverflow.com/users/570928/" ]
Two bits of metaprogramming helpers: ``` template<std::size_t I> using index=std::integral_constant<std::size_t, I>; template<class T> struct tag_t {constexpr tag_t(){};}; template<class T> tag_t<T> tag{}; template<std::size_t, class T> using indexed_type = T; ``` Now we define an enum type for each of the argument ...
Instead of having a `std::string` argument for your functions, you could use a `std::vector<std::string>`, so you could store multiple arguments. That would relate to something like : ``` using function_t = std::function<void(const std::vector<std::string>&)>; static const std::unordered_map<std::string, function_t> ...
40,468,483
I have two asp.net MVC websites. One the front end(mysite.com) and one the backend(admin.mysite.com). They both use the same database and everything is working fine. But, I am facing the issue in upload. I want to upload images in front end **content** folder from the admin website. How can that be achieved? Using `...
2016/11/07
[ "https://Stackoverflow.com/questions/40468483", "https://Stackoverflow.com", "https://Stackoverflow.com/users/570928/" ]
Two bits of metaprogramming helpers: ``` template<std::size_t I> using index=std::integral_constant<std::size_t, I>; template<class T> struct tag_t {constexpr tag_t(){};}; template<class T> tag_t<T> tag{}; template<std::size_t, class T> using indexed_type = T; ``` Now we define an enum type for each of the argument ...
I couldn't figure out a way to store all operations in one structure and still have compile time checks. Yet it is possible to check the number of passed values at runtime. ``` #include <iostream> #include <functional> #include <string> #include <unordered_map> class operation { using op0_funcptr = void(*)(); ...
40,468,483
I have two asp.net MVC websites. One the front end(mysite.com) and one the backend(admin.mysite.com). They both use the same database and everything is working fine. But, I am facing the issue in upload. I want to upload images in front end **content** folder from the admin website. How can that be achieved? Using `...
2016/11/07
[ "https://Stackoverflow.com/questions/40468483", "https://Stackoverflow.com", "https://Stackoverflow.com/users/570928/" ]
Two bits of metaprogramming helpers: ``` template<std::size_t I> using index=std::integral_constant<std::size_t, I>; template<class T> struct tag_t {constexpr tag_t(){};}; template<class T> tag_t<T> tag{}; template<std::size_t, class T> using indexed_type = T; ``` Now we define an enum type for each of the argument ...
I suggest the use of single `std::map` where the key is the name of the function (`NOP`, `AND`, `ADD`, etc.). Using inheritance, a trivial base class, a `std::function` wrapper... Not really elegant, I suppose, but... ``` #include <map> #include <memory> #include <iostream> #include <functional> struct funBase { ...
57,834,932
I am trying to restrict user from double spaces at same time i searched and found in textfield we can use inputFormatter to Block any key in keyboard. I used this RegExp to block double spaces its working fine , the space button doesn't work when last character is space but when i type next character then its just rem...
2019/09/07
[ "https://Stackoverflow.com/questions/57834932", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10721736/" ]
To restrict user to add 2 or more space together In below **Allow RegExp** ther is one space in end and **Deny RegExp** there is two space user this input formatter;- ``` inputFormatters: [FilteringTextInputFormatter.allow(RegExp('[a-z A-Z á-ú Á-Ú 0-9 ]')),FilteringTextInputFormatter.deny(' ')], ``` you can adjus...
**Updated**: this way you can check the last typed character then update widget state based on that: ```dart //... bool _isBlockedSpaceKey = false; //... TextField( // ... onChanged:(value) { setState(() { _isBlockedSpaceKey = value.endsWith(' '); }); } ); ```
15,210,850
I have the following POJO: ``` public class Widget { private String fizz; private String buzz; private String foo; // Getters and setters for all 3... } ``` In my code, I am trying to convert a `List<List<Widget>>` into JSON using the [Java JSON](http://json.org/java/) library (however I'd also acce...
2013/03/04
[ "https://Stackoverflow.com/questions/15210850", "https://Stackoverflow.com", "https://Stackoverflow.com/users/892029/" ]
First, are you sure this is correct? The comment and code does not match . ``` // Returns a single List<Widget> with 2 Widgets in it... List<List<Widget>> widgetGroups = getWidgetGroups(); ``` Second, create a WidgetGroup class that will act as a container for a single WidgetGroup. ``` public class WidgetGroup { ...
In JSON there are only two types of "containers" - arrays, which are implicitly ordered but not named, and object (or associative arrays), which are not necessarily ordered but have named key-value pairs. The correct JSON syntax should be: ``` { "widgetGroups": [ { "widgetGroup": [ { "f...
50,536,786
I'm trying to use symfony without success. It is working in local, but I get an error in production. Can someone help ? thank you :) **the error :** ``` PHP Fatal error: Uncaught TypeError: Return value of Symfony\\Component\\Dotenv\\Dotenv::populate() must be an instance of Symfony\\Component\\Dotenv\\void, none re...
2018/05/25
[ "https://Stackoverflow.com/questions/50536786", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9295883/" ]
I had this same issue, down to the line number (95), ``` PHP Fatal error: Uncaught TypeError: Return value of Symfony\\Component\\Dotenv\\Dotenv::populate() must be an instance of Symfony\\Component\\Dotenv\\void ... ``` As per @Glen Pinheiro , I disabled the php7.0 module (after ensuring my other packages were upd...
Perform following operations to resolve the above issue, ``` sudo apt install apache2 libapache2-mod-php7.2 sudo a2dismod php7.0 sudo a2enmod php7.2 sudo service apache2 restart ```
22,886,937
I'm trying to write data in [FITS format](http://heasarc.gsfc.nasa.gov/fitsio/fitsio.html) using compression. Here's what I tried: ``` #include <vector> #include "fitsio.h" #define DIM 100 int main(int argc, char *argv[]) { fitsfile *fptr; /* pointer to the FITS file, defined in fitsio.h */ std::vector<d...
2014/04/05
[ "https://Stackoverflow.com/questions/22886937", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2743307/" ]
There are older FITS libraries that cannot deal with the FITS tile compression standard. Software based on recent cfitsio (and CCfits) and nom.tam.fits is generally compliant with that convention.
It looks like I create a valid fits file it's just [imageJ](http://imagej.nih.gov/ij/) not reading it properly. Downloaded [ds9](http://ds9.si.edu/) at it works pretty well.
264,152
[Edited to give more details] I'm trying to build an 6th order Butterworth active op-amp low pass filter with programmable cutoff frequencies of 1/5/10/50/100/250/500/1000/2000Hz. Another limitation is that it must fit in a very small footprint, about 10mm^2. I've come up with a design using a three circuit op-amp w...
2016/10/18
[ "https://electronics.stackexchange.com/questions/264152", "https://electronics.stackexchange.com", "https://electronics.stackexchange.com/users/126339/" ]
This is called "push pull output configuration" and provides unity voltage gain but significantly low output impedance and high output current. This makes push/pull output ideal for driving high capacitive loads such as power MOSFET gates at relatively high frequencies when the driver (IC or MCU) cannot source enough c...
MOSFETS are voltage triggered and therefore they are perfect as they are with your microcontroler or SOC, as long as you use a pull-down resistor to pull the input to ground, you should be fine. Therefore I don't think the complicated NPN and PNP design is required.
264,152
[Edited to give more details] I'm trying to build an 6th order Butterworth active op-amp low pass filter with programmable cutoff frequencies of 1/5/10/50/100/250/500/1000/2000Hz. Another limitation is that it must fit in a very small footprint, about 10mm^2. I've come up with a design using a three circuit op-amp w...
2016/10/18
[ "https://electronics.stackexchange.com/questions/264152", "https://electronics.stackexchange.com", "https://electronics.stackexchange.com/users/126339/" ]
This is called "push pull output configuration" and provides unity voltage gain but significantly low output impedance and high output current. This makes push/pull output ideal for driving high capacitive loads such as power MOSFET gates at relatively high frequencies when the driver (IC or MCU) cannot source enough c...
If you want to keep your high voltage FET, then the following is a common way of the doing the job, and can be driven from 3v/5v logic. Q1 pulls the signal low through D1. Even with the drop through D1, it gets to more or less as low an output voltage as an emitter follower. Q2 amplifies the current through R1, so dr...
264,152
[Edited to give more details] I'm trying to build an 6th order Butterworth active op-amp low pass filter with programmable cutoff frequencies of 1/5/10/50/100/250/500/1000/2000Hz. Another limitation is that it must fit in a very small footprint, about 10mm^2. I've come up with a design using a three circuit op-amp w...
2016/10/18
[ "https://electronics.stackexchange.com/questions/264152", "https://electronics.stackexchange.com", "https://electronics.stackexchange.com/users/126339/" ]
If you want to keep your high voltage FET, then the following is a common way of the doing the job, and can be driven from 3v/5v logic. Q1 pulls the signal low through D1. Even with the drop through D1, it gets to more or less as low an output voltage as an emitter follower. Q2 amplifies the current through R1, so dr...
MOSFETS are voltage triggered and therefore they are perfect as they are with your microcontroler or SOC, as long as you use a pull-down resistor to pull the input to ground, you should be fine. Therefore I don't think the complicated NPN and PNP design is required.