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 |
|---|---|---|---|---|---|
119,444 | For one and a half years, I have been keeping my eyes on the git community in hopes of making the switch away from SVN. One particular issue holding me back is the inability to lock binary files. Throughout the past year I have yet to see developments on this issue. I understand that locking files goes against the fund... | 2008/09/23 | [
"https://Stackoverflow.com/questions/119444",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/472/"
] | [Git LFS 2.0](https://github.com/blog/2328-git-lfs-2-0-0-released) has added support for file locking.
>
> With Git LFS 2.0.0 you can now lock files that you're actively working on, preventing others from pushing to the Git LFS server until you unlock the files again.
>
>
> This will prevent merge conflicts as well... | In response to Mario's additional concern with changes happening in multiple places on the binaries. So the scenario is Alice and Bob are both making changes to the same binary resource at the same time. They each have their own local repo, cloned from one central remote.
This is indeed a potential problem. So Alice f... |
64,176 | Can anyone help me identify the year, make and model of this car?
I would greatly appreciate anyone that can help me. Please!
Thank you so much for anyone that is looking.
[](https://i.stack.imgur.com/h2Ssh.jpg) | 2019/03/03 | [
"https://mechanics.stackexchange.com/questions/64176",
"https://mechanics.stackexchange.com",
"https://mechanics.stackexchange.com/users/46216/"
] | I'd say it's a first-generation BMW X3 (E83) - the ridge along the top of the doors is different to the Volvos, and you can see the distinctive upsweep to the bottom of the rearmost window. | Without a much clearer and larger picture I have to take an educated guess. It looks like a Volvo SUV XC model. As for the year hard to say. |
63,802,194 | Consider following 4 lines of code:
```
Mono<Void> result = personRepository.findByNameStartingWith("Alice")
.map(...)
.flatMap(...)
.subscriberContext()
```
**Fictional Use Case which I hope you will immediat... | 2020/09/08 | [
"https://Stackoverflow.com/questions/63802194",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/873139/"
] | This was achieved as proposed in the question.
The finished sample flow looks like this:
[](https://i.stack.imgur.com/FUiEu.jpg)
Add the Mule Java Module dependency, and Apache POI for handling the Microsoft xls file:
```
<dependency>
<groupId>org.mule.mod... | Yes, You can pass an InputStream to Java module method invocation and use for example Apache POI (capable of reading xls and xlsx as well) for Your stream to csv conversion. |
30,041,551 | I have a class user which contains a boolean field, I want to sort a list of users, I want the users who have the boolean field equals true to be in the top of the list and than I want sort them by their names.
Here is my class :
```
public class User{
int id;
String name;
boolean myBooleanField;
publi... | 2015/05/04 | [
"https://Stackoverflow.com/questions/30041551",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3578325/"
] | Something along these lines perhaps?
```
Collections.sort(users, new Comparator<User>() {
public int compare(User u1, User u2) {
String val1 = (u1.myBooleanField ? "0" : "1") + u1.name;
String val2 = (u2.myBooleanField ? "0" : "1") + u2.name;
return val1.compareTo(val2);
}
}); ... | You can use `Collectors.groupingBy` to seperate top users from the rest
```
Map<Boolean, List<User>> list = users.stream()
.collect(
Collectors.groupingBy(
Info::getMyBooleanField);
```
Select top users and sort them by name
```
List<User> topUsers = list.get(true);
... |
50,557,099 | I'm trying to parse strings like this: *aa bb first item ee ff*
I need separate prefix '*aa bb*', keyword:'*first item*' and suffix '*ee ff*'
Prefix and suffix can be several words or even doesn't exist. Keyword is list of predefined values.
this is what I tried but it didn't work:
```
a = ZeroOrMore(Word(alphas)('... | 2018/05/27 | [
"https://Stackoverflow.com/questions/50557099",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9855931/"
] | First issue is your use of the '&' operator. In pyparsing, '&' produces `Each` expressions, which are like `And`s but accept the subexpressions in any order:
```
Word('a') & Word('b') & Word('c')
```
would match 'aaa bbb ccc', but also 'bbb aaa ccc', 'ccc bbb aaa', etc.
In your parser, you'll want to use the '+' op... | If I understood your question correctly this should do the trick:
```
toParse='aa bb first item ee ff'
keywords=['test 1','first item','test two']
for x in keywords:
res=toParse.find(x)
if res>=0:
print('prefix='+toParse[0:res])
print('keyword='+x)
print('suffix='+toParse[res+len(x)+1:]... |
48,240,039 | When I try to localize my app and I create a new Main.strings file for the target language, everything I have created in interface builder (labels, buttons, ...) is added to the new Main.strings files (base and language versions) and I can localize the text accordingly.
But when I later add a label or a button to a Vi... | 2018/01/13 | [
"https://Stackoverflow.com/questions/48240039",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6852849/"
] | Easy XIB and Storyboard Localization - Very efficient and simple method
This repository serves as an example on how to localize some UIKit controls:
UILabel,
UIButton,
UITextField placeholder,
UISegmentedControl,
UIBarItem for tab bar items and navigation bar items,
UINavigationItem,
Review Localizable.swift to check... | Use `ObjectID.text` for `UILabel`
Use `ObjectID.normalTitle` for `UIButton`
**Example:**
```
/* Object ID of UILabel */
"GWb-TZ-iGk.text" = "I am label";
/* Object ID of UIButton */
"H6f-pG-K8Z.normalTitle" = "I am button";
``` |
2,763,091 | As the title says, I want to parse some Java source code in Java. I'm pretty sure there are other java libraries that already perform this, but I couldn't find any. | 2010/05/04 | [
"https://Stackoverflow.com/questions/2763091",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/133973/"
] | [Janino](http://docs.codehaus.org/display/JANINO/Home) can parse, compile and execute Java code. | JavaCC has a Java 1.5 grammar including generics.
>
> the tokens are probably more
> fine-grained then what I want
>
>
>
Your first requirement is to get an accurate parse, and you will realistically only get that from an existing parser. What you do with the result is up to you. |
38,601,746 | I have a spring boot application where I am creating `Datasource` and `JdbcTemplate` manually in my config because I need to decrypt datasource password.
I am using tomcat `DataSource` (`org.apache.tomcat.jdbc.pool.DataSource`) as recommended in spring boot docs since I am configuring connection properties.
I am ex... | 2016/07/27 | [
"https://Stackoverflow.com/questions/38601746",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1988876/"
] | The problem is with the arguments of your bean definitions. Where would their values come from? For example -
```
@Bean
public JdbcTemplate jdbcTemplate(DataSource dataSource) {
return new JdbcTemplate(dataSource);
}
```
Here you haven't specified where would value of `dataSource` argument come from. Same case o... | It's possible...
You might not have added JdbcTemplate dependency in project configuration file(.xml file). |
60,458,870 | Is it possible to call POST actions from an Azure Resource Manager (ARM) template? I have custom resource provider where I can create resources and call actions using POST as follows:
POST
/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CustomResourceProvider/resource/{resourceNa... | 2020/02/28 | [
"https://Stackoverflow.com/questions/60458870",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/12970037/"
] | No, there is none. ARM Templates can only do PUT calls, not POST. | I'm not sure whether I understand the question. I try to answer.
>
> The operations available for each Azure Resource Manager resource
> provider. These operations can be used in custom roles to provide
> granular role-based access control (RBAC) to resources in Azure.
>
> Refer to: [Azure Resource Manager r... |
27,671,748 | I'm creating very simple charts with matplotlib / pylab Python module. The letter "y" that labels the Y axis is on its side. You would expect this if the label was longer, such as a word, so as not to extend the outside of the graph to the left too much. But for a one letter label, this doesn't make sense, the label sh... | 2014/12/27 | [
"https://Stackoverflow.com/questions/27671748",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3275196/"
] | It is very simple. After plotting the label, you can simply change the rotation:
```py
import matplotlib.pyplot as plt
plt.ion()
plt.plot([1, 2, 3])
plt.ylabel("y", rotation=0)
# or
# h = plt.ylabel("y")
# h.set_rotation(0)
plt.draw()
``` | Expanding on the accepted answer, when we work with a particular axes object `ax`:
```
ax.set_ylabel('abc', rotation=0, fontsize=20, labelpad=20)
```
Note that often the `labelpad` will need to be adjusted manually too — otherwise the "abc" will intrude onto the plot.
From brief experiments I'm guessing that `label... |
11,072 | Is it possible to build a CNC whose Linear motion system does not contain any timing belt(pulley) or lead screw(threaded rod).
I was wondering whether I could directly control the Linear motion by securing wheels of a slider onto aluminum rails & directly connecting the wheels to a stepper motor.
The main objective of... | 2016/11/17 | [
"https://robotics.stackexchange.com/questions/11072",
"https://robotics.stackexchange.com",
"https://robotics.stackexchange.com/users/15322/"
] | CNC controllers, in most cases, control rotary motion and the model of how this rotary motion is tranformed, by the mechanism attached to the motor, to a translational motion is implemented in the controller.
You can use any method of transforming rotary motion to a linear motion as long as the model for it is pre-im... | Interesting question. Some degree of precision is required. There are two ways to do this:
a) use an encoder associated with a wheel which reports the rotary position. That value is then related to the wheel circumference to obtain the distance travelled. Perhaps a wifi transmitter on each carriage would be more pract... |
516,236 | I'm sure there's a more specific word/phrase for moments like in a soccer match when the loser team which is, say, two scores behind, scores 3 points in the last ten minutes to turn an almost certain defeat into a great victory to everyone's surprise.
PS: An alternative context can be a legal dispute or even a milita... | 2019/10/23 | [
"https://english.stackexchange.com/questions/516236",
"https://english.stackexchange.com",
"https://english.stackexchange.com/users/91410/"
] | When a competitor is beaten by a small margin and at the last moment they have been **pipped at the post**.
There's a question specifically about this phrase: [What is the origin of "Pipped at the post"?](https://english.stackexchange.com/questions/193600/what-is-the-origin-of-pipped-at-the-post) | Alternatively to Glorfindel's answer, from the losing team's point of view it could be described as a **throw**, which means "to intentionally lose a game" (Wiktionary) but used colloquially means to play so badly as to be almost indistinguishable from purposely losing. Also consider **upset**, which means "an unexpect... |
81,062 | Data input validation always was quite an internal struggle to me.
On the verge of adding a real security framework and code to our legacy application rewrite project (which so far pretty much keeps the card-castle-strong legacy security code and data validation), I'm wondering again about how much should I validate, ... | 2011/06/02 | [
"https://softwareengineering.stackexchange.com/questions/81062",
"https://softwareengineering.stackexchange.com",
"https://softwareengineering.stackexchange.com/users/15017/"
] | >
> •3rd tier (data layer/DAL/DAO): never
> believed much validation is needed
> here, as only the business layer is
> supposed to access the data (validate
> maybe on some case like "param2 must
> not be null if param1 is true").
>
>
>
This is so wrong. The most important place to have the validation is in t... | All the above make the assumption that developers and maintainers are perfect and write perfect code that always runs perfectly. The future software releases know about all the assumptions you made and never documented, and users and hackers who put data into the system in ways you never imagined.
Sure, too much vali... |
554,540 | My father was colorblind, and I always wondered if colors were a matter of physics or if different colors are just a human way of describing and differentiating our visual perception of the world?
For example, is the color blue by nature blue, or is it just what we see? | 2020/05/24 | [
"https://physics.stackexchange.com/questions/554540",
"https://physics.stackexchange.com",
"https://physics.stackexchange.com/users/74945/"
] | Our eyes are receptors, and have evolved so that they are most sensitive for visible wavelength photons, something called tricolor vision, with three types of receptors, each for Red, Green, and Blue wavelength. Now our receptors have naturally evolved for Sunlight, and Sunlight is made up of a combination of several d... | Colors can be described at three different levels.
The first two; electromagnetic frequency and neural signalling, have been well addressed in other answers. These are both objective measures of color, and it is even becoming possible to measure what color someone is seeing - or even imagining - in realtime, via non-i... |
1,322,934 | I have a Python list of strings, e.g. initialized as follows:
```
l = ['aardvark', 'cat', 'dog', 'fish', 'tiger', 'zebra']
```
I would like to test an input string against this list, and find the "closest string below it" and the "closest string above it", alphabetically and case-insensitively (i.e. no phonetics, ju... | 2009/08/24 | [
"https://Stackoverflow.com/questions/1322934",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/103532/"
] | A very naive implementation, good only for short lists: you can pretty easily iterate through the list and compare your choice against each one, then break the first time your choice is 'greater' than the item being compared.
```
for i, item in enumerate(l):
if lower(item) > lower(input):
break
print 'bel... | Are these relatively short lists, and do the contents change or are they fairly static?
If you've got a large number of strings, and they're relatively fixed, you might want to look into storing your data in a Trie structure. Once you build it, then it's quick & easy to search through and find your nearest neighbors ... |
71,232,214 | VS code and Android Studio is recognizing my connected android device.
My device is showing up on file explorer though. I have turned on USB debugging from settings too.
[](https://i.stack.imgur.com/pjY9D.png)
Below is the result of `flutter doctor`
... | 2022/02/23 | [
"https://Stackoverflow.com/questions/71232214",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7290043/"
] | Please check link below. It might solve your problem of not showing devices (Message "flutter run: No connected devices"):-
[Message "flutter run: No connected devices"](https://stackoverflow.com/questions/49045393/message-flutter-run-no-connected-devices) | Once check the output of the command
```
adb devices
```
If the list is empty then the system has recognized your device as a storage device. Then you need to install android SDK from the Android Studio IDE and try again. |
20,056,458 | A reasonably common operation is to filter one `list` based on another `list`. People quickly find that this:
```
[x for x in list_1 if x in list_2]
```
is slow for large inputs - it's O(n\*m). Yuck. How do we speed this up? Use a `set` to make filtering lookups O(1):
```
s = set(list_2)
[x for x in list_1 if x in ... | 2013/11/18 | [
"https://Stackoverflow.com/questions/20056458",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2581969/"
] | In order to optimize `set(list_2)`, the interpreter needs to prove that `list_2` (and all of its elements) does not change between iterations. This is a hard problem in the general case, and it would not surprise me if the interpreter does not even attempt to tackle it.
On the other hand a set literal cannot change it... | The basic reason is that a literal really can't change, whereas if it's an expression like `set(list_2)`, it's possible that evaluating the target expression or the iterable of the comprehension could change the value of `set(list_2)`. For instance, if you have
```
[f(x) for x in list_1 if x in set(list_2)]
```
It i... |
51,906,882 | Consider **abc.com** is my main website using nameservers **ns1.testnameserver.com** & **ns2.testnameserver.com**.
I would like to redirect multiple domains as below:
```
def.com to abc.com/products/def
ghi.com to abc.com/products/ghi
jkl.com to abc.com/products/jkl
mno.com to abc.com/products/mno
```
*I tried the ... | 2018/08/18 | [
"https://Stackoverflow.com/questions/51906882",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/755084/"
] | The `DataColumn` class doesn't have an `Item` property. If you want to iterate through the items of the 8th row, you can do so using the `ItemArray` property of the DataRow:
```
For Each item In myDataTable.Rows(7).ItemArray
MessageBox.Show(item.ToString)
Next
``` | ```
Dim dt As New DataTable()
Dim eightRow = dt.Rows(7)
For x = 0 To dt.Columns.Count - 1
MessageBox.Show(eightRow(x).ToString())
Next
``` |
3,447,545 | What's the easiest way to get a string with the value of "76.10" into an int rounded to 76?
I've tried a few different ways using Convert.ToInt32 and Decimal but I can't seem to get it right?
Edit: Here's the code Jon helped me with:
```
decimal t = Math.Round(decimal.Parse(info.HDDStatus));
... | 2010/08/10 | [
"https://Stackoverflow.com/questions/3447545",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/218638/"
] | The simplest way would be to use `Decimal.Parse` to parse it, and then [`Math.Round`](http://msdn.microsoft.com/en-us/library/aa340225.aspx) (or potentially [`Math.Floor`](http://msdn.microsoft.com/en-us/library/k7ycc7xh.aspx) depending on how you want numbers like "76.7" to be handled) to round it. *Then* convert to a... | 1. Convert it to double first and use Math.Floor()
2. Extract the substring (76) first .
```
string s = "76.7";
int n = int.Parse(s.Substring(0, s.IndexOf('.')));
``` |
4,270,657 | I was wonder is a there a web service or a database out there that let us programmatically check if the user input is an valid ISBN number before storing it in the database. Or is there a algorithm that allow the programmer to do that | 2010/11/24 | [
"https://Stackoverflow.com/questions/4270657",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/240337/"
] | [Gory details](http://isbntools.com/details.html) here. So you can check the check digit and have a go at deducing what the country (and maybe publisher) are, but I don't see any way of checking there's a real book with that number | As others have suggested in my quick searches on SO try: [idbndb](http://isbndb.com/docs/api/index.html) |
56,814,489 | Following some tutorials, on Windows 7, I installed the Heroku CLI (first Git, then Heroku-x64). Git has several options to select during installation, I kept it default for most of them, except the editor and the interface: my choice is mintty. In mintty I changed my Git username and email.
After installing Heroku-x6... | 2019/06/29 | [
"https://Stackoverflow.com/questions/56814489",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2650501/"
] | Ensure you are logged in on your Heroku CLI first:
```
heroku auth:login
```
Then you can login to your Heroku container registry:
```
heroku container:login
```
Running heroku/7.47.\* on Ubuntu 20+ (WSL) might require `sudo` for both commands listed above.
Before all these, I installed `gnupg2` and `pass`, foll... | I had problem login with the other methods, but this worked fine:
```
docker login --username=_ --password=$(heroku auth:token) registry.heroku.com
``` |
18,083 | I read the result that every compact $n$-manifold is
a compactification of $\mathbb{R}^n$.
Now, for surfaces, this seems clear: we take
an n-gon, whose interior (i.e., everything in
the n-gon except for the edges) is homeo. to $\mathbb{R}^n$,
and then we identify the edges to end up with
a surface that is closed and b... | 2011/01/19 | [
"https://math.stackexchange.com/questions/18083",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/6008/"
] | Assuming $M$ is a *differentiable* manifold, this can be shown by choosing normal coordinates about any point $P\in M$. The following is expanding on the method suggested by Jason DeVito in the comments.
Putting a metric on the manifold, we can define the exponential map $\exp\_P\colon T\_PM\to M$ and then, choosing a... | My guess it that you could generalize your example of the n-gon to any triangulation (with higher simplices, instead of only triangles) of your manifold. Any manifold admits a triangulation. |
13,833,566 | I have the following code to create a container which pretends to behave like the set of all prime numbers (actually hides a memoised brute-force prime test)
```
import math
def is_prime(n):
if n == 2 or n == 3:
return True
if n == 1 or n % 2 == 0:
return False
else:
return all(n %... | 2012/12/12 | [
"https://Stackoverflow.com/questions/13833566",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/674039/"
] | It was a documentation bug. This was [issue16468](https://bugs.python.org/issue16468), fixed in August 2019 by [PR 15566](https://github.com/python/cpython/pull/15566/files).
The library as written requires the `choices` argument to be not just a container but also iterable, It tries to list the available options, whi... | `choices` are for arguments that you can enumerate all allowed values (a finite (small) set). The docs should be more clear about it.
`primes` is an infinite set. You could set `type` parameter to raise ValueError for non-primes. |
246,512 | AlexNet architecture uses zero-paddings as shown in the pic. However, there is no explanation in the paper why this padding is introduced.
[](https://i.stack.imgur.com/oJVjf.png)
Standford CS 231n course teaches we use padding to preserve the spatial... | 2016/11/17 | [
"https://stats.stackexchange.com/questions/246512",
"https://stats.stackexchange.com",
"https://stats.stackexchange.com/users/96608/"
] | Elaborating on keeping information at the border, basically, the pixel at the corner (green shaded) when done convolution upon would just be used once whereas the one in the middle, like shaded red, would contribute to the resulting feature map multiple times.Thus, we pad the image See figure: [2](https://i.stack.imgur... | I'll try to tell from the regard of information that when is it okay to pad and when it is not.
Let's for base case take the example of tensorflow padding functionality. It provides two scenarios, either "Valid" or "same". Same will preserve the size of the output and will keep it the same as that of the input by add... |
53,938,761 | I've been working in a geodjango app to include a map for a search function in a spatial table, learning from tutorials, so far I know of a method to load serialized data in leaflet by creating a function based view assigning an url and importing that url as a GeoJSON.AJAX variable, I've been trying to change that meth... | 2018/12/27 | [
"https://Stackoverflow.com/questions/53938761",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/8303509/"
] | **1. First of all let’s plug our smartphone to the USB port of our computer and get a list of the installed packages and their namespaces:**
```
adb shell pm list packages
```
**2. This will list all packages on your smartphone, once you’ve found the namespace of the package you want to reverse** (`com.android.syste... | Thanks for your Answers. Finally i solved this problem and like to share with you. The steps to Download APK from Emulator to Desktop are given as follows ...
```
1. check the package list
adb shell pm list packages
adb shell pm list packages -f -3
2. find actual path
adb shell pm path [your_package_path]
Example: ad... |
566,396 | I need a word or phrase which can be used to describe someone or something challenging a general idea of belief. Here are some examples:
>
> They **challenge** the ethos of their particular eras and in turn, inflict personal and political change.
>
>
> In these sources, they investigate the intricacies of human int... | 2021/05/04 | [
"https://english.stackexchange.com/questions/566396",
"https://english.stackexchange.com",
"https://english.stackexchange.com/users/422276/"
] | "To contend *against*" is a close synonym.
>
> (SOED)**4** *v.i.* Argue (*with, against, etc.*)
>
>
>
They contend against the ethos of their particular eras and in turn, inflict personal and political change.
[Here](https://www.google.com/search?q=%22contend%20against%22&tbm=bks&tbs=cdr:1,cd_min:1909,cd_max:200... | I looked through the thesaurus, and two words you may find useful are ‘contest’ and ‘denounce’.
Contest carries the meaning of arguing and questioning, similar to challenge:
>
> to struggle or fight for, as in battle.
>
>
>
>
> to argue against; dispute:
> to contest a controversial question; to contest a will.... |
7,669,555 | Assume we have the following arrays:
```
a = [1, 2, 3, 4, 5]
```
and
```
b = [2, 3]
```
How can I subtract b from a? So that we have `c = a - b` which should be equal to `[1, 4, 5]`. jQuery solution would also be fine. | 2011/10/06 | [
"https://Stackoverflow.com/questions/7669555",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/407315/"
] | This is a modified version of the answer posted by @icktoofay.
In ES6 we can make use of:
* [`Array.prototype.contains()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/includes)
* [`Array.prototype.filter()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/G... | Might be an outdated query but i thought this might be useful to someone.
```js
let first = [1,2,3,4,5,6,7,9];
let second = [2,4,6,8];
const difference = first.filter(item=>!second.includes(item));
console.log(difference);//[ 1, 3, 6,7]
/*
the above will not work for objects with properties
This might do the trick
*/
... |
144,484 | Given the standard North American phone number format: (Area Code) Exchange - Subscriber, the set of possible numbers is about 6 billion. However, efficiently breaking down the nodes into the sections listed above would yield less than 12000 distinct nodes that can be arranged in groupings to get all the possible numbe... | 2012/04/14 | [
"https://softwareengineering.stackexchange.com/questions/144484",
"https://softwareengineering.stackexchange.com",
"https://softwareengineering.stackexchange.com/users/42446/"
] | If you were doing this for ultimate memory efficency you could do better.
Start with the area code - I don't know how many are actually used but assuming you need to store all 3 digit values.
Presumably exchange codes are filled in order, so you would expect the lower ones to be used in more areas than the higher one... | Graph isn't suitable for this, the implementation requires more memory than tree and it doesn't provide any additional features in this case.
Prefix trees? These are very efficient for search but memory representation isn't optimized for size. They're in fact very memory inefficient. They can also be used to compress ... |
3,166,289 | I tried to upload my iPhone application to the App store, but received the following error: **The binary you uploaded was invalid. The icon file must be in .png format.**
The icon file IS in .png format, size 57x57, so assumed it is a bug and tried to upload with Application Uploader, when I got another error:
**Applic... | 2010/07/02 | [
"https://Stackoverflow.com/questions/3166289",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/351354/"
] | Many people were confusing (like me) modifying the code signing property of XCode.
You must ensure that your code signing identity property start with
**iPhone Distribution : Developer Name**
instead of
**iPhone Developer : Developer Name**
PS : If you have no option start with iPhone distribution, you didn't ... | Since you haven't mentioned anything regarding the fact that you did sign the code, I'm going to assume you didn't.
You'll need to get your application code signed in order for it to be accepted, so that the phone knows it's from a trusted developer, and not just a virus someone has uploaded.
Do you have a code sign... |
3,322,627 | I have a long text that would not fit within the div it occupies. The div class is as follows:
```
.mydiv {
overflow:hidden;
padding:3px 3px 3px 5px;
white-space:nowrap;
}
```
Of course I can only see portion of text. The problem is that it shows first N characters and I want to show last N chars. How do... | 2010/07/23 | [
"https://Stackoverflow.com/questions/3322627",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/135946/"
] | If you're able to wrap your text in another element, you can make it work as shown in [this fiddle](http://jsfiddle.net/9XbZ9/). I've floated a nested `<span>` to the right. | You can do it with just CSS:
<http://jsbin.com/ususu>
```
<div style="width: 150px; border: 1px solid red; overflow: hidden; position: relative; height: 2em;">
<div style="position: absolute; right: 0px; padding: .5em;white-space:nowrap;">
aaaaaaaaaaaabbbbbbbbbcccccccccccccccccddddddddddddddddddddeeeeeeeeee... |
11,752,097 | I need to disable options with value "- Sold Out -" in a list of dynamic drop down menus. How can I do this easily with jQuery? Below is the HTML
```
<select id="field_0_1" class="text_select" name="field_0_1" onChange="">
<option value="">- Preferred Time -</option>
<option value="- Sold Out -">- Sold Out -</option>
... | 2012/08/01 | [
"https://Stackoverflow.com/questions/11752097",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1567428/"
] | ```
$("select option[value*='Sold Out']").prop('disabled',true);
```
**[Demo](http://jsfiddle.net/BYkVW/2/)**
### According to edit
```
$('#previous_select').on('change', function() {
// after creating the option
// try following
$("select option[value*='Sold Out']").prop('disabled',true);
});
`... | ```
$("#ddlList option[value='jquery']").attr("disabled","disabled");
``` |
29,306,958 | I have two columns in Bootstrap 3, one with a couple of images in it, the other with one big image. I want one column - the one with multiple images - to be partially overlapped the other, so one image overlaps the three other images. If I try this the big image gets moved either down or up. Is the a way to overlap the... | 2015/03/27 | [
"https://Stackoverflow.com/questions/29306958",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2969329/"
] | Please check if in the source code of the page where it's not working you have an element with `id="design-centre"` (probably an anchor `<a>`, often also used in conjunction with the `name` attribute). There probably will be none, but the homepage will have it. It's meant to be used as a kind of in-page navigation. Cli... | As this is a dropdown. I don't think you need to add href to the anchor tag.
You can just keep a # inside the href.
This is the updated code,
```html
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/js/bootstrap.mi... |
70,703,813 | I have a table with daily data by hour. I want to get a table with only one row per day. That row should have the max value for the column AforoTotal.
This is a part of the table, containing the records of three days.
| FechaHora | Fecha | Hora | AforoTotal |
| --- | --- | --- | --- |
| 2022-01-13T16:00:00Z | 2022-01... | 2022/01/13 | [
"https://Stackoverflow.com/questions/70703813",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/16167671/"
] | Another way which is little bit costly:
It will be working when (Fetcha and max(AforoTotal)) combination is unique.
In given example, I find it is unique.
```
SELECT * FROM your_table
WHERE Fecha||AforoTotal
IN
(SELECT Fecha||MAX( AforoTotal ) FROM your_table GROUP BY Fecha);
[Output]
https://i.stack.imgur.com... | thanks for your approach. This can be saved as a view in BigQuery and I can use it in DataStudio. I have not tested what happens when the combination is not unique, I will see how it behaves. |
245,428 | How to know the pid of active (focused) window?
I want to write a script in which it is necessary to know whether the user is actively using a program [browsing internet with somthing say firefox] or doing something else [writing text with something say gedit]
In my case i want to download big files but don't want to... | 2013/01/20 | [
"https://askubuntu.com/questions/245428",
"https://askubuntu.com",
"https://askubuntu.com/users/123897/"
] | bash
```bsh
xdotool getwindowpid `xdotool getactivewindow`
```
fish
```
xdotool getwindowpid (xdotool getactivewindow)
``` | You can install wmctrl then use it to list all windows, `wmctrl -l`. |
74,924 | I created this script to take informations "at-the-moment" of [this site](http://www.programme-tv.net/programme/toutes-les-chaines/en-ce-moment.html#Grandes%20cha%C3%AEnes):
```
Pictures of name channel
Name of channel
Pictures channel
Times
Title
Type
```
My script (Work):
```
<?php
$url="http://www.programme-tv.... | 2014/12/26 | [
"https://codereview.stackexchange.com/questions/74924",
"https://codereview.stackexchange.com",
"https://codereview.stackexchange.com/users/61885/"
] | To be honest I don't think your current way of handling is 'clean'.
But I would suggest you to use a HTML DOM parser. I took the liberty to google it for you and <http://simplehtmldom.sourceforge.net/> seems quite what you need.
It's a PHP HTML parser, which allows you to write
```
// Find all element which class=foo... | ### Don't parse HTML with regular expressions
First of all, [don't parse HTML with regular expressions](https://stackoverflow.com/questions/1732348/regex-match-open-tags-except-xhtml-self-contained-tags/1732454#1732454).
Second of all, [don't parse HTML with regular expressions](https://stackoverflow.com/questions/1... |
186,185 | The Apple Watch Activity allows for setting an overall "Move" goal, but I don't see how to change the green "Exercise" goal from the default 30 minutes. Is there a way to accomplish this? | 2015/05/07 | [
"https://apple.stackexchange.com/questions/186185",
"https://apple.stackexchange.com",
"https://apple.stackexchange.com/users/4395/"
] | You aren't limited to one time around the ring in the Activity app. You get a double arrow for 1 hour of exercise, for example. You also receive awards for doubling or tripling the exercise ring.
You can use the Workout app to set whatever exercise goal you like. And you get a custom ring to fill in that app, based o... | watchOS 7 enables changing the green Exercise Goal.
>
> Apple Watch > Activity app > Scroll to Bottom > Change Goals
>
>
>
[](https://i.stack.imgur.com/K2zNR.png)
* <https://kirkville.com/change-activity-goals-on-the-apple-watch-in-watchos-7/>
* <https... |
941,237 | I have just installed 16.04 on my [HP-149tx](https://support.hp.com/in-en/product/hp-15-ac100-notebook-pc-series/8499326/model/8960419/drivers) alongside Windows. I am unable to access the Wifi from Ubuntu. The signal is too weak even if I hold the laptop close to the router.I can confirm this is a driver issue since I... | 2017/07/30 | [
"https://askubuntu.com/questions/941237",
"https://askubuntu.com",
"https://askubuntu.com/users/628460/"
] | Quite often, the weak signal is a symptom of the antenna wire being connected to connection #1 on the card when the default driver is expecting to see the signal at connection #2. Of course, you could open the laptop and switch the wire or you could instruct the driver to explicitly select the working antenna connectio... | Have you checked your wifi signal strength? I suggest you to use wifi scanner <https://www.netspotapp.com/wireless-network-wifi-scanner.html> to monitor your network and identify problem areas first. I think the problem can be in the level of background noise at your house. |
4,710,491 | Is it mandatory to write `$(document).ready(function () {... })` every time ?
Can't we do it without this line? | 2011/01/17 | [
"https://Stackoverflow.com/questions/4710491",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/412982/"
] | The reason for placing your code inside this function is that it will get called once the DOM has loaded - meaning that all the elements are accessible. Calling jQuery selectors without this function means that the elements have not necessarily been loaded into the DOM and might not be accessible (and you'll see weird ... | If you don't use that line, and just include the javascript in your body, it will execute as soon as it's loaded. If it's trying to act on DOM elements that have not yet loaded, unpredictable results will occur.... better to be safe than sorry. |
24,846 | There is a tree that bears fruit e.g. grapes or mangoes. The tree has its roots in the neighbour's house and a large part of the fruit is also in the neighbour's house.
But, some part of that tree has its branches all over a tree that is in my house. Those branches have fruit.
Can that fruit be eaten?
* I am lookin... | 2015/06/15 | [
"https://islam.stackexchange.com/questions/24846",
"https://islam.stackexchange.com",
"https://islam.stackexchange.com/users/2418/"
] | I think the best option would be to talk to the neighbor and ask for their permission. It is just good etiquette. In fact I can narrate my story. Our mango tree goes into our neighbor house and they always return our mangoes when they fall. It is just very nice of them. Once they had workers and found a lot of mangoes,... | No , techinically it belongs to the person who maintains the tree , he being an owner and you are not the owner of the tree. The verses of stealing would be applicable here. |
56,856,011 | I'm trying to convert a serialized string into an array
This is the string i'm getting on php (form sent using serialized AJAX POST)
```
"ref_1=000CBA0000&name_1=Produto%20A&quantity_1=1&ref_2=000CBA0000&name_2=Produto%20A&quantity_2=1&ref_3=000CBA0000&name_3=Produto%20A&quantity_3=1"
```
every product that comes i... | 2019/07/02 | [
"https://Stackoverflow.com/questions/56856011",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1205650/"
] | **Before creation:**
You can set environment variable while creating the cluster.
Click on **Advanced Options** => Enter **Environment Variables**.
[](https://i.stack.imgur.com/y1XuV.jpg)
**After creation:**
Select your **cluster** => click on **E... | Use databricks cluster policy [configuration](https://docs.databricks.com/administration-guide/clusters/policies.html#cluster-policy-attribute-paths).
The configuration will auto-add the environment variables during policy selection.
```
spark_env_vars.MY_ENV_VAR: {
"value":"2.11.2",
"type": "fixed"
}
``` |
22,087,076 | Does any one know how to do a simple image upload and display it on the page.
This is what I'm looking for.
* User(me) will choose a image
* The page will display the image without refreshing the page or going to another file.
* multiple `<img src>` will do because I need to display different image size.
This was my... | 2014/02/28 | [
"https://Stackoverflow.com/questions/22087076",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3335903/"
] | ```
<img id="output_image" height=50px width=50px\
<input type="file" accept="image/*" onchange="preview_image(event)">
<script type"text/javascript">
function preview_image(event) {
var reader = new FileReader();
reader.onload = function(){
var output = document.getElementById('output_image');
o... | ```
<li class="list-group-item active"><h5>Feaured Image</h5></li>
<li class="list-group-item">
<div class="input-group mb-3">
<div class="custom-file ">
<input type="file" class="custom-file-input" name="thumbnail" id="thumbnail">
... |
9,316,758 | It may sound stupid, but how can I remove a definite child from the stage?
e.g.
```
function giveMeResult(e:MouseEvent):void
{
if(stage.contains(result))
{removeChild(result);}
addChild(result); // this part works fine, but it adds one over another
}
```
it adds one result on the top of the previous one.
... | 2012/02/16 | [
"https://Stackoverflow.com/questions/9316758",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1212216/"
] | All I had to do is just change result.txt without even removing it from the stage | Have you tried?
```
MovieClip(root).removeChild(result)
```
[EDIT]
```
function giveMeResult(e:MouseEvent):void{
if(result.parent != null && result.parent == result.stage){
stage.removeChild(result);
}
stage.addChild(result);
}
``` |
3,823,607 | I have the following gradient:
```
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<gradient
android:startColor="#ECECEC"
android:centerColor="#F6F6F4"
android:endColor="#F8F8F6"
android:angle="90"
... | 2010/09/29 | [
"https://Stackoverflow.com/questions/3823607",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/19875/"
] | Just use an 8-digit color value, e.g. #FFF8F8F6, where the first two characters are the alpha value. FF being fully opaque, and 00 being fully transparent. | android:background="#00000000" android:cacheColorHint="#00000000"
this will make is transparent however, this is to make it a full transparency... |
552,818 | **"I am using flash as3, php and mysql"**
What is the difference between:
```
$username = $_POST['username'];
$password = md5( $_POST['password']);
```
and
```
$username = mysql_real_escape_string( $_POST['username']);
$password = mysql_real_escape_string(md5( $_POST['password']));
```
I am sending and ... | 2009/02/16 | [
"https://Stackoverflow.com/questions/552818",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/65379/"
] | Remember that mysql\_real\_escape\_string() needs an open database connection to work properly; if you're calling it before using mysql\_connect, it won't have the desired effect. | You just need the `mysql_real_escape_string` if you want to use a string in a query that is then executed by the `mysql_query` function. And furthermore you just need this function if you cannot ensure that this string doesn’t contain certain characters that can violate the integrity of the query you intended. |
751,744 | What are your thoughts on code that looks like this:
```
public void doSomething()
{
try
{
// actual code goes here
}
catch (Exception ex)
{
throw;
}
}
```
The problem I see is the actual error is not handled, just throwing the exception in a different place. I find it more di... | 2009/04/15 | [
"https://Stackoverflow.com/questions/751744",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2847/"
] | Sometimes this is appropriate - when you're going to handle the exception higher up in the call stack. However, you'd need to do something in that catch block other than just re-throw for it to make sense, e.g. log the error:
```
public void doSomething()
{
try
{
// actual code goes here
}
catch... | I've seen instances where generic exceptions are caught like this and then re-packed in a custom Exception Object.
The difference between that and what you're saying is that those custom Exception objects hold MORE information about the actual exception that happened, not less. |
87,786 | One member of our household has some specific food allergies. Her food is often prepared differently, but not usually in a way where it is visually different from the rest of the food. Let’s say we’re cooking chicken thighs on a baking sheet for the whole family. My suggestion was to insert a toothpick. What’s the best... | 2018/02/16 | [
"https://cooking.stackexchange.com/questions/87786",
"https://cooking.stackexchange.com",
"https://cooking.stackexchange.com/users/65185/"
] | I have spent decades cooking for people who can't have gluten, and I and several other people can't have shrimp. The simplest thing to do is to make everyone's food meet the needs of the allergic person. So for example don't bread anyone's chicken, or make a single gluten-free gravy.
That's the simplest, but it may n... | Whatever works for you is best. If the allergy is serious, you'd definitely want to not just mark, which means either:
* just don't use whatever they're allergic to
* use easily-distinguishable separate dishes (if there's one piece on one and 10 on the other, that works)
Some useful things when you do want separate d... |
13,896,528 | I explain what I am trying to do in comments above the parts in the method:
```
public int addPatron(String name) throws PatronException {
int i = 0;
//1. Iterate through a hashmap, and confirm the new name I am trying to add to the record doesn't already exist in the hashmap
for (Map.Entry<Integer, Pa... | 2012/12/15 | [
"https://Stackoverflow.com/questions/13896528",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1005450/"
] | As others have said, the use of `==` for comparing strings is almost certainly inappropriate. However, it shouldn't actually have caused a problem in your test case, as you're using the same constant string twice, so `==` should have worked. Of course, you should still fix the code to use `equals`.
It's also not clear... | You need to use equals to compare String objects in java, not ==. So replace:
```
if (nameTest.getName() == name) {
```
with:
```
if (nameTest.getName().equals(name)) {
``` |
361,856 | I need some help with jQuery script again :-) Just trying to play with jQuery..I use script below for coloring options of select element. It works in pure html, but in my asp.net 2.0 (Master + Content pages) does not. Script is placed in Head section.
```
function pageLoad(){
var allOddSelectOption = "select optio... | 2008/12/12 | [
"https://Stackoverflow.com/questions/361856",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/24507/"
] | Check [css(properties)](http://docs.jquery.com/CSS/css#properties), you can apply styles very easy.
```
$(document).ready(function(){
$("select option:odd").css({'background-color' : 'yellow', 'font-weight' : 'bolder'});
});
```
EDIT: For ASP .NET 2.0 `$(document).ready()` will work, since you can call it [multipl... | ASP.Net decorates your element IDs when you are using master pages. It will put a lot of stuff up front, but leave your original ID at the end. Because of that, you can use a selector like this on ASP.Net server control renderings.
```
$("[id$=originalIdFromAspxPage]").attr...
```
The `$=` part means this will match... |
51,983,291 | I need advice.
I have CRM on laravel. We are doing booking now. There will be one common database. How to organize correctly?
1. One application with different namespaces and domain routes.
2. Two application
How do they design such systems?
Thanks! | 2018/08/23 | [
"https://Stackoverflow.com/questions/51983291",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4403617/"
] | I know this thread is fairly old, but maybe the answer can help some people stumbling upon the thread anyway.
We had the same problem (using NavigationView instead of BottomNavigationView) and for some reason Skytile's solution didn't work for us.
As Skytile pointed out, it is not possible (at least on API levels < 2... | Add color resource folder in resources and put bottom\_color\_state in that folder and replace your bottom\_color\_state code as following
```
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_checked="true" android:color="@color/white... |
8,187,355 | Over using gdb, any one can see content of any registers ?
```
ex:
x/x $ebp + 0x4
print $eax
```
I wonder, Can I do same thing by just with c++ ? If yes, how? | 2011/11/18 | [
"https://Stackoverflow.com/questions/8187355",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | C++ does not specify any particular machine architecture; therefore, it would not be able to do anything standard related to (machine specific) registers. You'll have to check your compiler's documentation to see if doing these kinds of things are supported. | I believe the only way you can do this is to use assembly language to access the registers - but that's non-portable.
There's a good thread on the subject here:
<http://bytes.com/topic/c/answers/626071-how-access-processor-registers>
and I asked a question a while back about usage of assembly in C which would show ... |
19,900,081 | I have a single page web application which contains dfp ads. I have two dfp adunits that Iam firing and they are placed in between the content which is a list of articles for a particular category.
When I click on another category,it just loads articles for different category(doesnt change the url in address bar) and ... | 2013/11/11 | [
"https://Stackoverflow.com/questions/19900081",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1218430/"
] | If you are using jQuery take a look at the [plugin](https://github.com/coop182/jquery.dfp.js) I made which wraps DFP and allows you to use it quite easily within single page apps.
This is a demo using turbolinks which will be similar to your single page app:
<http://coop182.github.io/jquery.dfp.js/dfptests/demo1.html... | Do it the hard way:
```
function myGoogleTagLoaderFn(callback) {
// reset googletag lib
window.googletag = null;
// we're using requirejs, so we have to do this as well
window.requirejs.undef('http://www.googletagservices.com/tag/js/gpt.js');
myRequireOr$getScriptFn('http://www.googletagservices.... |
2,016,415 | This is my markup:
```
<div id="nav">
<ul>
<li><a href="#">Page 1</a></li>
<li><a href="#">Page 2</a></li>
<li>
<a href="#">Articles</a>
<ul class="inside-ul">
<li><a href="#">Article 1</a></li>
<li><a href="#">Article 2</a></li>
... | 2010/01/06 | [
"https://Stackoverflow.com/questions/2016415",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/230701/"
] | Change
```
#nav ul {
something;
}
```
to
```
#nav > ul {
something;
}
```
That way the CSS is only applied to the child UL of #nav and not the sub UL. | It is a [CSS specificity](http://htmldog.com/guides/cssadvanced/specificity/) issue.
Id's have a value of 100 while classes have a value of 10 and each element name has a value of 1.
So `#nav ul` = 101
while `.inside_ul` = 10
If two selectors apply to the same element, the one with higher specificity wins.
So the... |
16,469,728 | I'm trying to have a div in which the top is barely visible (Image #1), but on mouseover it slides up to where it will have some copy in it (Image #2). Then on mouseout / leave the div returns back to #1 position.
Any help is greatly appreciated
[Link to IMG of what I'm trying accomplish](http://i.stack.imgur.com/MJ1... | 2013/05/09 | [
"https://Stackoverflow.com/questions/16469728",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2282821/"
] | Everyone has likely since moved on, but I'd like to share my solution to this problem. (Sorry about the long variables names...)
The idea is simple: always keep the fireDate in the future.
-every time didFinishLaunchingWithOptions or didReceiveLocalNotification is invoked, simply cancel your current notification and ... | **If your UILocalNotifications increment the application icon badge number** (i.e. the number in the red circle on the top right of the app's icon), then there is a *ridiculously simple* way to check for unacknowledged UILocalNotifications: just check what the current `applicationIconBadgeNumber` is:
```
- (void)appli... |
17,549,111 | I would like to monitor the following system information in my ASP.NET solution:
* current cpu usage (percent)
* available memory\* (free/total)
* available disk space (free/total)
\*note that I mean overall memory available to the whole system
I tried with windows perfmon (run --> perfmon.msc ) but it seems not to ... | 2013/07/09 | [
"https://Stackoverflow.com/questions/17549111",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2541720/"
] | Use:
```
DELETE FROM users WHERE personID=$personID
```
Make sure you read up about [SQL Injection](http://en.wikipedia.org/wiki/SQL_injection) | You don't need the \* in the delete query
try
```
DELETE FROM users WHERE personID=$personID
``` |
11,280,102 | I was planning on learning a way to create my own programming language and I wanted to know what language to write a compiler with. C? C++? | 2012/07/01 | [
"https://Stackoverflow.com/questions/11280102",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1442564/"
] | Windows Vista and newer come with the .NET Framework installed by default. That in turn already provides a compiler for the .NET languages (most notably C# and VB.NET). It's the only provided language you could possibly write an efficient compiler in. Other languages are VBScript and JScript (via windows Scripting Host... | I suggest you use C#; DLR is great for this purpose. |
17,591,768 | I am working on an application which will have an option for users to upload images. Once uploaded, the application will show other images from the web which look exactly similar, whether or not of the same size.
For this, I will create a temporary URL for the image so that I could provide Google custom search API the... | 2013/07/11 | [
"https://Stackoverflow.com/questions/17591768",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1001641/"
] | Well, the answer quite simply is TinEye Commercial API <https://api.tineye.com/welcome>. I was looking in the wrong place I guess, I did not have any luck with Google Custom Search API. | Would you need a simple result?
If you are, you can use Vision API of Google.
This is very simple.
<https://cloud.google.com/vision/>
You can try on the top.
First, access the URL.
Second, upload your image file on the "Try API"
Third, click "JSON" tab menu on the result.
You can be seen JSON abou... |
38,514,198 | I have lists of NLTK-tags as below. I would like to select only those tagged as 'NNP' and, more specifically, first and last names (e.g. Event Chair Iris Dankner, Even Producer Barbara Schorr).
```
O5 = [[(u'Room', 'NN'), (u'Designers', 'NNS'), (u',', ','), (u'BCRF', 'NNP'), (u'and', 'CC'), (u'Holiday', 'NNP'), (u'Ho... | 2016/07/21 | [
"https://Stackoverflow.com/questions/38514198",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6057372/"
] | >
> **Note:** The post is about WebBrowser control, however, for all the new
> .NET projects the main solution is using
> [**WebView2**](https://learn.microsoft.com/en-us/microsoft-edge/webview2/?WT.mc_id=DT-MVP-5003235).
> To learn more, take a look at this post:
>
>
> * [Getting started with WebView2](https://stac... | The below procedures will add the correct key and remove it again.
Call the CreateBrowserKey upon loading the form that your web browser is in.
Then when closing the form, call the RemoveBrowserKey
```
Private Sub CreateBrowserKey(Optional ByVal IgnoreIDocDirective As Boolean = False)
' Dim basekey As String ... |
1,186,450 | My professor of calculus said that he will not adopt books like "stewart" or "thomas" because they are too easy for a physics undergrad course.
He said that Apostol is a great book for our case, but some people told me that this book focus a lot in the historical concept and was not good to them.
I know that my profe... | 2015/03/12 | [
"https://math.stackexchange.com/questions/1186450",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/104187/"
] | Spivak's *Calculus* and *Calculus on Manifolds* (for multivariable calculus) are pretty standard rigorous calculus texts. Rudin's *Principle's of Mathematical Analysis* is standard for a first analysis course, but may be too abstract for a physics course. If you don't like Apostol but still want the mathematical rigor,... | Arihant Publishers Calculus by Amit M Aggarwal is the best as per your requirements.
This is from where i learnt <https://www.youtube.com/results?search_query=profrobbob+calculus+2..im> sure it will help! |
6,290,292 | I have an S3 bucket, and am using a GitHub [S3 class](http://undesigned.org.za/2007/10/22/amazon-s3-php-class), and I am successful in uploading a file, yet I haven't understood how can I update my database with the file path and name, once I have uploaded it.
Any help on the issue will be greatly appreciated.
**Edit... | 2011/06/09 | [
"https://Stackoverflow.com/questions/6290292",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/646891/"
] | Add another hidden input field with name="success\_action\_redirect". The value is the callback URL on your server. You can attach parameters to the callback URL, S3 will call it on success. Don't forget to generate a token and passing that along to make sure it is your callback coming back. | It looks like your code is uploading directly to S3, so you really don't have a way to know what was uploaded.
Consider [uploading the file to your local server **first**](http://php.net/manual/en/features.file-upload.php), write to the DB and then upload to S3.
Read up on [`inputFile()`](http://undesigned.org.za/200... |
96,646 | One of Ezio's assassinations requires me to kill a merchant hiding on a boat without being detected by any of his guards.
He's being guarded by an archer on the dock (no problem), two patrolling guards on the back of the boat (no problem), two stationary guards near the wheel (kind of a problem), and two heavy guards ... | 2012/12/20 | [
"https://gaming.stackexchange.com/questions/96646",
"https://gaming.stackexchange.com",
"https://gaming.stackexchange.com/users/5398/"
] | Taken from [this post](http://www.gamespot.com/assassins-creed-ii/answers/sequence-13-port-authority-mission-help-169445/):
>
> 1) Dive into the water, either from the rooftop directly (move along
> the roof to the right of the mission start-point) or work your way
> down to ground level
>
>
> 2) Swim to the othe... | My way was simple enough. Just do a double air assassination on the two guards at the top of the stairs, then once the sock guard is standing at the side of the boat use a pistol to gun him down the quickly dive into the water from the top of the staircase, this strategy is genius because both brutes and most guards wi... |
720 | I was out on a ride yesterday and several times when I was changing up and down between big chain ring and little chain ring (I only have the 2 rings up front) it required 2 gear changes. The gears actually settled on an imaginary middle cog! How can I fix this? | 2010/09/06 | [
"https://bicycles.stackexchange.com/questions/720",
"https://bicycles.stackexchange.com",
"https://bicycles.stackexchange.com/users/188/"
] | I think Shimano integrated shifters ("brifters") for the front derailleur on a triple normally have 5 indexed positions: 1-3-5 are the main positions that match the chainrings and 2-4 are intermediate spots to avoid chain rub for some chainring+sprocket combinations. If you give the front shift lever a short pull it wi... | This is probably down to the gear cables.
If the cables are new they may have stretched a little and you'll need to take the slack out by adjusting the tension, you usually do this with a barrel adjuster either at the shifter or inline in the shifter cable.
If the cables have been on the bike for some time then the... |
54,088,814 | I want to connect to a database using a parameter provided by the URL like this:
```
www.mywebsite.com/DATABASE_1/
```
This will redirect to the login page using that "DATABASE\_1" as the database to connect to.
I am new to Symfony and working with controllers, I've been a SQL developer all my life and I'm trying ... | 2019/01/08 | [
"https://Stackoverflow.com/questions/54088814",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/10883212/"
] | You should not to connect to database from your controller and handle database connection directly. The way it works is declaring configuration for Doctrine in config/packages/doctrine.yaml. Doctrine connects to database by itself. To work with database in controllers, for example, you need to get Doctrine instance fir... | I'm not sure about this, but I guess you could make different `VirtualHost` tha point to your URLS and add different `ENV` parameters thats contains your doctrine connection string.
[On this link](https://symfony.com/doc/2.0/cookbook/configuration/external_parameters.html), there are example to set Env param in Virtua... |
22,098,754 | In a small HBase cluster, all the slave nodes got restarted. When I started HBase services, one of the tables (test) became **inconsistent**.
In HDFS some blocks were missing(hbase blocks). So it was in safe mode. I gave `safemode -leave` command.
Then HBase table (test) became inconsistent.
***I performed below men... | 2014/02/28 | [
"https://Stackoverflow.com/questions/22098754",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1862493/"
] | In HBase 2.0 (and possibly in previous versions), "not deployed on any region server" is typically solved by getting the region assigned.
1. Authenticate if you're on a secured cluster. You are on a secured cluster, aren't you? ;)
```
kinit [keytab] [principal]
```
2. Run HBase check to see which regions specificall... | In `Hbase 2.0.2` version there is no repair option to recover inconsistencies.
1. Run hbase hbck command.
2. If the error mesaage look like mentioned below:
```
ERROR: Region { meta => EMP_NMAE,\x02\x00\x00\x00\x00,1571419090798.054b393c37a80563ae1aa60f29e3e4df., hdfs => hdfs://node1:8020/apps/hbase/data/data/LEVEL_R... |
22,542,454 | I'm trying to create a procedure that will insert me an new entry IF the ID is not already used. I just can't figure out what I'm not doing right there:
```
CREATE OR REPLACE PROCEDURE add_user
IS
BEGIN
IF NOT EXISTS SELECT * FROM tab WHERE tab.id = '111'
THEN
INSERT INTO tab(id, name, job, city, phone)
... | 2014/03/20 | [
"https://Stackoverflow.com/questions/22542454",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2908704/"
] | Do not try to enforce referential integrity in code as it is very, very likely that it will be very, very wrong. Not *obviously* wrong - no, this is the kind of "wrong" that only shows up when you have 200 users banging on the database and then something goes very very far south in a very big hurry and all of a sudden ... | You forgot to add `(` and `)` in IF statement:
```
CREATE OR REPLACE PROCEDURE add_user
IS
BEGIN
IF NOT EXISTS (SELECT * FROM tab WHERE tab.id = '111') THEN
INSERT INTO tab(id, name, job, city, phone)
VALUES(111, 'Frank', 'Programmer', 'Chicago', '111111111');
END IF;
END;
`... |
147,747 | As a photon has no mass and must always have velocity *c*, if I were to shine a laser straight up (so Earth's gravity would be pulling straight back on it), what would the effect be on the photon? It wouldn't slow it down nor divert it, correct? My understanding is that it would reduce the frequency of the photon (as i... | 2014/11/20 | [
"https://physics.stackexchange.com/questions/147747",
"https://physics.stackexchange.com",
"https://physics.stackexchange.com/users/64831/"
] | For the first question: Sure, light emitted by a galaxy is affected by the gravitational redshift, but the effect is small and independent of the distance of the galaxy from us. (See also the question "[Why is “gravitational” red-shift neglected in galaxy and galaxy cluster scales?](https://physics.stackexchange.com/qu... | The question presupposes that photons would be emitted from the hard core of the black hole - that is, that they would fly into the air and then fall back in.
The black hole is not black on the inside when looking out. On the contrary, on the inside of the black hole, the sky would be bright.
Any laser pointed into ... |
15,063,724 | I need help to convert following ql query to Linq to Sql query.
```
select Name, Address
from Entity
group by Name, Address
having count(distinct LinkedTo) = 1
```
Idea is to find all unique Name, Address pairs who only have 1 distinct LinkedTo value. Remember that there are other columns in the table as well. | 2013/02/25 | [
"https://Stackoverflow.com/questions/15063724",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1509736/"
] | I would try something like this:
```
Entity.GroupBy(e => new { e.Name, e.Address})
.Where(g => g.Select(e => e.LinkedTo).Distinct().Count() == 1)
.Select(g => g.Key);
```
You should put a breakpoint after that line and check the SQL that is generated to find what is really going to the database. | You could use:
```
from ent in Entities
group ent by new { ent.Name, ent.Address } into grouped
where grouped.Select(g => g.LinkedTo).Distinct().Count() == 1
select new { grouped.Key.Name, grouped.Key.Address }
```
The generated SQL does not use a `having` clause. I'm not sure LINQ can generate that. |
27,787,923 | I have a very specific problem in which I must do something like (in HQL):
```
insert into EntityA(field1, field2, field3, field4, field5)
select
:paramForField1,
:paramForField2,
:paramForField3,
:paramForField4,
:paramForField5
from
EntityB
where
...
```
The parameters are being pass... | 2015/01/05 | [
"https://Stackoverflow.com/questions/27787923",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/304556/"
] | Starting with hibernate 4.3 this is possible. Versions before hibernate 4.3 did not support parameters in the select clause. | Try this instead:
```
Class<?> entityAClass = EntityA.class;
Field field1 = entityAClass.getDeclaredField("paramForField1");
field1.setAccessible(true);
String paramForField1 = field1.getName();
Field field2 = entityAClass.getDeclaredField("paramForField2");
field2.setAccessible(true);
String paramForField2 = fiel... |
71,508,566 | >
> Your app contains content that doesn’t comply with the Device and
> Network Abuse policy. We found your app is using a non-compliant
> version of Huawei Mobile Services SDK which contains code to download
> or install applications from unknown sources outside of Google Play.
>
>
>
**I am using Huawei Mobile Se... | 2022/03/17 | [
"https://Stackoverflow.com/questions/71508566",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6676310/"
] | **Update:**
*Note*:
If you have confirmed that the latest SDK version is used, before submitting a release to Google, please check the apks in all Testing track on Google Play Console(including Open testing, Closed testing, Internal testing). Ensure that the APKs on all tracks(including paused track) have updated to t... | I solved it by doing similar to what @Daniel has suggested to avoid such worries in the future:
1. Create different product flavors in your app level Gradle file:
```
android {
...
flavorDimensions 'buildFlavor'
productFlavors {
dev {
dimension 'buildFlavor'
}
produc... |
1,146,387 | I'm using Subtitle Edit to make subtitles for a video, it is supposed to let the user choose between several video engines, one of them is VLC. I can only choose DirectShow since the other options are [disabled](https://i.stack.imgur.com/D2Lz0.png). I have installed the latest version of both programs and the LAV split... | 2016/11/16 | [
"https://superuser.com/questions/1146387",
"https://superuser.com",
"https://superuser.com/users/530423/"
] | Is your computer 32-bit or 64-bit? You must install the VLC version equivalent to your computer. If it still doesn't work, reinstall VLC. I had to reinstall VLC 64-bit version twice to make it work.
<http://www.nikse.dk/SubtitleEdit/Help#codecs> | I could not select Media Classic Player when reinstalled SE because I upgraded to Windows 8.1. I tried many different things but did not work. Finally, I then realized it might because the codecs (K-Lite) were installed in the D drive. I uninstalled and reinstalled them in C and the problem was solved! |
53,184,161 | I am writing a program in Java that needs to take a numeric phone number from the user, for example: 555-GET-FOOD and then print all the numbers, 555-438-3663.
I ran into some issues because my program just print one number, not all of it. Also, How do I make it that the user can enter dashes as part of their input, f... | 2018/11/07 | [
"https://Stackoverflow.com/questions/53184161",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | I suggest that you simply create a map for these
```
Map<Character, String> numbers = new HashMap <Character, String> ();
numbers.put('A', "1" );
numbers.put('B', "1" );
numbers.put('C', "1" );
numbers.put('D', "2" );
numbers.put('E', "2" );
numbers.put('F', "2" );
// etc
for (char c: phoneNumber.toCharArray()) {
... | The issue you have is that you aren't adding to the number - you're overwriting it each time. It would probably be easier to have number be a String and append the corresponding digit to the result string during each iteration of the loop.
Also, in the "else if", you're not doing anything with the expression - you hav... |
2,513,058 | I have an image folder stored at ~/Content/Images/
I am loading these images via
```
<img src="/Content/Images/Image.png" />
```
Recently, the images aren't loading and I am getting the following errors in my error log. What's weird is that some images load fine, while others do not load.
Anyone have any idea w... | 2010/03/25 | [
"https://Stackoverflow.com/questions/2513058",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/23695/"
] | I would insert another ignored route immediately under the first one.
```
routes.IgnoreRoute("Content/Images/{*pathInfo}");
``` | ```
<img src="<%= Url.Content("~/Content/Images/Image.png")%>" alt="does this work?" />
``` |
53,252,030 | I am struggling with this complex query. I am trying to insert the order position of some products.
For example,
I have currently table 1 with a position of NULL, I want to group each Product ID and assign each size a menu position based on ProductID group and using this FIND\_IN\_SET:
`FIND_IN_SET(size,"UNI,XS,S,M,... | 2018/11/11 | [
"https://Stackoverflow.com/questions/53252030",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/10487045/"
] | You can use variables in pre-MySQL 8.0:
```
SELECT t1.*,
(@rn := if(@p = productid, @rn + 1,
if(@p := productid, 1, 1)
)
) as menu_position
FROM (SELECT t1.*
FROM Table1 t1
ORDER BY ProductId,
FIND_IN_SET(size, 'UNI,XS,S,M,L,XL,XXL,3XL,4XL,40,... | Create a two-column table containing all the the `Size` values in one column and the integer order of those sizes in the second column--call that table `menu_pos`. Join this to your `Table` on size, to produce a table or view (call this `product_pos`) containing columns `product_id`, `size`, and `menu_pos`. Then modify... |
88,766 | I think the title explains it all.
In more detail, I'm using the data set from [this Kaggle](https://www.kaggle.com/camnugent/sandp500?select=merge.sh) page.
The data set doesn't come with a daily change in percent, so I copied the dataset and made a new column for the daily percentage change, which I calculate by $$... | 2021/01/31 | [
"https://datascience.stackexchange.com/questions/88766",
"https://datascience.stackexchange.com",
"https://datascience.stackexchange.com/users/111169/"
] | This simply has to do with the fact that returns are compounding, i.e. the daily percentage changes are cumulative. If a stock gets has a daily percentage change of 1% for a single year (trading for 252 days), and therefore also an average change of 1% the total return over this year will not be equal to 1%. The actual... | Had my subtraction backwards.e
Should have been $\frac{close-open}{open}$, not $\frac{open-close}{open}$
Whoops |
238,750 | I recently read somewhere a single word that described a person who enjoyed an argument - in the sense of a lively debate. It may have been a word implying a positive or neutral context but I don't think it was negative or derogatory.
A complex word (uncommon in colloquial use), medium length (7-8 letters), possibly e... | 2015/04/11 | [
"https://english.stackexchange.com/questions/238750",
"https://english.stackexchange.com",
"https://english.stackexchange.com/users/116780/"
] | ***contentious, quarrelsome, cantankerous, O.E. contekors, [grizzle guts](https://books.google.ca/books?id=4J5Fo7OSfXgC&pg=PT593&dq=quarrelsome%20slang&hl=en&sa=X&ei=nGopVY12t4CxBPq4gLgH&redir_esc=y#v=onepage&q=quarrelsome%20slang&f=false), obstructive, argol-bargolous, quarrelsome; argy-bargy (—1887) [is mostly Scotti... | Some good answers here but just wanted to add **devil's advocate** - <https://en.wikipedia.org/wiki/Devil%27s_advocate> |
24,690,160 | **What is the difference between the `div` tag and the new HTML5 `aside` tag?**
W3Schools has a very similar description for the two -
* [**Aside**](http://www.w3schools.com/tags/tag_aside.asp)
* [**Div**](http://www.w3schools.com/tags/tag_div.asp)
I have also seen many sites use the `aside` tag where a `div` tag wo... | 2014/07/11 | [
"https://Stackoverflow.com/questions/24690160",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1799136/"
] | ### Short answer:
>
> **`<div>`** tag defines a general division or section in HTML.
>
>
> **`<aside>`** tag has the same representations as a div, but contains content that is only related to the main page content.
>
>
>
### Difference
>
> Both have the same behavior but have a different meaning logically.
>... | The only practical difference (for now at least) is that old browsers do not recognize `aside` at all. They will treat it as undefined, not as a block element like `div`. Old versions of IE do not even let you style an `aside` element, though there are JavaScript-based ways to fix this.
The theoretical difference is e... |
9,671,780 | Basically I want to be able, in Javascript (JQuery optionally), to search into a JSON with nested elements for a particular element and edit it.
Ex. search for "components" with id 110 and change the name to "video card".
Notice the following JSON is just an example. I am wondering if javascript libraries or good tri... | 2012/03/12 | [
"https://Stackoverflow.com/questions/9671780",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/689763/"
] | You could try [linq.js](http://linqjs.codeplex.com/). | You can use this javascript lib, DefiantJS (<http://defiantjs.com>), with which you can filter matches using XPath on JSON structures. To put it in JS code:
```
var data = {
"computers": [
{
"id": 10,
"components": [
{ "id": 56, "name": "processor" },
... |
19,229,386 | I have installed `openssl` on a Microsoft Windows machine and I was trying to do this conversion:
From:
* `.pfx`
To:
* `.crt`
* `.pem`
* `.key`
But I keep getting this error trying to use certificate:
```
Mac verify error: invalid password?
``` | 2013/10/07 | [
"https://Stackoverflow.com/questions/19229386",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2855359/"
] | In my case it was special characters in password which confuse argument parser. So call without `-password ...` argument and typing password on request did the trick. | For xelat's solution, it's no longer working if you create `.pfx` with OpenSSL 3 because AES-256-CBC is a new default cipher despite most of devices are not supporting it. To solve this, use this command instead:
```sh
openssl pkcs12 -in path.p12 -out myoutput.pem -nocerts -nodes -password pass:<mypassword> -certpbe P... |
24,805,521 | What is the best practice to switch between `UIViewControllers` for iOS in `Objective-C`? Now I have a menu `UIViewController` and a game's main screen `UIViewController`. In the menu there's a "New game" `UIButton` which should switch to the game's main controller. I do it like this:
```
- (IBAction)newGameButtonClic... | 2014/07/17 | [
"https://Stackoverflow.com/questions/24805521",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1608835/"
] | If you want to init an `UIViewController` from the `UIStoryboard` you can do it like in your example. I would just use a `UINavigationController` as parent `UIViewController` and push them to the `UINavigationController`.
```
NSString *strVC = [NSString stringWithFormat:@"%@", [MenuViewController class]];
MenuViewCon... | Segues are the way to do when switching between view controllers:
```
- (IBAction)newGameButtonClicked:(id)sender {
[self performSegueWithIdentifier:@"goToGameViewController"];
}
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
if(segue.identifier isEqualToString:@"goToGameViewControlle... |
36,867,049 | for some reason, logstash (version 1.5) can't process logs with this exception:
*{:timestamp=>"2016-04-26T09:20:12.141000-0400", :message=>"Failed parsing date from field", :field=>"time", :value=>"2016-04-26T09:20:03.520-04:00", :exception=>java.lang.IllegalArgumentException: Invalid format: "2016-04-26T09:20:03.520-... | 2016/04/26 | [
"https://Stackoverflow.com/questions/36867049",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3323914/"
] | I had the same problem; Logstash will happily do its job, but then Elasticsearch would complain with this same error. You can see that '@timestamp' is produced with the correct variable. The key is understanding this sort of error is the bit where it says something like the following:
```
[2020-07-22 12:27:40,814][DEB... | Your `@timestamp` has offset (timzeone value) and you need to add that to your configuration. Please see this link: <https://www.elastic.co/guide/en/logstash/current/plugins-filters-date.html>
* `Z` time zone offset or identity
+ `Z`: Timezone offset structured as HHmm (hour and minutes offset from Zulu/UTC). Example... |
26,491,140 | i have url like this :
```
http://192.168.6.1/Images/Work3ererg.png
http://192.168.6.1/Images/WorwefewfewfefewfwekThumb.png
http://192.168.6.1/Images/ewfefewfewfewf23243.png
http://192.168.6.1/Images/freferfer455ggg.png
http://192.168.6.1/Images/regrgrger54654654.png
```
i would like to know `http://192.168.6.1` fr... | 2014/10/21 | [
"https://Stackoverflow.com/questions/26491140",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2447764/"
] | ```
var url = 'http://192.168.6.1/Images/Work3ererg.png';
var host = url.substr(0,url.indexOf('/',7));
```
`url.indexOf('/',7)`means search `/` after `http://`
Then use `substr` to get string from start to the first `/` after `http://` | you can use **RegularExpression** (pure JavaScript) to do this job
for example you can use
```
var ip = ''; // will contain the ip address
var ips = [] // ips is an array that will contain all the ip address
var url = 'http://192.168.6.1/Images/Work3ererg.png';
url.replace(/http:\/\/(.+?)\//,function(all,first){
... |
3,992,242 | Basically in my website I have a sidebar with a stack of boxes; each box can be collapsed or expanded by the user. I need to save the status of each box for the currently logged in user.
I don't want to use cookies because if an user changes browser or computer, all the boxes will go to the default status.
Should I s... | 2010/10/21 | [
"https://Stackoverflow.com/questions/3992242",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/459271/"
] | Your desired features are contradictory.
1. Length at compile time
2. Defined in header file
3. Single copy across compilation units
To get (1) and (2), you need to declare the variable as `static` or put it in an unnamed namespace. However, this will cause a definition in each compilation unit, which goes against (3... | This is how I see it. I wouldn't use any of those as it is. First, I'm inclined by #2, but, take into account that you have to declare the variable as extern in the .h, and select some .cpp to actually store the string:
```
// .h
extern const char*const STR;
// .cpp
const char*const STR = "abc";
```
The only drawb... |
19,156,231 | I have the following function in my `Website model`
```
public function update_website_status($id = null,$status ){
$this->saveField('is_approved',$status,array('website_id' => $id));
}
```
Now if i wish to call this function from a `controller` how would i set the `$id` and the `$status`?
I know this i... | 2013/10/03 | [
"https://Stackoverflow.com/questions/19156231",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2745998/"
] | I know that the RedGate tools can peek inside a backup file, but it's a commercial product, not sure if there are any other free tools that can. | I'm not sure you can interpret what is inside sql server backup files with out restoring onto a development server.
but as long as you restore onto a dev server you shouldn't have any major concerns. |
44,995,570 | [Here](https://jsfiddle.net/uz6y3L2y/2/) is my code:
```
$(document).ready(function(){
$('a').bind('mouseenter', function() {
var self = $(this);
this.iid = setTimeout(function() {
var tag_name = self.text(),
top = self.position().top + self.outerHeight(true),
left = self.p... | 2017/07/09 | [
"https://Stackoverflow.com/questions/44995570",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5259594/"
] | ```js
$(document).ready(function(){
$('a').bind('mouseenter', function() {
var self = $(this);
this.iid = setTimeout(function() {
var tag_name = self.text(),
top = self.position().top + self.outerHeight(true),
left = self.position().left;
$('body').append("<div ... | in jQuery selector define in first.
```
$('.tag_info').remove();
``` |
8,610 | So, I've read Sketching User Experience by Bill Buxton and several blogs discussion how to start the ideation process in a good way with sketching. I've also read about different pens, such as Copic and Sharpie, and seen showcases of UI sketches. But, nowhere have I found any resources about actually becoming better at... | 2011/06/28 | [
"https://ux.stackexchange.com/questions/8610",
"https://ux.stackexchange.com",
"https://ux.stackexchange.com/users/4596/"
] | Here's a blog post that has some ideas:
<http://www.uxbooth.com/blog/tools-for-sketching-user-experiences/>
There's a Flickr group, though I don't know if it's being moderated anymore:
<http://www.flickr.com/groups/uxsketches/pool/>
And Jakob Linowski has a lot of great posts on hand sketching:
<http://wireframes.... | I think there's only one way to get better: Practice, practice and practice. |
22,248,110 | I have a list, that I wanted to convert to a dictionary.
```
L = [
is_text,
is_archive,
is_hidden,
is_system_file,
is_xhtml,
is_audio,
is_video,
is_unrecognised
]
```
Is there any way to do this, can I convert to dictionary like this by program:... | 2014/03/07 | [
"https://Stackoverflow.com/questions/22248110",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1182058/"
] | I have made few assumptions here to derive this result.
The variables in the List are the only available bool variables in the scope.
```
{ x:eval(x) for x in dir() if type(eval(x)) is bool }
```
or if you have enforced an naming convention for your variables
```
{ x:eval(x) for x in dir() if x.startswith('is_') ... | Below code works.
For Variables to String
```
>>> a = 10
>>> b =20
>>> c = 30
>>> lst = [a,b,c]
>>> lst
[10, 20, 30]
>>> {str(item):item for item in lst}
{'10': 10, '30': 30, '20': 20}
```
For string only.
```
>>> lst = ['a','b','c']
>>> lst
['a', 'b', 'c']
>>> {item:item for item in lst}
{'a'... |
169,566 | How can I create a column in SharePoint 2013 which represent the current date. For example today is 02/09/2016 tomorrow should be 02/10/2016, 02/10/2016... and so on each day the date must be changed.
I was wondering if someone could tell me, thanks. | 2016/02/09 | [
"https://sharepoint.stackexchange.com/questions/169566",
"https://sharepoint.stackexchange.com",
"https://sharepoint.stackexchange.com/users/43990/"
] | Create One **Calculated** type column and set data return formula type to **Number** and apply this formula:
```
="<img src='/_layouts/images/blank.gif' onload=""{"&" var day=new Date();"&" this.parentNode.innerHTML= day ;"&"}"">"
```
You will current date and time.
UPDATE
======
For only Date try below formula:
... | You create the column as you'd like, and set the default value to Todays Date.
[](https://i.stack.imgur.com/IyOwr.png) |
7,828,452 | I'm working on a WPF app, using .NET 4. I'm also trying to wrap my head about WPF Commands, and not always rely upon events, as I've done for upteen years. I'm trying to figure out which command to use. I've come across a Search command, that that appears to be a part of the NavigationCommands, which doesn't make sense... | 2011/10/19 | [
"https://Stackoverflow.com/questions/7828452",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/197791/"
] | >
> Could this RegEx have been structured in such a way as to bypass the first array entry and just produce the desired result?
>
>
>
Absolutely. Use [assertions](http://us.php.net/manual/en/regexp.reference.assertions.php). This regex:
```
preg_match_all('/(?<=\^)[^^]*?(?=~)/', $str, $newStr);
```
Results in:
... | Whenever you have problems to imagine the function of preg\_match\_all you should use an evaluator like [preg\_match\_all tester @ regextester.net](http://regextester.net/preg_match_all.php)
This shows you the result in realtime and you can configure things like the result order, meta instructions, offset capturing an... |
5,150,476 | I have a registration form on which I use client side validation (Required, StringLength etc. specified on my view model). The form is currently pretty much how the scaffolder creates it:
```
@using (Html.BeginForm("Index", "Registration"))
{
@Html.ValidationSummary(true)
<fieldset>
<legend>Registratio... | 2011/03/01 | [
"https://Stackoverflow.com/questions/5150476",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/395377/"
] | This article seems to explain how add client side validation summary into the validation summary:
<http://geekswithblogs.net/stun/archive/2011/01/28/aspnet-mvc-3-client-side-validation-summary-with-jquery-validation-unobtrusive-javascript.aspx>
However I did not test it by myself and it does not seem to have any dif... | i have solved this problem after 2 day of intense research, and finaly, i found the answer by myself and my experimentations !
To display the Client-side Validator message in the validator Summary there is 3 easy step :
1- put `<add key="ClientValidationEnabled" value="false" />` in the `<appSettings>` section of you... |
3,056 | I was reading this [CompTIA Security+ SYO-201 book](http://rads.stackoverflow.com/amzn/click/0789747138), and the author David Prowse claims that:
>
> Whichever VM you select, the VM cannot cross the software boundaries set in
> place. For example, a virus might infect a computer when executed and spread to
> other... | 2011/04/12 | [
"https://security.stackexchange.com/questions/3056",
"https://security.stackexchange.com",
"https://security.stackexchange.com/users/2053/"
] | I think that author assertion is **not completely** true. Actually, there are two types of **hypervisor** in virtualization area. *Hypervisor* is a piece of computer software, firmware or hardware that **creates** and **runs** *virtual machine*s. Those types are:
* **Type-1 hypervisors**
* **Type-2 hypervisors**
Type... | 1. Physical isolation will always be more robust than using logical isolation. In physically-isolated systems (servers, etc.), a security issue in one physically-isolated system will not become an issue in another through shared hypervisor or HW. Of course, the network is another vector that needs to be addressed.
2. F... |
46,894 | Is there nowadays any case for brevity over clarity with method names?
Tonight I came across the Python method `repr()` which seems like a bad name for a method to me. It's not an English word. It apparently is an abbreviation of 'representation' and even if you can deduce that, it still doesn't tell you what the meth... | 2011/02/11 | [
"https://softwareengineering.stackexchange.com/questions/46894",
"https://softwareengineering.stackexchange.com",
"https://softwareengineering.stackexchange.com/users/13825/"
] | I heard a great quote on this once, something along the lines of:
>
> Code is written to be read by humans,
> not computers
>
>
>
If computers were all we cared about we would still be writing assembler, or 1s and 0s for that matter. We have to consider the people who will be using our code, as an API for example... | Short method names mattered in the time of 128k or less of memory where literally every byte counted. Today, there absolutely no reason to use cryptic abbreviated names for methods when longer more descriptive names do not have any practical costs. |
295,690 | I've got a section of code on a b2evo PHP site that does the following:
```
$content = preg_replace_callback(
'/[\x80-\xff]/',
create_function( '$j', 'return "&#".ord($j[0]).";";' ),
$content);
```
What does this section of code do? My guess is that it strips out ascii characters between 128 and 256, bu... | 2008/11/17 | [
"https://Stackoverflow.com/questions/295690",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1726/"
] | Not really stripping, it replaces high-Ascii characters by their entities.
See [preg\_replace\_callback](http://fr.php.net/manual/en/function.preg-replace-callback.php "PHP: preg_replace_callback - Manual").
create\_function is used to make an anonymous function, but you can use a plain function instead:
```
$cont... | It's `create_function` that's leaking your memory - just use a normal function instead and you'll be fine.
The function itself is replacing the characters with numeric HTML entities (`&#xxx;`) |
52,740,523 | I'm missing something basic here (newish to JQuery).
I have the id of an element ex an array and wish to get it's parent.
but the parent object looks like a whole function declaration of some type, when I display it.
What am I missing please.
Thx
```
$.each(arr, function (){
var thisElId = arr[i][0];
alert(thi... | 2018/10/10 | [
"https://Stackoverflow.com/questions/52740523",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1156020/"
] | Two things:
1. You're using *`parents`*, which gives you the full ancestry of the element, not just its parent. It's not clear to me whether you meant to do that. If you're looking for its closest parent matching the given selector, use `closest(...)` or `parents(...).first()`
2. You're not \*calling `text`, you're ju... | first of all text() is a function not a property
second you can use this .. as per my understanding.
```
$.each(arr, function (i,o)
{
var thisElId = $(this);
alert(thisElId); //correct
var EnclSpanParentText =thisElId.parent().text() ;
alert("SpanParent " + EnclSpanParentTe... |
1,816,573 | If mysql record with condition exists-update it,else create new record | 2009/11/29 | [
"https://Stackoverflow.com/questions/1816573",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/182671/"
] | You can use the `REPLACE INTO` for that with the syntax of `INSERT INTO`. This way MySQL will invoke an `UPDATE` whenever there's a fictive constraint violation.
Be aware that this construct is MySQL-specific, so your query ain't going to work whenever you switch from DB. | Are you looking for [`INSERT ... ON DUPLICATE KEY UPDATE`](http://dev.mysql.com/doc/refman/5.0/en/insert-on-duplicate.html)? |
1,207,902 | I saw the [the news that emacs 23.1 was released](http://lwn.net/Articles/344436/).
**For a programmer,** What are the big reasons to upgrade? I'm currently on 22.2.
None of the features listed really seem like must-haves for me. The most immediately interesting bit is that nXML is now integrated. I already have it ... | 2009/07/30 | [
"https://Stackoverflow.com/questions/1207902",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/48082/"
] | M-x butterfly
 | While I was using the pre-releases, the most noticeable feature has been the improved font support. and some small things about smarter window splitting. |
52,456,719 | I have a very simple Jenkins build which is needed for several repositories. All these repositories have the same organisation, the same branches, etc. There is no difference except the repository name.
Each single repository should be able to trigger the build for only this specific repository. I imagine something li... | 2018/09/22 | [
"https://Stackoverflow.com/questions/52456719",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6104854/"
] | After having done a bit more research I think I will try the "GitHub Organization" job type. It scans all repositories for a given GitHub organization or owner and automatically manages corresponding jobs. | Somewhere I read about an organization where they put most standard pipelines into comprehensive shared libraries. [This article](https://jenkins.io/blog/2017/06/27/speaker-blog-SAS-jenkins-world/ "This article") is quite a good read about that.
My own company uses "Seedjobs" to create multiple pipelines with only one... |
6,446,363 | I'm loading a TreeView from a list, and the user has a button to delete an item and it deletes it from the list no problem, but there is also a button to update the TreeView with the list after items have been deleted, I have no problem adding the new items to the TreeView but is there a way to clear all the items in t... | 2011/06/22 | [
"https://Stackoverflow.com/questions/6446363",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/776647/"
] | First of all, Items and Clear should be capitalized in your example. Maybe that's the only problem.
Second, if you are populating the tree by setting its ItemsSource, then you are not allowed to add and remove items from its Items collection by hand. Instead, you should make the source an ObservableCollection instead ... | did you try
```
treeView1.DataBind();
``` |
67,548,332 | I have two tables in Excel, one with categories and listings, and another with points based on the category and listing threshold. It goes as follows:
Categories table:
| ID | CATEGORY | LISTINGS | Points |
| --- | --- | --- | --- |
| 001 | A | 56 | |
| 002 | C | 120 | |
| 003 | A | 4 | |
| 004 | B | 98 | |
Poin... | 2021/05/15 | [
"https://Stackoverflow.com/questions/67548332",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/15196667/"
] | A slightly verbose formula which takes the data as originally formatted (using Excel 365 Let):
```
=LET(ranges,INDEX(Points!B$2:D$12,MATCH(B2,Points!A$1:A$12,0),0),
leftRanges,VALUE(LEFT(ranges,FIND("-",ranges)-1)),
points,INDEX(Points!B$2:D$12,MATCH(B2,Points!A$1:A$12,0)+1,0),
INDEX(points,MATCH(C2,leftRanges)))
```... | Please, try the next code. It uses arrays and should be very fast, working only in memory. Please use your sheets when setting `shC` and `shP` as your real sheets. I only use the active sheet and the next one for testing reason:
```
Sub GetPoints()
Dim shC As Worksheet, shP As Worksheet, lastRC As Long, lastRP As Lon... |
565,013 | I'm working on a coilgun and I need to discharge a capacitor bank through a coil to create a strong magnetic field. My coil has a resistance of 266 milliohms and when fully charged, the capacitors are at 200V with a capacitance of 4700uF total. This will result in a peak current of 750A (ignoring wire resistance and ES... | 2021/05/13 | [
"https://electronics.stackexchange.com/questions/565013",
"https://electronics.stackexchange.com",
"https://electronics.stackexchange.com/users/268421/"
] | You are working with 200V power source, and irfp260n has absolute maximum drain-source voltage 200V. So this mosfet is not suitable for the task, you have to have some margin. And you are not even considering transients and ringing, which is inevitable. Use mosfets with much higher voltage rating. Like 500V. And consid... | Very fast turn-on is essential here so you need a very powerful gate drive. You don't care so much about ringing etc. So go ahead and pump 10A into each of the gates.
If this is still too slow to protect your FETs, maybe check out some GaN parts which have much lower gate charge.
Another step you can take to slightly... |
17,154 | On juniper switches is something like root user. Are there any things that must be done from that user?
For what root user can be usefull? Or isn't usefull, and can be safetly disabled? | 2015/03/09 | [
"https://networkengineering.stackexchange.com/questions/17154",
"https://networkengineering.stackexchange.com",
"https://networkengineering.stackexchange.com/users/14268/"
] | Ryan is correct, you can do absolutely anything from root. JUNOS is built on FreeBSD and inherits that behavior. But to be honest, it's rarely used directly.
The biggest **practical** example I can think of offhand would be to collect core files from devices without another type of authentication, whether its due to ... | The `root` user for any \*nix platform is capable of performing any functions on the system they want - and I mean **anything**. I'd suggest you [look into a wiki article](http://en.wikipedia.org/wiki/Superuser) on this as it is a little beyond the scope of this SE.
It is good practice to disable root access to your j... |
2,550,188 | This question has been asked in an examination of the Indian Statistical Institute, Kolkata for second year Master of Statistics students in the subject Martingale Theory.
>
> Q. Mr.Trump decides to post a random message on the Facebook and
> starts typing a random sequence $\{U\_k\}\_{k\geq1}$ of letters such that
... | 2017/12/04 | [
"https://math.stackexchange.com/questions/2550188",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/118296/"
] | I'm a little late to the party, but here's my solution:
Let's say we have a word $w$ in an alphabet of size $b$, and we have an infinite stream of random letters. let's say we have a gremlin that runs along the stream up until the first occurrence of the word, and then starts from scratch at the next letter. for examp... | My answer is based on the answer of Mike Spivey [on a related question](https://math.stackexchange.com/questions/73758/probability-of-n-successes-in-a-row-at-the-k-th-bernoulli-trial-geometric), which uses [the probability generating function](https://en.wikipedia.org/wiki/Probability-generating_function) $G(z)$ of a d... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.