qid
int64
10
74.7M
question
stringlengths
15
26.2k
date
stringlengths
10
10
metadata
list
response_j
stringlengths
27
28.1k
response_k
stringlengths
23
26.8k
34,230,227
I'm trying to match these kind of character sequences: ``` sender=11&receiver=2&subject=3&message=4 sender=AOFJOIA&receiver=p2308u48302rf0&subject=(@#UROJ)(J#OFN:&message=aoefhoa348!!! ``` Where the delimiters between (key, val) pair is the '&' character. I'd like to group them in a way I can get access to the key a...
2015/12/11
[ "https://Stackoverflow.com/questions/34230227", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3454745/" ]
<https://regex101.com/r/hN7qG9/1> I guess that will solve your problem: > > /([^?=&]+)(=([^&]\*))?/ig > > > **output:** > > sender=11 > > receiver=2 > > subject=3 > > message=4 > > sender=AOFJOIA > > receiver=p2308u48302rf0 > > subject=(@#UROJ)(J#OFN: > > message=aoefhoa348!!! ...
All the special characters in your example fall unter the "punctuation" group, see : <https://docs.oracle.com/javase/7/docs/api/java/util/regex/Pattern.html> If that still isn't enough, you could try to make your own character regex class. Like [@# etc...] . Keep in mind that you will have to escape special java char...
2,164,981
why are the structure declarations in assembly different from those in the win32 api documentation.(i am coming from c++ and trying my hand at assembly language) for example i got this function prototype from icezelion's tutorials(tutorial3) ``` WNDCLASSEX STRUCT DWORD cbSize DWORD ? style ...
2010/01/29
[ "https://Stackoverflow.com/questions/2164981", "https://Stackoverflow.com", "https://Stackoverflow.com/users/200399/" ]
The size of all those different C types is DWORD. Assembly is NOT strongly typed - all it knows about each variable is the number of bytes.
In assembly, regardless of whether a high level structure has pointers or ints, the reality is that their associated high-level datatypes are of BYTE, WORD and DWORD, in your case, the structure are all 32 bit hence DWORD (a WORD is 16bit, DWORD is 32bits). Do not be mislead into thinking the structure in assembly is d...
25,416,102
I see that Admob ads have a dependency on playstore services library. I was wondering if this means that if I distribute my app via channels other than play store it will serve ads or not.
2014/08/20
[ "https://Stackoverflow.com/questions/25416102", "https://Stackoverflow.com", "https://Stackoverflow.com/users/54082/" ]
If you can structure your code so that you return from each branch, it can be a lot cleaner. Sometimes this may entail extracting a method. And ternary operators, if your language supports them, can make matters clearer if used judiciously ``` if (dog == 'alive') return cat == 'alive' ? 'bothLiving' : 'justDog'; re...
You may use different bits to represent animal's state (alive or dead). Then it's a simple switch statement like ``` switch (state) { case 0: // None alive ... break; case 1: // 0th bit alive only(say dog) ... break; case 2: // 1st bit alive only (say cat) .... break; case 3: // 0th and 1st bit alive (dog and cat) } ...
6,067,370
Currently running [Arch Linux](http://en.wikipedia.org/wiki/Arch_Linux), I decided to install [Aircrack-ng](http://en.wikipedia.org/wiki/Aircrack-ng) and try it out on my own wireless network. So I installed it, and I get an error upon Aireplay that states something along the lines of > > Either patch this, or use th...
2011/05/20
[ "https://Stackoverflow.com/questions/6067370", "https://Stackoverflow.com", "https://Stackoverflow.com/users/762109/" ]
Lua is a dynamic language and functions are just a kind of value that can be called with the `()` operator. So you don't really need to forward declare the function so much as make sure that the variable in scope when you call it is the variable you think it is. This is not an issue at all for global variables contain...
You can forward declare a function by declaring its name before declaring the actual function body: ``` local func1 local func2 = function() func1() end func1 = function() --do something end ``` However forward declarations are only necessary when declaring functions with local scope. That is generally what you ...
5,414,775
I am confused with the time complexity of the following piece of code.... ``` i = 0 //first row if(board[i][0] == win && board[i][1] == win && board[i][2] == win) return win; //second row if(board[i+1][0] == win && board[i+1][1] == win && board[i+1][2] == win) return win; //third row i...
2011/03/24
[ "https://Stackoverflow.com/questions/5414775", "https://Stackoverflow.com", "https://Stackoverflow.com/users/66593/" ]
This is obviously a trap question to see if you understood the concept of time complexity. Time complexity measures the order of magnitude that an algorithm needs if applied to larger and larger input. Your example does depend only on a constant number of inputs, this why the others correctly said O(1). In essence thi...
As the other answers suggest, it is O(1). But this is not considered as good coding practice. You can use a loop to generalize it.
11,087,951
I am trying to connect to the ejb service in glassfish server through Java Web start. I am getting the following error while getting the initial context. I have also added the code snippet for getting the initial context. One interesting is when I run the program as a simple java program outside of java web start in...
2012/06/18
[ "https://Stackoverflow.com/questions/11087951", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1437884/" ]
I have the same problem. I use JMS and I need to add other jars. At first I tried using gf-client.jar, but it does not work through Java Web start. So I've added jars listed in [Connecting a remote JMS client to GlassFish 3](https://stackoverflow.com/questions/5489937/connecting-a-remote-jms-client-to-glassfish-3) . I...
I don't know what the relevant jar files are for you, but just in case we have a different view on that area: I use just appserv-rt.jar and java-ee.jar using the same properties you use for initial context and it works fine. Don't add anything else you don't need and try again.
20,740
In the given image below, Fux writes a counterpoint to a cantus firmus given to him as part of his studies by his fictitious teacher *Aloysious*. A rule that is often emphasised is that one should remain in the mode (in this case, the mixolydian mode), and there should be **NO** accidentals, except in the second to l...
2014/07/04
[ "https://music.stackexchange.com/questions/20740", "https://music.stackexchange.com", "https://music.stackexchange.com/users/12397/" ]
First of all, the clefs are not quite right and the bottom part should be an octave lower (this is inferrable from the illegal 4th in the penultimate bar). Modes in Renaissance style are not the strict collections of 7 notes used in "modal" pop and jazz songs. Instead, a mode tells us where the tonic is located within...
I know it's an old discussion, but I thought I might add my five cents: I'm working on the "Gradus" these days (Mann's translation) and have asked myself the same question. Then I remembered that in footnote 9 to Chapter one Mann says that "the tritone is to be avoided even when reached stepwise (f-g-a-b) IF THE LINE ...
2,710,009
A user can have many addresses, but I want to retrieve the latest entry for the user. In sql I would do: ``` SELECT TOP 1 * FROM UserAddress WHERE userID = @userID ``` How can I create a criteria query with the same logic? Is there a TOP functionality?
2010/04/25
[ "https://Stackoverflow.com/questions/2710009", "https://Stackoverflow.com", "https://Stackoverflow.com/users/39677/" ]
Assuming that you have some timestamp column (eg. InsertedAt): ``` User user = ...; var crit = DetachedCriteria.For<UserAddress>() .Add(Restrictions.Eq("User", user)) .AddOrder(Order.Desc("InsertedAt")) .SetMaxResults(1); ```
Since the ordering of the contents of a table are subject to movement (reindexing etc), I'd suggest that you have a time stamp of some description to indicate which is the latest. Then get the first ordered by that field.
51,934,432
My dataset looks like this below ``` Id Col1 -------------------- 133 Mary 7E 281 Feliz 2D 437 Albert 4C ``` What I am trying to do is to take the 1st two characters from the 1st word in Col1 and all the whole second word and then merge them. My final expected dataset should look like this...
2018/08/20
[ "https://Stackoverflow.com/questions/51934432", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4574190/" ]
We can also do this in `paste0` together the output of `substr` and `str_split` within a `dplyr` pipe chain: ``` df <- data.frame(id = c(133,281,437), Col1 = c("Mary 7E", "Feliz 2D", "Albert 4C")) library(stringr) df %>% mutate(Col1 = toupper(paste0(substr(Col1, 1, 2), ...
rather than one row solution this is easy to interpret and modify ``` xx_df <- data.frame(id = c(133,281,437), Col1 = c("Mary 7E", "Feliz 2D", "Albert 4C")) xx_df %>% mutate(xpart1 = stri_split_fixed(Col1, " ", simplify = T)[,1]) %>% mutate(xpart2 = stri_split_fixed(Col1, " ", simplify = T)[,2]...
27,797,706
i have to make a chart on luggage Statistics. The code below will show 4 bars per month, in a bar-chart. i have a sidebar(not given here) were i can fill in the range of details i want (Example, 1 January till 20 August). now i thought of something like a for loop, wich sets a line depening on the amount of months. i...
2015/01/06
[ "https://Stackoverflow.com/questions/27797706", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4295974/" ]
Netease is promoting their new mobile email app "邮箱大师", and they currently blocked any imap client other than their offical clients and several popular clients such as thunderbird, foxmail. I don't know how do they identified the client. Anyway, may it's time for you to switch to other email service provider. At least ...
Please show us the debug output produced by your IMAP library. It seems that the server administrators have configured their server to always reject LOGIN even though you are on a secure SSL connection. That's an interesting choice, but some providers do that. Talk to their support about how you are supposed to connect...
36,093,359
This is driving me around the bend. All the documentation on vectors is ridiculously deep. In a class I want to declare a vector equal in length to the length of a string I've already declared. It sounds easy enough. If I use: ``` class Test { private: size_t size = 10; std::vector<int> array(size); }; ```...
2016/03/18
[ "https://Stackoverflow.com/questions/36093359", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2067256/" ]
In-class initialization requires use of the `type var = value;` syntax or the uniform initialization syntax. For your needs, it is more appropriate to use `type var = value;` syntax. ``` class Test { private: std::size_t size = 10; std::vector<int> array = std::vector<int>(size); }; ``` You can initializ...
Data members are usually initialized in the member initialization list: ``` class Test { std::vector<int> array; public: Test() : array(10) { // ^^^^^^^^^ } }; ```
465,232
This is the problem: There are two players A and B. Player A starts and chooses a number in the range 1 to 10. Players take turn and in each step add a number in the range 1 to 10. The player who reaches 100 first wins. In the program, player A is the user and player B is the computer. Besides that the computer must ...
2013/08/11
[ "https://math.stackexchange.com/questions/465232", "https://math.stackexchange.com", "https://math.stackexchange.com/users/86653/" ]
First player starts with $1$ and then at each turn after picks $11-n$ where $n$ was the other player's choice. That means the numbers are $11k+1$ after first player's turn, and therefore you get to $89$ at turn $9$. If first player even chooses any other value, then second player should choose so the sum is $11k+1$ fo...
Let's assume we will add in range $1$ to $a$ ($1 \leq a$) and we want to reach $0 \leq b$. Then, you should stay on the numbers which gives ($b$ mod $a+1$) in mod $a+1$. For example, if $a = 10$ and $b = 100$, you should say $1,12,23,34,45,56,67,78,89$. So, if you start, say $1$ and whatever computer says, say $12$ (an...
63,417,657
I wrote the following code: ```cpp #include <iostream> using namespace std; const int * myFunction() { int * p = new int(5); return p; } int main() { int * q = myFunction(); cout << "*q=" << *q; cout << endl; return 0; } ``` I purposely wrote the above code to receive an error. The mistake ...
2020/08/14
[ "https://Stackoverflow.com/questions/63417657", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13149182/" ]
> > The return type of myFunction must match exactly to the type of variable which is going the receive it's return value. (Am I correct here? This is what I have understood.) > > > No, the return type must not match exactly to the type of the variable. But it must be possible to implicitly convert the return type...
In the 2nd code, `q` is a `const int *` - a non-const "pointer to a `const int`". Since `q` itself is not `const`, it can be re-assigned to point at a new address. The compiler allows `q = &a;` because an `int*` (ie, what `&a` returns since `a` is an `int`) can be assigned to a `const int*`. In other words, a "pointer...
33,377,872
How can I get automatically primaryKey name of any table in yii framework.I want to use primary key automatically in `framework\gii\generators\model\templates\default\model.php` . primaryKey is XXX ``` return new CActiveDataProvider($this, array( 'criteria'=>$criteria, 'sort'=>array( 'defaultOrder'=>' XX...
2015/10/27
[ "https://Stackoverflow.com/questions/33377872", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4826469/" ]
`find` gives the Output `---------- file.txt :10` when working with files. If it processes STDIN, it gives you only the number: ``` find /v /c "" <file.txt ``` to get this Output into a variable, use this `for` Statement: ``` for /f %%i in ('find /v /c "" ^<file.txt') do set myint=%%i echo %myint% ``` (for use on...
I believe you'll need to pipe the results of `find` into another utility such as [`findstr`](https://technet.microsoft.com/en-us/library/bb490907.aspx)2. Reason being: The /C option `Displays only the count of lines containing the string.`. Depending upon the search `filepath` you provide, there could be multiple en...
20,519,192
I know you can set user [profiles](https://stackoverflow.com/questions/1914286/oracle-set-query-timeout) or set a general timeout for query. But I wish to set timeout to a specific query inside a procedure and catch the exception, something like : ``` begin update tbl set col = v_val; --Unlimited time del...
2013/12/11
[ "https://Stackoverflow.com/questions/20519192", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1026199/" ]
No, you can not set a timeout in pl/sql. You could use a host language for this in which you embed your sql and pl/sql.
```none MariaDB> select sleep(4); +----------+ | sleep(4) | +----------+ | 0 | +----------+ 1 row in set (4.002 sec) MariaDB> ``` See: <https://mariadb.com/kb/en/sleep/>
24,601,235
I am having some trouble with the csrf of sails.js, I activated it and create the hidden field like in the sailsjs documentation, but when I submit the form I always get this response: ``` Error: Forbidden at Object.exports.error (/Users/matheus/Development/javascript/activity_overlord/node_modules/sails/node_modu...
2014/07/06
[ "https://Stackoverflow.com/questions/24601235", "https://Stackoverflow.com", "https://Stackoverflow.com/users/839867/" ]
If your app is in production mode, it will mask the csrf mismatch response with "Forbidden" as per the default forbidden.js file. You can override this by creating the file "api/responses/forbidden.js" and copying the contents of this into it <https://github.com/balderdashy/sails/blob/master/lib/hooks/responses/defau...
First of all you need to get CSRF token by calling the webservice (/csrfToken). In response, you'll get a token. You need to send that token in all subsequent requests to server. ``` $http.get($scope.baseUrl + '/csrfToken') .success(function(csrfObj) { csrfToken = csrfObj._csrf; }); $http.post('/chat/...
816,968
Determine $\displaystyle{\lim\_{n\to\infty} x\_n}$ if $$\left(1+\frac{1}{n}\right)^{n+x\_n}=e,\forall n\in \mathbb{N} $$ I have typed 2 methods giving two different answers --- ### Method 1 $$\lim\_{n\to\infty}\left(1+\frac{1}{n}\right)^{n+x\_n}=\lim\_{n\to\infty}e\\\implies \lim\_{n\to\infty}\left(1+\frac{1}{n}\ri...
2014/06/01
[ "https://math.stackexchange.com/questions/816968", "https://math.stackexchange.com", "https://math.stackexchange.com/users/154556/" ]
We have $$ \left(1+\frac{1}{n}\right)^{x\_n} =e\left(1+\frac{1}{n}\right)^{-n}$$ hence $$x\_n =\frac{1}{\ln\left(1+\frac{1}{n}\right)} -n$$ and therefore $$\lim\_{n\to\infty} x\_n =\frac{1}{2}.$$
You are still solving two different problems. In the first case, you are saying: > > If I know that $$\lim\_{n\to\infty} \left(1+\frac1n\right)^{n+x\_n} = e$$ can I determine $\lim\_{n\to\infty} x\_n$? > > > Your conclusion is correct, you cannot determine $\lim x\_n$ based in this information. For example, if $\...
44,505,904
Suppose I have an RDD of integers, how to apply a median filter to it if the window for the filter is 3? All of the map and filter methods in Spark that I looked into, process only one element at a time. But to find the median within a window, we'd want to know the values of all the elements with in the window at the...
2017/06/12
[ "https://Stackoverflow.com/questions/44505904", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6526073/" ]
To support font family on `API` lower than 26, we need to use ``` <font app:fontStyle="normal" app:fontWeight="400" app:font="@font/myfont-Regular"/> ``` instead of ``` <font android:fontStyle="normal" android:fontWeight="400" android:font="@font/myfont-Regular"/> ```
Here is an example, min sdk support 18 (in app) <https://github.com/mukundrd/androidFonts>
44,939
I distinctly recall reading a Wikipedia page listing multiple theories on the origin of existence itself. One in particular, described in the title, was fascinating and came to mind recently, but I can't recall its name or find the page. I'd like to dig back into it - does anyone know the theory name or page? Again, t...
2017/07/28
[ "https://philosophy.stackexchange.com/questions/44939", "https://philosophy.stackexchange.com", "https://philosophy.stackexchange.com/users/17837/" ]
Wittgenstein has noted that all of logic is a set of tautologies. If you want something other than tautologies, you need an inductive base. From a basic logic point of view, statistics never support an argument. So all observations of frequency are not conclusive. But we generally live in a world that also acknowledge...
> > "A large portion of people find it offensive" > > > This is a logical fallacy. It's called an [argumentum ad populum](https://en.wikipedia.org/wiki/Argumentum_ad_populum). All of Alice's statements are in fact a mere repetition of the same logical fallacy. For Bob and Alice to settle the argument with logic,...
43,820
I have a folder and within it there are many links. I make those links absolute, so that I can move them about within the folder and they still point to the same data. Relative links would break if I moved them within the folder. But the problem arises when i move the folder to another system, say an external hard dr...
2012/07/24
[ "https://unix.stackexchange.com/questions/43820", "https://unix.stackexchange.com", "https://unix.stackexchange.com/users/8563/" ]
I guess the answer to your problem are variant symbolic links, though they only exist on DragonFlyBSD to the best of my knowledge (see that previous question: [Dynamic Symlinks](https://unix.stackexchange.com/questions/7529/dynamic-symlinks) )
You can't have your cake and eat it. Relative links are generally better, because you can move them around and copy all or part of the tree to another location. If you move a file within the hierarchy, it's not clear what *should* happen: if there are links `a -> b` and `c -> d`, and you run `mv b d`, should `a` now p...
69,318,826
I have a hard time to convert a given tensorflow model into a tflite model and then use it. I already posted a [question](https://stackoverflow.com/questions/69305190/object-detection-with-tflite) where I described my problem but didn't share the model I was working with, because I am not allowed to. Since I didn't fin...
2021/09/24
[ "https://Stackoverflow.com/questions/69318826", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6620870/" ]
[`search`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/search) converts any string you give it to a *regular expression*. `[]` is special in regular expressions, it defines a character class. I suspect you want [`includes`](https://developer.mozilla.org/en-US/docs/Web/JavaSc...
### The nasty trap is that you need to double-escape the square bracket Whatever you pass into the `.search()` method is assumed to be a regular expression. In a regular expression, the "[" and "]" are the delimiters for a set of characters, allowing a match with any one of those characters. For example the regular e...
3,594,024
How to create OSGi bundle from jar library?
2010/08/29
[ "https://Stackoverflow.com/questions/3594024", "https://Stackoverflow.com", "https://Stackoverflow.com/users/294069/" ]
First check out if you can find a osgi enabled version of your library from repositories 1. SpringSource <http://www.springsource.com/repository> 2. Fusesource <http://repo.fusesource.com/> If you don't find the OSGi enabled versions. You can go ahead with using the pax tool - [PaxConstruct](http://wiki.ops4j.org/dis...
Late arrival to the party: If you're using **Gradle**, you can add the jar as a normal dependency of your project if you apply the [osgi-run](https://github.com/renatoathaydes/osgi-run) plugin. The osgi-run plugin will wrap the jar transparently into a bundle for you, exporting every package in it and calculating al...
24,297,737
I'd like to place an `ImageView` behind an `ImageButton`. What's the best way to go about doing this?
2014/06/19
[ "https://Stackoverflow.com/questions/24297737", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2580984/" ]
I believe the easiest way to do this is to wrap both the `ImageView` and `ImageButton` in a `FrameLayout`. eg: ``` <FrameLayout android:layout_width="match_parent" android:layout_height="wrap_content" > <ImageView android:layout_width="match_parent" android:layout_height="match_parent" ...
The easiest way is to use an `ImageButton` only. `ImageButton` has a `background` attribute for the background image and a `src` attribute for the image in the foreground. *See this existing [example](https://stackoverflow.com/a/2283993/320111) on StackOverflow.* ``` <ImageButton android:id="@+id/ImageButton0...
13,637,956
I have a base class with a static pointer member. When I assign that static pointer member in a derived class, that static member appears NULL when referenced from the methods of the base class. This is not the behavior I expect. Shouldn't the static pointer member still be assigned regardless of where it is accessed ...
2012/11/30
[ "https://Stackoverflow.com/questions/13637956", "https://Stackoverflow.com", "https://Stackoverflow.com/users/753089/" ]
No repro on a fixed up and simplified version of your code: ``` #include <iostream> #include <iomanip> struct Base { static Base* staticMember; static void baseMethod(); }; Base* Base::staticMember; void Base::baseMethod() { std::cout << std::boolalpha << (staticMember == nullptr) << std::endl; } stru...
Maybe you have accidentally declared class Derived { static Base \*staticMember; }; So you have two staticMembers floating around. This is why an SSCE is useful, to keep people like me from making unfounded guesses.
63,615,554
In laravel 5.8 my swagger documentation is displaying fine but when I enter execute then its coming with 'Could not render n, see the console.' error. [![enter image description here](https://i.stack.imgur.com/LyrO0.png)](https://i.stack.imgur.com/LyrO0.png) **composer.php** ``` "darkaonline/l5-swagger": "5.8.*" ``...
2020/08/27
[ "https://Stackoverflow.com/questions/63615554", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6901052/" ]
Let's try this: 1. Tools -> Options -> Authentication 2. Click "Edit" on Your Account 3. Click "Refresh OAuth Token" It works for me :)
Tools/Options/Authentication, delete your github account, add again. Works for me.
25,740,431
Hello all I am creating a program for finding the date of birth when the exact age is given. For example if age of a man is 21 years 10 months and 22 days(up to current date) how can i find the exact date of birth. I will be thankful if anyone help me with isuue. What i tried is here. here d,m and y are text field fo...
2014/09/09
[ "https://Stackoverflow.com/questions/25740431", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3992215/" ]
Here is Java 8 solution implemented by [Date & Time API](http://docs.oracle.com/javase/8/docs/api/java/time/package-summary.html): ``` int dobYear = 21; int dobMonth = 10; int dobDay = 22; LocalDate now = LocalDate.now(); LocalDate dob = now.minusYears(dobYear) .minusMonths(dobMonth) .minusDays(dobDay...
You are subtracting the days first, then the months and last the years. This is wrong in my opinion because you don't know how many leap year may have been in all the years. Try ``` Calendar cal = Calendar.getInstance(); cal.add(Calendar.YEAR, ye); cal.add(Calendar.MONTH, mo); cal.add(Cal...
7,103,312
I'm using following code for textarea: ``` $('#ajaxSendMessage').live('keyup', function(event) { if (event.keyCode == 13) { controller.sendMessage($(this).val(), $("#ajaxAnswerTo").val()); } }); ``` This code works, but `$("#ajaxAnswerTo").val()` have new line characte when I click enter... For examp...
2011/08/18
[ "https://Stackoverflow.com/questions/7103312", "https://Stackoverflow.com", "https://Stackoverflow.com/users/568975/" ]
Ensure that account running your process where the service is hosted has access rights to the database. For example in case of IIS the account running the application pool where the service is hosted must have login to database server and it must have permissions to do all necessary operations in your database.
Problem :- I had the same problem with hosted WCF service on one of our windows servers. Application was unable to connect with the service. Solution :- Had to reset app/pool of WCF service Thanks
47,971,712
I have files with these filename: ``` ZATR0008_2018.pdf ZATR0018_2018.pdf ZATR0218_2018.pdf ``` Where the 4 digits after `ZATR` is the issue number of magazine. With this regex: ``` ([1-9][0-9]*)(?=_\d) ``` I can extract `8`, `18` or `218` but I would like to keep minimum 2 digits and max 3 digits so the result ...
2017/12/25
[ "https://Stackoverflow.com/questions/47971712", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1297545/" ]
``` (?:[1-9][0-9]?)?[0-9]{2}(?=_[0-9]) ``` or perhaps: ``` (?:[1-9][0-9]+|[0-9]{2})(?=_[0-9]) ``` (<https://www.freeformatter.com/regex-tester.html>, which claims to use the XRegExp library, that you mention in another answer doesn't seem to backtrack into the `(?:)?` in my first suggestion where necessary, which ...
I propose you: ``` ^ZATR0*(\d{2,3})_\d+\.pdf$ ``` demo code [here](https://regex101.com/r/MZ0vRi/1/). Result: > > Match 1 Full match 0-17 `ZATR0008_2018.pdf` Group 1. 6-8 `08` > > > Match 2 Full match 18-35 `ZATR0018_2018.pdf` Group 1. 24-26 `18` > > > Match 3 Full match 36-53 `ZATR0218_2018.pdf` Group 1. 41-4...
3,806,534
> > Question: Suppose $f:(-\delta,\delta)\to (0,\infty)$ has the property that $$\lim\_{x\to 0}\left(f(x)+\frac{1}{f(x)}\right)=2.$$ Show that $\lim\_{x\to 0}f(x)=1$. > > > My approach: Let $h:(-\delta,\delta)\to(-1,\infty)$ be such that $h(x)=f(x)-1, \forall x\in(-\delta,\delta).$ Note that if we can show that $\...
2020/08/28
[ "https://math.stackexchange.com/questions/3806534", "https://math.stackexchange.com", "https://math.stackexchange.com/users/751630/" ]
Setting $y = f(x) + \dfrac{1}{f(x)} \to 2$ we have $$ f(x) = \frac{y\pm\sqrt{y^2-4}}{2} \to \frac{2\pm\sqrt{2^2-4}}{2} = 1. $$ The limit can be justified using the squeeze theorem, since $f(x) = \frac{y\pm\sqrt{y^2-4}}{2},$ i.e. $f(x)$ equals either $\frac{y-\sqrt{y^2-4}}{2}$ or $\frac{y+\sqrt{y^2-4}}{2},$ implies $\f...
I will start off with a fairly general lemma about limiting behavior of roots of a parameterized polynomial equation: **Lemma:** Consider the polynomial equation $x^n + t\_{n-1} x^{n-1} + t\_{n-2} x^{n-2} + \cdots + t\_0 = 0$. Then as $t\_{n-1}, \ldots, t\_0 \to 0$, all $n$ complex roots of this equation also approach...
581,193
there seem to be no stage.border property in AS 3? my class extends Sprite, what is best way to draw border around flash object?
2009/02/24
[ "https://Stackoverflow.com/questions/581193", "https://Stackoverflow.com", "https://Stackoverflow.com/users/20979/" ]
this.graphics.lineStyle(0,0x555555,0.5); this.graphics.drawRect(0,0,this.width,this.height); where "this" is your Sprite object.
OXMO456's code has a typo. Below is the fixed version: ``` this.graphics.lineStyle(0,0x555555,0.5); this.graphics.drawRect(0,0,this.width,this.height); ``` Also, I should mention that this.width and this.height both start as 0 when the application starts, so putting the code above in the constructor of the main Movi...
2,219,169
Integrate the given: $$\int 3x\sqrt {x+5} dx$$. My Attempt: $$\int 3x\sqrt {x+5} dx$$ $$3\int x\sqrt {x+5} dx$$ What should I do next?
2017/04/05
[ "https://math.stackexchange.com/questions/2219169", "https://math.stackexchange.com", "https://math.stackexchange.com/users/354073/" ]
Set $u=x+5$, so the integrand becomes $3(u-5)\sqrt{u} = 3u^{3/2}-15u^{1/2}.$ (And here $dx=du$.) In general, square roots and addition don't get along well together, so when you see $\sqrt{a\pm b}$, you can make the difficulty go away by substituting $u=a \pm b.$
Hint : Take $x+5=t^2$. Then the integral reduces to $$3\int (t^2-5)t 2t dt=6\int t^4-5t^2 $$
12,862,655
When signing an apk after a long break from Android development I was surprised that I'm no longer able to enter an **empty keystore password** to unlock it. Is it just me or has this been possible before? If so, when did that change and how can I manage to unlock the keystore anyway? Some background: maybe I'm just c...
2012/10/12
[ "https://Stackoverflow.com/questions/12862655", "https://Stackoverflow.com", "https://Stackoverflow.com/users/198996/" ]
Try default android debug mode keystore password which is `android` or java cacerts default `changeit`/`changeme`.
If all of the above fail you can try cracking it. Related question: [Android - Forgot keystore password. Can I decrypt keystore file?](https://stackoverflow.com/questions/8894987/android-forgot-keystore-password-can-i-decrypt-keystore-file)
124,628
We have a VF custom button on lead record that sends details of lead via email to a selected contact but when the email is sent it doesn't shows up on lead activity history, is there any way to track the emails being sent through this button? Apex class ``` /*Controller to send This lead to any selected Contact */ p...
2016/06/03
[ "https://salesforce.stackexchange.com/questions/124628", "https://salesforce.stackexchange.com", "https://salesforce.stackexchange.com/users/9919/" ]
you need to use `saveAsActivity` to add this as activity. ``` mail.saveAsActivity(true); ``` This is the missing key here. **Update:** Use the `leadId` in `targetObject` Id to add in the Activity under lead and set the contact email address in to address to send email to contact. ``` String[] toAddresses = new Str...
You have to set `setSaveAsActivity` and `setWhatId`. > > Update > > > In your code, you have set `TargetObjectId` twice as `mail.setTargetObjectId(c.id);` and `mail.setTargetObjectId(LeadRecord.Id);`. Thats why when you comment `mail.setTargetObjectId(LeadRecord.Id);` it is sent to Contact. I was going through ...
38,581,697
I have a following piece for loop in a function which I intended to parallelize but not sure if the load of multiple threads will overweight the benefit of concurrency. All I need is to send different log files to corresponding receivers. For the timebeing lets say number of receivers wont more than 10. Instead of sen...
2016/07/26
[ "https://Stackoverflow.com/questions/38581697", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1702957/" ]
``` XmlDocument newdoc = new XmlDocument(); newdoc.InnerXml = " <?xml version="1.0" encoding="utf-8" ?> <Resorces> <Resource id="3" name="loreum ipsum" downloadcount="5"></Resource> <Resource id="2" name="loreum ipsum" downloadcount="9"></Resource> </Resorces>"; List<string> list = new List <string>(); var selectnode...
You can get by this ``` XDocument doc = XDocument.Load(xmlpath); List<Report> resourceList = doc.Descendants("Resorces") .First() .Elements("Resource") .Select(report => new Report() ...
603,980
According to my desk clock, it is now Monday, 1:00 a.m. I wish to mention in an e-mail preparations for a storm which is expected to arrive Monday around 8:00 p.m., that is, 19 hours from now. The storm is not expected to come "tonight": rather, it is expected to come the following night. The storm is not expected to...
2023/02/27
[ "https://english.stackexchange.com/questions/603980", "https://english.stackexchange.com", "https://english.stackexchange.com/users/210038/" ]
Choose the answers-in-comments that fits your requirements: The 'small hours' of Monday morning can be regarded as still part of Sunday night in some contexts, but not all. The only way to make it clear is to say "The storm is expected tonight (Monday)". – Kate Bunting It is potentially ambiguous: at 1 am Monday it's...
While "tonight" may sometimes be ambiguous in the middle of the night, very often context will make it clear whether you mean the current night in progress or the upcoming night. For instance, if you say: > > There's a storm coming tonight, I'm going to board up the windows in the morning. > > > it's obvious tha...
11,003,586
I have a table like "groups" that stores a list of groups that my "users" can belong to. In the User model, this is accomplished with `belongs_to :group`. In my view, I want to display the group name. I'm trying to do that with `@user.group.name`. The problem is that not every user is assigned to a group, so `@user.g...
2012/06/12
[ "https://Stackoverflow.com/questions/11003586", "https://Stackoverflow.com", "https://Stackoverflow.com/users/186100/" ]
The simplest way would be to do something like this: ``` <% if @user.group.present? %> <%= @user.group.name %> <% end %> ``` However, according to the [Law of Demeter](http://en.wikipedia.org/wiki/Law_of_Demeter), a model should only talk to it's immediate association/should not know about its association's metho...
I would create a method with a good name, so it would be easy to reuse the code. ``` def is_assigned? self.group end <% if @user.is_assigned? %> ... <% end %> ```
150,895
Is there a state in Rubik's cube which can be considered to have the highest degree of randomness (maximum entropy?) asssuming that the solved Rubik's cube has the lowest?
2012/05/28
[ "https://math.stackexchange.com/questions/150895", "https://math.stackexchange.com", "https://math.stackexchange.com/users/5622/" ]
Assuming 'most random' means 'takes the most number of moves to solve the cube', then [the answer is 20](http://cube20.org/). This site also has an example of a state that requires at least 20 moves to solve. This result is from 2010, and is a computer-assisted proof.
If you're considering maximal entropy as I think your question alludes to, you need to maximize the degeneracy of the states since $S \equiv k \ln \Omega$, where $\Omega$ is the number microstates. It doesn't make sense to consider a single state of the cube to be most random...we could just as well consider our chose...
31,464
I'm trying to do some distribution calculations on a couple of tokens and could use an export of the token holders list that I can find in Etherscan when I search for a specific token. Since Etherscan is showing the list I was hoping the API would have a function for this, but it looks to me like it doesn't. Please bea...
2017/11/23
[ "https://ethereum.stackexchange.com/questions/31464", "https://ethereum.stackexchange.com", "https://ethereum.stackexchange.com/users/23548/" ]
I have created a standalone tool which does the same. * Take a token contract address * Iterate over all `Transfer` events for token using `eth_getLogs` JSON-RPC API * Build a local database of these events * Allow you to use SQL to query any account balance on any point of time (block num) [You can find the command ...
Try this: [<https://etherscan.io/exportData?type=tokens&contract=0xa02e3bb9cebc03952601b3724b4940e0845bebcf> Replace *Contract* with your token contract address
58,087,772
I'm trying to modify [this](https://github.com/aws-samples/aws-cdk-examples/blob/master/python/lambda-s3-trigger/s3trigger/s3trigger_stack.py) AWS-provided CDK example to instead use an existing bucket. Additional [documentation](https://docs.aws.amazon.com/cdk/latest/guide/resources.html#resources_importing) indicates...
2019/09/24
[ "https://Stackoverflow.com/questions/58087772", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4024884/" ]
I managed to get this working with a [custom resource](https://docs.aws.amazon.com/cdk/api/latest/docs/custom-resources-readme.html). It's TypeScript, but it should be easily translated to Python: ```js const uploadBucket = s3.Bucket.fromBucketName(this, 'BucketByName', 'existing-bucket'); const fn = new lambda.Funct...
AWS [now supports](https://aws.amazon.com/blogs/aws/new-use-amazon-s3-event-notifications-with-amazon-eventbridge/) s3 eventbridge events, which allows for adding a source s3 bucket by name. So this worked for me. Note that you need to enable eventbridge events manually for the triggering s3 bucket. ``` new Rule(thi...
390,015
When I boot up after installing that package, my monitors don't work. I know that I can still get to a tty and that the system is working because I can run 'eject cdrom' and I can play the bell noise, but I can't see anything. I know that it's specifically this package because I reinstalled the OS, rebooted, and ever...
2017/09/02
[ "https://unix.stackexchange.com/questions/390015", "https://unix.stackexchange.com", "https://unix.stackexchange.com/users/223417/" ]
Well, nvidia drivers aren't the top top ones I've faced. The probable reason may be some incompatibility between your xorg and your (non-free, binary) nvidia drivers. The first what I would do in your place: removing the linux-firmware-nonfree and reboot. Second, you may think on a kernel upgrade (if you aren't on t...
I reinstalled the OS and instead of installing linux-firmware-nonfree I installed nvidia-driver. This fixed the issue.
224,159
*Context*: I have a very similar problem to the one exposed [here](https://electronics.stackexchange.com/questions/30719/analog-voltage-level-conversion-level-shift), and in the best rated answer (by Olin Lathrop), he says we need a *rail to rail* output opamp. *My question*: 1. What is a **rail to rail** opamp? (In ...
2016/03/23
[ "https://electronics.stackexchange.com/questions/224159", "https://electronics.stackexchange.com", "https://electronics.stackexchange.com/users/100869/" ]
"*Rail-to-rail*" is a marketing term used to describe an op amp whose dynamic range is able to reach the extremes of the supply voltage. This can refer to either the output or both the input and output. It is not possible for the output to exceed the positive or negative supply voltage (which is why these are commonly...
Rail to rail means that the op-amp inputs and outputs can operate near the supply voltages. Many op-amps that operate on relatively high voltage rails (I.e. +/-15v) can only drive the output to within 3 or 4 volts of the rail - for example, with a bipolar 15 volt supply, the amp may only be able to drive up to +/-12v. ...
800,294
Windows 7 Enterprise x64 So I made a mistake and ran a dubious executable program downloaded from the internet. I was making a dvd and I didn't know how to download videos from funnyordie.com, so I went out on a limb and tried Wondershare Allmytube. It did what I wanted but it seemed really sketchy and it made my lapt...
2014/08/20
[ "https://superuser.com/questions/800294", "https://superuser.com", "https://superuser.com/users/359575/" ]
I found a useful tip on another website about this Wondershare issue. 1. Go into registry editor. 2. Collapse all the files. 3. Go under "edit" and hit "find" - type in `Wondershare` and it will call up instances of the file (one by one). 4. You have to delete them manually. 5. Hit `F3` to find the next instance of th...
I found Control.Alt.Delete then Processes. Delete any under wondershare then go back to the regular uninstaller and remove. Worked for me
6,427,530
I'm not very good at regular expressions at all. I've been using a lot of framework code to date, but I'm unable to find one that is able to match a URL like `http://www.example.com/etcetc`, but it is also is able to catch something like `www.example.com/etcetc` and `example.com/etcetc`.
2011/06/21
[ "https://Stackoverflow.com/questions/6427530", "https://Stackoverflow.com", "https://Stackoverflow.com/users/793197/" ]
I have been using the following, which works for all my test cases, as well as fixes any issues where it would trigger at the end of a sentence preceded by a full-stop (`end.`), or where there were single character initials, such as 'C.C. Plumbing'. The following regex contains multiple `{2,}`s, which means two or mor...
I was getting so many issues getting [the answer from anubhava](http://%20https://stackoverflow.com/a/6427654/7778012) to work due to recent PHP allowing `$` in strings and the preg match wasn't working. Here is what I used: ``` // Regular expression $re = '/((https?|ftp):\/\/)?([a-z0-9+!*(),;?&=.-]+(:[a-z0-9+!*(),;?...
14,558,417
I am trying to interface my Nokia N95 with Proteus. It works almost fine, except of one thing. When I want to get the response from the modem, I use `unsigned char input[20]` and `scanf("%s",input)`. When the modem receives a call, it send `RING` to the port, but what I get with `scanf` is `RIG` or `RNG`. What might be...
2013/01/28
[ "https://Stackoverflow.com/questions/14558417", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1993293/" ]
Does that code really compile? The if-statement in void checkRing() has mismatched paranthesis. ps. Sorry for the "answer" instead of a comment, but my reputation does not allow comments.
I must say that this code seems to invite a hacker attack. The line `scanf("%s",&input);` reads bytes until a newline, into the buffer on the stack. If more than 10 bytes are read, the buffer overflows and the stack is corrupted. From there, the way to overwriting the return address and executing arbitrary code is ...
6,628,358
I know what this means, and I have searched Google, and MSDN. But, how else am I going to get around this? I have a function in my razor code inside the App\_Code folder (using WebMatrix), and I get info from the database, do some calculations, then update the database with the new total. But, how am I to pass variab...
2011/07/08
[ "https://Stackoverflow.com/questions/6628358", "https://Stackoverflow.com", "https://Stackoverflow.com/users/789564/" ]
you can't use `var` as the type of a method parameter. It has to be a real type (string, int, Object, etc). `var` can only be used inside of a method (like in your foreach)
as usual, this is dumb. Why not use declare it as the type of the return type of the constructor?. as a "rule" var should only be used with constructors. If you have some deep problem with that.. introduce dim into csharp; just change the token for a class reference when compiling.
3,434
`UNDER CONSTRUCTION` ==================== I noticed (or re-noticed, studies say people's attention span on the internet decreases by . . . Oh I love that GIF, it never gets old) that we have an [Editor's Lounge](http://chat.stackexchange.com/rooms/49035/ell-editors-lounge). Nice. There have been previous attempts at ...
2017/02/04
[ "https://ell.meta.stackexchange.com/questions/3434", "https://ell.meta.stackexchange.com", "https://ell.meta.stackexchange.com/users/14111/" ]
[![Language Learning Stack Exchange](https://i.stack.imgur.com/M1ZO7.png)](http://languagelearning.stackexchange.com)
[![Support the Interpersonal Skills site proposal](https://area51.stackexchange.com/ads/proposal/92736.png)](https://interpersonal.stackexchange.com/)
14,455,039
I'm not a DBA and I don't know what is the best solution. I have two tables, ``` Custumers Table CustomerId (primary key, identity) ... ``` and ``` Suppliers Table SupplierId (primary key, identity) ... ``` and I want to store multiple telephone number and multiple emails. I thought to create two other tables...
2013/01/22
[ "https://Stackoverflow.com/questions/14455039", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1016255/" ]
A good design would be * Customers: Table of customers - CustomerId, Other columns * Suppliers: Table of suppliers - SupplierId, Other columns * Telephones: Table of telephones - TelephoneId, other columns * CustomerTelephones: CustomerId, TelephoneId * SupplierTelephones: SupplierId, TelephoneId
you can do like ``` Customers: Table of customers - CustomerId, Other columns Suppliers: Table of suppliers - SupplierId, Other columns Telephones: Table of telephones - TelephoneId,TypeId,TypeName, other columns ``` where TypeName will be `Customers` or `Suppliers`, ant `TypeId` will be id of the resp.
4,750
I think I understand the (quite easy) basic grammar now... I just need some way to learn the words, but I don't just want to learn them off a list. Some kind of text with each line in English and Esperanto would be perfect, so I learn it while reading... Where do I find some material like this?
2018/03/25
[ "https://esperanto.stackexchange.com/questions/4750", "https://esperanto.stackexchange.com", "https://esperanto.stackexchange.com/users/1414/" ]
Duolingo – Did you know that Duolingo has an Esperanto course? If you’re very busy, you can use this program to learn Esperanto from your smartphone in your downtime. Lernu – This excellent website has three different Esperanto courses, depending on your learning style. I recommend you start with Ana Pana. The site al...
Each of [the exercises of the *Fundamento*](http://www.akademio-de-esperanto.org/fundamento/ekzercaro.html) includes a gloss. Although later exercises do expect you to already know the words from earlier exercises. I personally found these exercises very helpful. Especially because they also demonstrate some nuances t...
1,862,526
I have an ASP.NET application where only users authenticated by Windows (i.e. logged on user) have access to most pages. Now, my client wants to be able to 'log on' through this app, with a custom login dialogue/page. Is Authentication the way to achieve this, and how do I go about it?
2009/12/07
[ "https://Stackoverflow.com/questions/1862526", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8741/" ]
Just tweak the JButton. ``` button= new JButton("MenuItem"); button.setOpaque(true); button.setContentAreaFilled(false); button.setBorderPainted(false); button.setFocusable(false); button.addActionListener(new buttonHandler()); menuBar.add(button); ``` `setContentAreaFilled` makes it see-through, `setBorderPainte...
I had something like this happen recently I had a JMenuBar that only had 2 JMenuItems in (so note that I haven't tried this in a mixed JMenu and JMenuItem environment. At first I ended up changing the Layout to a FlowLayout with a left alignment, but that left too much space in-between the components. I messed around ...
16,690
I am brewing my first kit beer. I want to set aside one gallon and make a high ABV batch. I am brewing a honey wheat and adding jalapeño. How would I make the higher ABV and what would the technical name be? Imperial witbier?
2015/12/21
[ "https://homebrew.stackexchange.com/questions/16690", "https://homebrew.stackexchange.com", "https://homebrew.stackexchange.com/users/13069/" ]
First: It is your first brew! Relax. Brew it and THEN start playing. There is a lot of things you need to get used to. But it is up to you. :) You can follow thesquaregroot's answer, or you can alter the abv in a different way: Brew the beer and let it ferment in two fermenters, where the one fermenter is the one gal...
Assuming you're doing a partial boil (e.g. boiling 3 gallons and adding water to reach a target 5 gallons), you could just take a gallon post-boil and a proportional amount of water to the larger batch (i.e. two thirds of the additional 2 gallons). Of course if you're targeting a specific ABV it may be more complicate...
60,549,660
I have a simple chat module that allows accounts to create multi-user rooms. * Given the below schema - is it possible to create a query that will check if room with given users already exist? * If this check could lead to performance issues - can you propose other design or approach? [![enter image description here]...
2020/03/05
[ "https://Stackoverflow.com/questions/60549660", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4904588/" ]
Based on the other answers, I ended up writing my own query: ``` SELECT chat_id FROM chat_account WHERE chat_id IN ( SELECT c2.chat_id FROM chat_account c2 WHERE c2.account_id IN (2, 3) ) GROUP BY chat_account.chat_id HAVING array_agg(chat_account.account_id) = ARRAY[2, 3] ```
you need something like this ``` with selected_users as (select * from accounts where id in (2,3)), users_chat_rooms as ( select chat_id, array_agg(account_id order by account_id asc) users_in_room from chat_account group by chat_id ) select * from users_chat_rooms where chat_id in (select chat_id from chat_account wh...
1,794
I just remarked that some of the questions on the main page are formatted differently than others. All questions which have been tagged with `biblatex` have a yellow background. Is this a new feature or just a browser issue? ![enter image description here](https://i.stack.imgur.com/TxIqs.png)
2011/09/29
[ "https://tex.meta.stackexchange.com/questions/1794", "https://tex.meta.stackexchange.com", "https://tex.meta.stackexchange.com/users/3240/" ]
It may be that you favorited [biblatex](https://tex.stackexchange.com/questions/tagged/biblatex "show questions tagged 'biblatex'"), as Martin explained, but it also can be that you just happened to *visit* a lot of questions with the [biblatex](https://tex.stackexchange.com/questions/tagged/biblatex "show questions ta...
To add to the other answers. Favoring tags is one way to watch and highlight certain preferred content on Stack Exchange. The two other ways to watch content that I can think of is favoring questions (i.e. your favorite questions) and subscribing to tags by either e-mail (the subscribe link in the hover of tags) or rss...
42,581,035
Defined model like below (No property, but just one method): ``` namespace PartyInvitesInProASPNETMVC5.Models { public class MyAsyncMethods { public static Task<long?> GetPageLength() { HttpClient client = new HttpClient(); var httpTask = client.GetAsync("http://www.goog...
2017/03/03
[ "https://Stackoverflow.com/questions/42581035", "https://Stackoverflow.com", "https://Stackoverflow.com/users/338944/" ]
You should wait for the result in the controller with await: ``` public async Task<ActionResult> GooglePageLength() { long? content = await MyAsyncMethods.GetPageLength(); return View(content); } ``` Then make your view model type `long?`: ``` @model long? ``` You are currently passing the task that compl...
Modified the action method like below. ``` public ActionResult WellsFargoPageLength() { ViewBag.PageLength = MyAsyncMethods.GetPageLength().Result; return View(); } ``` Deleted the View and created once again keeping the above modified action method in mind.
217,810
I need to make a field required on the edit form. It does not appear on the New Form. I can't set it as required at the site column level because the system will not save the New form without that field completed. I took this `PreSaveAction` script from another form I have used it with and tried to modify to fix my is...
2017/06/09
[ "https://sharepoint.stackexchange.com/questions/217810", "https://sharepoint.stackexchange.com", "https://sharepoint.stackexchange.com/users/59691/" ]
You can check whether the form is a edit/new/disp form. Accordingly you can set the required field. For edit form the default url of the list for is editform.aspx, so check if the URL is EditForm.aspx then get the field and make it mandatory. Check if this works for you. There is other option if you are editing the f...
you have to modify your code like below. ``` <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script> <script type="text/javascript"> function PreSaveAction(){ //these look for the display name values in the text field var textDept1 = $("select[title$='Dept#1']").val(); i...
9,096,139
Can FindFirstFile() be used to move or copy a file from one directory to another? Since it returns a handle, can this handle be used to do it?
2012/02/01
[ "https://Stackoverflow.com/questions/9096139", "https://Stackoverflow.com", "https://Stackoverflow.com/users/627760/" ]
The handle it returns is only useful to allow you to call FindNextFile(). Quite handy, lets you pass a wildcard ("*.*" for example) to iterate all the files that match. Don't forget to call FindClose(). The real nugget is the WIN32\_FIND\_DATA.cFileName value it returns. That's the one you need to call MoveFile() to a...
The [MoveFile()](http://msdn.microsoft.com/en-us/library/windows/desktop/aa365239%28v=vs.85%29.aspx) function just takes in 2 parameters (from file name, to file name) so you wouldn't need to use FindFirstFile to move a file. The [CopyFile()](http://msdn.microsoft.com/en-us/library/windows/desktop/aa363851%28v=vs.85%29...
11,128,843
I have a function that returns a value that can be true if the condition is met and false if not, but the function can also return a string message in case of an error. I need to differentiate between the true/false boolean values under normal conditions without mistaking the string value for either one. My strategy i...
2012/06/20
[ "https://Stackoverflow.com/questions/11128843", "https://Stackoverflow.com", "https://Stackoverflow.com/users/848117/" ]
According to this: > > @Esailija Why no sense? If it is true return a true, if it is false > return false, if it is 'somestring' also return false. Get it? – > Registered User 31 secs ago > > > You want ``` function parseBoolean(value) { return typeof value == "boolean" ? value : false; } ``` But this ob...
Is it what you're looking for? ``` var parseBooleanGenerator = function(aPerfectString) { return function(someStringFromWild) { return aPerfectString === someStringFromWild }; }; var goodString = 'FFF'; var badString = 'FfF'; console.log(parseBooleanGenerator('FFF')(goodString)); // true console.log(parseB...
119,597
I have a multiboot system set up. The system has three drives. Multiboot is configured with Windows XP, Windows 7, and Ubuntu - all on the first drive. I had a lot of unpartitioned space left on the drive and was reserving it for adding other OSes and for storing files there in the future. One day I went ahead and dow...
2012/04/07
[ "https://askubuntu.com/questions/119597", "https://askubuntu.com", "https://askubuntu.com/users/53817/" ]
There is an alternative cause of this problem. In this particular case, GRUB was somehow corrupted and needed to be repaired or reinstalled. However, as shown in [Grub rescue fails with "Boot Repair" with error "unknown file system"](https://askubuntu.com/questions/286837/grub-rescue-fails-with-boot-repair-with-error-u...
**Install Boot-Repair in Ubuntu** 1. Boot your computer on a Ubuntu live-CD or live-USB. 2. Choose "Try Ubuntu" 3. Connect internet 4. Open a new Terminal (`Ctrl`+`Alt`+`T`), then type: ``` sudo add-apt-repository ppa:yannubuntu/boot-repair && sudo apt-get update ``` 5. Press `Enter`. 6. Then type: ``` sudo apt-get...
446,276
I just read about the [FastFormat C++ i/o formatting library](http://www.fastformat.org/), and it seems too good to be true: Faster even than printf, typesafe, and with what I consider a pleasing interface: ``` // prints: "This formats the remaining arguments based on their order - in this case we put 1 before zero, f...
2009/01/15
[ "https://Stackoverflow.com/questions/446276", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1737/" ]
> > Is there a 'catch' with FastFormat? > > > Last time I checked, there was one annoying catch: You can only use *either* the narrow string version *or* the wide string version of this library. (The functions for `wchar_t` and `char` are the same -- which type is used is a compile time switch.) With iostreams, ...
It looks pretty interesting indeed! Good tip regardless, and +1 for that! I've been playing with it for a bit. The main drawback I see is that FastFormat supports less formatting options for the output. This is I think a direct consequence of the way the higher typesafety is achieved, and a good tradeoff depending on ...
267,021
When at the command line, I find that I have to type out this command very often: ``` find . -iname "*php" -exec grep -H query {} \; ``` I'd love to set up an alias, script, or shortcut to make it work easier. I would like to do something like: ``` mysearch query ("*php") (.) ``` It would be great if the comman...
2011/04/05
[ "https://superuser.com/questions/267021", "https://superuser.com", "https://superuser.com/users/64408/" ]
From [**Firefox Help - Recovering important data from an old profile**](http://support.mozilla.com/en-US/kb/Recovering%20important%20data%20from%20an%20old%20profile#w_passwords): > > Your passwords are stored in two different files, both of which are required: > > > * key3.db - This file stores your key database f...
[password forensics](https://web.archive.org/web/20150216232057/http://securityxploded.com:80/passwordsecrets.php#Firefox) has an overview and tools for recovery. The latter is a brute force attack on the master password (if you have it, which you should). The security is as good as your password, basically. [This link...
18,636,046
I am making a HTTPPost call using Apache HTTP Client and then I am trying to create an object from the response using Jackson. Here is my code: ``` private static final Logger log = Logger.getLogger(ReportingAPICall.class); ObjectMapper mapper = new ObjectMapper(); public void makePublisherApiCall(String jsonRequest)...
2013/09/05
[ "https://Stackoverflow.com/questions/18636046", "https://Stackoverflow.com", "https://Stackoverflow.com/users/523537/" ]
I found an answer for similar issue with Spring RestTemplate here : <https://www.baeldung.com/spring-rest-template-interceptor> if we want our interceptor to function as a request/response logger, then we need to read it twice – the first time by the interceptor and the second time by the client. The default implement...
I had the same problem. In my case, I need to get the response content via AOP/
47,194,063
Has anyone figured out a way to keep files persisted across sessions in Google's [newly open sourced Colaboratory](https://colab.research.google.com)? Using the sample notebooks, I'm successfully authenticating and transferring csv files from my Google Drive instance and have stashed them in /tmp, my ~, and ~/datalab....
2017/11/09
[ "https://Stackoverflow.com/questions/47194063", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3424705/" ]
Not sure whether this is the best solution, but you can sync your data between Colab and Drive with automated authentication like this: <https://gist.github.com/rdinse/159f5d77f13d03e0183cb8f7154b170a>
As you pointed out, Google Colaboratory's file system is ephemeral. There are workarounds, though there's a network latency penalty and code overhead: e.g. you can use boilerplate code in your notebooks to mount external file systems like GDrive (see their [example notebook](https://colab.research.google.com/notebooks/...
961,833
Is it possible to disable default gateway in WireGuard VPN client? I used "allowed IP" to my own subnet, but still whenever I try to connect to VPN server, the client sets default gateway to the WireGuard server IP. Any other way to disable default gateway in WireGuard?
2019/04/06
[ "https://serverfault.com/questions/961833", "https://serverfault.com", "https://serverfault.com/users/100156/" ]
Instead of specifying `AllowedIPs = 0.0.0.0/0` specify an ip address. Ran into this question wondering the same thing. The use case detailed here pointed me in the right direction: <https://emanuelduss.ch/2018/09/wireguard-vpn-road-warrior-setup/>
I used `systemd`. Setting `netdev` here <https://www.freedesktop.org/software/systemd/man/systemd.netdev.html#%5BWireGuard%5D%20Section%20Options> will **not** create route table entry for you. You'll need to manually add it here <https://www.freedesktop.org/software/systemd/man/systemd.network.html#%5BNetwork%5D%20Sec...
444,628
Would learning to program fractals help think clearly about certain set of programming problems?
2009/01/14
[ "https://Stackoverflow.com/questions/444628", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1443363/" ]
Fractals got me thinking about complex numbers and [branch-points](http://en.wikipedia.org/wiki/Branch_point). Whether that was a good thing is, I suppose, a matter of opinion. :-)
Great idea! I think coding up fractals makes a great "etude" (study) sized program. It has some nice features this way: generally you won't require much 3rd party code, they can be implemented in a reasonably short amount of time (and complexity) and you get something nice too look at in the end which also verifies you...
885,496
In order to get good test coverage, I want to test the `WriteExternal` and `ReadExternal` methods of `IPortableObject` (as described at [Creating an IPortableObject Implementation (.NET)](http://coherence.oracle.com/display/COH34UG/Configuration+and+Usage+for+.NET+Clients#ConfigurationandUsagefor.NETClients-CreatinganI...
2009/05/19
[ "https://Stackoverflow.com/questions/885496", "https://Stackoverflow.com", "https://Stackoverflow.com/users/22514/" ]
High level abstraction? I suppose the highest level abstractions in the Bouncy Castle library would include: * The [BlockCipher](http://www.bouncycastle.org/docs/docs1.6/org/bouncycastle/crypto/BlockCipher.html) interface (for symmetric ciphers) * The [BufferedBlockCipher](http://www.bouncycastle.org/docs/docs1.6/org/...
You may use: ``` byte[] process(bool encrypt, byte[] input, byte[] key) { var cipher = CipherUtilities.GetCipher("Blowfish"); cipher.Init(false, new KeyParameter(key)); return cipher.DoFinal(input); } // Encrypt: byte[] encrypted = process(true, clear, key); // Decrypt: byte[] decrypted = process(false, ...
47,366,956
[![enter image description here](https://i.stack.imgur.com/Nt0e9.jpg)](https://i.stack.imgur.com/Nt0e9.jpg) I have a division which horizontally fits the screen inside which I have 5 divisons, I want 4 divisions to appear on screen and 1 division to appear when I scroll the division horizontally. And I want the scrollb...
2017/11/18
[ "https://Stackoverflow.com/questions/47366956", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7088483/" ]
You can do it with [Flexbox](https://developer.mozilla.org/en-US/docs/Learn/CSS/CSS_layout/Flexbox): ```css .outer { display: flex; /* displays flex-items (children) inline */ overflow-x: auto; } .inner { flex: 0 0 25%; /* doesn't grow nor shrink, initial width set to 25% of the parent's */ height: 1em; /* ju...
I'm not sure if I've misunderstood you, but I think that what you want to do is have the H1 over the 5 div, like this: <https://jsfiddle.net/p78L2bka/> ```css .outer { display: flex; overflow-x: scroll; } .middle { display: flex; width: 100%; } .inner { flex: 0 0 25%; height: 100px; } ``` ``...
2,916,352
I was just researching some statistics and ran into this problem: a)If we have two normal bell curves, displaced by one standard deviation, how large is the area of overlap? b)What is the proportion of the area of overlap to the remaining area of one of the bell curves? Thank you for any help in advance.
2018/09/14
[ "https://math.stackexchange.com/questions/2916352", "https://math.stackexchange.com", "https://math.stackexchange.com/users/552221/" ]
Not much left to add to the answers you provided in the post, except +1 for a nicely asked question. * For quick verification, and trusting that the problem has indeed a unique answer regardless of $\,A\,$, consider the degenerate case where $\,A\,$ lies on $\,BC\,$ one unit away from $\,B\,$ towards $\,C\,$. Then $\,...
Apply cosine law to both $\triangle ABM$ and $\triangle ACM$. Note that the cosine term will cancel each other because $\cos \theta = - \cos (\pi - \theta)$.
7,000,090
I have a table with following scehma ``` CREATE TABLE MyTable ( ID INTEGER DEFAULT(1,1), FirstIdentifier INTEGER NULL, SecondIdentifier INTEGER NULL, --.... some other fields ..... ) ``` Now each of FirstIdentifier & SecondIdentifier isunique but NULLable. I want to put a unique ...
2011/08/09
[ "https://Stackoverflow.com/questions/7000090", "https://Stackoverflow.com", "https://Stackoverflow.com/users/712447/" ]
You can use a filtered index as a unique constraint. ``` create unique index ix_FirstIdentifier on MyTable(FirstIdentifier) where FirstIdentifier is not null ```
Do a filtered unique index on the fields: ``` CREATE UNIQUE INDEX ix_IndexName ON MyTable (FirstIdentifier, SecondIdentifier) WHERE FirstIdentifier IS NOT NULL AND SecondIdentifier IS NOT NULL ``` It will allow `NULL` but still enforce uniqueness.
65,719
I'm trying to communicate with a remotely connected FRAM (FM24C04 from Ramtron) by using I2C. This memory is embedded on a board that can be inserted and removed at any time to/from the system (communication is properly terminated before the memory is removed). The problem is: just after inserting the card that contai...
2013/04/15
[ "https://electronics.stackexchange.com/questions/65719", "https://electronics.stackexchange.com", "https://electronics.stackexchange.com/users/22628/" ]
10k seems a bit big for your pullups, and your leading edges look slow. Reduce the resistors to about 3k and see if that helps. Also, why is the off voltage drifting with time?
Do u hv a 24c04a, b, or c? If its a c04a, it was a robust design. The b part has sensitivity to power supply ramps. What decoupling do u hv on pin8 to gnd? I was gonna say something about signal levels but I see that u use a level translator. You might want to check that u don't get a glitch on SCL that the chip would ...
14,087,893
I'm trying to create a simple script for logging into various servers via ssh, all keys have been installed and are working but i simply cannot get this script to work for me. Basically there is an option as to which server the user wishes to login to but it keeps throwing up the following error: ``` ': not a valid id...
2012/12/30
[ "https://Stackoverflow.com/questions/14087893", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1232678/" ]
This answer is really just a comment, but comments are not suitable for code. You're script could be greatly simplified. Consider something like: ``` #!/bin/bash servers=( host1 host2 host3 ) ips=( 192.168.1.1 192.168.1.2 192.168.1.3 ) ports=( 123 22 33 ) select server in ${servers[@]}; do echo "Logging into $ser...
I'll throw myself in front of the SO bus by answering the question you didn't ask on this one. Why not use `select`? ``` echo 'Which server would you like to log into?' select server in 192.168.0.1 192.168.0.2 192.168.0.3 192.168.0.4; do printf 'Logging in to server %s...\n' "$server" ssh "$server" -p "$port" ...
16,287,829
I started learning WPF few days ago and have been creating some test projects to evaluate my understanding of the materials as I learn them. According to [this article](http://www.codeproject.com/Articles/18270/A-Guided-Tour-of-WPF-Part-3-Data-binding), "a property can only be bound if it is a dependency property." To ...
2013/04/29
[ "https://Stackoverflow.com/questions/16287829", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1082327/" ]
Picking up a second question tucked in at the end of your post: > > Also a not-very-relevant question: I noticed in almost every singe article on WPF people use a local variable and then define a getter and setter for it, even though we all know in .NET 2.5 (I believe?) and above, we can just use the `get; set;` synt...
Using mvvm light you can bind properties and raise event. ``` /// <summary> /// The <see cref="SelectedPriority" /> property's name. /// </summary> public const string SelectedPriorityPropertyName = "SelectedPriority"; private string _selectedPriority = "normalny"; /// <summary> /// Sets ...
33,109,712
i tried to center a row of bootstrap custom buttons. It is not working and still is at the left side of the page, no matter what i try. i need some help. the page got all bootstrap added to the code like it should, but i cant center this buttons. Thank you. Here is my css and html Code ``` <style type="text/css"> .bt...
2015/10/13
[ "https://Stackoverflow.com/questions/33109712", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1668330/" ]
Fixed your codes. -- ```css .btn-circle { width: 130px; height: 130px; padding: 10px 0; font-size: 12px; border:7px solid #cfd8dc; line-height: 1.428571429; border-radius: 130px; } .btn-circle.btn-lg { width: 130px; height: 130px; paddi...
Take out the unnecessary div wrap around each button, then the text-align works properly. Check fiddle: <https://jsfiddle.net/bL8vr504/1/> ``` <div class="row" style="margin:auto;text-align:center; width: 100%;"> <button type="button" class="btn btn-default btn-circle btn-lg"><span>-</span></button> <button t...
71,100
Do police need to have established probable cause before they arrest you, or can your actions later validate the lack of probable cause that they had when they arrested you? I suspect this may just be one of the many reasons not to talk to the police.
2021/08/24
[ "https://law.stackexchange.com/questions/71100", "https://law.stackexchange.com", "https://law.stackexchange.com/users/5189/" ]
**Can police arrest you to later fish for probable cause?** Answer for [england-and-wales](/questions/tagged/england-and-wales "show questions tagged 'england-and-wales'") (although presumably there are similar conditions that must be met in the [united-states](/questions/tagged/united-states "show questions tagged 'u...
In formal English common law, a person cannot be arrested unless they are in commission of a felony and the person or persons arresting them have observed them committing that felony. In all other cases, by formal law, a warrant of arrest would be needed. Note that there is no need to "arrest" someone to charge and pro...
14,160,683
I am a c# developer learning/relearning/brushing up on c++ I'm working on database access I have the following code and im having trouble understand what the & does in this case. ``` SQLHENV hEnv = NULL; if (SQLAllocHandle(SQL_HANDLE_ENV, SQL_NULL_HANDLE, &hEnv) == SQL_ERROR) { ``` If I remove the & I get ...
2013/01/04
[ "https://Stackoverflow.com/questions/14160683", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1949093/" ]
`&` is the address operator. It's taking the local hEnv and passing the address of it. Now you have not the type but a pointer to the type you are referring. so ``` void foo() { int i = 1; int * iptr = &i; } ``` When you skip the address operator you still have the type, not the pointer to the type.
& does mean to pass by reference. The compiler is just telling you it can't convert from a reference to value type EDIT: When a function accepts an ADDRESS(pointer), it is called pass by reference. I'm sorry if my answer confused some people, but in this case your function is expecting a REFERENCE to a variable, so yo...
10,191
I'm new in Mathematica and I am trying to write numbers from 1 to 10 in txt file. But "Null" is everything that is written in my file. The code is: ``` Export["C:\\Users\\Sealy\\Desktop\\list.txt", For[k = 1, k <= 10, k++, Print[List[k]]]] ```
2012/09/04
[ "https://mathematica.stackexchange.com/questions/10191", "https://mathematica.stackexchange.com", "https://mathematica.stackexchange.com/users/2200/" ]
Recommendation: Read up on `Table`, `Range` etc. . Press `F1` often! ``` Export[NotebookDirectory[] <> "test.txt", Range[10]] ```
`Print` is used for it's side effect (which is printing to the screen) but it returns `Null`. Also the `For` loop returns `Null` Try this: ``` lst = {}; For[k = 1, k <= 10, k++, AppendTo[lst, {k}]] lst (* {{1}, {2}, {3}, {4}, {5}, {6}, {7}, {8}, {9}, {10}} *) Export["C:\Users\Sealy\Desktop\list.txt", lst] ```
394,068
I wonder if someone can help me. How will one go about to create a simple circuit simulator? Similar to Multisim, just a lot simpler! Basically, I only need resistors, capacitors, inductors and voltage sources. Is there a tutorial I can follow, to create this using C# and Visual Studio?
2018/09/03
[ "https://electronics.stackexchange.com/questions/394068", "https://electronics.stackexchange.com", "https://electronics.stackexchange.com/users/187853/" ]
I wrote the simulation engine that powers [CircuitLab](https://www.circuitlab.com/) from scratch: from the sparse matrix library up through component models and simulation modes. My co-founder wrote the front-end. It ended up being an unbelievably huge programming project, but one I'm quite proud of. If you're up for t...
I doubt there are online tutorials because it's something pretty specific. However, one source of information you can definitely use is open source code. One I know of is [SpicePy](https://github.com/giaccone/SpicePy) - it's written in Python, but it's very well documented, although the Python language is very descri...
8,450,561
Consider the following code: ``` <script> var i = 0; function test() { var _this = this; // foo and _this.foo are set to the same number var foo = _this.foo = i++; function wtf() { console.log(_this.foo, foo); } $("#thediv").click(wtf); }; t...
2011/12/09
[ "https://Stackoverflow.com/questions/8450561", "https://Stackoverflow.com", "https://Stackoverflow.com/users/149288/" ]
When test() is run, `this` is a reference to `window` for each of your three test() calls, so you are actually updating `window.foo` when you assign to `_this.foo` and referencing `window.foo` in your `console.log`. Then, when `wtf()` is invoked, the `_this` variables in each of the `wtf()` closures are the same - the...
If you are testing in Chrome you may well be hitting a bug in console.log. See : [Javascript Funky array mishap](https://stackoverflow.com/questions/8395718/javascript-funky-array-mishap/8396289#8396289) Try changing to : ``` console.log(_this.foo + ' = ' + foo); ```
11,306,587
i am new to j query, it is cool, but i am glued to the ceiling on how to add width and height to a iframe generated after click, using this code: all suggestions would be great and thanks in advance Khadija ``` $(document).ready(function () { $(".fancybox").fancybox(); }) .height = '600px'; ```
2012/07/03
[ "https://Stackoverflow.com/questions/11306587", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1498036/" ]
To initialize the fancybox popup for the usage of an iframe, limited to a certain width and height, you need at least three parameters: **jQuery** ``` $(document).ready(function(){ $(".fancybox").fancybox({ 'width' : 600, // set the width 'height' : 600, // set the height 'type' ...
**With iframe** ``` $(document).ready(function () { $(".fancybox").fancybox({ width:600, height:400, type: 'iframe', href : 'url_here' }); }) ``` **Without iframe** ``` $(document).ready(function () { $(".fancybox").fancybox({ wid...
28,191,305
I made this application with a button ("descrição") to open a "gray background" with one text box and two buttons: "salvar" (save button) and "cancelar" (cancel button), you can only save and close it if you type something inside the box or click on "cancelar", for the first time it works perfectly, but when you start ...
2015/01/28
[ "https://Stackoverflow.com/questions/28191305", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
Have you tried using ng-if instead of ng-show? ng-if won't render the HTML nodes within if the expression is false. At least with Angular 1.3 or later. ``` <div ng-if="messageAvailable" class="message"> <p ng-bind="message"></p> </div> ``` In general you should consider ng-if over ng-show/hide, especially when ...
Just hide it with styles **upd** ``` <style> .h {display: none;} .v { display: block} </style> <div ng-show="messageAvailable" ng-class="{'v': messageAvailable,'h':!messageAvailable}" ```
37,326,068
So I just updated my app to use ASP.NET Core RC2. I published it using Visual Studio and noticed that my Area is not published: This snapshot is from `src\MyProject\bin\Release\PublishOutput`: [![enter image description here](https://i.stack.imgur.com/FjpgY.png)](https://i.stack.imgur.com/FjpgY.png) And here is my A...
2016/05/19
[ "https://Stackoverflow.com/questions/37326068", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5173926/" ]
You need to configure your `publishOptions` section of `project.json` to include the `Areas` folder which is not included in the default template: ex: ``` "publishOptions": { "include": [ "wwwroot", "Views", "appsettings.json", "web.config", "Areas" ], "exclude": [ "bin" ] } ``` **Update**...
Adding Areas will copy everything including the .cs files. so should add `"Areas/**/Views/**/*.cshtml"` and `"Areas/ * /.cshtml"` under publish options instead of only `"Areas"`
28,598,308
On a wordpress site a malformed div tag and a link to thepiratebay.in.ua are being inserted through some kind of attack. The inserted code is: `div style="position:absolute;top:-1488px;"&gt;<a href="http://thepiratebay.in.ua">torrents,pirate,piratebay,software torrents,porn,porn download</a>` On a clone of the site...
2015/02/19
[ "https://Stackoverflow.com/questions/28598308", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4111409/" ]
I suffered the exact same problem and just got it solved. Check you index.php Mine was modified a few days ago and comparing to other wordpress installations I saw it had these extra lines at the beggining: ``` //eAccelerate Caching System /*ordpr*/ @ini_set('display_errors', '0'); ob_start('__e_accelerate_engine'); ...
First, check the entire WP install to see which were the most recent files updated. That would be where you start looking. Often the code is encrypted, which is why you can't find it using grep. Look for something like: ``` eval(gzinflate(base64_decode(..))); ``` Try grep'ing for "eval" or "base64\_decode". Often ...
45,647,714
i'm new to mac. and i installed the netbeans IDE . so i just went to verify it in the terminal. then i'm getting an error while finding out the version ?[this is the screenshot of the terminal.](https://i.stack.imgur.com/nqOsG.png)
2017/08/12
[ "https://Stackoverflow.com/questions/45647714", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7475005/" ]
According to your question, you can declare a function `is_square(n)` to check a number whether perfect square or not. Then, you take a number (i.e. `val`) from list `l` using this `for val in l:`. If number (i.e. `val`) is perfect square then it will add to the `sm` otherwise not. You code will be like following cod...
Try This: ``` import math a=map(int,input().split()) sum1=0 for i in a: b=math.sqrt(i) if math.ceil(b)==math.floor(b): sum1+=i print (int(sum1)) ```
23,775,680
i want to download file from url. `http://opengov.dev.ifabrika.ru/upload/435/IF_Заявка_Программист PHP_2013-09-03.docx` - you can try it, it work. My code is next: ``` new DownloadFileFromURL().execute("http://opengov.dev.ifabrika.ru/upload/435/IF_Заявка_Программист PHP_2013-09-03.docx"); ``` DownloadFileFromUrl is...
2014/05/21
[ "https://Stackoverflow.com/questions/23775680", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2101843/" ]
This happening because your url is in unicoded form so you have to first encode it then try to download ``` URLEncoder.encode(Url, "UTF-8") ``` It works for me.
You can try with this method by calling this method from your doInBackground ``` private void downloader(String urlstr) { HttpURLConnection c = null; FileInputStream fis = null; FileOutputStream fbo = null; File file = null, file1; File outputFile = null; InputStream is = null; URL url = nu...
138,818
Sometimes when I take a photo I like to share it with friends and family, so I press the button that points up, which then leads to a screen where I can share the photo with facebook, flickr and several other things that I don't use. Recently I decided to use instagram as a means of sharing photos, since I had noticed...
2014/07/13
[ "https://apple.stackexchange.com/questions/138818", "https://apple.stackexchange.com", "https://apple.stackexchange.com/users/-1/" ]
Sorry but you don't really have any control over this. Some sharing panels offer a "Open In..." option in the bottom-right corner. If you check an application that does offer this option (for example Dropbox) you'll likely find Instagram in that list. For some reason Apple doesn't provide that "Open In..." option in t...
Re upload the app you missed a step that it asks to access your pictures I did the same thing I have a iOS 6
1,462
I installed Fresh Magento in **Live Server with a subdomain** (shop.example.com) And It given me error **500 : internal server error** **But If i delete .htaccess** the site works properly Without .htaccess file magento project won't be running. So how to solve this ?
2013/03/20
[ "https://magento.stackexchange.com/questions/1462", "https://magento.stackexchange.com", "https://magento.stackexchange.com/users/661/" ]
You've clearly got an error in your `.htaccess` file. If you check your Apache error log, you should see a pointer as to where the error is exactly. Eg. ``` [Wed Mar 20 12:15:49 2013] [alert] [client 8.8.8.8] /home/chocoloo/public_html/.htaccess: Invalid command 'faulty_line', perhaps misspelled or defined by a modu...
If you are using CGI mode for PHP (check phpinfo()), you must uncomment first two lines in your .htaccess file: ``` Action php5-cgi /cgi-bin/php5-cgi AddHandler php5-cgi .php ```
45,799,041
So my problem is I'm creating a UITabBarController without a storyboard and I'm stuck with how to create a UITabBar item without a Viewcontroller. Because what I want to do is the 2nd item of my UITabBarItem is an action not presenting a view controller.
2017/08/21
[ "https://Stackoverflow.com/questions/45799041", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8495570/" ]
I implement something like this in an app (the close button), though I use storyboards. The close button is a viewController, but I used the following code to get it to act like a regular button: ``` func tabBarController(_ tabBarController: UITabBarController, shouldSelect viewController: UIViewController) -> Bool {...
There is an API conform way to do this. The `UITabBarControllerDelegate` has a `shouldSelect` method that you can implement: <https://developer.apple.com/documentation/uikit/uitabbarcontrollerdelegate/1621166-tabbarcontroller> Something along these lines: ``` - (BOOL)tabBarController:(UITabBarController *)tabBarCont...
50,603,769
I have a list which contain lines of files, sample of which is shown. ``` list(c("\"ID\",\"SIGNALINTENSITY\",\"SNR\"", "\"NM_012429\",\"7.19739265676517\",\"0.738130599770152\"", "\"NM_003980\",\"12.4036181424743\",\"13.753593768862\"", "\"AY044449\",\"8.74973537284918\",\"1.77200602833912\"", "\"NM_005015\",\"11.3...
2018/05/30
[ "https://Stackoverflow.com/questions/50603769", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4467155/" ]
You can use ***`CircleAvatar`*** widget to display the obtained image to make it `circular`. ``` import 'dart:async'; import 'dart:io'; import 'package:flutter/material.dart'; import 'package:image_picker/image_picker.dart'; void main() => runApp(new MaterialApp(debugShowCheckedModeBanner: false, home: new MyApp()))...
You can also use [ClipOval](https://api.flutter.dev/flutter/widgets/ClipOval-class.html) to circle the image. Just wrap your file image with `ClipOval`. ``` ClipOval( child: FileImage(_image) ), ```
26,165,160
In Sublime Text I can arbitrarily select a set of lines and then use `⌘+L` to expand the selection to the full lines. Is there a similar command in PHPStorm / WebStorm? (I'd like to map that command to a keyboard shortcut.) I know PHPStorm has the option "Select Line at Caret", but that selects only one line.
2014/10/02
[ "https://Stackoverflow.com/questions/26165160", "https://Stackoverflow.com", "https://Stackoverflow.com/users/373154/" ]
With WebStorm 11 (at least) the multi-caret keyboard shortcut is: `Ctrl` then `Ctrl`+`Arrow Up` (or click & drag with the middle mouse button/scroll wheel) then to select the full lines: `Home` then `Shift`+`End` which you could even create as a [macro with a keyboard shortcut](https://www.jetbrains.com/help/websto...
This is currently not possible with a selection. However, you can still do that from the keyboard. Instead of doing selections set up a shortcut for `Clone Caret Above` (Alt+Shift+U for me) and `Clone Caret Bellow` (Alt+Shift+D for me). This allows to go up or down a line and add a caret there. So instead of selecting ...
13,925,724
I want to reuse certain filter for many projects so I want to extract it and use a single jar to just add it to any Web App. For building I am using Gradle 1.3 and the following `build.gradle` file: ``` apply plugin: 'java' dependencies { compile group:'org.slf4j', name:'slf4j-api', version:'1.7.+' testCom...
2012/12/18
[ "https://Stackoverflow.com/questions/13925724", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1391333/" ]
There is no such configuration out of the box for the `java` plugin. However you can build it yourself as follows: ``` configurations { providedCompile } dependencies { providedCompile "javax.servlet:javax.servlet-api:3.+" } sourceSets.main.compileClasspath += configurations.providedCompile sourceSets.test.compi...
I wrote a blog post recently which covers exactly this scenario. It also shows you how to get integration with Eclipse set up properly too. <http://blog.codeaholics.org/2012/emulating-mavens-provided-scope-in-gradle/>
252,036
I was looking into thermography which talks about emissivities of metals and other materials. Polished metals which have low emissivity appear to be colder in thermal imaging cameras even if they are actually hot (because they have low emissivity). Refer to the image below: [![enter image description here](https://i.s...
2016/04/25
[ "https://physics.stackexchange.com/questions/252036", "https://physics.stackexchange.com", "https://physics.stackexchange.com/users/115460/" ]
A hot material will radiate heat to a colder, that is to say it will radiate more heat outward than it absorbs from the colder object. The problem is only that the radiation RATE, as well as the absorption rate, is not determined by temperature alone, but by the coupling of the material to light of any given wavelength...
The mug is made up of two materials, ceramic (an insulator) and metal (a conductor). These two types of materials certainly have different heat coupling coefficients, and metals in general both emit and absorb heat faster than insulators. So it definitely makes sense that metals, by virtue of more efficient **radiative...
27,785,572
I have a TableView with some TextFields in. The values of said TextFields are linked to certain positions in a 2D Array (NSArray of NSMutableArrays). An initial clean array is defined as so: ``` self.cleanEditContents = @[ [@[@-1,@-1] mutableCopy], [@[@0,@80] mutableCopy], ...
2015/01/05
[ "https://Stackoverflow.com/questions/27785572", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1375665/" ]
Assuming that you only need to support [old to recent browsers](http://caniuse.com/#feat=queryselector) (not everything back to IE 4) you can just use [`querySelectorAll`](https://developer.mozilla.org/en-US/docs/Web/API/document.querySelectorAll): ``` var buttons = document.querySelectorAll('.test-button-set button')...
If you want to accomplish the same outcome you're getting with your two lines of code without using querySelector/querySelectorAll (which is a great option but isn't supported in some older browsers), you could just chain your methods together to get them on one line rather than using a variable and breaking them up on...
32,896,845
I have managed to create an algorithm to check the rank of a poker hand. It works 100% correctly, but it's very slow. I've been analysing the code, and the check straight function is one of the slowest parts of it. So my question is, is there a better way of calculating whether a hand make a straight? Here is some d...
2015/10/01
[ "https://Stackoverflow.com/questions/32896845", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3698723/" ]
Instead of working with array deduping and sorting, consider using a bitmask instead, and setting bits to 1 where the card value is set. A bitmask works like a Set datastructure and comes with additional advantages when it comes to detecting contiguous elements. ``` for ($i = 0; $i < count($cards); $i++) { $card ...
Consider the Java implementation at [this link](http://www.mathcs.emory.edu/~cheung/Courses/170/Syllabus/10/pokerCheck.html). I've included it here: ``` public static boolean isStraight( Card[] h ) { int i, testRank; if ( h.length != 5 ) return(false); sortByRank(h); // Sort the poker hand by the ran...
24,094,158
In Swift, can someone explain how to override a property on a superclass's with another object subclassed from the original property? Take this simple example: ``` class Chassis {} class RacingChassis : Chassis {} class Car { let chassis = Chassis() } class RaceCar: Car { override let chassis = RacingChassis...
2014/06/07
[ "https://Stackoverflow.com/questions/24094158", "https://Stackoverflow.com", "https://Stackoverflow.com/users/559030/" ]
Depending on how you plan on using the property, the simplest way to do this is to use an optional type for your subclass, and override the `didSet {}` method for the super: ``` class Chassis { } class RacingChassis: Chassis { } class Car { // Declare this an optional type, and do your // due diligence to ch...
Simple using generics, e.g. ``` class Chassis { required init() {} } class RacingChassis : Chassis {} class Car<ChassisType : Chassis> { var chassis = ChassisType() } let car = Car() let racingCar = Car<RacingChassis>() let c1 = car.chassis let c2 = racingCar.chassis print(c1) // Chassis print(c2) // Racin...
73,881,051
I have an array of strings, and when the user enters a string with question marks replacing some characters, I want the program to return all words from the array that it could be. ``` possibleWords = ["Animal", "Basket", "Bridge", "Guitar", "Needle", "Office", "Orange"] #and the user enters "O????e", the program wou...
2022/09/28
[ "https://Stackoverflow.com/questions/73881051", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10849607/" ]
Try this in one line using list comprehension and `all()`: ``` possibleWords = ["Animal", "Basket", "Bridge", "Guitar", "Needle", "Office", "Orange"] m = "O????e" result = [i for i in possibleWords if all(k=='?' or j==k for j,k in zip(i,m))] ``` the output(`result`) will be: ``` In [4]: [i for i in possibleWords ...
The regex character you're looking for is ".", instead of "?". So by simple replacing the question marks with dots, you can use the regex module `re` to get your desired output: ``` import re possibleWords = ["Animal", "Basket", "Bridge", "Guitar", "Needle", "Office", "Orange"] entry = "O????e" pattern = entry.repla...
8,852,939
I have a list of directories hard coded into my program as such: ``` import os my_dirs = ["C:\a\foo" ,"C:\b\foo" ,"C:\c\foo" ,"C:\t\foo" ] ``` I later want to perform some operation like `os.path.isfile(my_dirs[3])`. But the string my\_dirs[3] is becoming messed up because `"\...
2012/01/13
[ "https://Stackoverflow.com/questions/8852939", "https://Stackoverflow.com", "https://Stackoverflow.com/users/929195/" ]
I agree with Joel - that's how I handle it. A build script minifies the CSS (*and JS*) before each release is FTP'ed to production. I just have a switch in PHP like: ``` if ($config->prod()) { // incldue the minfied css } else { // include all the original files } ```
Personnaly, I use an ant build script to make a production version: 1. it "condense" multiple css files in one 2. then it minify them with YUI compressor 3. same for scripts 4. (page recomposition to point to the newly generated files) this way you divide your http request for those files, and gain some bandwith from...
20,379,701
I'm wondering if it's possible to filter logs by properties of passed arguments to a specific function. To be more specific, here's where I'm starting: ```dart _dispatcher.getLogs(callsTo("dispatchEvent", new isInstanceOf<PinEvent>())); ``` I'd like to further filter this by PinEvent.property = "something" In pseud...
2013/12/04
[ "https://Stackoverflow.com/questions/20379701", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2954178/" ]
[This question](https://stackoverflow.com/questions/7343769/sql-server-2008-r2-intellisense-not-working) covers making sure it's enabled, which it sounds like it is (I'm linking it just in case). There also seems to be an installation issue with 2008 and Visual Studio 2010 (also mentioned in that link) sometimes, and [...
Apart from some very common reasons (which don't apply here, as you say it's not working only for some servers) listed here: <http://msdn.microsoft.com/en-us/library/ks1ka3t6%28v=vs.90%29.aspx> ... did you happen to instal VS2010 lately? There's a bug that makes IntelliSense stop workingŁ <http://support.microsoft.com...
6,243,273
Are there any tools that can generate classes from anonymous types? I have a complex data structure that I have created using anonymous types. I would like to use this data structure in other places where the anonymous type would be out of scope. That's why I'm looking for such a code generation tool.
2011/06/05
[ "https://Stackoverflow.com/questions/6243273", "https://Stackoverflow.com", "https://Stackoverflow.com/users/64334/" ]
That's one of the [refactorings](http://www.jetbrains.com/resharper/webhelp/Refactorings__Convert_Anonymous_to_Named_Type.html) supported by [Resharper](http://www.jetbrains.com/resharper/). With nested anonymous types (where one anonymous type has properties of another anonymous type), you'll just have to convert the ...
[Resharper - Convert Anonymous to Named Type](https://www.jetbrains.com/resharper/webhelp/Refactorings__Convert_Anonymous_to_Named_Type.html) > > The Convert Anonymous to Named Type refactoring converts anonymous > types to nested or top-level named types in the scope of either the > current method (locally) or the...
221,434
I'm trying to serve dynamically generated xml pages from a web server, and provide a custom, static, xslt from the same web server, that will offload the processing into the client web browser. Until recently, I had this working fine in Firefox 2, 3, IE5, 6 and Chrome. Recently, though, something has changed, and Fire...
2008/10/21
[ "https://Stackoverflow.com/questions/221434", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7938/" ]
Displaying just the text elements is the behavior you would get out of an empty XSL stylesheet. To me, that suggests that something fishy is going on with your xpath expressions, and that the xsl:template/@match attributes do not match the source document. You do not provide enough information to diagnose further, so...
try serving it as application/xml instead of text/xml
158,871
This a follow up on the previous post that asked how strong graphene armor would be and the general conclusion is that we have no idea sadly. So in this post I will ask a more relevant question. If we have made armor with advanced, light-weight carbon and ceramic based materials that can easily stop most bullets like...
2019/10/20
[ "https://worldbuilding.stackexchange.com/questions/158871", "https://worldbuilding.stackexchange.com", "https://worldbuilding.stackexchange.com/users/69795/" ]
In general: * Strong armor/weak ranged weapons means **more close (up to hand-to-hand) combat**, shorter and more active battles, elite troops rules battlefield (less camo, but more colors and honor), relativly less casulties in battles (defeated prefer to run). It also means that **charge is stronger than equal numbe...
This is just a small partial answer, but in medieval times, a full plate was pretty much impenetrable. The thing is: only knights and nobleman could afford full plates, so most of the people in the battlefield would still be vulnerable to any weapon. If full body armor capable of protecting against personal projectile...
279,569
I need to delete a "~" folder in my home directory. I realize now that `rm -R ~` is a bad choice. Can I safely use `rm -R "~"`?
2016/04/27
[ "https://unix.stackexchange.com/questions/279569", "https://unix.stackexchange.com", "https://unix.stackexchange.com/users/162496/" ]
In theory yes. In practice usually also yes. If you're calling a shell script or alias that does something weird, then maybe no. You could use `echo` to see what a particular command would be expanded to by the shell: ``` $ echo rm -R ~ rm -R /home/frostschutz $ echo rm -R "~" rm -R ~ ``` Note that `echo` removes t...
In addition to frostschutz's double quotes method, and Andy's simple quote one, there are also the shorter: ``` rm -r \~ ``` and the relative path one: ``` rm -rf ./~ ```
82,389
I am unable to run an installer with `.packproj` extension. I am unable to find anything via Web search. Can these files be handled natively by macOS? How do I install a package with this extension?
2013/02/16
[ "https://apple.stackexchange.com/questions/82389", "https://apple.stackexchange.com", "https://apple.stackexchange.com/users/12543/" ]
`.packproj`-files were files used by developers in the process of application development for OS X 10.2. They contain xml-strings – try editing the file in TextEdit or TextWrangler, you should see an XML-structure, or see [this example](http://code.ohloh.net/file?fid=ntEBCQqv3JoMY44QlWDd6OSq1Ns&cid=w9EXGk1oh00&s=&brows...
There is also the [Packages](http://s.sudre.free.fr/Software/Packages/about.html) tool.