qid
int64
1
74.7M
question
stringlengths
15
58.3k
date
stringlengths
10
10
metadata
list
response_j
stringlengths
4
30.2k
response_k
stringlengths
11
36.5k
15,118,828
I don't know JQuery but am looking to create a box that populates with different content based on clicks from a navigation bar above. Thanks for any help!
2013/02/27
[ "https://Stackoverflow.com/questions/15118828", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1499522/" ]
To achieve this, you should read up on the basic concepts of jQuery, in particular the jQuery [click](http://api.jquery.com/click/) and [html](http://api.jquery.com/html/)/[text](http://api.jquery.com/text/) functions. In the most basic form, you would use it something like this: ``` $('#myNavLink').click(function(){...
This is a very broad question and has answers all over the internet; however, to get you started you will want to check out the following syntax: ``` var value = '<p>Here is my new content that came from my database, fetched using Ajax & jQuery!</p>'; $('#mydiv').html(value); ``` Mind you that the code above is very...
15,118,828
I don't know JQuery but am looking to create a box that populates with different content based on clicks from a navigation bar above. Thanks for any help!
2013/02/27
[ "https://Stackoverflow.com/questions/15118828", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1499522/" ]
As I said in my comment on the question, this question is too broad and I expect it will get closed by the community. But I thought I'd offer a couple of pointers: 1. You can trigger a function call when an element is clicked by having jQuery hook up a `click` handler on that element. You need to be able to tell jQuer...
This is a very broad question and has answers all over the internet; however, to get you started you will want to check out the following syntax: ``` var value = '<p>Here is my new content that came from my database, fetched using Ajax & jQuery!</p>'; $('#mydiv').html(value); ``` Mind you that the code above is very...
3,422,711
Let $A$ be an $n\times n$ symmetric matrix with coefficient $\mathbb{R}$ and $S$ be a nonsingular matrix. Then does the signature of $S^tAS$ equal that of $A$?
2019/11/05
[ "https://math.stackexchange.com/questions/3422711", "https://math.stackexchange.com", "https://math.stackexchange.com/users/697599/" ]
First let's solve an easier integral that doesn't have the denominator squared, namely:$$y(t)=\int\_0^\infty \frac{\cos(tx)}{\color{blue}{1+x^2}}dx=\int\_0^\infty \cos(tx){\color{blue}{\int\_0^\infty \sin y e^{-xy}dy}}dx$$ $$={\int\_0^\infty}\sin y{\color{red}{\int\_0^\infty \cos(tx)e^{-xy}dx}}dy=\int\_0^\infty \frac{{...
Another way to do it is to note that$$\frac{1}{x^2+t^2}=\frac{1}{2it}\left(\frac{1}{x-it}-\frac{1}{x+it}\right)\implies\frac{1}{(x^2+t^2)^2}=\frac{-1}{4t^2}\left(\frac{1}{(x-it)^2}+\frac{1}{(x+it)^2}+\frac{i}{t}\left(\frac{1}{x-it}-\frac{1}{x+it}\right)\right).$$The $e^{ix}$ in $\cos x$ doesn't diverge when $x=i\infty$...
31,271,549
In a bash script I have to match strings that begin with exactly 3 times with the string `lo`; so `lololoba` is good, `loloba` is bad, `lololololoba` is good, `balololo` is bad. I tried with this pattern: `"^$str1/{$n,}"` but it doesn't work, how can I do it? *EDIT:* According to OPs comment, `lololololoba` is bad n...
2015/07/07
[ "https://Stackoverflow.com/questions/31271549", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3928445/" ]
This should work: ``` pat="^(lo){3}" s="lolololoba" [[ $s =~ $pat ]] && echo good || echo bad ``` *EDIT (As per OPs comment):* If you want to match exactly 3 times (i.e `lolololoba` and such should be unmatched): change the `pat="^(lo){3}"` to: ``` pat="^(lo){3}(l[^o]|[^l].)" ```
You can use following regex : ``` ^(lo){3}.*$ ``` Instead of `lo` you can put your variable. See demo <https://regex101.com/r/sI8zQ6/1>
31,271,549
In a bash script I have to match strings that begin with exactly 3 times with the string `lo`; so `lololoba` is good, `loloba` is bad, `lololololoba` is good, `balololo` is bad. I tried with this pattern: `"^$str1/{$n,}"` but it doesn't work, how can I do it? *EDIT:* According to OPs comment, `lololololoba` is bad n...
2015/07/07
[ "https://Stackoverflow.com/questions/31271549", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3928445/" ]
You can use following regex : ``` ^(lo){3}.*$ ``` Instead of `lo` you can put your variable. See demo <https://regex101.com/r/sI8zQ6/1>
You can use this `awk` to match **exactly** 3 occurrences of `lo` at the beginning: ``` # input file cat file lololoba balololo loloba lololololoba lololo # awk command to print only valid lines awk -F '^(lo){3}' 'NF == 2 && !($2 ~ /^lo/)' file lololoba lololo ```
31,271,549
In a bash script I have to match strings that begin with exactly 3 times with the string `lo`; so `lololoba` is good, `loloba` is bad, `lololololoba` is good, `balololo` is bad. I tried with this pattern: `"^$str1/{$n,}"` but it doesn't work, how can I do it? *EDIT:* According to OPs comment, `lololololoba` is bad n...
2015/07/07
[ "https://Stackoverflow.com/questions/31271549", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3928445/" ]
You can use following regex : ``` ^(lo){3}.*$ ``` Instead of `lo` you can put your variable. See demo <https://regex101.com/r/sI8zQ6/1>
As per your comment: ``` ... more than 3 is bad so "lolololoba" is not good! ``` You'll find that @Jahid's answer doesn't fit (as his gives you "good" to that test string. To use his answer with the correct regex: ``` pat="^(lo){3}(?\!lo)" s="lolololoba" [[ $s =~ $pat ]] && echo good || echo bad ``` This verifi...
31,271,549
In a bash script I have to match strings that begin with exactly 3 times with the string `lo`; so `lololoba` is good, `loloba` is bad, `lololololoba` is good, `balololo` is bad. I tried with this pattern: `"^$str1/{$n,}"` but it doesn't work, how can I do it? *EDIT:* According to OPs comment, `lololololoba` is bad n...
2015/07/07
[ "https://Stackoverflow.com/questions/31271549", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3928445/" ]
This should work: ``` pat="^(lo){3}" s="lolololoba" [[ $s =~ $pat ]] && echo good || echo bad ``` *EDIT (As per OPs comment):* If you want to match exactly 3 times (i.e `lolololoba` and such should be unmatched): change the `pat="^(lo){3}"` to: ``` pat="^(lo){3}(l[^o]|[^l].)" ```
You can use this `awk` to match **exactly** 3 occurrences of `lo` at the beginning: ``` # input file cat file lololoba balololo loloba lololololoba lololo # awk command to print only valid lines awk -F '^(lo){3}' 'NF == 2 && !($2 ~ /^lo/)' file lololoba lololo ```
31,271,549
In a bash script I have to match strings that begin with exactly 3 times with the string `lo`; so `lololoba` is good, `loloba` is bad, `lololololoba` is good, `balololo` is bad. I tried with this pattern: `"^$str1/{$n,}"` but it doesn't work, how can I do it? *EDIT:* According to OPs comment, `lololololoba` is bad n...
2015/07/07
[ "https://Stackoverflow.com/questions/31271549", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3928445/" ]
This should work: ``` pat="^(lo){3}" s="lolololoba" [[ $s =~ $pat ]] && echo good || echo bad ``` *EDIT (As per OPs comment):* If you want to match exactly 3 times (i.e `lolololoba` and such should be unmatched): change the `pat="^(lo){3}"` to: ``` pat="^(lo){3}(l[^o]|[^l].)" ```
As per your comment: ``` ... more than 3 is bad so "lolololoba" is not good! ``` You'll find that @Jahid's answer doesn't fit (as his gives you "good" to that test string. To use his answer with the correct regex: ``` pat="^(lo){3}(?\!lo)" s="lolololoba" [[ $s =~ $pat ]] && echo good || echo bad ``` This verifi...
62,688,328
I am trying to create tabs in my layout. But instead of showing tab it is showing the below screen in design: [![enter image description here](https://i.stack.imgur.com/WwGzK.png)](https://i.stack.imgur.com/WwGzK.png) Below is the code: ``` **activity_mail.xml** <?xml version="1.0" encoding="utf-8"?> <LinearLayout ...
2020/07/02
[ "https://Stackoverflow.com/questions/62688328", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13109658/" ]
JavaScript is case sensitive. ``` clinet.on("message", Message => {}); ``` In the following you defined message parameter with a capital "M". So you need to mention the Message with a capital M. Here's the fix for args V ``` let args = Message.content.slice(prefix.length).trim().split(' '); ``` Hope This helps.
The error is pretty self-explanatory. You've got `message` on one line and `Message` on another. JavaScript variables are case-sensitive. You also can't have `message` defined outside of a scope *`client.on()` in this case*. I recommend putting everything that requires messages into your `client.on('Message', Message =...
62,688,328
I am trying to create tabs in my layout. But instead of showing tab it is showing the below screen in design: [![enter image description here](https://i.stack.imgur.com/WwGzK.png)](https://i.stack.imgur.com/WwGzK.png) Below is the code: ``` **activity_mail.xml** <?xml version="1.0" encoding="utf-8"?> <LinearLayout ...
2020/07/02
[ "https://Stackoverflow.com/questions/62688328", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13109658/" ]
JavaScript is case sensitive. ``` clinet.on("message", Message => {}); ``` In the following you defined message parameter with a capital "M". So you need to mention the Message with a capital M. Here's the fix for args V ``` let args = Message.content.slice(prefix.length).trim().split(' '); ``` Hope This helps.
Make sure to keep the "args" var inside a client.on callback. Like this: ```js client.on('message', message => { let args = message.content.slice(prefix.length).trim().split(' '); }) ```
69,847,905
I started learning Flutter this week. I'm trying to get the position of the device using the Geolocator package but I'm not used to async functions. I want to use the position.latitude inside the Text of AppBar title. I wrote < position information goes here > in the code to show the right place. Below is my code. ```...
2021/11/05
[ "https://Stackoverflow.com/questions/69847905", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11356556/" ]
1. Your page must be stateful in order to change it state. Stateless widget are static, you can use them when your Widgets don't change and the user doesn't interact with the screen. 2. You have to call the setState() method, so your page know's something has changed. 3. Later, if you desire to evolve your code, use st...
I don't know exactly how do you want to use it. But I will give my solution as I understood the issue. First, change StatelessWidget to StatefulWidget. Then you can define the position variable inside the HomeScreen class and set the current position to. Then send this variable as a parameter to the buildAppbar functi...
38,125,599
I really want to know, how can I click a button inside a Bootstrap modal after I've open it by clicking its link: ``` <a href="#" data-toggle="modal" data-target="#myid"> ``` Buttons have ids', so I think I can click the button using **js**, but I don't really know how to deal with this. Could I use a function such...
2016/06/30
[ "https://Stackoverflow.com/questions/38125599", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6449926/" ]
```js $('#myModal').on('shown.bs.modal', function (event) { $("#newBtn").trigger("click"); }); $("#newBtn").on("click",function(){ alert("button inside modal clicked"); }) ``` ```html <link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css"> <script src="https:...
Call the trigger on the modal shown event ``` $('#myid').on('shown.bs.modal', function () { $("#buttonid").trigger('click'); }); ```
96,557
In Dybjer's *Inductive Families* the author present a method to derive an eliminator/induction principle for every inductive family of types. In particular for the type of finite lists, namely $$List' \colon (A \colon set) (n \colon N) set$$ we get the eliminator $$\begin{align\*} listrec' \colon &(A \colon set)\\ & ...
2018/08/23
[ "https://cs.stackexchange.com/questions/96557", "https://cs.stackexchange.com", "https://cs.stackexchange.com/users/27248/" ]
> > I am totally lost on how to approach this problem since the eliminator seems to be able to provide just function defined on the whole family List′A(n) and not on the sub-family List′A(s(n)). > > > The typical trick in this situation is to pick a `C` such that you can pretend you are defining a function on the ...
What follows is just a little modification of the idea proposed in the accepted answer, nevertheless I think it can be of interest to other readers. Here's a way to build tail We can consider the predicate $P \colon (A\colon set)(n \colon N)(l \colon List'\_A n)set$ defined (by recursion on natural numbers) as the o...
1,025,803
Given the follwing class - I would like to know which of the both members is abstract: ``` abstract class Test { public abstract bool Abstract { get; set; } public bool NonAbstract { get; set; } } var type = typeof( Test ); var abs = type.GetProperty( "Abstract" ); var nonAbs = type.GetProperty( "NonAbstract" ); ...
2009/06/22
[ "https://Stackoverflow.com/questions/1025803", "https://Stackoverflow.com", "https://Stackoverflow.com/users/52444/" ]
A property is actually some 'syntactic sugar', and is implemented by 2 methods: a getter method and a setter method. So, I think that you should be able to determine if a property is abstract by checking if the getter and/or setter are abstract, like this: ``` PropertyInfo pi = ... if( pi.GetSetMethod().IsAbstract )...
First off: fields can't be abstract, since all there is to them is the field itself. Next we note that properties are (in a loose sense!) actually get\_/set\_ methods under the hood. Next we check what *does* have an `IsAbstract` property, and see that `MethodBase` (and so `MethodInfo`) does. Finally we remember/kno...
32,211,793
I am really having trouble wrapping my head around the deferred() method inside jquery. I've spent several hours reading the documentation, but I still don't fully understand what I'm doing. My basic problem is, I have a series of functions (not ajax calls) that I want to run in sequence, but stop all processes if th...
2015/08/25
[ "https://Stackoverflow.com/questions/32211793", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1245564/" ]
You cannot share deferred objects. You should create a different promise from a deferred for each function. Here is some very simple example, using sycnhronus functions for the sake of simplicity, although promises are meant to be used with asynchronous functions: ``` var func1 = function(arg){ var dfd = jQuery.D...
You will need a separate `$.deferred()` inside each of your functions, because you want to return unique promise for each function. ``` //Private method var _myPrivateFunction1 = function(userID) { var deferred = $.Deferred(); if(userID >= 10) { //All is good, set var vOne to true and run next function...
13,679,608
\**Note: \** I'm new here. If you're going to downvote please tell me why. I'm writing a java chess program using swing. I'm able to display the board, initialize pieces, and store them in a two dimensional array. However, I can't figure out how to display the pieces on my canvas. I keep getting a null pointer error o...
2012/12/03
[ "https://Stackoverflow.com/questions/13679608", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1811341/" ]
* Dont call `drawPiece()` from your constructor for what reason? I think [`repaint()`](http://docs.oracle.com/javase/7/docs/api/java/awt/Component.html#repaint%28%29) might be what you need. * dont use `getGraphics()` as it wont be initialized yet until the panel is added and first repaint is done if im not mistaken. *...
It seems like your variable `board` is not initialized yet. You need to call `setCanvas()` first to initialize it, then you can call `drawPiece()`.
47,491,642
After changing my theme on my website, my articles do not show the hole article. it seems to only display the first part of the article and then it shows [...] I have changed the settings to display hole article. Am i missing another setting or is this a code error? You can view the website here [www.greywatershop.com...
2017/11/25
[ "https://Stackoverflow.com/questions/47491642", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2130954/" ]
Elegant solution for a two characters alphabet ---------------------------------------------- Since you only have two letters in your alphabet, an elegant solution could be to use binary decomposition of integers (`a` represents a binary `0` and `b` represents a `1`). Here's the algorithm you could implement: ``` pri...
By following @Dici's approach, I've written this code that specifically solves my problem. ``` public class SigmaStar { //max length of word, just to limit the execution //change it with your own value private static final int MAX_LENGTH = 4; public static void main(String[] args) { int wordLength = 0; int c...
11,567,134
I am using several SharedPreferences to store data in my app. Some preferences are used in a lot of activites. I know that the SharedPreferences are internally backed by a map for fast read-access and written to sdcard when settings are changed. I wonder which way is better if a sharedpreference is accessed by a lot...
2012/07/19
[ "https://Stackoverflow.com/questions/11567134", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1164971/" ]
`SharedPreferences` are managed internally by Android as singletons. You can get as many instances as you want using: ``` context.getSharedPreferences(name, mode); ``` as long as you use the same **name**, you'll always get the same **instance**. Therefore there are no concurrency problems.
I will prefer using a **singleton** class for preference, *initialize preference once by application context*. create getter and setter(get/put) methods to add, update and delete data. This way it will create instance once and can be more readable,reusable.
11,567,134
I am using several SharedPreferences to store data in my app. Some preferences are used in a lot of activites. I know that the SharedPreferences are internally backed by a map for fast read-access and written to sdcard when settings are changed. I wonder which way is better if a sharedpreference is accessed by a lot...
2012/07/19
[ "https://Stackoverflow.com/questions/11567134", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1164971/" ]
It is worth reviewing the [sources](http://grepcode.com/file_/repository.grepcode.com/java/ext/com.google.android/android/2.3.7_r1/android/app/ContextImpl.java/?v=source) that show that a `Context` instance (be it an `Activity` or an `Application` instance) share the same static map `HashMap<String, SharedPreferencesIm...
I will prefer using a **singleton** class for preference, *initialize preference once by application context*. create getter and setter(get/put) methods to add, update and delete data. This way it will create instance once and can be more readable,reusable.
11,567,134
I am using several SharedPreferences to store data in my app. Some preferences are used in a lot of activites. I know that the SharedPreferences are internally backed by a map for fast read-access and written to sdcard when settings are changed. I wonder which way is better if a sharedpreference is accessed by a lot...
2012/07/19
[ "https://Stackoverflow.com/questions/11567134", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1164971/" ]
I will prefer using a **singleton** class for preference, *initialize preference once by application context*. create getter and setter(get/put) methods to add, update and delete data. This way it will create instance once and can be more readable,reusable.
We can make a Preferences Singleton Class and make instance of that class in extended Application class with applicationContext, so we may use that object in whole application I have made a sharedPreferenceManager Class and make a static object by providing applicationContext. Now static object can be accessible anywhe...
11,567,134
I am using several SharedPreferences to store data in my app. Some preferences are used in a lot of activites. I know that the SharedPreferences are internally backed by a map for fast read-access and written to sdcard when settings are changed. I wonder which way is better if a sharedpreference is accessed by a lot...
2012/07/19
[ "https://Stackoverflow.com/questions/11567134", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1164971/" ]
It is worth reviewing the [sources](http://grepcode.com/file_/repository.grepcode.com/java/ext/com.google.android/android/2.3.7_r1/android/app/ContextImpl.java/?v=source) that show that a `Context` instance (be it an `Activity` or an `Application` instance) share the same static map `HashMap<String, SharedPreferencesIm...
`SharedPreferences` are managed internally by Android as singletons. You can get as many instances as you want using: ``` context.getSharedPreferences(name, mode); ``` as long as you use the same **name**, you'll always get the same **instance**. Therefore there are no concurrency problems.
11,567,134
I am using several SharedPreferences to store data in my app. Some preferences are used in a lot of activites. I know that the SharedPreferences are internally backed by a map for fast read-access and written to sdcard when settings are changed. I wonder which way is better if a sharedpreference is accessed by a lot...
2012/07/19
[ "https://Stackoverflow.com/questions/11567134", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1164971/" ]
`SharedPreferences` are managed internally by Android as singletons. You can get as many instances as you want using: ``` context.getSharedPreferences(name, mode); ``` as long as you use the same **name**, you'll always get the same **instance**. Therefore there are no concurrency problems.
We can make a Preferences Singleton Class and make instance of that class in extended Application class with applicationContext, so we may use that object in whole application I have made a sharedPreferenceManager Class and make a static object by providing applicationContext. Now static object can be accessible anywhe...
11,567,134
I am using several SharedPreferences to store data in my app. Some preferences are used in a lot of activites. I know that the SharedPreferences are internally backed by a map for fast read-access and written to sdcard when settings are changed. I wonder which way is better if a sharedpreference is accessed by a lot...
2012/07/19
[ "https://Stackoverflow.com/questions/11567134", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1164971/" ]
It is worth reviewing the [sources](http://grepcode.com/file_/repository.grepcode.com/java/ext/com.google.android/android/2.3.7_r1/android/app/ContextImpl.java/?v=source) that show that a `Context` instance (be it an `Activity` or an `Application` instance) share the same static map `HashMap<String, SharedPreferencesIm...
We can make a Preferences Singleton Class and make instance of that class in extended Application class with applicationContext, so we may use that object in whole application I have made a sharedPreferenceManager Class and make a static object by providing applicationContext. Now static object can be accessible anywhe...
3,101,545
I'm trying to index the GAC and use the `ResolveAssemblyReferences` target. However, some assemblies (such as Unity application block) seem to be missing from the GAC and yet VS happily shows them in the Add Reference dialog. My question: how can this be? I always thought that only GAC-registered assemblies appear ther...
2010/06/23
[ "https://Stackoverflow.com/questions/3101545", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9476/" ]
In addition to the registry setting ckramer mentioned, there is also `HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\.NETFramework\v2.0.50727\AssemblyFoldersEx` and `HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\.NETFramework\v4.0.30319\AssemblyFoldersEx`. Tip: if you download the [VS 2010 Pro Power Tools](http://visualstudiogallery.m...
There is actually a registry setting which allows you to add directories to the list of locations where Visual Studio will search for assemblies to display in the "Add References" dialog. [Here](http://www.csharp411.com/adding-assemblies-to-the-visual-studio-add-reference-dialog/) is a quick overview of where it is an...
14,896,607
My application is navigation based and mainly runs in portrait orientation, But one view controller supports both portrait and landscape orientation. Now the problem is, When I push the new viewcontroller from landscape view controller, the new view controller is also pushed in landscape mode though i want it in portra...
2013/02/15
[ "https://Stackoverflow.com/questions/14896607", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1838063/" ]
I found a solution to this. It's bloody witchcraft, but it works. When you install the client, open **Control Panel > Network Connections**. You'll see a disabled network connection that was added by the TAP installer (Local Area Connection 3 or some such). Right Click it, click **Enable**. The device will not rese...
It seems to me you are using the wrong version... TAP-Win32 should not be installed on the 64bit version. Download the right one and try again!
65,028,698
I have two files. File1 with data ``` DF2SVT-(.CD(),.CP(clk),.D(),.SDN(),.Q(na)); OAI3DSVT-(.A1(na),.A2(),.A3(),.B(),.ZN(y)); GLHSVT-(.D(v),.E(),.Q(y)); DCCDSVT-(.I(w),.ZN(y)); ``` and file2 with data ``` GLHSVT-(.D(v),.E(),.Q(y)); ``` If the line in file2 is present in file1 then remove that line from file1 a...
2020/11/26
[ "https://Stackoverflow.com/questions/65028698", "https://Stackoverflow.com", "https://Stackoverflow.com/users/12346657/" ]
Read the lines of both files into a separate variables. Iterate over the lines of the first file, and for each of one them check if they exist on the second file, if not then save them into the first file. ``` with open(file1, "r") as file1: lines_file1 = file1.readlines() with open(file, "r") as file2: line...
You can use **set operations** to do this with few lines of code. Read two file and convert the list of lines into the set and use set operations ``` line_file1 = set(line_file1) line_file2 = set(line_file2) result = line_file1 - line_file2 ``` Now write the **result** set each element (line) to the file. **Note**...
64,904
I need to support exact phrases (enclosed in quotes) in an otherwise space-separated list of terms. Thus splitting the respective string by the space-character is not sufficient anymore. Example: ``` input : 'foo bar "lorem ipsum" baz' output: ['foo', 'bar', 'lorem ipsum', 'baz'] ``` I wonder whether this could be ...
2008/09/15
[ "https://Stackoverflow.com/questions/64904", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
``` 'foo bar "lorem ipsum" baz'.match(/"[^"]*"|\w+/g); ``` the bounding quotes get included though
Expanding on the accepted answer, here's a search engine parser that, * can match phrases or words * treats phrases as regular expressions * does a boolean OR across multiple properties (e.g. item.title and item.body) * handles negation of words or phrases when they are prefixed with - Treating phrases as regular exp...
64,904
I need to support exact phrases (enclosed in quotes) in an otherwise space-separated list of terms. Thus splitting the respective string by the space-character is not sufficient anymore. Example: ``` input : 'foo bar "lorem ipsum" baz' output: ['foo', 'bar', 'lorem ipsum', 'baz'] ``` I wonder whether this could be ...
2008/09/15
[ "https://Stackoverflow.com/questions/64904", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
``` var str = 'foo bar "lorem ipsum" baz'; var results = str.match(/("[^"]+"|[^"\s]+)/g); ``` ... returns the array you're looking for. Note, however: * Bounding quotes are included, so can be removed with `replace(/^"([^"]+)"$/,"$1")` on the results. * Spaces between the quotes will stay intact. So, if there a...
One that's easy to understand and a general solution. Works for all delimiters and 'join' characters. Also supports 'joined' words that are more than two words in length.... ie lists like `"hello my name is 'jon delaware smith fred' I have a 'long name'"`.... A bit like the answer by AC but a bit neater... ``` func...
64,904
I need to support exact phrases (enclosed in quotes) in an otherwise space-separated list of terms. Thus splitting the respective string by the space-character is not sufficient anymore. Example: ``` input : 'foo bar "lorem ipsum" baz' output: ['foo', 'bar', 'lorem ipsum', 'baz'] ``` I wonder whether this could be ...
2008/09/15
[ "https://Stackoverflow.com/questions/64904", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
A simple regular expression will do but leave the quotation marks. e.g. ``` 'foo bar "lorem ipsum" baz'.match(/("[^"]*")|([^\s"]+)/g) output: ['foo', 'bar', '"lorem ipsum"', 'baz'] ``` edit: beaten to it by shyamsundar, sorry for the double answer
``` 'foo bar "lorem ipsum" baz'.match(/"[^"]*"|\w+/g); ``` the bounding quotes get included though
64,904
I need to support exact phrases (enclosed in quotes) in an otherwise space-separated list of terms. Thus splitting the respective string by the space-character is not sufficient anymore. Example: ``` input : 'foo bar "lorem ipsum" baz' output: ['foo', 'bar', 'lorem ipsum', 'baz'] ``` I wonder whether this could be ...
2008/09/15
[ "https://Stackoverflow.com/questions/64904", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
Try this: ``` var input = 'foo bar "lorem ipsum" baz'; var R = /(\w|\s)*\w(?=")|\w+/g; var output = input.match(R); output is ["foo", "bar", "lorem ipsum", "baz"] ``` Note there are no extra double quotes around lorem ipsum Although it assumes the input has the double quotes in the right place: ``` var input2 = ...
how about, ``` output = /(".+?"|\w+)/g.exec(input) ``` then do a pass on output to lose the quotes. alternately, ``` output = /"(.+?)"|(\w+)/g.exec(input) ``` then do a pass n output to lose the empty captures.
64,904
I need to support exact phrases (enclosed in quotes) in an otherwise space-separated list of terms. Thus splitting the respective string by the space-character is not sufficient anymore. Example: ``` input : 'foo bar "lorem ipsum" baz' output: ['foo', 'bar', 'lorem ipsum', 'baz'] ``` I wonder whether this could be ...
2008/09/15
[ "https://Stackoverflow.com/questions/64904", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
``` var str = 'foo bar "lorem ipsum" baz'; var results = str.match(/("[^"]+"|[^"\s]+)/g); ``` ... returns the array you're looking for. Note, however: * Bounding quotes are included, so can be removed with `replace(/^"([^"]+)"$/,"$1")` on the results. * Spaces between the quotes will stay intact. So, if there a...
A simple regular expression will do but leave the quotation marks. e.g. ``` 'foo bar "lorem ipsum" baz'.match(/("[^"]*")|([^\s"]+)/g) output: ['foo', 'bar', '"lorem ipsum"', 'baz'] ``` edit: beaten to it by shyamsundar, sorry for the double answer
64,904
I need to support exact phrases (enclosed in quotes) in an otherwise space-separated list of terms. Thus splitting the respective string by the space-character is not sufficient anymore. Example: ``` input : 'foo bar "lorem ipsum" baz' output: ['foo', 'bar', 'lorem ipsum', 'baz'] ``` I wonder whether this could be ...
2008/09/15
[ "https://Stackoverflow.com/questions/64904", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
``` 'foo bar "lorem ipsum" baz'.match(/"[^"]*"|\w+/g); ``` the bounding quotes get included though
One that's easy to understand and a general solution. Works for all delimiters and 'join' characters. Also supports 'joined' words that are more than two words in length.... ie lists like `"hello my name is 'jon delaware smith fred' I have a 'long name'"`.... A bit like the answer by AC but a bit neater... ``` func...
64,904
I need to support exact phrases (enclosed in quotes) in an otherwise space-separated list of terms. Thus splitting the respective string by the space-character is not sufficient anymore. Example: ``` input : 'foo bar "lorem ipsum" baz' output: ['foo', 'bar', 'lorem ipsum', 'baz'] ``` I wonder whether this could be ...
2008/09/15
[ "https://Stackoverflow.com/questions/64904", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
ES6 solution supporting: * Split by space except for inside quotes * Removing quotes but not for backslash escaped quotes * Escaped quote become quote Code: ``` input.match(/\\?.|^$/g).reduce((p, c) => { if(c === '"'){ p.quote ^= 1; }else if(!p.quote && c === ' '){ p.a.push(''...
Expanding on the accepted answer, here's a search engine parser that, * can match phrases or words * treats phrases as regular expressions * does a boolean OR across multiple properties (e.g. item.title and item.body) * handles negation of words or phrases when they are prefixed with - Treating phrases as regular exp...
64,904
I need to support exact phrases (enclosed in quotes) in an otherwise space-separated list of terms. Thus splitting the respective string by the space-character is not sufficient anymore. Example: ``` input : 'foo bar "lorem ipsum" baz' output: ['foo', 'bar', 'lorem ipsum', 'baz'] ``` I wonder whether this could be ...
2008/09/15
[ "https://Stackoverflow.com/questions/64904", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
A simple regular expression will do but leave the quotation marks. e.g. ``` 'foo bar "lorem ipsum" baz'.match(/("[^"]*")|([^\s"]+)/g) output: ['foo', 'bar', '"lorem ipsum"', 'baz'] ``` edit: beaten to it by shyamsundar, sorry for the double answer
how about, ``` output = /(".+?"|\w+)/g.exec(input) ``` then do a pass on output to lose the quotes. alternately, ``` output = /"(.+?)"|(\w+)/g.exec(input) ``` then do a pass n output to lose the empty captures.
64,904
I need to support exact phrases (enclosed in quotes) in an otherwise space-separated list of terms. Thus splitting the respective string by the space-character is not sufficient anymore. Example: ``` input : 'foo bar "lorem ipsum" baz' output: ['foo', 'bar', 'lorem ipsum', 'baz'] ``` I wonder whether this could be ...
2008/09/15
[ "https://Stackoverflow.com/questions/64904", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
``` var str = 'foo bar "lorem ipsum" baz'; var results = str.match(/("[^"]+"|[^"\s]+)/g); ``` ... returns the array you're looking for. Note, however: * Bounding quotes are included, so can be removed with `replace(/^"([^"]+)"$/,"$1")` on the results. * Spaces between the quotes will stay intact. So, if there a...
``` 'foo bar "lorem ipsum" baz'.match(/"[^"]*"|\w+/g); ``` the bounding quotes get included though
64,904
I need to support exact phrases (enclosed in quotes) in an otherwise space-separated list of terms. Thus splitting the respective string by the space-character is not sufficient anymore. Example: ``` input : 'foo bar "lorem ipsum" baz' output: ['foo', 'bar', 'lorem ipsum', 'baz'] ``` I wonder whether this could be ...
2008/09/15
[ "https://Stackoverflow.com/questions/64904", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
Thanks a lot for the quick responses! Here's a summary of the options, for posterity: ``` var input = 'foo bar "lorem ipsum" baz'; output = input.match(/("[^"]+"|[^"\s]+)/g); output = input.match(/"[^"]*"|\w+/g); output = input.match(/("[^"]*")|([^\s"]+)/g) output = /(".+?"|\w+)/g.exec(input); output = /"(.+?)"|(\w+...
ES6 solution supporting: * Split by space except for inside quotes * Removing quotes but not for backslash escaped quotes * Escaped quote become quote Code: ``` input.match(/\\?.|^$/g).reduce((p, c) => { if(c === '"'){ p.quote ^= 1; }else if(!p.quote && c === ' '){ p.a.push(''...
51,046,476
I am trying to import the account circle icon from material-ui icons, but I am getting this error: > > export 'default' (imported as 'AccountCircle') was not found in '@material-ui/icons/es'. > > > I am not sure what it means. Thanks in advance.
2018/06/26
[ "https://Stackoverflow.com/questions/51046476", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8684976/" ]
Assuming your `photos` array contains an array of file system paths of the uploaded photos, Your FormData should be looped through like this: ``` const data = new FormData() photos.forEach((element, i) => { const newFile = { uri: element, type: 'image/jpg' } data.append('files', newFile) }); ``` Then you ...
``` const data = new FormData() photos.forEach((element, i) => { const newFile = { uri: element, type: 'image/jpg' } data.append('files[]', newFile) }); ``` docs say <https://developer.mozilla.org/en-US/docs/Web/API/FormData/append#Example>
15,676,722
I want to build a graph in jqchart where i need to get two arrays Now i want to perform operation as given below.Which is giving error ofcourse. ``` html $.ajax( { type: "GET", url: "customer_coverage.php", data: {id:id}, contentType: "application/json", ...
2013/03/28
[ "https://Stackoverflow.com/questions/15676722", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1814087/" ]
no need to echo json encode two times....merge the array and send the data....... ``` echo json_encode(array('result1'=>$arr1,'result2'=>$arr2)); ``` and get data by ``` initChart2(data.result1,data.result2); ```
You cannot get multiple object like that. For a JSON object, you will need to have single object. So what you can do is, create a wrapper object put those two array inside it. So basically, your php code will be: ``` <?php $arr= array(); $arr['arr1'] = $arr1; $arr['arr2'] = $arr2; echo json_encode($arr); ?> ``` So...
15,676,722
I want to build a graph in jqchart where i need to get two arrays Now i want to perform operation as given below.Which is giving error ofcourse. ``` html $.ajax( { type: "GET", url: "customer_coverage.php", data: {id:id}, contentType: "application/json", ...
2013/03/28
[ "https://Stackoverflow.com/questions/15676722", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1814087/" ]
You cannot get multiple object like that. For a JSON object, you will need to have single object. So what you can do is, create a wrapper object put those two array inside it. So basically, your php code will be: ``` <?php $arr= array(); $arr['arr1'] = $arr1; $arr['arr2'] = $arr2; echo json_encode($arr); ?> ``` So...
You need to combine both array using `array_merge()`. **Example** ``` $response = array(); $response = array_merge($arr1,$arr2); echo json_encode($response); ```
15,676,722
I want to build a graph in jqchart where i need to get two arrays Now i want to perform operation as given below.Which is giving error ofcourse. ``` html $.ajax( { type: "GET", url: "customer_coverage.php", data: {id:id}, contentType: "application/json", ...
2013/03/28
[ "https://Stackoverflow.com/questions/15676722", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1814087/" ]
See if you are able to produce two object arrays of json then you can try with this: ``` var data21,data22; $.ajax({ type: "GET", url: "customer_coverage.php", data: {id:id}, contentType: "application/json", dataType: "json", success: function (data) { ...
You cannot get multiple object like that. For a JSON object, you will need to have single object. So what you can do is, create a wrapper object put those two array inside it. So basically, your php code will be: ``` <?php $arr= array(); $arr['arr1'] = $arr1; $arr['arr2'] = $arr2; echo json_encode($arr); ?> ``` So...
15,676,722
I want to build a graph in jqchart where i need to get two arrays Now i want to perform operation as given below.Which is giving error ofcourse. ``` html $.ajax( { type: "GET", url: "customer_coverage.php", data: {id:id}, contentType: "application/json", ...
2013/03/28
[ "https://Stackoverflow.com/questions/15676722", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1814087/" ]
no need to echo json encode two times....merge the array and send the data....... ``` echo json_encode(array('result1'=>$arr1,'result2'=>$arr2)); ``` and get data by ``` initChart2(data.result1,data.result2); ```
You need to combine both array using `array_merge()`. **Example** ``` $response = array(); $response = array_merge($arr1,$arr2); echo json_encode($response); ```
15,676,722
I want to build a graph in jqchart where i need to get two arrays Now i want to perform operation as given below.Which is giving error ofcourse. ``` html $.ajax( { type: "GET", url: "customer_coverage.php", data: {id:id}, contentType: "application/json", ...
2013/03/28
[ "https://Stackoverflow.com/questions/15676722", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1814087/" ]
no need to echo json encode two times....merge the array and send the data....... ``` echo json_encode(array('result1'=>$arr1,'result2'=>$arr2)); ``` and get data by ``` initChart2(data.result1,data.result2); ```
See if you are able to produce two object arrays of json then you can try with this: ``` var data21,data22; $.ajax({ type: "GET", url: "customer_coverage.php", data: {id:id}, contentType: "application/json", dataType: "json", success: function (data) { ...
15,676,722
I want to build a graph in jqchart where i need to get two arrays Now i want to perform operation as given below.Which is giving error ofcourse. ``` html $.ajax( { type: "GET", url: "customer_coverage.php", data: {id:id}, contentType: "application/json", ...
2013/03/28
[ "https://Stackoverflow.com/questions/15676722", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1814087/" ]
See if you are able to produce two object arrays of json then you can try with this: ``` var data21,data22; $.ajax({ type: "GET", url: "customer_coverage.php", data: {id:id}, contentType: "application/json", dataType: "json", success: function (data) { ...
You need to combine both array using `array_merge()`. **Example** ``` $response = array(); $response = array_merge($arr1,$arr2); echo json_encode($response); ```
45,786,448
I created a standard nav menu. my `home.html` has a slider component. this slider component can be navigated using few links that invoke the `goToSlide()` method exposed using ``` @ViewChild(Slides) slides: Slides; ``` As the side navigator menu is implemented and accessible via `app.component.ts` so how do i get a...
2017/08/20
[ "https://Stackoverflow.com/questions/45786448", "https://Stackoverflow.com", "https://Stackoverflow.com/users/135982/" ]
You can use [Events](https://ionicframework.com/docs/api/util/Events/). In your `home.ts` file subscribe to an event that will change the current slide: ``` import { Events } from 'ionic-angular'; @ViewChild(Slides) slides: Slides; constructor(public events: Events) { events.subscribe('slider:slideTo', (index) => ...
You could just insert a slider component on that page too? If you want the slider component to be defined only in the app component you could: 1.: emit an event in the home.ts which would be listened to in the app.component. 2.: make a slider.service.ts which you inject in your he component and in your app.component...
10,781,185
What I am trying to do is something similar to how collaborative editor works. I want to allow two people to edit the same document. And for this I have to simulate an artificial caret. I can extract the other user's activity in term of addition and deletion at specified location in a textarea. I will then transmit th...
2012/05/28
[ "https://Stackoverflow.com/questions/10781185", "https://Stackoverflow.com", "https://Stackoverflow.com/users/538191/" ]
have you seen this? <https://github.com/benjamn/kix-standalone/> This is how google docs does it: <https://drive.googleblog.com/2010/05/whats-different-about-new-google-docs.html>
Have you tried Draft.js, from facebook ? <https://facebook.github.io/draft-js/> "Draft.js is a framework for building rich text editors in React, powered by an immutable model and abstracting over cross-browser differences. Draft.js makes it easy to build any type of rich text input, whether you're just looking to ...
10,781,185
What I am trying to do is something similar to how collaborative editor works. I want to allow two people to edit the same document. And for this I have to simulate an artificial caret. I can extract the other user's activity in term of addition and deletion at specified location in a textarea. I will then transmit th...
2012/05/28
[ "https://Stackoverflow.com/questions/10781185", "https://Stackoverflow.com", "https://Stackoverflow.com/users/538191/" ]
You could mimic a caret with a special character and do the regex to insert the partner text and move his caret, and you can use the real one. This is the simplest design I can think. To get the idead, you could use the pipe `|` as a artificial caret. but this would easily conflict with user insert a pipe, to avoid thi...
Have you tried Draft.js, from facebook ? <https://facebook.github.io/draft-js/> "Draft.js is a framework for building rich text editors in React, powered by an immutable model and abstracting over cross-browser differences. Draft.js makes it easy to build any type of rich text input, whether you're just looking to ...
22,714,820
I have an image to be used a background in activity: ![enter image description here](https://i.stack.imgur.com/MfXu0.png) I want this image to fit screen by its height. It means that for wide-screen smartphones, I want my image to be fit by height and centered: ![enter image description here](https://i.stack.imgur.c...
2014/03/28
[ "https://Stackoverflow.com/questions/22714820", "https://Stackoverflow.com", "https://Stackoverflow.com/users/674548/" ]
Your evaluation of the different `scaleType`'s is correct. If you want the whole image to be visible, use `"centerInside"`, or if you want to fill the whole view then use `centerCrop`. To use a mix of both, you can set the `scaleType` in your `onCreate()` method. Based on the behavior you want to have, you can check t...
You can have two layouts, one for each of your configurations. You can then load the proper one at the activity's onCreate() call.
22,714,820
I have an image to be used a background in activity: ![enter image description here](https://i.stack.imgur.com/MfXu0.png) I want this image to fit screen by its height. It means that for wide-screen smartphones, I want my image to be fit by height and centered: ![enter image description here](https://i.stack.imgur.c...
2014/03/28
[ "https://Stackoverflow.com/questions/22714820", "https://Stackoverflow.com", "https://Stackoverflow.com/users/674548/" ]
Your evaluation of the different `scaleType`'s is correct. If you want the whole image to be visible, use `"centerInside"`, or if you want to fill the whole view then use `centerCrop`. To use a mix of both, you can set the `scaleType` in your `onCreate()` method. Based on the behavior you want to have, you can check t...
Use `centerCrop` because `centerInside` doesn't scale an image in a view and you have to create the image with appropriate height to achieve wide-screened smartphones background filling. Or alternative you could use `fitCenter` to get uniformly scaled image by both axes which fills the all background.
22,714,820
I have an image to be used a background in activity: ![enter image description here](https://i.stack.imgur.com/MfXu0.png) I want this image to fit screen by its height. It means that for wide-screen smartphones, I want my image to be fit by height and centered: ![enter image description here](https://i.stack.imgur.c...
2014/03/28
[ "https://Stackoverflow.com/questions/22714820", "https://Stackoverflow.com", "https://Stackoverflow.com/users/674548/" ]
Your evaluation of the different `scaleType`'s is correct. If you want the whole image to be visible, use `"centerInside"`, or if you want to fill the whole view then use `centerCrop`. To use a mix of both, you can set the `scaleType` in your `onCreate()` method. Based on the behavior you want to have, you can check t...
When you fit one side of image to background, you will face with two problems, first one is screen width is bigger than image's width or screen height is bigger than image height.So you will have empty space. If you do not want to face with resolution problem and you want to fit both side of image to background, you n...
22,714,820
I have an image to be used a background in activity: ![enter image description here](https://i.stack.imgur.com/MfXu0.png) I want this image to fit screen by its height. It means that for wide-screen smartphones, I want my image to be fit by height and centered: ![enter image description here](https://i.stack.imgur.c...
2014/03/28
[ "https://Stackoverflow.com/questions/22714820", "https://Stackoverflow.com", "https://Stackoverflow.com/users/674548/" ]
You can have two layouts, one for each of your configurations. You can then load the proper one at the activity's onCreate() call.
Use `centerCrop` because `centerInside` doesn't scale an image in a view and you have to create the image with appropriate height to achieve wide-screened smartphones background filling. Or alternative you could use `fitCenter` to get uniformly scaled image by both axes which fills the all background.
22,714,820
I have an image to be used a background in activity: ![enter image description here](https://i.stack.imgur.com/MfXu0.png) I want this image to fit screen by its height. It means that for wide-screen smartphones, I want my image to be fit by height and centered: ![enter image description here](https://i.stack.imgur.c...
2014/03/28
[ "https://Stackoverflow.com/questions/22714820", "https://Stackoverflow.com", "https://Stackoverflow.com/users/674548/" ]
When you fit one side of image to background, you will face with two problems, first one is screen width is bigger than image's width or screen height is bigger than image height.So you will have empty space. If you do not want to face with resolution problem and you want to fit both side of image to background, you n...
Use `centerCrop` because `centerInside` doesn't scale an image in a view and you have to create the image with appropriate height to achieve wide-screened smartphones background filling. Or alternative you could use `fitCenter` to get uniformly scaled image by both axes which fills the all background.
50,050,858
So I have a recursive solution to the make change problem that works sometimes. It is: ``` def change(n, c): if (n == 0): return 1 if (n < 0): return 0; if (c + 1 <= 0 and n >= 1): return 0 return change(n, c - 1) + change(n - coins[c - 1], c); ``` where coins is my array of coins. F...
2018/04/26
[ "https://Stackoverflow.com/questions/50050858", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5906043/" ]
As suggested in the answers above you could use DP for a more optimal solution. Also your conditional check - `if (c + 1 <= 0 and n >= 1)` should be `if (c <= 1 ):` as n will always be >=1 and c <= 1 will prevent any calculations if the number of coins is lesser than or equal to 1.
While using recursion you will always run into this. If you set the recursion limit higher, you may be able to use your algorithm on a bigger number, but you will always be limited. The recursion limit is there to keep you from getting a stack overflow. The best way to solved for bigger change amounts would be to swa...
50,050,858
So I have a recursive solution to the make change problem that works sometimes. It is: ``` def change(n, c): if (n == 0): return 1 if (n < 0): return 0; if (c + 1 <= 0 and n >= 1): return 0 return change(n, c - 1) + change(n - coins[c - 1], c); ``` where coins is my array of coins. F...
2018/04/26
[ "https://Stackoverflow.com/questions/50050858", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5906043/" ]
As suggested in the answers above you could use DP for a more optimal solution. Also your conditional check - `if (c + 1 <= 0 and n >= 1)` should be `if (c <= 1 ):` as n will always be >=1 and c <= 1 will prevent any calculations if the number of coins is lesser than or equal to 1.
Note that you have a bug here: ``` if (c + 1 <= 0 and n >= 1): ``` is like ``` if (c <= -1 and n >= 1): ``` So `c` can be 0 and pass to the next step where you pass `c-1` to the index, which works because python doesn't mind negative indexes but still false (`coins[-1]` yields `25`), so your solution sometimes pr...
60,749,076
After Applying a rotation or a translation matrix on the vertex array, the vertex buffer is not updated So how can i get the position of vertices after applying the matrix? here's the `onDrawFrame()` function ``` public void onDrawFrame(GL10 gl) { PositionHandle = GLES20.glGetAttribLocation(Program,"vPosition"); Mat...
2020/03/18
[ "https://Stackoverflow.com/questions/60749076", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13085596/" ]
The GPU doesn't normally write back transformed results anywhere the application can use them. It's possible in ES 3.0 with transform feedback, BUT it's very expensive. For touch event "hit" testing, you generally don't want to use the raw geometry. Generally use some simple proxy geometry, which can be transformed in...
Maybe you should try this: ``` private float[] modelViewMatrix = new float[16]; ... Matrix.rotateM(RotationMatrix, 0, -90f, 1, 0, 0); Matrix.multiplyMM(modelViewMatrix, 0, viewMatrix, 0, RotationMatrix, 0); Matrix.multiplyMM(vpMatrix, 0, projectionMatrix, 0, modelViewMatrix, 0); ``` You can use the vertex movement ...
31,218,651
I have followed the steps [here](http://blogs.msdn.com/b/webdev/archive/2015/06/30/asp-net-5-beta5-now-available.aspx) to upgrade from ASP.NET 5 Beta 4 to Beta 5 but am getting an error at runtime when calling `application.UseBrowserLink();`: > > An exception of type 'System.TypeLoadException' occurred in > mscorlib...
2015/07/04
[ "https://Stackoverflow.com/questions/31218651", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1212017/" ]
In order to help you migrate from beta4 to beta5, these are the following steps it took me, based on the research/findings. Environment =========== * PowerShell run: `$env:DNX_FEED="https://www.nuget.org/api/v2"` * PowerShell run: `dnvm install 1.0.0-beta5` * PowerShell run: `dnvm use 1.0.0-beta5 -p` (*not sure if it...
In case anyone is wondering how to update to ASP.NET 5 Beta 7, I found it useful to download the latest ASP.NET and Web Tools updates for Visual Studio 2015 and then create a new ASP.NET 5 project in Visual Studio. This will create a Beta 7 project with the project structure, code and referenced dependencies for you. ...
31,218,651
I have followed the steps [here](http://blogs.msdn.com/b/webdev/archive/2015/06/30/asp-net-5-beta5-now-available.aspx) to upgrade from ASP.NET 5 Beta 4 to Beta 5 but am getting an error at runtime when calling `application.UseBrowserLink();`: > > An exception of type 'System.TypeLoadException' occurred in > mscorlib...
2015/07/04
[ "https://Stackoverflow.com/questions/31218651", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1212017/" ]
In order to help you migrate from beta4 to beta5, these are the following steps it took me, based on the research/findings. Environment =========== * PowerShell run: `$env:DNX_FEED="https://www.nuget.org/api/v2"` * PowerShell run: `dnvm install 1.0.0-beta5` * PowerShell run: `dnvm use 1.0.0-beta5 -p` (*not sure if it...
After speaking with @davidfowl from the ASP.NET vNext team, he told me that Browser Link doesn't work in beta5 and should be removed.
31,218,651
I have followed the steps [here](http://blogs.msdn.com/b/webdev/archive/2015/06/30/asp-net-5-beta5-now-available.aspx) to upgrade from ASP.NET 5 Beta 4 to Beta 5 but am getting an error at runtime when calling `application.UseBrowserLink();`: > > An exception of type 'System.TypeLoadException' occurred in > mscorlib...
2015/07/04
[ "https://Stackoverflow.com/questions/31218651", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1212017/" ]
After speaking with @davidfowl from the ASP.NET vNext team, he told me that Browser Link doesn't work in beta5 and should be removed.
[Microsoft.AspNet.Http and Microsoft.AspNet.Http.Core package names swapped](https://github.com/aspnet/Announcements/issues/7)
31,218,651
I have followed the steps [here](http://blogs.msdn.com/b/webdev/archive/2015/06/30/asp-net-5-beta5-now-available.aspx) to upgrade from ASP.NET 5 Beta 4 to Beta 5 but am getting an error at runtime when calling `application.UseBrowserLink();`: > > An exception of type 'System.TypeLoadException' occurred in > mscorlib...
2015/07/04
[ "https://Stackoverflow.com/questions/31218651", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1212017/" ]
To complete, if you want to update from beta 4 to beta 6, see the Stephen Lautier's answer and to this after : **To update from beta 5 to beta 6 :** I did : * Open global.json and update sdk to "1.0.0-beta6" and save this file * Visual Studio 2015 proposes to download beta6, click on Yes In project.json : * change...
After speaking with @davidfowl from the ASP.NET vNext team, he told me that Browser Link doesn't work in beta5 and should be removed.
31,218,651
I have followed the steps [here](http://blogs.msdn.com/b/webdev/archive/2015/06/30/asp-net-5-beta5-now-available.aspx) to upgrade from ASP.NET 5 Beta 4 to Beta 5 but am getting an error at runtime when calling `application.UseBrowserLink();`: > > An exception of type 'System.TypeLoadException' occurred in > mscorlib...
2015/07/04
[ "https://Stackoverflow.com/questions/31218651", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1212017/" ]
To complete, if you want to update from beta 4 to beta 6, see the Stephen Lautier's answer and to this after : **To update from beta 5 to beta 6 :** I did : * Open global.json and update sdk to "1.0.0-beta6" and save this file * Visual Studio 2015 proposes to download beta6, click on Yes In project.json : * change...
This is the thing: You updated the DNX from beta4 to beta5, and you want to run an MVC6 template inside Visual Studio RC (whose templates were built around beta4). In the first place, `"Microsoft.Framework.Configuration.Json"` doesn't exist in beta5 anymore. (you should definitely see this: <https://github.com/aspne...
31,218,651
I have followed the steps [here](http://blogs.msdn.com/b/webdev/archive/2015/06/30/asp-net-5-beta5-now-available.aspx) to upgrade from ASP.NET 5 Beta 4 to Beta 5 but am getting an error at runtime when calling `application.UseBrowserLink();`: > > An exception of type 'System.TypeLoadException' occurred in > mscorlib...
2015/07/04
[ "https://Stackoverflow.com/questions/31218651", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1212017/" ]
In order to help you migrate from beta4 to beta5, these are the following steps it took me, based on the research/findings. Environment =========== * PowerShell run: `$env:DNX_FEED="https://www.nuget.org/api/v2"` * PowerShell run: `dnvm install 1.0.0-beta5` * PowerShell run: `dnvm use 1.0.0-beta5 -p` (*not sure if it...
To complete, if you want to update from beta 4 to beta 6, see the Stephen Lautier's answer and to this after : **To update from beta 5 to beta 6 :** I did : * Open global.json and update sdk to "1.0.0-beta6" and save this file * Visual Studio 2015 proposes to download beta6, click on Yes In project.json : * change...
31,218,651
I have followed the steps [here](http://blogs.msdn.com/b/webdev/archive/2015/06/30/asp-net-5-beta5-now-available.aspx) to upgrade from ASP.NET 5 Beta 4 to Beta 5 but am getting an error at runtime when calling `application.UseBrowserLink();`: > > An exception of type 'System.TypeLoadException' occurred in > mscorlib...
2015/07/04
[ "https://Stackoverflow.com/questions/31218651", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1212017/" ]
To complete, if you want to update from beta 4 to beta 6, see the Stephen Lautier's answer and to this after : **To update from beta 5 to beta 6 :** I did : * Open global.json and update sdk to "1.0.0-beta6" and save this file * Visual Studio 2015 proposes to download beta6, click on Yes In project.json : * change...
[Microsoft.AspNet.Http and Microsoft.AspNet.Http.Core package names swapped](https://github.com/aspnet/Announcements/issues/7)
31,218,651
I have followed the steps [here](http://blogs.msdn.com/b/webdev/archive/2015/06/30/asp-net-5-beta5-now-available.aspx) to upgrade from ASP.NET 5 Beta 4 to Beta 5 but am getting an error at runtime when calling `application.UseBrowserLink();`: > > An exception of type 'System.TypeLoadException' occurred in > mscorlib...
2015/07/04
[ "https://Stackoverflow.com/questions/31218651", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1212017/" ]
In order to help you migrate from beta4 to beta5, these are the following steps it took me, based on the research/findings. Environment =========== * PowerShell run: `$env:DNX_FEED="https://www.nuget.org/api/v2"` * PowerShell run: `dnvm install 1.0.0-beta5` * PowerShell run: `dnvm use 1.0.0-beta5 -p` (*not sure if it...
This is the thing: You updated the DNX from beta4 to beta5, and you want to run an MVC6 template inside Visual Studio RC (whose templates were built around beta4). In the first place, `"Microsoft.Framework.Configuration.Json"` doesn't exist in beta5 anymore. (you should definitely see this: <https://github.com/aspne...
31,218,651
I have followed the steps [here](http://blogs.msdn.com/b/webdev/archive/2015/06/30/asp-net-5-beta5-now-available.aspx) to upgrade from ASP.NET 5 Beta 4 to Beta 5 but am getting an error at runtime when calling `application.UseBrowserLink();`: > > An exception of type 'System.TypeLoadException' occurred in > mscorlib...
2015/07/04
[ "https://Stackoverflow.com/questions/31218651", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1212017/" ]
To complete, if you want to update from beta 4 to beta 6, see the Stephen Lautier's answer and to this after : **To update from beta 5 to beta 6 :** I did : * Open global.json and update sdk to "1.0.0-beta6" and save this file * Visual Studio 2015 proposes to download beta6, click on Yes In project.json : * change...
In case anyone is wondering how to update to ASP.NET 5 Beta 7, I found it useful to download the latest ASP.NET and Web Tools updates for Visual Studio 2015 and then create a new ASP.NET 5 project in Visual Studio. This will create a Beta 7 project with the project structure, code and referenced dependencies for you. ...
31,218,651
I have followed the steps [here](http://blogs.msdn.com/b/webdev/archive/2015/06/30/asp-net-5-beta5-now-available.aspx) to upgrade from ASP.NET 5 Beta 4 to Beta 5 but am getting an error at runtime when calling `application.UseBrowserLink();`: > > An exception of type 'System.TypeLoadException' occurred in > mscorlib...
2015/07/04
[ "https://Stackoverflow.com/questions/31218651", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1212017/" ]
After speaking with @davidfowl from the ASP.NET vNext team, he told me that Browser Link doesn't work in beta5 and should be removed.
This is the thing: You updated the DNX from beta4 to beta5, and you want to run an MVC6 template inside Visual Studio RC (whose templates were built around beta4). In the first place, `"Microsoft.Framework.Configuration.Json"` doesn't exist in beta5 anymore. (you should definitely see this: <https://github.com/aspne...
80,053
I'm trying to prove why the mean of the distribution of sums of the top 3 out of 4 fair 6 sided dice is rolls 12.25. Anybody who's rolled a D&D character knows the idea. $r\_n = Rand([1,6])$ $x = \frac{\sum\_{i=1}^4{r\_i} - min(r\_i)}{3}$ Pardon the notation, I wasn't sure how to properly define the problem. So, I ...
2011/11/08
[ "https://math.stackexchange.com/questions/80053", "https://math.stackexchange.com", "https://math.stackexchange.com/users/19075/" ]
We use the same idea as Ross Millikan. In order to bring out the structure, there will be as little calculation as possible. Let the random variable $X$ denote the smallest roll, and let $Y$ denote the sum of the three larger rolls. Then $$E(X)+E(Y)=E(X+Y)=14.$$ We calculate $E(X)$. From this, $E(Y)$ is easily found....
One approach is to find the number of rolls with each number as the lowest. There is only one roll with $6$ the minimum. There are $2^4-1=15$ with $5$ the minimum. This continues to the fact that there are $6^4-5^4=1296-625$ rolls with $1$ the minimum. The total of all the dice is $1296\*4\*3.5=18144$ The thrown out di...
80,053
I'm trying to prove why the mean of the distribution of sums of the top 3 out of 4 fair 6 sided dice is rolls 12.25. Anybody who's rolled a D&D character knows the idea. $r\_n = Rand([1,6])$ $x = \frac{\sum\_{i=1}^4{r\_i} - min(r\_i)}{3}$ Pardon the notation, I wasn't sure how to properly define the problem. So, I ...
2011/11/08
[ "https://math.stackexchange.com/questions/80053", "https://math.stackexchange.com", "https://math.stackexchange.com/users/19075/" ]
One approach is to find the number of rolls with each number as the lowest. There is only one roll with $6$ the minimum. There are $2^4-1=15$ with $5$ the minimum. This continues to the fact that there are $6^4-5^4=1296-625$ rolls with $1$ the minimum. The total of all the dice is $1296\*4\*3.5=18144$ The thrown out di...
There are $6^4$ rolls for which the minimum is at least $1$, $5^4$ rolls for which the minimum is at least $2$, and so on. Thus the sum over all the minima is $1^4+2^4+3^4+4^4+5^4+6^4=2275$. It's a bit of an overkill, but if you like you can also calculate this sum using the general formula for the sum of the first $n$...
80,053
I'm trying to prove why the mean of the distribution of sums of the top 3 out of 4 fair 6 sided dice is rolls 12.25. Anybody who's rolled a D&D character knows the idea. $r\_n = Rand([1,6])$ $x = \frac{\sum\_{i=1}^4{r\_i} - min(r\_i)}{3}$ Pardon the notation, I wasn't sure how to properly define the problem. So, I ...
2011/11/08
[ "https://math.stackexchange.com/questions/80053", "https://math.stackexchange.com", "https://math.stackexchange.com/users/19075/" ]
We use the same idea as Ross Millikan. In order to bring out the structure, there will be as little calculation as possible. Let the random variable $X$ denote the smallest roll, and let $Y$ denote the sum of the three larger rolls. Then $$E(X)+E(Y)=E(X+Y)=14.$$ We calculate $E(X)$. From this, $E(Y)$ is easily found....
There are $6^4$ rolls for which the minimum is at least $1$, $5^4$ rolls for which the minimum is at least $2$, and so on. Thus the sum over all the minima is $1^4+2^4+3^4+4^4+5^4+6^4=2275$. It's a bit of an overkill, but if you like you can also calculate this sum using the general formula for the sum of the first $n$...
14,503,449
I have a large delimited txt file with two columns and about 17 million lines. I have imported it to the database, mistakenly one column in table had shorter size than the text from the file. i.e. varchar (4000) instead of varchar (7000) about 48 thousands records with longer text has been cut into 40k chars. How wou...
2013/01/24
[ "https://Stackoverflow.com/questions/14503449", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1147622/" ]
Depending a bit on how this is connected to other infrastructure, my guess would be that the easiest and safest way of handeling it is just to drop and reimport the table... If that for some reason not is an option, I would write a script that goes through the text file, and either just updates the large text field un...
You could also build a query that returns every record where that column contains 4000 bytes. Which are possibly the ones that were cut when you imported the file. With that set of records in hand, you could try to find them on the file if you have a line reference on the database table ofc. If there is too many, a si...
2,312,431
I need to submit my hundreds of products to hundreds of websites. For most websites I need to select a directory/category for each product. But it seems each website has a different definition of categories. For example, some list laptops under computers/hardware, some under computers/laptop, some under /electronics/co...
2010/02/22
[ "https://Stackoverflow.com/questions/2312431", "https://Stackoverflow.com", "https://Stackoverflow.com/users/234118/" ]
Yes, it's hard. No one agrees on the categories. The Unix "rm" command ("remove") is spelled "del" in Windows. Why? People don't agree on something that simple and obvious. What kind of magic do you want? Your task requires a *person* to *think*. A person must (1) understand your products and (2) understand the web ...
I would try to build a graph with synonyms and generalizations. For example `Notebook` and `Laptop` are synonym. `Computer` generalizes them. `PC` is a synonym for `Computer`. `Electronics` generalizes `Computer` (and its synonym `PC`) again. Now, for a given product, look at the deepest level of the available categor...
781,300
We have a website where we need a scheduler to receive notifications (e-mail) on specific time. eg. a person setting reminder at 5 PM to attend the meeting at 4:45 PM, will receive email at 4:45 PM about same. As this site is hosted on shared server, we don't have any control over the server to run any SQL Job or sche...
2009/04/23
[ "https://Stackoverflow.com/questions/781300", "https://Stackoverflow.com", "https://Stackoverflow.com/users/51635/" ]
However if you really are completely stuck and have no choice but to host it in your WebApp, You could look at creating a `System.Timers.Timer` instance in your Global.asax.cs file. Wire up a Elapsed event as you normally would, and give it some code that does something along the lines of ``` protected void myTimer_E...
It's really not desirable to do, but you can do what Razzie is suggesting. I have seen it done many times. Although ugly, sometimes ya just have to do the ugly hacks. Using this method though, you have to make sure you application is not unloaded. So you need some sort of keep alive. I would suggest setting up a web m...
781,300
We have a website where we need a scheduler to receive notifications (e-mail) on specific time. eg. a person setting reminder at 5 PM to attend the meeting at 4:45 PM, will receive email at 4:45 PM about same. As this site is hosted on shared server, we don't have any control over the server to run any SQL Job or sche...
2009/04/23
[ "https://Stackoverflow.com/questions/781300", "https://Stackoverflow.com", "https://Stackoverflow.com/users/51635/" ]
However if you really are completely stuck and have no choice but to host it in your WebApp, You could look at creating a `System.Timers.Timer` instance in your Global.asax.cs file. Wire up a Elapsed event as you normally would, and give it some code that does something along the lines of ``` protected void myTimer_E...
I don't belive you, because source code of Quartz.Net (1.0 and 1.0.1) doesn't compile under Visual Studio.Net 2005 and 2008. The only way to get Quartz.Net is to use whole Spring.Net package, which compiles fine under VS.Net 2005 and 2008 Unless you could share some tips, how to compile and use quartz.dll in asp.net p...
781,300
We have a website where we need a scheduler to receive notifications (e-mail) on specific time. eg. a person setting reminder at 5 PM to attend the meeting at 4:45 PM, will receive email at 4:45 PM about same. As this site is hosted on shared server, we don't have any control over the server to run any SQL Job or sche...
2009/04/23
[ "https://Stackoverflow.com/questions/781300", "https://Stackoverflow.com", "https://Stackoverflow.com/users/51635/" ]
How about this: [Simulate a Windows Service using ASP.NET to run scheduled jobs](http://www.codeproject.com/KB/aspnet/ASPNETService.aspx). At one point this technique was [used on Stack Overflow](https://blog.stackoverflow.com/2008/07/easy-background-tasks-in-aspnet), although I don't think it is any more. To be hone...
I had the same problem as you and I ended up with a programming a service that utilize Quartz.NET: <http://quartznet.sourceforge.net/> and connect to the same database as the website.
781,300
We have a website where we need a scheduler to receive notifications (e-mail) on specific time. eg. a person setting reminder at 5 PM to attend the meeting at 4:45 PM, will receive email at 4:45 PM about same. As this site is hosted on shared server, we don't have any control over the server to run any SQL Job or sche...
2009/04/23
[ "https://Stackoverflow.com/questions/781300", "https://Stackoverflow.com", "https://Stackoverflow.com/users/51635/" ]
I had the same problem as you and I ended up with a programming a service that utilize Quartz.NET: <http://quartznet.sourceforge.net/> and connect to the same database as the website.
I don't belive you, because source code of Quartz.Net (1.0 and 1.0.1) doesn't compile under Visual Studio.Net 2005 and 2008. The only way to get Quartz.Net is to use whole Spring.Net package, which compiles fine under VS.Net 2005 and 2008 Unless you could share some tips, how to compile and use quartz.dll in asp.net p...
781,300
We have a website where we need a scheduler to receive notifications (e-mail) on specific time. eg. a person setting reminder at 5 PM to attend the meeting at 4:45 PM, will receive email at 4:45 PM about same. As this site is hosted on shared server, we don't have any control over the server to run any SQL Job or sche...
2009/04/23
[ "https://Stackoverflow.com/questions/781300", "https://Stackoverflow.com", "https://Stackoverflow.com/users/51635/" ]
If you really have no control over the server (meaning, you cannot use an sql job, a scheduled task, or install a windows server) then you could use a [System.Threading.Timer](http://msdn.microsoft.com/en-us/library/system.threading.timer.aspx) that you initialize in your Global.asax (e.g, on application startup) that ...
> > I don't belive you, because source > code of Quartz.Net (1.0 and 1.0.1) > doesn't compile under Visual > Studio.Net 2005 and 2008. The only way > to get Quartz.Net is to use whole > Spring.Net package, which compiles > fine under VS.Net 2005 and 2008 > > > Unless you could share some tips, how > to compil...
781,300
We have a website where we need a scheduler to receive notifications (e-mail) on specific time. eg. a person setting reminder at 5 PM to attend the meeting at 4:45 PM, will receive email at 4:45 PM about same. As this site is hosted on shared server, we don't have any control over the server to run any SQL Job or sche...
2009/04/23
[ "https://Stackoverflow.com/questions/781300", "https://Stackoverflow.com", "https://Stackoverflow.com/users/51635/" ]
How about this: [Simulate a Windows Service using ASP.NET to run scheduled jobs](http://www.codeproject.com/KB/aspnet/ASPNETService.aspx). At one point this technique was [used on Stack Overflow](https://blog.stackoverflow.com/2008/07/easy-background-tasks-in-aspnet), although I don't think it is any more. To be hone...
With ASP.NET you are not guaranteed that your app is alive at all times, and thus web applications as a host process for a scheduling solution is not feasible IMO. A Windows service is what you need for this scenario. You have full control on starting and stopping the process as well as ways of monitoring the applicat...
781,300
We have a website where we need a scheduler to receive notifications (e-mail) on specific time. eg. a person setting reminder at 5 PM to attend the meeting at 4:45 PM, will receive email at 4:45 PM about same. As this site is hosted on shared server, we don't have any control over the server to run any SQL Job or sche...
2009/04/23
[ "https://Stackoverflow.com/questions/781300", "https://Stackoverflow.com", "https://Stackoverflow.com/users/51635/" ]
I had the same problem as you and I ended up with a programming a service that utilize Quartz.NET: <http://quartznet.sourceforge.net/> and connect to the same database as the website.
However if you really are completely stuck and have no choice but to host it in your WebApp, You could look at creating a `System.Timers.Timer` instance in your Global.asax.cs file. Wire up a Elapsed event as you normally would, and give it some code that does something along the lines of ``` protected void myTimer_E...
781,300
We have a website where we need a scheduler to receive notifications (e-mail) on specific time. eg. a person setting reminder at 5 PM to attend the meeting at 4:45 PM, will receive email at 4:45 PM about same. As this site is hosted on shared server, we don't have any control over the server to run any SQL Job or sche...
2009/04/23
[ "https://Stackoverflow.com/questions/781300", "https://Stackoverflow.com", "https://Stackoverflow.com/users/51635/" ]
How about this: [Simulate a Windows Service using ASP.NET to run scheduled jobs](http://www.codeproject.com/KB/aspnet/ASPNETService.aspx). At one point this technique was [used on Stack Overflow](https://blog.stackoverflow.com/2008/07/easy-background-tasks-in-aspnet), although I don't think it is any more. To be hone...
You need to have a job done at the server, but you have no good way of triggering it from ASP.NET? How about creating a webpage that will start your job, and have a timer run elsewhere (ie. on another computer) that requests that page. (Just hitting the page to trigger you jobs)
781,300
We have a website where we need a scheduler to receive notifications (e-mail) on specific time. eg. a person setting reminder at 5 PM to attend the meeting at 4:45 PM, will receive email at 4:45 PM about same. As this site is hosted on shared server, we don't have any control over the server to run any SQL Job or sche...
2009/04/23
[ "https://Stackoverflow.com/questions/781300", "https://Stackoverflow.com", "https://Stackoverflow.com/users/51635/" ]
However if you really are completely stuck and have no choice but to host it in your WebApp, You could look at creating a `System.Timers.Timer` instance in your Global.asax.cs file. Wire up a Elapsed event as you normally would, and give it some code that does something along the lines of ``` protected void myTimer_E...
> > I don't belive you, because source > code of Quartz.Net (1.0 and 1.0.1) > doesn't compile under Visual > Studio.Net 2005 and 2008. The only way > to get Quartz.Net is to use whole > Spring.Net package, which compiles > fine under VS.Net 2005 and 2008 > > > Unless you could share some tips, how > to compil...
781,300
We have a website where we need a scheduler to receive notifications (e-mail) on specific time. eg. a person setting reminder at 5 PM to attend the meeting at 4:45 PM, will receive email at 4:45 PM about same. As this site is hosted on shared server, we don't have any control over the server to run any SQL Job or sche...
2009/04/23
[ "https://Stackoverflow.com/questions/781300", "https://Stackoverflow.com", "https://Stackoverflow.com/users/51635/" ]
With ASP.NET you are not guaranteed that your app is alive at all times, and thus web applications as a host process for a scheduling solution is not feasible IMO. A Windows service is what you need for this scenario. You have full control on starting and stopping the process as well as ways of monitoring the applicat...
However if you really are completely stuck and have no choice but to host it in your WebApp, You could look at creating a `System.Timers.Timer` instance in your Global.asax.cs file. Wire up a Elapsed event as you normally would, and give it some code that does something along the lines of ``` protected void myTimer_E...
65,865,353
I have a really basic and simple question but for some reason I can't figure it out. I have the following code in python: ``` counter = 0 for el in mylist: if self.check_el(el): counter += 1 ``` I want to make it in one line. Is it something that possible to achieve?
2021/01/23
[ "https://Stackoverflow.com/questions/65865353", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9808098/" ]
Yeah, here is one option: ``` counter = sum(1 for el in mylist if self.check_el(el)) ```
``` sum(map(lambda el: bool(self.check_el(el)), my_list)) ``` Or if you know `check_el` always returns a bool: ``` sum(map(self.check_el, my_list)) ```
65,865,353
I have a really basic and simple question but for some reason I can't figure it out. I have the following code in python: ``` counter = 0 for el in mylist: if self.check_el(el): counter += 1 ``` I want to make it in one line. Is it something that possible to achieve?
2021/01/23
[ "https://Stackoverflow.com/questions/65865353", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9808098/" ]
Yeah, here is one option: ``` counter = sum(1 for el in mylist if self.check_el(el)) ```
``` counter = sum(int(self.check_el(el)) for el in mylist) ```
65,865,353
I have a really basic and simple question but for some reason I can't figure it out. I have the following code in python: ``` counter = 0 for el in mylist: if self.check_el(el): counter += 1 ``` I want to make it in one line. Is it something that possible to achieve?
2021/01/23
[ "https://Stackoverflow.com/questions/65865353", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9808098/" ]
Yeah, here is one option: ``` counter = sum(1 for el in mylist if self.check_el(el)) ```
I suggest ```py len(list(filter(self.check_el, mylist))) ``` It filters out all elemenents not fulfilling self.check\_el, converts the filter object into a list, and then takes the length of said list. If you want to iterate over the elements, `filter(self.check_el, mylist)` is iterable.
65,865,353
I have a really basic and simple question but for some reason I can't figure it out. I have the following code in python: ``` counter = 0 for el in mylist: if self.check_el(el): counter += 1 ``` I want to make it in one line. Is it something that possible to achieve?
2021/01/23
[ "https://Stackoverflow.com/questions/65865353", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9808098/" ]
``` sum(map(lambda el: bool(self.check_el(el)), my_list)) ``` Or if you know `check_el` always returns a bool: ``` sum(map(self.check_el, my_list)) ```
I suggest ```py len(list(filter(self.check_el, mylist))) ``` It filters out all elemenents not fulfilling self.check\_el, converts the filter object into a list, and then takes the length of said list. If you want to iterate over the elements, `filter(self.check_el, mylist)` is iterable.
65,865,353
I have a really basic and simple question but for some reason I can't figure it out. I have the following code in python: ``` counter = 0 for el in mylist: if self.check_el(el): counter += 1 ``` I want to make it in one line. Is it something that possible to achieve?
2021/01/23
[ "https://Stackoverflow.com/questions/65865353", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9808098/" ]
``` counter = sum(int(self.check_el(el)) for el in mylist) ```
I suggest ```py len(list(filter(self.check_el, mylist))) ``` It filters out all elemenents not fulfilling self.check\_el, converts the filter object into a list, and then takes the length of said list. If you want to iterate over the elements, `filter(self.check_el, mylist)` is iterable.
65,624,819
I would like to consume messages from one kafka cluster and publish to another kafka cluster. Would like to know how to configure this using spring-kafka?
2021/01/08
[ "https://Stackoverflow.com/questions/65624819", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7073189/" ]
Simply configure the consumer and producer factories with different `bootstrap.servers` properties. If you are using Spring Boot, see <https://docs.spring.io/spring-boot/docs/current/reference/html/appendix-application-properties.html#spring.kafka.consumer.bootstrap-servers> and <https://docs.spring.io/spring-boot/...
you can use spring cloud stream kafka binders. create two stream one for consume and one for producing. for consumer ``` public interface InputStreamExample{ String INPUT = "consumer-in"; @Input(INPUT) MessageChannel readFromKafka(); } ``` for producer ``` public interface ProducerStreamExample{ ...
50,236,904
I am developing a native script app using angular, and I need to access the native Android API. I tried to use `android.view` as mentioned in the native script documentation, but I get an error saying that view is not defined : [Native Script documentation](https://docs.nativescript.org/runtimes/android/metadata/access...
2018/05/08
[ "https://Stackoverflow.com/questions/50236904", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3532113/" ]
You don't have to import anything to access the native APIs. So to use `android.view` you'd just call it in your app like this: `const x = new android.view.ViewGroup.... // or whatever you're accessing`
As per Brad Martin response, there is no need to make any import. To use it in angular environment, add this line before the component declaration. ``` declare var android :any; ```
50,236,904
I am developing a native script app using angular, and I need to access the native Android API. I tried to use `android.view` as mentioned in the native script documentation, but I get an error saying that view is not defined : [Native Script documentation](https://docs.nativescript.org/runtimes/android/metadata/access...
2018/05/08
[ "https://Stackoverflow.com/questions/50236904", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3532113/" ]
You don't have to import anything to access the native APIs. So to use `android.view` you'd just call it in your app like this: `const x = new android.view.ViewGroup.... // or whatever you're accessing`
In the answer ( which also answered my issue ) there are two things to note: * The native variable that you can use `android` * The one that you import from `import { android } from "@nativescript/core/application";` when I used as the answer suggested I run into an issue where it now couldn't find the `addEventListe...
62,879,446
I am pulling in dependencies from a parent and need most of the dependencies in there. But I also wish to be able to exclude 2 dependencies entirely. I am not able to edit the parent thus this needs to be excluded from my POM file. Is this even possible? I've seen examples for overrides and quite a bit of suggestion to...
2020/07/13
[ "https://Stackoverflow.com/questions/62879446", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9401029/" ]
You should study the syntax of your expected matches to extract them correctly. To get the port number value, I'd use ``` regex reg("--riotclient-app-port=(\\d+)"); ``` This way, you do not even need to care about the number of digits you match since it will capture a number after a known string. If the auth token...
First, you need to escape your str value. Every double-quotes (") character must be escaped with (\") ``` string str = "C:/Riot Games/League of Legends/LeagueClientUx.exe\" \"--riotclient-auth-token=yvjM3_sRqdaFoETdKSt1bQ\" \"--riotclient-app-port=53201\" \"--no-rads\" \"--disable-self-update\" \"--region=EUW\" \"--lo...
51,650
I'm not an expert on theology but I've heard that Christianity is filled with inconsistencies and incongruencies. My question, if this is the case, is whether this is normal for the major theologies or it is a specific fault of Christianity.
2018/05/01
[ "https://philosophy.stackexchange.com/questions/51650", "https://philosophy.stackexchange.com", "https://philosophy.stackexchange.com/users/30032/" ]
On religious views inconsistency is not necessarily a fault, after all God is supposed to surpass human reason and logic. And many paradoxical notions come from general [monotheistic doctrines](https://plato.stanford.edu/entries/monotheism/), like creation from nothing, omnipotence, omnibenevolence and omniscience, tha...
Christs teachings were not written down until some time after his death. Given the nature of that, his authority couldn't weigh in on the composition and editing of these. It took some 300 years to settle on the New Testament canon, and the final set is very open to dispute, especially inclusion of The Book of Revelati...
26,860,858
I have Genymotion emulator running on a different machine.I can connect to that emulator from my development machine (by **adb connect 192.168.0.105**).The GCM client app runs well in that remote machine's emulator. When I try to register that emulator into my dev server, it says "cant connect to 10.0.3.2...).If the ad...
2014/11/11
[ "https://Stackoverflow.com/questions/26860858", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1625343/" ]
`du -h` displays sizes in human readable form. You can't sort them, so just apply it on the already sorted files: ``` du --max-depth=1 | sort -n | cut -f2 | xargs du --max-depth=0 -h ``` Note: Doesn't work for directories with spaces in their names. For such a case, replace the `xargs` with the (much slower) loop: ...
I don't generally worry about human readable format, you can just use: ``` du -s * 2>/dev/null | sort -k1 -n ``` to get them in the correct order, then concentrate on the last few. If you *really* need them in human readable format, you can post-process the output of `du` with something like: ``` du -s * 2>/dev/n...
26,860,858
I have Genymotion emulator running on a different machine.I can connect to that emulator from my development machine (by **adb connect 192.168.0.105**).The GCM client app runs well in that remote machine's emulator. When I try to register that emulator into my dev server, it says "cant connect to 10.0.3.2...).If the ad...
2014/11/11
[ "https://Stackoverflow.com/questions/26860858", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1625343/" ]
`du -h` displays sizes in human readable form. You can't sort them, so just apply it on the already sorted files: ``` du --max-depth=1 | sort -n | cut -f2 | xargs du --max-depth=0 -h ``` Note: Doesn't work for directories with spaces in their names. For such a case, replace the `xargs` with the (much slower) loop: ...
Since a picture is worth a thousand words, why not do it graphically, using something like <http://www.marzocca.net/linux/baobab/index.html> ? ![enter image description here](https://i.stack.imgur.com/LaMsQ.png) Also, of course remove unneeded package files, temp files, backup files, etc, using something like <https:...
26,860,858
I have Genymotion emulator running on a different machine.I can connect to that emulator from my development machine (by **adb connect 192.168.0.105**).The GCM client app runs well in that remote machine's emulator. When I try to register that emulator into my dev server, it says "cant connect to 10.0.3.2...).If the ad...
2014/11/11
[ "https://Stackoverflow.com/questions/26860858", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1625343/" ]
Since a picture is worth a thousand words, why not do it graphically, using something like <http://www.marzocca.net/linux/baobab/index.html> ? ![enter image description here](https://i.stack.imgur.com/LaMsQ.png) Also, of course remove unneeded package files, temp files, backup files, etc, using something like <https:...
I don't generally worry about human readable format, you can just use: ``` du -s * 2>/dev/null | sort -k1 -n ``` to get them in the correct order, then concentrate on the last few. If you *really* need them in human readable format, you can post-process the output of `du` with something like: ``` du -s * 2>/dev/n...
8,822,475
To illustrate my problem, let's say I have an instance of Thing which has two text properties - 'foo' and 'bar'. I want to create a Panel to edit instances of Thing. The panel has two TextField components, one for the 'foo' property and one for the 'bar' property. I want to be able to call `setDefaultModel()` on my P...
2012/01/11
[ "https://Stackoverflow.com/questions/8822475", "https://Stackoverflow.com", "https://Stackoverflow.com/users/207753/" ]
You can use a `PropertyModel` for the textFields. Pass the `IModel<Thing>` into the constructor of the `PropertyModel` with `foo` as the property name: ``` add(new TextField("fooFieldId", new PropertyModel(thingModel, "foo"))); ``` The `PropertyModel` will figure out that the thingModel is a `Model` and call `getObj...
Maybe I'm just missing the point, but I can't find a `Panel.setModel()` in the JavaDocs of neither [1.4](http://wicket.apache.org/apidocs/1.4/org/apache/wicket/markup/html/panel/Panel.html) nor [1.5](http://wicket.apache.org/apidocs/1.5/org/apache/wicket/markup/html/panel/Panel.html). If it's something you implemented ...
8,822,475
To illustrate my problem, let's say I have an instance of Thing which has two text properties - 'foo' and 'bar'. I want to create a Panel to edit instances of Thing. The panel has two TextField components, one for the 'foo' property and one for the 'bar' property. I want to be able to call `setDefaultModel()` on my P...
2012/01/11
[ "https://Stackoverflow.com/questions/8822475", "https://Stackoverflow.com", "https://Stackoverflow.com/users/207753/" ]
You can use a `PropertyModel` for the textFields. Pass the `IModel<Thing>` into the constructor of the `PropertyModel` with `foo` as the property name: ``` add(new TextField("fooFieldId", new PropertyModel(thingModel, "foo"))); ``` The `PropertyModel` will figure out that the thingModel is a `Model` and call `getObj...
Maybe this would help? ``` public abstract class AbstractWrapModel<T> extends Object implements IWrapModel<T> ``` Simple base class for IWrapModel objects. See IComponentAssignedModel or IComponentInheritedModel so that you don't have to have empty methods like detach or setObject() when not used in the wrapper. Th...
244,170
I have the following MySQL query that is querying naughty ip addresses from the last 24 hours and ban count >= 2. I don't want them if they are in an extra naughty ban list from the last 7 days and ban count >= 5. The query takes 3 minutes to run. If I replace `@__cutOff_1` with the actual hard coded date inline in the...
2019/07/31
[ "https://dba.stackexchange.com/questions/244170", "https://dba.stackexchange.com", "https://dba.stackexchange.com/users/46214/" ]
Posted a bug / feature request with Oracle, they say it is a known issue. So there are two work-arounds: 1] Only use hard-coded values in sub-queries, no parameters. Not really an option for me, but may be for some people. 2] Create a temporary data set and filter the outer query with it in code behind. This is the r...
For clarity, change ``` CROSS JOIN `IPAddresses` AS `i` WHERE (`s`.`IPAddressId` = `i`.`IPAddress`) ``` To ``` JOIN `IPAddresses` AS `i` ON (`s`.`IPAddressId` = `i`.`IPAddress`) ``` Change ``` AND `i`.`IPAddress` NOT IN ( SELECT DISTINCT `i2`.`IPAddress` ... ) ...
14,419,552
I'm new to xslt and i'm doing a chat application and I want to save the users sessions as xml files that appear with the user predefined color and font so I used xslt to make that happen but I don't know how to take the font from the xml and applay it in the html tag so it appears with the font that the user selected. ...
2013/01/19
[ "https://Stackoverflow.com/questions/14419552", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1993693/" ]
It's hard to guess without seeing your input format, however I think you are looking for attribute value templates (Using `{ }` in literal result element attribute values). If you change ``` <font family="/body/msg[font/text()]" color="/body/msg/color"> ``` to ``` <font family="{/body/msg[font/text()]}" color="{/...
Could I propose using an approach like this? When possible, it's a good idea to avoid repeating large parts of your code (this is known as the [DRY principle](http://en.wikipedia.org/wiki/Don%27t_repeat_yourself), and with the following, if you need to make a change to that `<font>` portion and the stuff inside it, you...
6,108,044
Is it possible to load a dropdownlist in asp.NET just when the user click the DropDownList for the firs time? I will try to explain it. I have an aspx page with a DropDownList with one item. ``` ListItem listlt = new ListItem("UNDEFINED", "-1"); ddl.Items.Insert(0, listlt); ``` I want to load all data in the DropDo...
2011/05/24
[ "https://Stackoverflow.com/questions/6108044", "https://Stackoverflow.com", "https://Stackoverflow.com/users/468891/" ]
You can use PageMethods instead. ``` using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using System.Web.Services; public partial class _Default : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { ...
use jquery [`load`](http://api.jquery.com/load/) ``` $("select#theDropdownID").click(function(){ $(this).load("thedropdownItems.html"); }); ``` And in `thedropdownItems.html` ``` <option value='foo'>foo</option> <option value='bar'>bar</option> .... ```
664,693
I used an app in Windows 7, I think called dimmer to make the screen change its contrast settings so I could dim it lower than the controls of the PC defaults such as function key or the power options in control panel. Are there any of these type apps for Ubuntu 15.04 or approved for the latest Ubuntu LTS version on a...
2015/08/23
[ "https://askubuntu.com/questions/664693", "https://askubuntu.com", "https://askubuntu.com/users/424690/" ]
Follow these steps exactly: 1. Open terminal via `Ctrl`-`Alt`-`T` 2. Create a folder for the script ``` mkdir -p ~/bin ``` 3. Open the file `~/bin/setup.sh` in `gedit`. ``` gedit ~/bin/setup.sh ``` 4. **Copy** over the code below **save** the file, **close** the editor. ``` #!/bin/sh # Author: Serg Kolo # Date: ...
If you edit the file /etc/default/grub and change the line: ``` GRUB_CMDLINE_LINUX="" ``` to ``` GRUB_CMDLINE_LINUX="acpi_backlight=vendor" ``` and then run ``` sudo update-grub ``` and reboot, you should have the ability to lower the screen backlight to completely black.
50,739,391
My websocket client needs to send over a large message containing a base64 encoded image. Now, this is quit slow at the moment, and I thought... well maybe I should increase the ReceiveBufferSize of my websocket server within ASP.NET Core 2.0. Unfortunately... it seems to completely ignore my set buffer size... Readi...
2018/06/07
[ "https://Stackoverflow.com/questions/50739391", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4564466/" ]
In a browser environment, you can assign variables by setting a property of the `window` object: ```js for (let i = 0; i < 8; i++) { window["a"+i] = "something "+i; } console.log(a2, a3); ``` As for your code, use this: ``` window["a"+i] = $('[name="answer['+i+']"]:checked').val(); ``` In the `for` loop
What I can think of is this ``` var i; for (i = 1; i < 8; i++) { let a[i] = $('[name="answer['+i+']"]:checked').val(); } ```
50,739,391
My websocket client needs to send over a large message containing a base64 encoded image. Now, this is quit slow at the moment, and I thought... well maybe I should increase the ReceiveBufferSize of my websocket server within ASP.NET Core 2.0. Unfortunately... it seems to completely ignore my set buffer size... Readi...
2018/06/07
[ "https://Stackoverflow.com/questions/50739391", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4564466/" ]
In a browser environment, you can assign variables by setting a property of the `window` object: ```js for (let i = 0; i < 8; i++) { window["a"+i] = "something "+i; } console.log(a2, a3); ``` As for your code, use this: ``` window["a"+i] = $('[name="answer['+i+']"]:checked').val(); ``` In the `for` loop
``` for (var i = 0; i < 8; ++i) { a[i] = "whatever"; } ``` as posted in [JavaScript: Dynamically Creating Variables for Loops](https://stackoverflow.com/questions/6645067/javascript-dynamically-creating-variables-for-loops)