qid
int64
1
74.7M
question
stringlengths
0
58.3k
date
stringlengths
10
10
metadata
list
response_j
stringlengths
2
48.3k
response_k
stringlengths
2
40.5k
3,457,604
I am using iText library for writing a PDF file. I want to give page numbers and page header on every page of file How can I do that?
2010/08/11
[ "https://Stackoverflow.com/questions/3457604", "https://Stackoverflow.com", "https://Stackoverflow.com/users/417116/" ]
If you don't break lines manually then it's really hard almost impossible to precisely get the line count. This number depends on font measurement and the text layout on a page. iText is a great tool for PDF generation not for parsing.
I suggest you buy the iText book "iText in Action" which is very helpful. If you don't generate your page breaks yourself, you could checkout the PdfPageEvent methods such as onStartPage() and the getPageNumber() method.
25,143,493
Hi i'm new to WPF entirely, I would like to be able to control the margin value of anything that is in the XAML via a variable in the CS file , i've read up a few questions/answers on stackoverflow, tried to implement it as such but it dosen't seem to work . This is what i've tried so far, but i couldn't get it to wo...
2014/08/05
[ "https://Stackoverflow.com/questions/25143493", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3782401/" ]
There is a problem with the property name "public Thickness Margin" you use it is overrides the Window.Margin property you should rename it. Second you are binding the member value not the property value. Try this code (I added a button to trigger the PropertyChanged event you should replace it whatever you want to us...
There's an inconsistency in how you are setting the data context. The `DataContext` is being set to the "\_Margin" property of "MainWindow", but then the binding is also targeting the path "\_Margin". You need this instead: ``` No.DataContext = this; ```
69,105,602
*(Note! This question particularly covers the state of C++14, before the introduction of inline variables in C++17)* ### TLDR; Question * What constitutes odr-use of a constexpr variable used in the definition of an inline function, such that multiple definitions of the function violates [basic.def.odr]/6? (... like...
2021/09/08
[ "https://Stackoverflow.com/questions/69105602", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4573247/" ]
In the OP's example with `std::max`, an ODR violation does indeed occur, and the program is ill-formed NDR. To avoid this issue, you might consider one of the following fixes: * give the `doMath` function internal linkage, or * move the declaration of `kTwo` inside `doMath` A variable that is used by an expression is...
> > Does a program where doMath() defined as follows: [...] have undefined behaviour as soon as `doMath()` is defined in two different translation units (say by inclusion of `some_math.h` and subsequent use of `doMath()`)? > > > Yes; this particular issue was highlighted in [LWG2888](https://cplusplus.github.io/LW...
3,165,476
I have a power series nestled inside a power series, and the inside power series is taken to a power. I need to isolate the term that would go like $t^{2mn}$ so that I could integrate it. I'm not looking to sum up the series, since that's where I'm coming from. $$ \sum\_{n=0}^{\infty} (-1)^n \left(\sum\_{m=0}^{\infty...
2019/03/28
[ "https://math.stackexchange.com/questions/3165476", "https://math.stackexchange.com", "https://math.stackexchange.com/users/353643/" ]
Here are two approaches to extract the coefficient of $t^{2MN}$. One is based upon *[multinomial expansion](https://en.wikipedia.org/wiki/Multinomial_theorem#Theorem)*, the other is based upon the representation $\cos t=\frac{1}{2}\left(e^{it}+e^{-it}\right)$. Regrettably, none of them seems really promising. Neverthel...
Seems like a strange approach but the only thing I think would help would be this: <https://en.m.wikipedia.org/wiki/Cauchy_product> Although you'd need to establish a general form for the coefficients when multiplying more than 2 series, which would include several nested finite sums, making the result really ugly
11,804,760
I'm quite new to the variadic template of C++2011 and I would like to know if a trick exists to do the following thing : ``` template<typename T, unsigned int... TDIM> class VariadicTest { public: static const unsigned int order_const = sizeof...(TDIM); static const unsigned int size_const = // TDI...
2012/08/04
[ "https://Stackoverflow.com/questions/11804760", "https://Stackoverflow.com", "https://Stackoverflow.com/users/882932/" ]
Here is the way to implement other two functionality: ``` template<unsigned int... T> struct mul; template<unsigned int L,unsigned int... T> struct mul<L,T...> { static const int val= L*mul<T...>::val; }; template<unsigned int L> struct mul<L> { static const int val= L; }; template<typename T, unsigned int... TDIM> c...
Here's a partial answer, it does `order_const` and `size_const`. But I can't see how to do `dim_const` yet. ``` #include<iostream> using namespace std; template<typename T, unsigned int... TDIM> class VariadicTest; template<typename T> class VariadicTest<T> { public: static const unsigned int order_const...
590,959
My active directory account just got locked out. On a whim I unplugged the ethernet cord and turned off the wifi radio switch and I was able to log into my account. I plugged the ethernet back in and then tried to RDP to another computer on the network and got the "your account is locked" message. So I ctrl+alt+del loc...
2014/04/24
[ "https://serverfault.com/questions/590959", "https://serverfault.com", "https://serverfault.com/users/20063/" ]
Yes. With network connectivity you'll attempt a login to the domain and fail because your account is locked out. Without network connectivity you'll log on to your computer with cached credentials. This is by design.
To add to joeqwerty's answer, this is by design for people who may travel or be away from the domain without any access, be it through VPN or other method, back to the local domain. It is also by design for several other reasons, but your credentials do get cached and then used in this instance. When you unplug your et...
34,488,572
This is my ViewController.m file's code for Collection view: ``` - (void)viewDidLoad { img = [[NSArray alloc] initWithObjects:@"1.png",@"2.png",@"3.png", nil]; name = [[NSArray alloc] initWithObjects:@"Flag",@"Blue",@"Fish", nil]; [self.collectionview registerNib:[UINib nibWithNibName:@"cell" bundle:nil...
2015/12/28
[ "https://Stackoverflow.com/questions/34488572", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5697428/" ]
Add like this static NSString \*identifier = @"Cell"; ``` UICollectionViewCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:identifier forIndexPath:indexPath]; UIImageView *recipeImageView=(UIImageView *)[cell viewWithTag:100]; recipeImageView.image = [UIImage imageNamed:[jsonImagesArr objectAtInde...
Make sure the cell on the .xib file know what's the type of the cell. Select the cell on your interface builder [![enter image description here](https://i.stack.imgur.com/FwfRH.png)](https://i.stack.imgur.com/FwfRH.png) and then on the identity inspector. In your case it should be `cell` [![enter image description ...
34,488,572
This is my ViewController.m file's code for Collection view: ``` - (void)viewDidLoad { img = [[NSArray alloc] initWithObjects:@"1.png",@"2.png",@"3.png", nil]; name = [[NSArray alloc] initWithObjects:@"Flag",@"Blue",@"Fish", nil]; [self.collectionview registerNib:[UINib nibWithNibName:@"cell" bundle:nil...
2015/12/28
[ "https://Stackoverflow.com/questions/34488572", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5697428/" ]
Add like this static NSString \*identifier = @"Cell"; ``` UICollectionViewCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:identifier forIndexPath:indexPath]; UIImageView *recipeImageView=(UIImageView *)[cell viewWithTag:100]; recipeImageView.image = [UIImage imageNamed:[jsonImagesArr objectAtInde...
Have you set the identifier in xib as "CELL" [![enter image description here](https://i.stack.imgur.com/81Qz1.png)](https://i.stack.imgur.com/81Qz1.png) You need to register your nib/class if you are using a custom cell. You can do that by ``` [self.myCollectionView registerNib:[UINib nibWithNibName:@"ShubhCalendarC...
34,488,572
This is my ViewController.m file's code for Collection view: ``` - (void)viewDidLoad { img = [[NSArray alloc] initWithObjects:@"1.png",@"2.png",@"3.png", nil]; name = [[NSArray alloc] initWithObjects:@"Flag",@"Blue",@"Fish", nil]; [self.collectionview registerNib:[UINib nibWithNibName:@"cell" bundle:nil...
2015/12/28
[ "https://Stackoverflow.com/questions/34488572", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5697428/" ]
Make sure the cell on the .xib file know what's the type of the cell. Select the cell on your interface builder [![enter image description here](https://i.stack.imgur.com/FwfRH.png)](https://i.stack.imgur.com/FwfRH.png) and then on the identity inspector. In your case it should be `cell` [![enter image description ...
Have you set the identifier in xib as "CELL" [![enter image description here](https://i.stack.imgur.com/81Qz1.png)](https://i.stack.imgur.com/81Qz1.png) You need to register your nib/class if you are using a custom cell. You can do that by ``` [self.myCollectionView registerNib:[UINib nibWithNibName:@"ShubhCalendarC...
52,212,526
I've seen many examples of the `lock` usage, and it's usually something like this: ``` private static readonly object obj = new object(); lock (obj) { // code here } ``` Is it possible to lock based on a property of a class? I didn't want to lock globally for any calls to the method with the `lock` statement, I...
2018/09/06
[ "https://Stackoverflow.com/questions/52212526", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2263507/" ]
Let me first make sure I understand the proposal. The problem given is that we have some resource shared to multiple threads, call it `database`, and it admits two operations: `Read(Context)` and `Write(Context)`. The proposal is to have lock granularity based on a property of the context. That is: ``` void MyRead(Con...
Although I find Eric Lippert's answer fantastic and marked it as the correct one (and I won't change that), his thoughts made me think and I wanted to share an alternative solution I found to this problem (and I'd appreciate any feedbacks), even though I'm not going to use it as I ended up using Azure functions with my...
63,040,755
I follow this course: <https://firebase.google.com/docs/functions/callable#java_2> and i can't call my function. However i can call triggered functions: In index.json ```java const functions = require('firebase-functions'); const admin = require('firebase-admin'); admin.initializeApp(); //firebase.functions().useFun...
2020/07/22
[ "https://Stackoverflow.com/questions/63040755", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13735799/" ]
Did someone manage to figure out what the problem was here? I am using Kotlin in Android: ``` functions = FirebaseFunctions.getInstance() functions.useEmulator("10.0.2.2", 5001) ``` and am also getting an INTERNAL error.
I had a similar problem when calling functions in the emulator using my Flutter app. I have multiple Firebase projects for each of my environments and therefore when I initialize Firebase in the app I provide `FirebaseOptions` depending on the environment. Within the `FirebaseOptions` is a `projectId` parameter which ...
63,040,755
I follow this course: <https://firebase.google.com/docs/functions/callable#java_2> and i can't call my function. However i can call triggered functions: In index.json ```java const functions = require('firebase-functions'); const admin = require('firebase-admin'); admin.initializeApp(); //firebase.functions().useFun...
2020/07/22
[ "https://Stackoverflow.com/questions/63040755", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13735799/" ]
Be aware that when you use a mobile device in development you will need to instruct firebase to start with the device's local ip. See <https://github.com/firebase/firebase-tools/issues/1943#issuecomment-581754837> However, when you use your computer's simulator, it should not return an internal error. I think they shou...
I had a similar problem when calling functions in the emulator using my Flutter app. I have multiple Firebase projects for each of my environments and therefore when I initialize Firebase in the app I provide `FirebaseOptions` depending on the environment. Within the `FirebaseOptions` is a `projectId` parameter which ...
168,929
We could see that Theon Greyjoy helped Sansa Stark escape from Winterfell which was under Ramsay's control by jumping off the wall. The outer wall is said to be about 80 feet high. How did both of them survive jumping from that height? It is highly unlikely to survive that jump even if there was snow.
2017/09/05
[ "https://scifi.stackexchange.com/questions/168929", "https://scifi.stackexchange.com", "https://scifi.stackexchange.com/users/89353/" ]
Covered at this Physics.SE question: <https://physics.stackexchange.com/questions/167077/freefall-into-snow> Yes: You can do it. No: It won't kill you. It does however depend on factors such as how much snow there is, is it powder or compacted, whether the landing is steep or flat. Falls of 100 feet or more are note...
In World War II, multiple pilots survived falls of not just 100 feet, but over 18,000 feet without a parachute. If my memory serves correctly, the true story *Under the Wire* by William Ash (and Brendan Foley) tells at one point how William Ash met a Soviet prisoner-of-war who had fallen more than 20,000 feet from his ...
168,929
We could see that Theon Greyjoy helped Sansa Stark escape from Winterfell which was under Ramsay's control by jumping off the wall. The outer wall is said to be about 80 feet high. How did both of them survive jumping from that height? It is highly unlikely to survive that jump even if there was snow.
2017/09/05
[ "https://scifi.stackexchange.com/questions/168929", "https://scifi.stackexchange.com", "https://scifi.stackexchange.com/users/89353/" ]
Covered at this Physics.SE question: <https://physics.stackexchange.com/questions/167077/freefall-into-snow> Yes: You can do it. No: It won't kill you. It does however depend on factors such as how much snow there is, is it powder or compacted, whether the landing is steep or flat. Falls of 100 feet or more are note...
There may have been some water in a moat that's frozen over, so they hit the snow then they hit they hit water too slowing their fall. Would have been very wet though.
168,929
We could see that Theon Greyjoy helped Sansa Stark escape from Winterfell which was under Ramsay's control by jumping off the wall. The outer wall is said to be about 80 feet high. How did both of them survive jumping from that height? It is highly unlikely to survive that jump even if there was snow.
2017/09/05
[ "https://scifi.stackexchange.com/questions/168929", "https://scifi.stackexchange.com", "https://scifi.stackexchange.com/users/89353/" ]
Covered at this Physics.SE question: <https://physics.stackexchange.com/questions/167077/freefall-into-snow> Yes: You can do it. No: It won't kill you. It does however depend on factors such as how much snow there is, is it powder or compacted, whether the landing is steep or flat. Falls of 100 feet or more are note...
If the snow's deep enough, they could easily survive a fall of 80 feet, regardless of plot armor. [This video](https://www.youtube.com/embed/-RYkapHBVs8) shows a guy skiing away from a jump off a 255 foot cliff. He lands head first.
168,929
We could see that Theon Greyjoy helped Sansa Stark escape from Winterfell which was under Ramsay's control by jumping off the wall. The outer wall is said to be about 80 feet high. How did both of them survive jumping from that height? It is highly unlikely to survive that jump even if there was snow.
2017/09/05
[ "https://scifi.stackexchange.com/questions/168929", "https://scifi.stackexchange.com", "https://scifi.stackexchange.com/users/89353/" ]
**TL;DR:** Characters survive their falls from heights due to plot armour. --- Looking back over the scene it isn't clear at all how they actually survive the jump. The snow at the bottom of the wall doesn't actually look that deep and you never see them land. The following image is of the look down the wall to the g...
In World War II, multiple pilots survived falls of not just 100 feet, but over 18,000 feet without a parachute. If my memory serves correctly, the true story *Under the Wire* by William Ash (and Brendan Foley) tells at one point how William Ash met a Soviet prisoner-of-war who had fallen more than 20,000 feet from his ...
168,929
We could see that Theon Greyjoy helped Sansa Stark escape from Winterfell which was under Ramsay's control by jumping off the wall. The outer wall is said to be about 80 feet high. How did both of them survive jumping from that height? It is highly unlikely to survive that jump even if there was snow.
2017/09/05
[ "https://scifi.stackexchange.com/questions/168929", "https://scifi.stackexchange.com", "https://scifi.stackexchange.com/users/89353/" ]
In World War II, multiple pilots survived falls of not just 100 feet, but over 18,000 feet without a parachute. If my memory serves correctly, the true story *Under the Wire* by William Ash (and Brendan Foley) tells at one point how William Ash met a Soviet prisoner-of-war who had fallen more than 20,000 feet from his ...
There may have been some water in a moat that's frozen over, so they hit the snow then they hit they hit water too slowing their fall. Would have been very wet though.
168,929
We could see that Theon Greyjoy helped Sansa Stark escape from Winterfell which was under Ramsay's control by jumping off the wall. The outer wall is said to be about 80 feet high. How did both of them survive jumping from that height? It is highly unlikely to survive that jump even if there was snow.
2017/09/05
[ "https://scifi.stackexchange.com/questions/168929", "https://scifi.stackexchange.com", "https://scifi.stackexchange.com/users/89353/" ]
In World War II, multiple pilots survived falls of not just 100 feet, but over 18,000 feet without a parachute. If my memory serves correctly, the true story *Under the Wire* by William Ash (and Brendan Foley) tells at one point how William Ash met a Soviet prisoner-of-war who had fallen more than 20,000 feet from his ...
If the snow's deep enough, they could easily survive a fall of 80 feet, regardless of plot armor. [This video](https://www.youtube.com/embed/-RYkapHBVs8) shows a guy skiing away from a jump off a 255 foot cliff. He lands head first.
168,929
We could see that Theon Greyjoy helped Sansa Stark escape from Winterfell which was under Ramsay's control by jumping off the wall. The outer wall is said to be about 80 feet high. How did both of them survive jumping from that height? It is highly unlikely to survive that jump even if there was snow.
2017/09/05
[ "https://scifi.stackexchange.com/questions/168929", "https://scifi.stackexchange.com", "https://scifi.stackexchange.com/users/89353/" ]
**TL;DR:** Characters survive their falls from heights due to plot armour. --- Looking back over the scene it isn't clear at all how they actually survive the jump. The snow at the bottom of the wall doesn't actually look that deep and you never see them land. The following image is of the look down the wall to the g...
There may have been some water in a moat that's frozen over, so they hit the snow then they hit they hit water too slowing their fall. Would have been very wet though.
168,929
We could see that Theon Greyjoy helped Sansa Stark escape from Winterfell which was under Ramsay's control by jumping off the wall. The outer wall is said to be about 80 feet high. How did both of them survive jumping from that height? It is highly unlikely to survive that jump even if there was snow.
2017/09/05
[ "https://scifi.stackexchange.com/questions/168929", "https://scifi.stackexchange.com", "https://scifi.stackexchange.com/users/89353/" ]
**TL;DR:** Characters survive their falls from heights due to plot armour. --- Looking back over the scene it isn't clear at all how they actually survive the jump. The snow at the bottom of the wall doesn't actually look that deep and you never see them land. The following image is of the look down the wall to the g...
If the snow's deep enough, they could easily survive a fall of 80 feet, regardless of plot armor. [This video](https://www.youtube.com/embed/-RYkapHBVs8) shows a guy skiing away from a jump off a 255 foot cliff. He lands head first.
168,929
We could see that Theon Greyjoy helped Sansa Stark escape from Winterfell which was under Ramsay's control by jumping off the wall. The outer wall is said to be about 80 feet high. How did both of them survive jumping from that height? It is highly unlikely to survive that jump even if there was snow.
2017/09/05
[ "https://scifi.stackexchange.com/questions/168929", "https://scifi.stackexchange.com", "https://scifi.stackexchange.com/users/89353/" ]
If the snow's deep enough, they could easily survive a fall of 80 feet, regardless of plot armor. [This video](https://www.youtube.com/embed/-RYkapHBVs8) shows a guy skiing away from a jump off a 255 foot cliff. He lands head first.
There may have been some water in a moat that's frozen over, so they hit the snow then they hit they hit water too slowing their fall. Would have been very wet though.
91,989
Challenge --------- Write a program which takes the URL of a PPCG answer as input and outputs the length of the answer's first code block in bytes. Code Blocks ----------- There are three different ways of formatting code blocks: **Four spaces before the code (`-` represents a space, here)** ``` ----Code goes here...
2016/09/01
[ "https://codegolf.stackexchange.com/questions/91989", "https://codegolf.stackexchange.com", "https://codegolf.stackexchange.com/users/30525/" ]
jQuery JavaScript, 97 Bytes =========================== ``` console.log((new Blob([$("#answer-"+location.hash.substr(1)+" code").eq(0).text().trim()])).size) ``` old version 151 Bytes ``` s=$('#answer-'+location.hash.substr(1)+' code').eq(0).text().trim();c=0;for(i=s.length;i--;)d=s.charCodeAt(i),c=d<128?c+1:d<2048...
C#, ~~249~~ 270 bytes ===================== ``` u=>{var c=new System.Net.Http.HttpClient().GetStringAsync(u).Result;var i=c.IndexOf("de>",c.IndexOf('"'+u.Split('/')[4]))+3;return System.Text.Encoding.UTF8.GetByteCount(c.Substring(i,c.IndexOf("<",i)-i-1).Replace("&gt;",">").Replace("&lt;","<").Replace("&amp;","&"));}; ...
91,989
Challenge --------- Write a program which takes the URL of a PPCG answer as input and outputs the length of the answer's first code block in bytes. Code Blocks ----------- There are three different ways of formatting code blocks: **Four spaces before the code (`-` represents a space, here)** ``` ----Code goes here...
2016/09/01
[ "https://codegolf.stackexchange.com/questions/91989", "https://codegolf.stackexchange.com", "https://codegolf.stackexchange.com/users/30525/" ]
jQuery JavaScript, 97 Bytes =========================== ``` console.log((new Blob([$("#answer-"+location.hash.substr(1)+" code").eq(0).text().trim()])).size) ``` old version 151 Bytes ``` s=$('#answer-'+location.hash.substr(1)+' code').eq(0).text().trim();c=0;for(i=s.length;i--;)d=s.charCodeAt(i),c=d<128?c+1:d<2048...
Java 7, ~~314~~ 313 bytes ========================= ``` int c(String u)throws Exception{String x="utf8",s=new java.util.Scanner(new java.net.URL(u).openStream(),x).useDelimiter("\\A").next();int j=s.indexOf("de>",s.indexOf('"'+u.split("/")[4]))+3;return s.substring(j,s.indexOf("<",j)-1).replace("&gt;",">").replace("&l...
8,081,575
I'm using lwIP on an embedded device, and I feel that I may be running into some bugs related to running out of memory. I know that the mem\_malloc function itself will return null when a memory allocation fails, but is there any way to get a rough assessment of the available memory at an arbitrary point in time? It wo...
2011/11/10
[ "https://Stackoverflow.com/questions/8081575", "https://Stackoverflow.com", "https://Stackoverflow.com/users/109517/" ]
Define MEM\_STATS and look at the memory statistics via stats\_display\_mem. See stats.h, stats.c, and opt.h among other places. That should get you started.
In LwIP version 2.1.3, You need to define MEM\_STATS, but also LWIP\_STATS. To output the stats, when you have defined LWIP\_STATS\_DISPLAY, you can use MEM\_STATS\_DISPLAY().
71,815,662
Here I have a string with repeated chars, I want to get the string without repetition, so I used map with specific index, but I don't know what's wrong with the 1st repeated char, when I used slice(i+1,1) all thing was good, but when I used slice(i,1) also all thing was good except the first repeated char. The output ...
2022/04/10
[ "https://Stackoverflow.com/questions/71815662", "https://Stackoverflow.com", "https://Stackoverflow.com/users/18101479/" ]
Your first code block only works because your `.slice()` happens to be returning empty strings. You really don't need to use `.slice()` at all, since all it does is generate an empty string which is then removed when you use `.join()`. The `.slice()` call does NOT update/remove an element like `.s**p**lice()` on an arr...
Since you are returning `myString[i]`, not `myString[i+1]`, you have to compare `myString[i]` with `myString[i-1]`: ```js let myString = "EElllzzzzzzzeroo"; let elzero = myString .split("") .map(function(ele, i = 1, myString) { console.log(i); // if (myString[i] === myString[i + 1]) { if (myString[i-1...
40,908,015
I have some excel in which the column names are numbers are dynamic, How can I design a table structure to save it in sql server table. Since its dynamic I can't keep a specific table structure.Please suggest a solution.
2016/12/01
[ "https://Stackoverflow.com/questions/40908015", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7134851/" ]
Just create a separate layout.xml file for action bar and include it as a custom action bar in main.xml and set the main activity's theme to noTitle bar. **Here is my custome\_app\_bar.xml** ``` <LinearLayout android:orientation="vertical" xmlns:android="http://schemas.android.com/apk/res/android" android:layout_widt...
Use `setLogo()` method. ``` getSupportActionBar().setLogo(R.drawable.fm); ```
40,908,015
I have some excel in which the column names are numbers are dynamic, How can I design a table structure to save it in sql server table. Since its dynamic I can't keep a specific table structure.Please suggest a solution.
2016/12/01
[ "https://Stackoverflow.com/questions/40908015", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7134851/" ]
Just create a separate layout.xml file for action bar and include it as a custom action bar in main.xml and set the main activity's theme to noTitle bar. **Here is my custome\_app\_bar.xml** ``` <LinearLayout android:orientation="vertical" xmlns:android="http://schemas.android.com/apk/res/android" android:layout_widt...
try this ``` ActionBar actionBar = getActionBar(); actionBar.setDisplayOptions(actionBar.getDisplayOptions() | ActionBar.DISPLAY_SHOW_CUSTOM); ImageView imageView = new ImageView(actionBar.getThemedContext()); imageView.setScaleType(ImageView.ScaleType.CENTER); imageView.setImageResource(R.drawable.adnace_sea...
40,908,015
I have some excel in which the column names are numbers are dynamic, How can I design a table structure to save it in sql server table. Since its dynamic I can't keep a specific table structure.Please suggest a solution.
2016/12/01
[ "https://Stackoverflow.com/questions/40908015", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7134851/" ]
Just create a separate layout.xml file for action bar and include it as a custom action bar in main.xml and set the main activity's theme to noTitle bar. **Here is my custome\_app\_bar.xml** ``` <LinearLayout android:orientation="vertical" xmlns:android="http://schemas.android.com/apk/res/android" android:layout_widt...
``` getSupportActionBar().setDisplayHomeAsUpEnabled(true); getSupportActionBar().setDisplayShowTitleEnabled(true); getSupportActionBar.setLogo(R.drawable.fm); ``` And one more thing if you are using `Activity` then change to `AppCompatActivity`
40,908,015
I have some excel in which the column names are numbers are dynamic, How can I design a table structure to save it in sql server table. Since its dynamic I can't keep a specific table structure.Please suggest a solution.
2016/12/01
[ "https://Stackoverflow.com/questions/40908015", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7134851/" ]
Just create a separate layout.xml file for action bar and include it as a custom action bar in main.xml and set the main activity's theme to noTitle bar. **Here is my custome\_app\_bar.xml** ``` <LinearLayout android:orientation="vertical" xmlns:android="http://schemas.android.com/apk/res/android" android:layout_widt...
Try this way ``` Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar); setSupportActionBar(toolbar); final ActionBar ab = getSupportActionBar(); if (ab != null) { ab.setLogo(R.drawable.fm); ab.setTitle("MukilFM"); ab.setHomeAsUpIndicator(R.drawable...
40,908,015
I have some excel in which the column names are numbers are dynamic, How can I design a table structure to save it in sql server table. Since its dynamic I can't keep a specific table structure.Please suggest a solution.
2016/12/01
[ "https://Stackoverflow.com/questions/40908015", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7134851/" ]
Just create a separate layout.xml file for action bar and include it as a custom action bar in main.xml and set the main activity's theme to noTitle bar. **Here is my custome\_app\_bar.xml** ``` <LinearLayout android:orientation="vertical" xmlns:android="http://schemas.android.com/apk/res/android" android:layout_widt...
``` Objects.requireNonNull(getSupportActionBar()).setDisplayShowHomeEnabled(true); getSupportActionBar().setIcon(R.drawable.whiteic); ```
157,010
I have a Ubuntu 10.04 machine that has tomcat6 on it. When I start tomcat6 with `/etc/init.d/tomcat6 start` I get ``` * Starting Tomcat servlet engine tomcat6 /bin/bash already running. ``` and the server fails to start. Unfortunately, there is nothing in **/var/log/tomcat/catalina.out** to help debug the issue. Wi...
2010/07/02
[ "https://serverfault.com/questions/157010", "https://serverfault.com", "https://serverfault.com/users/44953/" ]
Sometimes you gotta do what you gotta do. Here's a patch that makes running tomcat as root work: ``` --- init.d.old/tomcat6 2010-09-01 15:31:01.996208252 -0700 +++ init.d/tomcat6 2010-09-01 15:30:10.315146226 -0700 @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/sh -x # # /etc/init.d/tomcat6 -- startup script for the Tomcat 6...
Looking at the man page for start-stop-daemon, it looks for processes which match the name, uid, and/or gid of the command it's being asked to start. From the error message, I'd guess it may be doing this based on the /bin/bash command - so it's finding that there's already a root process running the /bin/bash command,...
157,010
I have a Ubuntu 10.04 machine that has tomcat6 on it. When I start tomcat6 with `/etc/init.d/tomcat6 start` I get ``` * Starting Tomcat servlet engine tomcat6 /bin/bash already running. ``` and the server fails to start. Unfortunately, there is nothing in **/var/log/tomcat/catalina.out** to help debug the issue. Wi...
2010/07/02
[ "https://serverfault.com/questions/157010", "https://serverfault.com", "https://serverfault.com/users/44953/" ]
There's [an Ubuntu bug](https://bugs.launchpad.net/ubuntu/+source/tomcat6/+bug/632554) for this issue, with a proposed patch. It's not necessarily anything to do with running as root - if your tomcat6 user has a /bin/bash process (say, you're using it to run some commands to support your Tomcat application), then you ...
Looking at the man page for start-stop-daemon, it looks for processes which match the name, uid, and/or gid of the command it's being asked to start. From the error message, I'd guess it may be doing this based on the /bin/bash command - so it's finding that there's already a root process running the /bin/bash command,...
157,010
I have a Ubuntu 10.04 machine that has tomcat6 on it. When I start tomcat6 with `/etc/init.d/tomcat6 start` I get ``` * Starting Tomcat servlet engine tomcat6 /bin/bash already running. ``` and the server fails to start. Unfortunately, there is nothing in **/var/log/tomcat/catalina.out** to help debug the issue. Wi...
2010/07/02
[ "https://serverfault.com/questions/157010", "https://serverfault.com", "https://serverfault.com/users/44953/" ]
Sometimes you gotta do what you gotta do. Here's a patch that makes running tomcat as root work: ``` --- init.d.old/tomcat6 2010-09-01 15:31:01.996208252 -0700 +++ init.d/tomcat6 2010-09-01 15:30:10.315146226 -0700 @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/sh -x # # /etc/init.d/tomcat6 -- startup script for the Tomcat 6...
This is (was) a known Ubuntu bug that has since been fixed: <https://bugs.launchpad.net/ubuntu/+source/tomcat6/+bug/632554> The init script won't start tomcat6 daemon if the user has a bash shell running. The fix as listed in the bug report is simply to add `-p "$CATALINA_PID"` to the start-stop-daemon command. ``` ...
157,010
I have a Ubuntu 10.04 machine that has tomcat6 on it. When I start tomcat6 with `/etc/init.d/tomcat6 start` I get ``` * Starting Tomcat servlet engine tomcat6 /bin/bash already running. ``` and the server fails to start. Unfortunately, there is nothing in **/var/log/tomcat/catalina.out** to help debug the issue. Wi...
2010/07/02
[ "https://serverfault.com/questions/157010", "https://serverfault.com", "https://serverfault.com/users/44953/" ]
There's [an Ubuntu bug](https://bugs.launchpad.net/ubuntu/+source/tomcat6/+bug/632554) for this issue, with a proposed patch. It's not necessarily anything to do with running as root - if your tomcat6 user has a /bin/bash process (say, you're using it to run some commands to support your Tomcat application), then you ...
This is (was) a known Ubuntu bug that has since been fixed: <https://bugs.launchpad.net/ubuntu/+source/tomcat6/+bug/632554> The init script won't start tomcat6 daemon if the user has a bash shell running. The fix as listed in the bug report is simply to add `-p "$CATALINA_PID"` to the start-stop-daemon command. ``` ...
57,070,312
Actually I have 3 questions about the same problem: controlling a window with applescript. 1. What should I do if I would press on button "Close Window" of application "Google Chrome"? 2. Is it possible to check if the window changes? For example, to see if appear a pop-up or something like that... 3. What about click...
2019/07/17
[ "https://Stackoverflow.com/questions/57070312", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11633172/" ]
You could achieve this by configuring ObjectMapper to use [`DeserializationFeature.UNWRAP_ROOT_VALUE`](https://static.javadoc.io/com.fasterxml.jackson.core/jackson-databind/2.9.8/com/fasterxml/jackson/databind/DeserializationFeature.html#UNWRAP_ROOT_VALUE) : ``` ObjectMapper mapper = new ObjectMapper(); mapper.configu...
You need to have a `HumanWrapper` class as your human object is defined inside you json object ``` { "human": { } } ``` If you able to change you API to send just a `human` object like this ``` { "fname":"anjali", "lname":"malhotra" } ``` Then you woudn't be bothering to have a `HumanWrapper`
10,717,817
I have one text box which accepts the path of selected folder. And i need to display all sub folders present in that folder in a TreeView. How can i do this?
2012/05/23
[ "https://Stackoverflow.com/questions/10717817", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1412326/" ]
``` string Path = @"C:\Temp Folder\"; string[] folders = System.IO.Directory.GetDirectories(Path, "*", System.IO.SearchOption.TopDirectoryOnly); TreeNode treeNode = new TreeNode(Path); TreeNode subNode; for (int i = 0; i < folders.Length; i++) { subNode = new TreeN...
I have done this in the past using VB.net (I will convert it for you shortly) All you need is a recursive function ``` YourTreeViewControl.Nodes.Add("C:\Temp") Recursive(@"C:\Temp", Tree.Nodes(0)) void Recursive(string d, TreeNode nodePar) { DirectoryInfo dir = new DirectoryInfo(d); foreach (v...
10,717,817
I have one text box which accepts the path of selected folder. And i need to display all sub folders present in that folder in a TreeView. How can i do this?
2012/05/23
[ "https://Stackoverflow.com/questions/10717817", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1412326/" ]
``` string Path = @"C:\Temp Folder\"; string[] folders = System.IO.Directory.GetDirectories(Path, "*", System.IO.SearchOption.TopDirectoryOnly); TreeNode treeNode = new TreeNode(Path); TreeNode subNode; for (int i = 0; i < folders.Length; i++) { subNode = new TreeN...
Following code will help u. ``` DirectoryInfo parentInfo = new DirectoryInfo(@"path"); DirectoryInfo[] childInfo= parentInfo.GetDirectories(); treeView1.Nodes.Add(parentInfo.Name); foreach(DirectoryInfo di in childInfo) { treeView1.Nodes[0].Nodes...
56,797,903
I want to be able to add an attribute to a dictionary but only if the condition I pass in is true. For example: ``` def addSum(num): obj = { 'name': "Home", 'url': "/", num > 0 ? 'data': num } ``` Is this possible? I can't find a way to do this in python, I have only...
2019/06/27
[ "https://Stackoverflow.com/questions/56797903", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7058272/" ]
You can't do it with quite that syntax. For one thing, you need Python, not Java/C. (1) add the attribute, but set to `None`: ``` obj = {'name': "Home", 'url': "/", 'data': num if num > 0 else None } ``` (2) make it an add-on: ``` obj = {'name': "Home", 'url': "/"} if num > 0: obj['d...
Just add/check it in separate statement: ``` def addSum(num): obj = { 'name': "Home", 'url': "/" } if num > 0: obj['data'] = num return obj print(addSum(3)) # {'name': 'Home', 'url': '/', 'data': 3} print(addSum(0)) # {'name': 'Home', 'url': '/'} ```
56,797,903
I want to be able to add an attribute to a dictionary but only if the condition I pass in is true. For example: ``` def addSum(num): obj = { 'name': "Home", 'url': "/", num > 0 ? 'data': num } ``` Is this possible? I can't find a way to do this in python, I have only...
2019/06/27
[ "https://Stackoverflow.com/questions/56797903", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7058272/" ]
You can't do it with quite that syntax. For one thing, you need Python, not Java/C. (1) add the attribute, but set to `None`: ``` obj = {'name': "Home", 'url': "/", 'data': num if num > 0 else None } ``` (2) make it an add-on: ``` obj = {'name': "Home", 'url': "/"} if num > 0: obj['d...
Create the dictionary without the optional element, then add it in an `if` statement ``` def addSum(num): obj = { 'name': "Home", 'url': "/" } if num > 0: obj['data'] = num; ```
56,797,903
I want to be able to add an attribute to a dictionary but only if the condition I pass in is true. For example: ``` def addSum(num): obj = { 'name': "Home", 'url': "/", num > 0 ? 'data': num } ``` Is this possible? I can't find a way to do this in python, I have only...
2019/06/27
[ "https://Stackoverflow.com/questions/56797903", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7058272/" ]
You can't do it with quite that syntax. For one thing, you need Python, not Java/C. (1) add the attribute, but set to `None`: ``` obj = {'name': "Home", 'url': "/", 'data': num if num > 0 else None } ``` (2) make it an add-on: ``` obj = {'name': "Home", 'url': "/"} if num > 0: obj['d...
Yes, just create the dictionary without the attribute, then create an if statement to add it if the condition is true: ``` def addSum(num): obj = { 'name': "Home", 'url': "/", } if num > 0: obj['data'] = num return obj ```
6,005,837
I'm trying to use `android.graphics.Movie` to play a GIF file from `/sdcard/download`. If I put the file in the `drawable` folder in the APK, I can load it using: ``` InputStream istr = context.getResources().openRawResource(R.drawable.animfile); Movie movie = Movie.decodeStream(istr); ``` That works. `movie.durati...
2011/05/15
[ "https://Stackoverflow.com/questions/6005837", "https://Stackoverflow.com", "https://Stackoverflow.com/users/727425/" ]
I ran into this as well. After much trial and error I got it to work using getContentResolver().openInputStream and the dead streamToBytes code in the android [BitmapDecode example](http://developer.android.com/resources/samples/ApiDemos/src/com/example/android/apis/graphics/BitmapDecode.html), which seems to work. I h...
``` is = new FileInputStream(file path); if (path != null) { try { byte[] array = streamToBytes(is); mMovie = Movie.decodeByteArray(array, 0, array.length); mDuration = mMovie....
6,005,837
I'm trying to use `android.graphics.Movie` to play a GIF file from `/sdcard/download`. If I put the file in the `drawable` folder in the APK, I can load it using: ``` InputStream istr = context.getResources().openRawResource(R.drawable.animfile); Movie movie = Movie.decodeStream(istr); ``` That works. `movie.durati...
2011/05/15
[ "https://Stackoverflow.com/questions/6005837", "https://Stackoverflow.com", "https://Stackoverflow.com/users/727425/" ]
You are right, except a one. You shouldn't use Uri and ContentResolver. Short solution is that you should use ``` Movie.decodeByteArray(array, 0, array.length) ``` instead of ``` Movie.decodeFile(path); ``` clue is in reset() method implementation of some stream that created inside the decodeFile(path) method.
``` is = new FileInputStream(file path); if (path != null) { try { byte[] array = streamToBytes(is); mMovie = Movie.decodeByteArray(array, 0, array.length); mDuration = mMovie....
26,433,067
I'm trying to add MVC 4 into an existing webforms project. I followed this guide: <https://www.packtpub.com/books/content/mixing-aspnet-webforms-and-aspnet-mvc> After adding to the web.config: ``` <add assembly="System.Core, Version=3.5.0.0, Culture=neutral,PublicKeyToken=B77A5C561934E089"/> <add assembly="Syst...
2014/10/17
[ "https://Stackoverflow.com/questions/26433067", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1759793/" ]
Ultimately, I ended taking my existing website and adding it to an MVC application, rather than going the other way around. The routing worked just fine then.
Try this, ``` public static void RegisterRoutes(System.Web.Routing.RouteCollection routes) { routes.IgnoreRoute("{resource}.axd/{*pathInfo}"); routes.MapRoute("Test", "{controller}/{action}/{id}", new { controller = "Home", action = "Index", id = UrlParameter.Optional }); } ```
26,433,067
I'm trying to add MVC 4 into an existing webforms project. I followed this guide: <https://www.packtpub.com/books/content/mixing-aspnet-webforms-and-aspnet-mvc> After adding to the web.config: ``` <add assembly="System.Core, Version=3.5.0.0, Culture=neutral,PublicKeyToken=B77A5C561934E089"/> <add assembly="Syst...
2014/10/17
[ "https://Stackoverflow.com/questions/26433067", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1759793/" ]
Ultimately, I ended taking my existing website and adding it to an MVC application, rather than going the other way around. The routing worked just fine then.
I think you might need to add an id parameter to the Index method in HomeController. Even though it's optional, the router is looking for a method that takes an id. Edit: Sorry, I don't know what I was thinking. This is wrong as demonstrated by the article you reference.
26,433,067
I'm trying to add MVC 4 into an existing webforms project. I followed this guide: <https://www.packtpub.com/books/content/mixing-aspnet-webforms-and-aspnet-mvc> After adding to the web.config: ``` <add assembly="System.Core, Version=3.5.0.0, Culture=neutral,PublicKeyToken=B77A5C561934E089"/> <add assembly="Syst...
2014/10/17
[ "https://Stackoverflow.com/questions/26433067", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1759793/" ]
Ultimately, I ended taking my existing website and adding it to an MVC application, rather than going the other way around. The routing worked just fine then.
Can you try out the following routing rules. This works for me in MVC4 projects. This defines what is the default page that will load when you navigate to some url and port like locallhost:4897 ``` public static void RegisterRoutes(RouteCollection routes) { routes.IgnoreRoute("{resource}.axd/{*pathInfo}"); rou...
48,230,561
I have a joomla site and i tried to use the font "Montserrat" from google on some classes. The font looks good on chrome and I.E., but looks bold or bolder on firefox. The css that i tried ``` p { font-weight: normal; } p { font-weight: 400; } ``` I found a thousand topics on internet, no solution.
2018/01/12
[ "https://Stackoverflow.com/questions/48230561", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7322619/" ]
I had the same problem and changed the SDK for my project from 10 to 1.8. Solved it. For IntelliJ, go to File --> Project Structure
I know this answer is a bit late, but I have just experienced a similar issue and stumbled on this question. The package you are referring to exists in different locations in different releases of Java. In my opinion, the simplest solution is to try to match the version of Java that was originally used to build the pr...
67,299
I picked up a new chest armor from the auction house, and it's a strange shade of blue that I've never seen, and it doesn't seem to match other items from its visual tier in terms of color. I *assume* that it's dyed, but I don't see any reference to this on the item itself, and I'm the kind of visual OCD that I'd like...
2012/05/17
[ "https://gaming.stackexchange.com/questions/67299", "https://gaming.stackexchange.com", "https://gaming.stackexchange.com/users/336/" ]
I know this is an old question, but there is in fact the following workaround! Equip the item, leave the game and logout (this step is required for your profile to be updated). Then log in at <http://battle.net>, click on Diablo III, navigate to your profile and select the character who has the item equipped. If the i...
Sadly, I don't think there is a mechanic in the game to identify the exact dye color that was applied. Although and arduous task, you may have to just sit through a youtube video that displays the dyes associated with your class and match up the name. **Males:** [Monk](http://www.youtube.com/watch?v=lcdKi8bujgs) [De...
67,299
I picked up a new chest armor from the auction house, and it's a strange shade of blue that I've never seen, and it doesn't seem to match other items from its visual tier in terms of color. I *assume* that it's dyed, but I don't see any reference to this on the item itself, and I'm the kind of visual OCD that I'd like...
2012/05/17
[ "https://gaming.stackexchange.com/questions/67299", "https://gaming.stackexchange.com", "https://gaming.stackexchange.com/users/336/" ]
I know this is an old question, but there is in fact the following workaround! Equip the item, leave the game and logout (this step is required for your profile to be updated). Then log in at <http://battle.net>, click on Diablo III, navigate to your profile and select the character who has the item equipped. If the i...
Here's what I would do to determine a dye color: * Screenshot the questionable item. You may want a front and back screenshot depending on which armor piece it is * Use a dye-remover and see if any colors change. + If it doesn't, the item is not dyed and is that color naturally. + If it does, you now know what col...
38,225,729
I have a problem in Eclipse with writing an array: ``` public class nizovi { int[] anArray; anArray = new int[10]; } ``` Eclipse says: > > "Syntax error on token ";" ,, expected" > > > As you can see, it looks perfectly fine. I don't know what is going on with it.
2016/07/06
[ "https://Stackoverflow.com/questions/38225729", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6556442/" ]
If you want to assign a value on class level, you must do it in one line: ``` public class nizovi { int[] anArray = new int[10]; } ```
I recomend you initialise your array in a constructor this way : ``` public class Nizovi { int[] anArray ; public Nizovi(){ this.anArray = new int[10]; } } ```
61,028,306
In the Windows Run dialog, I can use the command `shell:startup` to open the user's startup folder. In hope to be able to use the command in the Windows command line, I tried typing `shell` in the command prompt, but returned with the error message ``` 'shell' is not recognized as an internal or external command, op...
2020/04/04
[ "https://Stackoverflow.com/questions/61028306", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11439134/" ]
You can achieve this result using Expansion Tile: ``` bool _isExpanded = false; @override Widget build(BuildContext context) { return Scaffold( appBar: AppBar( title: Text('Expansion Tile'), ), drawer: Drawer( child: Column( children: <Widget>[ Expan...
You can make a custom drawer. [Check this example](https://dartpad.dev/a8764aff33b56e2435bb923075e6b11a) You can do something similar to achieve the results as in your image. Hope this helps!
18,759,375
Not being a particularly strong Javascript guy, I'm having a bit of trouble trying to update a lot of `Date` objects in Mongo. It seems that [`$inc` has not yet been implemented for `Date` objects](https://jira.mongodb.org/browse/SERVER-3174). So, to try and bump a bunch of dates by a day, I called (something like) th...
2013/09/12
[ "https://Stackoverflow.com/questions/18759375", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1193741/" ]
The problem is that my `$exists` query is (obviously, on second look) in the wrong place. Documents were being returned that, surely enough, didn't include `my_date`. Here's the patched up function, which works as expected. ``` var incrementDates = function() { db.blah.find({ ... , my_date : { $exists : true } ).fo...
Starting in `Mongo 4.2`, [`db.collection.update()`](https://docs.mongodb.com/master/reference/method/db.collection.update/index.html#db.collection.update) can accept an aggregation pipeline, finally allowing the update of a field based on its own value; thus avoiding inefficient find/foreach patterns. Also, you were l...
18,759,375
Not being a particularly strong Javascript guy, I'm having a bit of trouble trying to update a lot of `Date` objects in Mongo. It seems that [`$inc` has not yet been implemented for `Date` objects](https://jira.mongodb.org/browse/SERVER-3174). So, to try and bump a bunch of dates by a day, I called (something like) th...
2013/09/12
[ "https://Stackoverflow.com/questions/18759375", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1193741/" ]
The problem is that my `$exists` query is (obviously, on second look) in the wrong place. Documents were being returned that, surely enough, didn't include `my_date`. Here's the patched up function, which works as expected. ``` var incrementDates = function() { db.blah.find({ ... , my_date : { $exists : true } ).fo...
Starting in `Mongo 5.0`, it's a nice use case for the new [`$dateAdd`](https://docs.mongodb.com/v5.0/reference/operator/aggregation/dateAdd/#mongodb-expression-exp.-dateAdd) aggregation operator: ``` // { "date" : ISODate("2020-04-05T07:14:17.802Z"), "x" : "y" } db.collection.updateMany( { date : { $exists : true } ...
18,759,375
Not being a particularly strong Javascript guy, I'm having a bit of trouble trying to update a lot of `Date` objects in Mongo. It seems that [`$inc` has not yet been implemented for `Date` objects](https://jira.mongodb.org/browse/SERVER-3174). So, to try and bump a bunch of dates by a day, I called (something like) th...
2013/09/12
[ "https://Stackoverflow.com/questions/18759375", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1193741/" ]
Starting in `Mongo 4.2`, [`db.collection.update()`](https://docs.mongodb.com/master/reference/method/db.collection.update/index.html#db.collection.update) can accept an aggregation pipeline, finally allowing the update of a field based on its own value; thus avoiding inefficient find/foreach patterns. Also, you were l...
Starting in `Mongo 5.0`, it's a nice use case for the new [`$dateAdd`](https://docs.mongodb.com/v5.0/reference/operator/aggregation/dateAdd/#mongodb-expression-exp.-dateAdd) aggregation operator: ``` // { "date" : ISODate("2020-04-05T07:14:17.802Z"), "x" : "y" } db.collection.updateMany( { date : { $exists : true } ...
63,589,642
How can i select and compare x or y element value from a svg rect in jquery? svg looks like this: ``` <svg id="demo" width="100%" height="40" version="1.1" xmlns="http://www.w3.org/2000/svg"> <rect id="stretchy" x="20" y="40" width="100%" height="40" fill="#b7b7b7" stroke-width="5"></rect> <text x="50...
2020/08/26
[ "https://Stackoverflow.com/questions/63589642", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13322394/" ]
[![I Tested this some time ago.](https://i.stack.imgur.com/RcmaS.png)](https://i.stack.imgur.com/RcmaS.png) And what I found was, it returns an object, not a mention, and as you can't send an object, it will return as an empty message error. So to send a mention, you send: ``` // Getting the first and second users...
You can use: ```js message.mentions.users.array()[1] ``` To get the second user in a message. Appropriately, use `[2]` for the third, `[3]` for the fourth, and so on.
15,153,657
Workign on a script to send out emails when job has been completed. I added in a piece which I thought would prevent from emailing twice. Having trouble figuring out why. ```js function sendEmail() { var sheet = SpreadsheetApp.getActiveSheet(); var startRow = 2; var numRows = sheet.getLastRow(); var EMAIL_SE...
2013/03/01
[ "https://Stackoverflow.com/questions/15153657", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2122765/" ]
Your problem is your `var dataRange = sheet.getRange(startRow, 1, numRows, 3)`. Try to change `3` to something bigger than `9`, because of `var emailSent = row[9];`. When you read `emailSent` pay attention to read previous written status.
Let me clarify 2 things : 1. When you use `sheet.getRange(startRow + i, 9).setValue(EMAIL_SENT);` you are indeed writing the EMAIL-SENT label in column 9 because getRange works with column numbers starting from 1. 2. When yo read data in an array (that comes from a sheet range) the index in this array **starts on 0**,...
396,387
I am on windows 10, using QGIS 3.18. I have a shapefile with multiple entries (polygons) and a raster with a few pixel values. I would like to use a "select by ... " to select the entries within the '.shp' that intersect with specific pixel values. For example, try answering the question: Which entries (lines in my a...
2021/05/11
[ "https://gis.stackexchange.com/questions/396387", "https://gis.stackexchange.com", "https://gis.stackexchange.com/users/178188/" ]
Here is an example of the workflow. 1. Use `gdal_translate` to convert the raster to XYZ format. 2. Filter out **nodata** values from the resulting file. 3. Add a header to each set ("X Y value"). 4. Load the XYZ as a CSV file of Points. This converts the raster to a vector. 5. Do a spatial join using `Join Attributes...
Simply use this expression to get the raster value at a certain point (and convert lines etc. to points, see below). Be sure your vector- and raster-layers have the **same CRS** (projection): ``` raster_value('layer', 1,$geometry) ``` * `'layer'` is the name of the raster-layer * `1` is the number of the raster-band...
1,588,242
I was wondering whether the following command (from a .bat script): (1) connects to the mysql instance once and then executes script#1 followed by script#2, or (2) does it reconnect for each of the sql scripts? ``` mysql -B -b -h%HOST% -u%USER% -p%PASSWORD% %SCHEMA% < "scripts\create_and_populate.sql" < "scripts\upda...
2009/10/19
[ "https://Stackoverflow.com/questions/1588242", "https://Stackoverflow.com", "https://Stackoverflow.com/users/81520/" ]
You could maybe use a couple of scripts with [`SELECT CONNECTION_ID( );`](http://dev.mysql.com/doc/refman/5.0/en/information-functions.html#function_connection-id) to determine your theory, and then something like this: ``` copy scripts\create_and_populate.sql+scripts\update_joomla_article.sql scripts\temp\create_upda...
one more suggestion, does this work? ``` mysql -e script1 -e script2 -e script3 ```
2,754,905
I am binning a 2d array (x by y) in Python into the bins of its x value (given in "bins"), using np.digitize: ``` elements_to_bins = digitize(vals, bins) ``` where "vals" is a 2d array, i.e.: ``` vals = array([[1, v1], [2, v2], ...]). ``` elements\_to\_bins just says what bin each element falls into. What I the...
2010/05/02
[ "https://Stackoverflow.com/questions/2754905", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
If I understand your question correctly: ``` vals = array([[1, 10], [1, 11], [2, 20], [2, 21], [2, 22]]) # Example (x, y) = vals.T # Shortcut bin_limits = range(min(x)+1, max(x)+2) # Other limits could be chosen points_by_bin = [ [] for _ in bin_limits ] # Final result for (bin_num, y_value) in zip(searchsorted(b...
Are the bin keys just integers, no binning, as in your example ? Then you could just do this, without numpy: ``` from collections import defaultdict bins = defaultdict(list) # or [ [] ...] as in EOL vals = [[1, 10], [1, 11], [2, 20], [2, 21], [2, 22]] # nparray.tolist() for nbin, val in vals: bins[nbin].append(...
2,754,905
I am binning a 2d array (x by y) in Python into the bins of its x value (given in "bins"), using np.digitize: ``` elements_to_bins = digitize(vals, bins) ``` where "vals" is a 2d array, i.e.: ``` vals = array([[1, v1], [2, v2], ...]). ``` elements\_to\_bins just says what bin each element falls into. What I the...
2010/05/02
[ "https://Stackoverflow.com/questions/2754905", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
If I understand your question correctly: ``` vals = array([[1, 10], [1, 11], [2, 20], [2, 21], [2, 22]]) # Example (x, y) = vals.T # Shortcut bin_limits = range(min(x)+1, max(x)+2) # Other limits could be chosen points_by_bin = [ [] for _ in bin_limits ] # Final result for (bin_num, y_value) in zip(searchsorted(b...
This will return a data structure analogous to IDL HISTOGRAM's Reverse\_Indices: ``` ovec = np.argsort(vals) ivec = np.searchsorted(vals, bin_limits, sorter=ovec) ``` Then the list of elements that fall into bin #i is ``` ovec[ ivec[i] : ivec[i+1] ] ``` (my quick timing tests say this is 5x faster than EOL's algo...
2,754,905
I am binning a 2d array (x by y) in Python into the bins of its x value (given in "bins"), using np.digitize: ``` elements_to_bins = digitize(vals, bins) ``` where "vals" is a 2d array, i.e.: ``` vals = array([[1, v1], [2, v2], ...]). ``` elements\_to\_bins just says what bin each element falls into. What I the...
2010/05/02
[ "https://Stackoverflow.com/questions/2754905", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
This will return a data structure analogous to IDL HISTOGRAM's Reverse\_Indices: ``` ovec = np.argsort(vals) ivec = np.searchsorted(vals, bin_limits, sorter=ovec) ``` Then the list of elements that fall into bin #i is ``` ovec[ ivec[i] : ivec[i+1] ] ``` (my quick timing tests say this is 5x faster than EOL's algo...
Are the bin keys just integers, no binning, as in your example ? Then you could just do this, without numpy: ``` from collections import defaultdict bins = defaultdict(list) # or [ [] ...] as in EOL vals = [[1, 10], [1, 11], [2, 20], [2, 21], [2, 22]] # nparray.tolist() for nbin, val in vals: bins[nbin].append(...
69,296,521
does anyone know how to make a post request from Coinspot API? The information of how to put the API key, secret and nonce is not very clear --- All requests to the POST API requests will need to include the following security data. Headers key - Your API key generated from the settings page sign - The POST data is ...
2021/09/23
[ "https://Stackoverflow.com/questions/69296521", "https://Stackoverflow.com", "https://Stackoverflow.com/users/16981264/" ]
As the [documentation](https://learn.microsoft.com/en-us/windows/win32/api/processenv/nf-processenv-expandenvironmentstringsa) explains: > > `lpDst` > > > A pointer to a buffer that receives the result of expanding the environment variable strings in the *lpSrc* buffer. > > > The buffer needs to be supplied by ...
If you read the [doc](https://learn.microsoft.com/en-us/windows/win32/api/processenv/nf-processenv-expandenvironmentstringsa) > > `lpDst` > > > A pointer to a buffer that receives the result of expanding the environment variable strings in the lpSrc buffer. Note that this buffer cannot be the same as the lpSrc buff...
69,296,521
does anyone know how to make a post request from Coinspot API? The information of how to put the API key, secret and nonce is not very clear --- All requests to the POST API requests will need to include the following security data. Headers key - Your API key generated from the settings page sign - The POST data is ...
2021/09/23
[ "https://Stackoverflow.com/questions/69296521", "https://Stackoverflow.com", "https://Stackoverflow.com/users/16981264/" ]
ExpandEnvironmentStrings expects a buffer already allocated. You can determine the size of the buffer if [you pass a buffer with a size too small to hold the string](https://learn.microsoft.com/en-us/windows/win32/api/processenv/nf-processenv-expandenvironmentstringsa#return-value), like 0. So, here are two versions, ...
If you read the [doc](https://learn.microsoft.com/en-us/windows/win32/api/processenv/nf-processenv-expandenvironmentstringsa) > > `lpDst` > > > A pointer to a buffer that receives the result of expanding the environment variable strings in the lpSrc buffer. Note that this buffer cannot be the same as the lpSrc buff...
69,296,521
does anyone know how to make a post request from Coinspot API? The information of how to put the API key, secret and nonce is not very clear --- All requests to the POST API requests will need to include the following security data. Headers key - Your API key generated from the settings page sign - The POST data is ...
2021/09/23
[ "https://Stackoverflow.com/questions/69296521", "https://Stackoverflow.com", "https://Stackoverflow.com/users/16981264/" ]
As the [documentation](https://learn.microsoft.com/en-us/windows/win32/api/processenv/nf-processenv-expandenvironmentstringsa) explains: > > `lpDst` > > > A pointer to a buffer that receives the result of expanding the environment variable strings in the *lpSrc* buffer. > > > The buffer needs to be supplied by ...
ExpandEnvironmentStrings expects a buffer already allocated. You can determine the size of the buffer if [you pass a buffer with a size too small to hold the string](https://learn.microsoft.com/en-us/windows/win32/api/processenv/nf-processenv-expandenvironmentstringsa#return-value), like 0. So, here are two versions, ...
17,946,118
I have a thread that runs in a dll that I dynamic link with in my main app. Is there a way to wait for all threads in an .exe (including it's loaded dll's) without knowing the thread handle? Windows 7 x64, vc++ The thread is a function that does some processing on a certain file, it is not expected to return anything, ...
2013/07/30
[ "https://Stackoverflow.com/questions/17946118", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1083913/" ]
I never did this myself, but you could probably 1. create a snapshot using [`CreateToolhelp32Snapshot`](http://msdn.microsoft.com/en-us/library/windows/desktop/ms682489%28v=vs.85%29.aspx) 2. then enumerate the threads using [`Thread32First`](http://msdn.microsoft.com/en-us/library/windows/desktop/ms686728%28v=vs.85%29...
Another solution, assuming that all you want is to stop the main() function from running but not exit the process until any other threads are complete, is to call ``` ExitThread(GetCurrentThread()); ``` from within main(). If you don't call `ExitProcess`, either explicitly or by returning from main(), Windows will n...
65,323,129
I would like to take provided `enum` list and convert it to mine list. I am getting a list from a service Type and then I would like to convert it to mine `FieldTyp` via `DocumentFieldTypeConverter()` However, this dent work because `enum` is not valid at this point `dic.Add(i, Enum.GetName(rgl, FieldType));`I am tryi...
2020/12/16
[ "https://Stackoverflow.com/questions/65323129", "https://Stackoverflow.com", "https://Stackoverflow.com/users/14822988/" ]
Based on the traceback you have found this issue: [Selenium 3 is incompatible with Python 3.9](https://github.com/SeleniumHQ/selenium/issues/8762) [![enter image description here](https://i.stack.imgur.com/NxYsi.png)](https://i.stack.imgur.com/NxYsi.png) This is the fix for the issue: [DeprecationWarning of base64.en...
We were running into this issue as well, but going back to an older version of Python was not an option due to incompatibilities with other libraries. If you find yourself in the same spot, you can re-create the alias like so: ``` import base64 base64.encodestring = base64.encodebytes ``` In whatever your entry-poin...
20,346,053
I am using the page caching gem on Rails 4. I have a web server running nginx, app server running unicorn and rails, and db server running postgre. When page cache is generated on the app server, nginx will not serve the static files. Only after I set ``` config.serve_static_assets = true ``` where the page cache ...
2013/12/03
[ "https://Stackoverflow.com/questions/20346053", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2836837/" ]
This does a small job: ``` <?php $link = '<a href="http://www.my.com/app/319354212" class="hh"> with www </a> example <a href="http://my.com/app/319354212" class="hh"> No www </a> <a href="http://www.subdomain.my.com/app/319354212" class="hh"> Subdomain</a> <a href="http://www.yahoo.com/app/31...
``` <?php $link = '<a href="http://www.my.com/app/319354212" class="hh"> with www </a> example <a href="http://my.com/app/319354212" class="hh"> No www </a> <a href="http://www.subdomain.my.com/app/319354212" class="hh"> Subdomain</a> <a href="http://www.yahoo.com/app/319354212" class="hh"> yah...
20,346,053
I am using the page caching gem on Rails 4. I have a web server running nginx, app server running unicorn and rails, and db server running postgre. When page cache is generated on the app server, nginx will not serve the static files. Only after I set ``` config.serve_static_assets = true ``` where the page cache ...
2013/12/03
[ "https://Stackoverflow.com/questions/20346053", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2836837/" ]
``` <?php $link = '<a href="http://www.my.com/app/319354212" class="hh"> with www </a> example <a href="http://my.com/app/319354212" class="hh"> No www </a> <a href="http://www.subdomain.my.com/app/319354212" class="hh"> Subdomain</a> <a href="http://www.yahoo.com/app/319354212" class="hh"> yahoo</a> '; $p...
``` <?php $link = '<a href="http://www.my.com/app/319354212" class="hh"> with www </a> example <a href="http://my.com/app/319354212" class="hh"> No www </a> <a href="http://www.subdomain.my.com/app/319354212" class="hh"> Subdomain</a> <a href="http://www.yahoo.com/app/319354212" class="hh"> yah...
20,346,053
I am using the page caching gem on Rails 4. I have a web server running nginx, app server running unicorn and rails, and db server running postgre. When page cache is generated on the app server, nginx will not serve the static files. Only after I set ``` config.serve_static_assets = true ``` where the page cache ...
2013/12/03
[ "https://Stackoverflow.com/questions/20346053", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2836837/" ]
This does a small job: ``` <?php $link = '<a href="http://www.my.com/app/319354212" class="hh"> with www </a> example <a href="http://my.com/app/319354212" class="hh"> No www </a> <a href="http://www.subdomain.my.com/app/319354212" class="hh"> Subdomain</a> <a href="http://www.yahoo.com/app/31...
``` <?php $link = '<a href="http://www.my.com/app/319354212" class="hh"> with www </a> example <a href="http://my.com/app/319354212" class="hh"> No www </a> <a href="http://www.subdomain.my.com/app/319354212" class="hh"> Subdomain</a> <a href="http://www.yahoo.com/app/319354212" class="hh"> yahoo</a> '; $p...
24,765,001
I'd like to be able to retrieve the return value from a function in Oracle with c#. Currently, this is what I have: For SQL: ``` FUNCTION add_resource ( project_view BOOLEAN, project_id NUMBER, worker_id NUMBER, role_id NUMBER) RETURN NUMBER IS resource_id NUMBER; BEGIN INSERT INTO R...
2014/07/15
[ "https://Stackoverflow.com/questions/24765001", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3806441/" ]
You can't expect SQL Server to know that the date you passed in is meant to be the current date. How could it possibly tell? To SQL Server that date looks like any other date. SQL Server will correctly notify you if records with the predicate you applied are being changed. Issue a new SQL dependency at midnight each ...
maybe use "How to: Use SQL Server Change Tracking" <http://msdn.microsoft.com/en-us/library/cc305322(v=sql.110).aspx> There is sample code --- maybe you don't use equal = --> use > This will produce last 24 hours changes Select dbo.table.lastchangedate where dbo.table.lastchangedate > > DATE\_SUB(CURDATE(), INTE...
48,629,716
I have 4 tables. 1 with just sitenames. 3 tables, which contains sitenames and the ammount of hits on them for different user types. I need to make a report on the number of hits on thoose sites for each user type like this Site Userype1hits Userype2hits Userype3hits so in the select part I neeed to crosscheck wit...
2018/02/05
[ "https://Stackoverflow.com/questions/48629716", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4260492/" ]
You would use `left join`: ``` select sn.*, t1.cnt, t2.cnt, t3.cnt from sitenames sn left join table1 t1 on t1.name = sn.name left join table2 t2 on t2.name = sn.name left join table3 t3 on t3.name = sn.name; ``` Your question is vague on the field names. A `left join` keeps all rows i...
I did like this, googled some further as I did not get it to work even with the answer here, joins are totaly new to me. The internalusers, external and so on is just fake to post what I did here as I cant use the real names. ``` select s.Site,s2.Total_hits as 'Internalusers',s3.Total_Hits as 'ExternalUsers', s4.Tota...
56,881,908
I'm trying to get the values from a string builder , where I've converted the string builder to string to get values but not helping in fetching particular values. My String builder output is, ``` SN: 00486 Mode: 1 Temp. 15.4 C Fat............... 0.0% SNF............... 0.4% ``` well further replaced with char...
2019/07/04
[ "https://Stackoverflow.com/questions/56881908", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8989913/" ]
Remove the `buildToolsVersion` and try
Removing the buildToolsVersion did not work for me but updating my SDK tool helped me to solve the problem. First, update Android Update Build tools then change buildToolVersion to the latest one... Hope this fixes your problem.
1,765
Presently I am a married 55 year old man married with two grown kids. One of my term life insurance policies expires soon and they have offered me a policy that will never increase in price for the rest of my life. The premium is quite a bit higher and the amount is less than what I presently have. I do invest pretty ...
2010/06/05
[ "https://money.stackexchange.com/questions/1765", "https://money.stackexchange.com", "https://money.stackexchange.com/users/-1/" ]
The following is from [Wikipedia - Term life insurance](http://en.wikipedia.org/wiki/Term_life_insurance#Usage) (with very minor editing) > > Because term life insurance is a pure > death benefit, its primary use is to > provide coverage of financial > responsibilities, for the insured. > Such responsibilities ma...
If I were in your shoes, I would invest conservatively fully aware that for the next few years the stock market is going to be depressed, but then again, don't take that as advice. Every situation is different, weigh the pros and cons carefully and if required, consult a qualified professional.
1,765
Presently I am a married 55 year old man married with two grown kids. One of my term life insurance policies expires soon and they have offered me a policy that will never increase in price for the rest of my life. The premium is quite a bit higher and the amount is less than what I presently have. I do invest pretty ...
2010/06/05
[ "https://money.stackexchange.com/questions/1765", "https://money.stackexchange.com", "https://money.stackexchange.com/users/-1/" ]
Life insurance is not an investment -- by definition, since the companies need to take a profit out of it, the average amount paid in exceeds the amount paid out, yielding a negative rate of return. Get life insurance if your death would cause severe financial hardship for someone. If you have sufficient savings that ...
If I were in your shoes, I would invest conservatively fully aware that for the next few years the stock market is going to be depressed, but then again, don't take that as advice. Every situation is different, weigh the pros and cons carefully and if required, consult a qualified professional.
47,921,238
I am trying to get the amount of unique locations with type = city from this XML, but not sure how to do this.. I've been trying to apply counts, but this doesn't match up, I'll need to match a unique name aswell ``` <root> <report> <location name="Amsterdam" type="City"> <amtPeople>1 Million+<...
2017/12/21
[ "https://Stackoverflow.com/questions/47921238", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6932955/" ]
Use the count on distinct-values: ``` <?xml version="1.0" encoding="UTF-8"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xs="http://www.w3.org/2001/XMLSchema" exclude-result-prefixes="xs" version="2.0"> <xsl:template match="/"> <amtcities> <xsl:value-of select=...
1. why you using $log parameter is your XML store in this param? 2. As i notice that location/@type="City" are 4. 3. You can use `/root/report/location[@type='City']` only.
47,921,238
I am trying to get the amount of unique locations with type = city from this XML, but not sure how to do this.. I've been trying to apply counts, but this doesn't match up, I'll need to match a unique name aswell ``` <root> <report> <location name="Amsterdam" type="City"> <amtPeople>1 Million+<...
2017/12/21
[ "https://Stackoverflow.com/questions/47921238", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6932955/" ]
Use the count on distinct-values: ``` <?xml version="1.0" encoding="UTF-8"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xs="http://www.w3.org/2001/XMLSchema" exclude-result-prefixes="xs" version="2.0"> <xsl:template match="/"> <amtcities> <xsl:value-of select=...
**I use to assign param value manually its working fine:** ``` <xsl:param name="Log" select="doc('File.xml')"/> <xsl:variable name="AllCities" select="count($Log/root/report/location[@type='City'])"/> <xsl:template match="/"> <amtCities><xsl:value-of select="$AllCities"/></amtCities> </xsl:template> ``` I am usin...
47,921,238
I am trying to get the amount of unique locations with type = city from this XML, but not sure how to do this.. I've been trying to apply counts, but this doesn't match up, I'll need to match a unique name aswell ``` <root> <report> <location name="Amsterdam" type="City"> <amtPeople>1 Million+<...
2017/12/21
[ "https://Stackoverflow.com/questions/47921238", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6932955/" ]
Use the count on distinct-values: ``` <?xml version="1.0" encoding="UTF-8"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xs="http://www.w3.org/2001/XMLSchema" exclude-result-prefixes="xs" version="2.0"> <xsl:template match="/"> <amtcities> <xsl:value-of select=...
``` <xsl:param name="Log" select="doc('File.xml')"/> <xsl:template match="/"> <amtcities> <xsl:value-of select="count(distinct-values($Log/root/report/location[@type='City']/@name))"/> </amtcities> </xsl:template> ```
81,947
In my syllabus about electromagnetism, they state: "This surface charge density will not always be present, e.g. when considering two non-conducting dielectrics such surface charge density remains absent. However, at a perfect conductor, a surface charge density will be present. If one of the media (or both) carry a c...
2013/10/23
[ "https://physics.stackexchange.com/questions/81947", "https://physics.stackexchange.com", "https://physics.stackexchange.com/users/28246/" ]
The following relation describes the total electric flux density in a medium: ![enter image description here](https://i.stack.imgur.com/RcF57.png) In the previous equation, D is the total electric flux density, epsilon is the free space permittivity . E is the external applied electric field, and P is the polarizatio...
A simple line is as follows: 1. **Conductor is an equipotential volume.** If there were potential difference between any two points, free charges would flow to compensate for this difference, hence produce currents. If there is a current, it produces heat. However, due to energy conservation the heat cannot be produc...
19,585,729
When running an Asp.Net MVC application locally, everything runs fine but when application is deployed on the server, I am getting this error. ``` Could not load file or assembly 'WebGrease, Version=1.5.1.25624, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The located assembly's manife...
2013/10/25
[ "https://Stackoverflow.com/questions/19585729", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1283635/" ]
It was a mistake from our end whereby the actual root web config on the server had an incorrect `dependentAssembly` tag which consisted of: ``` <dependentAssembly> <assemblyIdentity name="WebGrease" publicKeyToken="31bf3856ad364e35" culture="neutral" /> <bindingRedirect oldVersion="0.0.0.0-1.3.0.0" new...
i just deleted everything in C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET\ its working ... if u r using framework 4 then try C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\
19,585,729
When running an Asp.Net MVC application locally, everything runs fine but when application is deployed on the server, I am getting this error. ``` Could not load file or assembly 'WebGrease, Version=1.5.1.25624, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The located assembly's manife...
2013/10/25
[ "https://Stackoverflow.com/questions/19585729", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1283635/" ]
It was a mistake from our end whereby the actual root web config on the server had an incorrect `dependentAssembly` tag which consisted of: ``` <dependentAssembly> <assemblyIdentity name="WebGrease" publicKeyToken="31bf3856ad364e35" culture="neutral" /> <bindingRedirect oldVersion="0.0.0.0-1.3.0.0" new...
I tried installing the latest version from Nuget: ``` install-package WebGrease ``` ReBuild the application twice and the error went away. hope it help somebody!
19,585,729
When running an Asp.Net MVC application locally, everything runs fine but when application is deployed on the server, I am getting this error. ``` Could not load file or assembly 'WebGrease, Version=1.5.1.25624, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The located assembly's manife...
2013/10/25
[ "https://Stackoverflow.com/questions/19585729", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1283635/" ]
It was a mistake from our end whereby the actual root web config on the server had an incorrect `dependentAssembly` tag which consisted of: ``` <dependentAssembly> <assemblyIdentity name="WebGrease" publicKeyToken="31bf3856ad364e35" culture="neutral" /> <bindingRedirect oldVersion="0.0.0.0-1.3.0.0" new...
I had the same error come up with my project as well. It turns out that there were several "XYZ-Copy.dll"'s in my bin directory that was causing the problem. I deleted all XYZ-copy.dll files and it worked.
19,585,729
When running an Asp.Net MVC application locally, everything runs fine but when application is deployed on the server, I am getting this error. ``` Could not load file or assembly 'WebGrease, Version=1.5.1.25624, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The located assembly's manife...
2013/10/25
[ "https://Stackoverflow.com/questions/19585729", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1283635/" ]
It was a mistake from our end whereby the actual root web config on the server had an incorrect `dependentAssembly` tag which consisted of: ``` <dependentAssembly> <assemblyIdentity name="WebGrease" publicKeyToken="31bf3856ad364e35" culture="neutral" /> <bindingRedirect oldVersion="0.0.0.0-1.3.0.0" new...
This was resolved by 1) running the Package Manager Console 2) in Console, type: 'Install-Package Microsoft.AspNet.Web.Optimization' Which resolved all the incorrect dependencies and Successfully added [Microsoft.AspNet.Web.Optimization](https://www.nuget.org/packages/Microsoft.AspNet.Web.Optimization/) to the Proje...
19,585,729
When running an Asp.Net MVC application locally, everything runs fine but when application is deployed on the server, I am getting this error. ``` Could not load file or assembly 'WebGrease, Version=1.5.1.25624, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The located assembly's manife...
2013/10/25
[ "https://Stackoverflow.com/questions/19585729", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1283635/" ]
i just deleted everything in C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET\ its working ... if u r using framework 4 then try C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\
This was resolved by 1) running the Package Manager Console 2) in Console, type: 'Install-Package Microsoft.AspNet.Web.Optimization' Which resolved all the incorrect dependencies and Successfully added [Microsoft.AspNet.Web.Optimization](https://www.nuget.org/packages/Microsoft.AspNet.Web.Optimization/) to the Proje...
19,585,729
When running an Asp.Net MVC application locally, everything runs fine but when application is deployed on the server, I am getting this error. ``` Could not load file or assembly 'WebGrease, Version=1.5.1.25624, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The located assembly's manife...
2013/10/25
[ "https://Stackoverflow.com/questions/19585729", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1283635/" ]
I tried installing the latest version from Nuget: ``` install-package WebGrease ``` ReBuild the application twice and the error went away. hope it help somebody!
This was resolved by 1) running the Package Manager Console 2) in Console, type: 'Install-Package Microsoft.AspNet.Web.Optimization' Which resolved all the incorrect dependencies and Successfully added [Microsoft.AspNet.Web.Optimization](https://www.nuget.org/packages/Microsoft.AspNet.Web.Optimization/) to the Proje...
19,585,729
When running an Asp.Net MVC application locally, everything runs fine but when application is deployed on the server, I am getting this error. ``` Could not load file or assembly 'WebGrease, Version=1.5.1.25624, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The located assembly's manife...
2013/10/25
[ "https://Stackoverflow.com/questions/19585729", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1283635/" ]
I had the same error come up with my project as well. It turns out that there were several "XYZ-Copy.dll"'s in my bin directory that was causing the problem. I deleted all XYZ-copy.dll files and it worked.
This was resolved by 1) running the Package Manager Console 2) in Console, type: 'Install-Package Microsoft.AspNet.Web.Optimization' Which resolved all the incorrect dependencies and Successfully added [Microsoft.AspNet.Web.Optimization](https://www.nuget.org/packages/Microsoft.AspNet.Web.Optimization/) to the Proje...
1,084,666
I found [this article](http://particletree.com/features/rediscovering-the-button-element/) and I decided that I liked the way they styled links and buttons. So I took the CSS from the article... ``` .buttons a, .buttons button{ display:block; float:left; margin:0 7px 0 0; background-color:#f5f5f5; ...
2009/07/05
[ "https://Stackoverflow.com/questions/1084666", "https://Stackoverflow.com", "https://Stackoverflow.com/users/99401/" ]
Try adding this to the CSS: ``` .buttons { text-align:center; margin: 0px auto 0px auto; } ``` The auto makes the margins equal on each side. The text-align is a bodge for older browsers. EDIT: ----- Add an extra div around the buttons called buttonwrapper. then apply this CSS ``` .buttonwrapper { pos...
I found that when you have a parent div float left and a child div you're trying to center, a lot of times people forget inheritance. HTML: ``` <div class="parent"> <div class="child"> Text </div> </div> ``` CSS: ``` .parent { float: left; width: 300px; } .child { float: none; /* ...
29,973
My husband and I have two children under 2 years old and have outgrown our current 1400 square foot home. My husband and I both work from home, and we have a day nanny who comes and helps with the kids. All five of us our falling over each other all day. We would like to acquire more space and more storage. *Backgrou...
2014/04/13
[ "https://money.stackexchange.com/questions/29973", "https://money.stackexchange.com", "https://money.stackexchange.com/users/14476/" ]
After a 6% commission to sell, you have $80K in equity. 20% down on a $400K house. 5% down will likely cost you PMI, and I don't know that you'll ever see a 3.14% rate. The realtor may very well have knowledge of the cost to finish a basement, but I don't ask my doctor for tax advice, and I'd not ask a realtor for c...
I am quite sure you can set up an office in your basement for a lot less than $15,000. Don't build any walls, install any flooring, or upgrade the ceiling. Just install more lights and plugs. Set up your desks, bookshelves and what not in whatever corner is furthest from noises like the laundry room or the furnace. The...
157,180
f(n) = log n^2; g(n) = log n + 5 => f(n) = Θ (g(n)) I think we can prove this for omega but how can we prove it for Big oh ? because if we simplify it to logn + logn <= logn +5 => logn<=5 is not true !
2023/01/29
[ "https://cs.stackexchange.com/questions/157180", "https://cs.stackexchange.com", "https://cs.stackexchange.com/users/157232/" ]
You might be looking for a [dictionary](https://en.wikipedia.org/wiki/Dictionary_(data%20structure)). Common implementations are [hash tables](https://en.wikipedia.org/wiki/Hash_table) and [binary search trees](https://en.wikipedia.org/wiki/Binary_search_tree).
Another common name for such a "map" data structure is *Map*. That's what it is called in [C++](https://cplusplus.com/reference/map/map/), [Java](https://docs.oracle.com/en/java/javase/19/docs/api/java.base/java/util/Map.html), [ECMAScript](https://tc39.es/ecma262/#sec-map-objects), [PHP](https://php.net/manual/en/clas...
38,407,167
I am going through some "badly" designed pages that have a hierarchy that looks something like this... ``` <h1> <span id=English>English</span> </h1> <div>go</div> <p>verb - to move from one place to another</p> <h1 id=Spanish>Spanish</h1> <div>va</div> <p>verb - to move from one place to another</p> ``` The poi...
2016/07/16
[ "https://Stackoverflow.com/questions/38407167", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4400804/" ]
You can use `following-sibling::p` and limit the result to `1`. For example, the following XPath should return `<p>verb - to move from one place to another</p>` : ``` //h1[@id='Spanish']/following-sibling::p[1] ```
You can try by using [preceding](https://developer.mozilla.org/en-US/docs/Web/XPath/Axes/preceding) axes as below :- ``` //p[preceding::h1[@id='Spanish']] ``` Hope it helps...:)
48,087,128
I'm beginning at Django and I don't know why but it seems like Django can't find my static folder. Here's how I did it : ``` # IN MY SETTINGS FILE STATIC_URL = '/static/' # IN MY APP "accounts", IN base.html {% load static %} <link rel="stylesheet" type="text/css" href="{% static 'accounts/basic.css' %}"> # (MAIN ...
2018/01/04
[ "https://Stackoverflow.com/questions/48087128", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9166624/" ]
Make sure to add these two lines to the `settings.py` file ``` STATIC_URL = '/static/' STATIC_ROOT = os.path.join(BASE_DIR, 'static') ``` Or use `STATICFILES_DIRS` instead of `STATIC_ROOT` if it does not work ``` STATIC_URL = '/static/' STATICFILES_DIRS = ( os.path.join(BASE_DIR, 'static/'), ) ``` Also make ...
You can keep your static files anywhere you want by defining a path in the `STATICFILES_DIRS` but @taoufik method is right there is nothing wrong defining the path like that.
3,795,677
How to prove this combinatorial summation : $$ \sum\_{i = 1}^{n} (-1)^i k^{n-i} \binom{n}{i} = (k-1)^n - k^n $$ here k is a constant positive integer. I've hadn't any luck with proving this nor do i know the approach to this summation. I found this formula using wolfram alpha.
2020/08/18
[ "https://math.stackexchange.com/questions/3795677", "https://math.stackexchange.com", "https://math.stackexchange.com/users/788152/" ]
By the Binomial Theorem, we have, $$(-1 + k)^{n} = \sum\_{i = 0}^{n}{n\choose i} (-1)^{i} k^{n - i}.$$ Can you finish from here?
Recognizing that adding $k^n$ to both sides gives you an instance of the binomial theorem is definitely the nicest approach, but there actually is another that isn’t *too* bad. Since the righthand side is negative, it’s natural to multiply through by $-1$ first to get $$\sum\_{i=1}^n(-1)^{i+1}k^{n-i}\binom{n}i=k^n-(k...
9,617,536
I'm following this [tutorial](http://blogs.msdn.com/b/stuartleeks/archive/2011/01/25/asp-net-mvc-3-integrating-with-the-jquery-ui-date-picker-and-adding-a-jquery-validate-date-range-validator.aspx) to display a datepicker when I click into a textbox... But the date picker doesn't display... **Model Class (Reservation)...
2012/03/08
[ "https://Stackoverflow.com/questions/9617536", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1221246/" ]
I think your view is missing a reference to the ="~/Scripts/jquery-1.5.1.js" script.
I think your partial view may need to be named DateTime.cshtml to match the type of your model property.
9,617,536
I'm following this [tutorial](http://blogs.msdn.com/b/stuartleeks/archive/2011/01/25/asp-net-mvc-3-integrating-with-the-jquery-ui-date-picker-and-adding-a-jquery-validate-date-range-validator.aspx) to display a datepicker when I click into a textbox... But the date picker doesn't display... **Model Class (Reservation)...
2012/03/08
[ "https://Stackoverflow.com/questions/9617536", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1221246/" ]
Your partial view model is not called because the DataType of your property is wrong. Replace ``` [DataType(DataType.DateTime)] ``` with ``` [DataType(DataType.Date)] ``` and everything should work as intended. **Edit** You should also remove the `@inherits`line from your partial view as inherits is not allowed...
I think your partial view may need to be named DateTime.cshtml to match the type of your model property.
9,617,536
I'm following this [tutorial](http://blogs.msdn.com/b/stuartleeks/archive/2011/01/25/asp-net-mvc-3-integrating-with-the-jquery-ui-date-picker-and-adding-a-jquery-validate-date-range-validator.aspx) to display a datepicker when I click into a textbox... But the date picker doesn't display... **Model Class (Reservation)...
2012/03/08
[ "https://Stackoverflow.com/questions/9617536", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1221246/" ]
Your partial view model is not called because the DataType of your property is wrong. Replace ``` [DataType(DataType.DateTime)] ``` with ``` [DataType(DataType.Date)] ``` and everything should work as intended. **Edit** You should also remove the `@inherits`line from your partial view as inherits is not allowed...
I think your view is missing a reference to the ="~/Scripts/jquery-1.5.1.js" script.
248,594
I'm trying to resolve some issues under monitoring, the main one being " **Content databases contain orphaned items**". However, the 'repair automatically' is disabled and I don't know how to repair 'manually'. I'm logged onto the server with the domain admin account, the same one that originally installed Sharepoint s...
2018/09/07
[ "https://sharepoint.stackexchange.com/questions/248594", "https://sharepoint.stackexchange.com", "https://sharepoint.stackexchange.com/users/78431/" ]
**By default**, the `Repair Automatically` option is disabled for `Content databases contain orphaned items.`. **To enable the `Automatic Repair`, do the following:** * Central Administrator > Monitoring > Click on `Review rule definitions`. * Below `Availability` category > Find the `Content databases contain orphan...
Also it is possible to run from the following command from powershell ``` (Get-SPContentDatabase).Repair($true) ``` which will give the output - ``` <OrphanedObjects Count="0" /> ```
12,623,480
I'm using WatiN 2.1.0 (C#) with IE 9 on Windows 7 64 bit. My problem is that calling this function ``` ie.FileUpload(Find.ByName(someRegExp)).Set(fileName); ``` is extremely slow. I mean object is nicely found. This code opens file dialog, but it starts to type file name after really long time, about 3 to 5 minu...
2012/09/27
[ "https://Stackoverflow.com/questions/12623480", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1387438/" ]
Ok, this is not a Watin solution per say, but we had the exact same problem; our file browser tests took up a lot of the total test time, and I solved it by kicking out Watin for fileuploads and instead use the (horrific) UIAutomation framework. Example usage: ``` public CustomFileUpload FileUpload { ...
I also experienced 3 to 5 minute delays before WatiN started typing the file name in the file upload dialog box. This seems to happen to me whenever the developer tools pane is open in IE. When it is not open, typing starts right away. Prompts about default browser and similar popups also seems to cause the delay.
12,623,480
I'm using WatiN 2.1.0 (C#) with IE 9 on Windows 7 64 bit. My problem is that calling this function ``` ie.FileUpload(Find.ByName(someRegExp)).Set(fileName); ``` is extremely slow. I mean object is nicely found. This code opens file dialog, but it starts to type file name after really long time, about 3 to 5 minu...
2012/09/27
[ "https://Stackoverflow.com/questions/12623480", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1387438/" ]
Ok, this is not a Watin solution per say, but we had the exact same problem; our file browser tests took up a lot of the total test time, and I solved it by kicking out Watin for fileuploads and instead use the (horrific) UIAutomation framework. Example usage: ``` public CustomFileUpload FileUpload { ...
I had a slightly simpler solution (again relying on automation, but only for selecting the file) I used .ClickNoWait() on the file input which did not cause the browser to hang. I then wrote an extension method to set the file I want to select: ``` public static void UploadFile(this Browser browser, string uploadPath...
12,623,480
I'm using WatiN 2.1.0 (C#) with IE 9 on Windows 7 64 bit. My problem is that calling this function ``` ie.FileUpload(Find.ByName(someRegExp)).Set(fileName); ``` is extremely slow. I mean object is nicely found. This code opens file dialog, but it starts to type file name after really long time, about 3 to 5 minu...
2012/09/27
[ "https://Stackoverflow.com/questions/12623480", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1387438/" ]
I had a slightly simpler solution (again relying on automation, but only for selecting the file) I used .ClickNoWait() on the file input which did not cause the browser to hang. I then wrote an extension method to set the file I want to select: ``` public static void UploadFile(this Browser browser, string uploadPath...
I also experienced 3 to 5 minute delays before WatiN started typing the file name in the file upload dialog box. This seems to happen to me whenever the developer tools pane is open in IE. When it is not open, typing starts right away. Prompts about default browser and similar popups also seems to cause the delay.
321,029
In *Donkey Kong 64*, one of the minigames is "Beaver Bother" where you try to herd beavers into a hole. I've tried this a whole bunch and am having a really hard time beating it. My strategy has been pretty much to just run up to the beaver closest to the hole and spam the B button, which the tutorial says is supposed...
2017/11/08
[ "https://gaming.stackexchange.com/questions/321029", "https://gaming.stackexchange.com", "https://gaming.stackexchange.com/users/47878/" ]
There's not much of a secret as there's only so many things you can do. You have the right idea to try and get the ones in that are closest to the hole, however, the way in which you move may make a difference in how it is panning out. If you go straight at them, it does very little to nothing, but if you move toward t...
Both of the videos in the above post get it wrong. You'lll notice, in particular, the "good way" doesn't actually work in the first video; the narrator's method consistently fails even as he's describing why it allegedly works. However, he wins the game because he's, however inadvertently, approximating the method belo...
13,322,122
I'm suffered from resizing image from original resolution image, which is about 8MP, my output resolution is about 2MP. Sometimes, it show memory warning for iPhone4S device, and I did some release in memorywarning, but it sometimes make my program crash for alassetlibrary usage problem. Here's my question, I want to...
2012/11/10
[ "https://Stackoverflow.com/questions/13322122", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1797501/" ]
I found it was reduced much when I use 3rd party JPEG decode library(libjpeg-turbo) to decode&resize it under 2048x2048 UIImage.(even the total memory is not reduced much.) So the memory wanring happen so often may be caused by creating UIImage larger than 2Kx2K. Hope this helps.
I am using the below code ``` -(UIImage*) generateThumbnailFromImage:(UIImage*)mainImage { UIImage * thumbnail; CGSize destinationSize = CGSizeMake(thumbnail image width,thumbnail image height); UIGraphicsBeginImageContext(destinationSize); [mainImage drawInRect:CGRectMake(0,0,destinationSize.width, ...
45,680,686
I got this custome directive: ``` angular.module('uvox-player').directive('customOnChange', function() { return { restrict: 'A', link: function (scope, element, attrs) { var onChangeHandler = scope.$eval(attrs.customOnChange); element.bind('change', onChangeHandler); ...
2017/08/14
[ "https://Stackoverflow.com/questions/45680686", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1433073/" ]
Maybe not the best way but my solution was installing [miniconda](https://docs.conda.io/en/latest/miniconda.html). You can also probably try the larger Anaconda distribution. I believe these distributions have built-in python-dev.
This is because virtualenv not link include and lib directory to virtualenv's directory. I solve this by using anaconda virtual env. wish helps.