qid
int64
1
74.7M
question
stringlengths
0
70k
date
stringlengths
10
10
metadata
list
response
stringlengths
0
115k
6,073,935
I have installed the Java 3D API on PC via the exe installer, which simply created a new directory with `j3dcore.jar`, `vecmath.jar`, `j3dutils.jar` in a lib sub-directory and `j3dcore-ogl.dll` in a bin sub-directory. Netbeans had no issues and my code compiled and executed smoothly, however once I built my project an...
2011/05/20
[ "https://Stackoverflow.com/questions/6073935", "https://Stackoverflow.com", "https://Stackoverflow.com/users/639422/" ]
> > Making my Java program easily distributable > > > If you mean 'easy for the end user' look to [Java Web Start](https://stackoverflow.com/tags/java-web-start/info). --- A passer-by asks: > > Can you package the dll dependencies with Web Start? > > > Yes, but much, much better. You can package the nativ...
44,608,964
``` pt=new Date(2019,11,12,8,2,3) console.log(pt.getFullYear()," ",pt.getMonth()); ``` gives result `2019 " " 11` ``` console.log(pt.getFullYear()+" "+pt.getMonth()); ``` gives the result as `2019 11` What is the difference between using, and + in this example?
2017/06/17
[ "https://Stackoverflow.com/questions/44608964", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3967709/" ]
The first of these gives three separate arguments to console.log, while the second appends the three together, then passes that as a single argument to console.log.
343,937
I need to take some online tests for school. This website tells me I need Flash Player 11.3.0 or higher. As far as I can see that is not yet avaible for Linux. I use Ubuntu 12.04 LTS and Chromium. Is there a way I can work around it? Greetz. Rob.
2013/09/10
[ "https://askubuntu.com/questions/343937", "https://askubuntu.com", "https://askubuntu.com/users/191781/" ]
The best way to get Flash Player 11.2+ is to use Google Chrome in Ubuntu. There is no other way to get it, because a higher version has not been released for Ubuntu. [Download Google Chrome From Here](https://www.google.com/intl/en/chrome/browser/) Select your OS version x86 or x64 and download it to any path. Then ...
40,155,466
we got homework to make convertor of weights where the fields are updated while typing the number (no need to click "calculate" or anything). one of the students offered the code below. the code works: when putting a number in field 1, field 2 changes while typing. what i dont understand is how does that work? in the ...
2016/10/20
[ "https://Stackoverflow.com/questions/40155466", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6932394/" ]
I'm going to focus on just 1 of the text fields to answer this. Look at this first line: `kgEdit = (EditText) findViewById(R.id.kgEdit);` All this does is get a reference to the `EditText` for entering kg. Now that there is a reference, we can call methods on that object. Next, we have this: ``` kgEdit.setOnKeyList...
19,074,447
I have to go into a table to retrieve a parameter, then go back into the same table to retrieve data based on the parameter. ``` <cfquery name = "selnm" datasource = "Moxart"> select SelName from AuxXref where Fieldname = <cfqueryparam value = "#orig#"> </cfquery> <cfset selname = selnm.SelName> <cfquery name = "...
2013/09/29
[ "https://Stackoverflow.com/questions/19074447", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1497281/" ]
You can do this in one query like so: ``` <cfquery name = "fld" datasource = "Moxart"> select Fieldname, DBname, SelName from AuxXref where SelName = <cfqueryparam value = "#orig#"> AND FieldName = <cfqueryparam value = "#orig#"> </cfquery> ```
115,794
**Rules** 1. Place some pentominoes into an 8 x 8 grid. They do not touch each other. They can touch only diagonally (with corner). 2. Pentominoes cannot repeat in the grid. Rotations and reflections of a pentomino are considered the same shape. 3. Grid is 8 x 8.
2022/04/17
[ "https://puzzling.stackexchange.com/questions/115794", "https://puzzling.stackexchange.com", "https://puzzling.stackexchange.com/users/79520/" ]
With integer programming, I managed to place > > 8 pieces, proved to be optimal > > > like this. > > $$\begin{array}{cccccccc} 3&3&3&3& &5&5&5\\ 3& & & & &5& &5\\ &4&4&4&4& &A&\\ 6& & &4& &A&A&A\\ 6&6&6& &8& &A&\\ & &6& &8&8& &B\\ 2&2& &8&8& &B&B\\2&2&2& & &B&B&\\ \end{array}$$ > > > Here is my formulation...
44,410,809
I'm looking for changing the **TextView** Sizes automatically. And I found the solution as well. Here is the official [Doc](https://developer.android.com/preview/features/autosizing-textview.html) for Auto sizing textviews. But Still I'm not able to resolve it. When i paste autoSizeTextType its showing error in xml fil...
2017/06/07
[ "https://Stackoverflow.com/questions/44410809", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3824298/" ]
As stated in the [docs](https://developer.android.com/guide/topics/ui/look-and-feel/autosizing-textview.html#setting-textview-autosize): > > The Support Library 26.0 provides full support to the autosizing TextView feature on devices running Android versions prior to Android 8.0 (API level 26). The library provides ...
52,007,637
I have the following string that corresponds to a JSON object. ``` $string = '{"status": "success", "count": 3, "data": [{"id": 112233}]}' ``` And I would like to cast it to a `stdClass`. My current solution: ``` $object = (object)(array)json_decode($string); ``` While this is functioning, is there a better way? ...
2018/08/24
[ "https://Stackoverflow.com/questions/52007637", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8115861/" ]
A much cleaner way would be: ``` $string = '{"status": "success", "count": 3, "data": [{"id": 112233}]}'; $object = json_decode($string); ``` check out what the output for print\_r($object); looks like: ``` stdClass Object ( [status] => success [count] => 3 [data] => Array ( [0] => ...
2,829,287
For example, User adds this "iamsmelly.com". And if I add an href to this, the link would be www.mywebsite.com/iamsmelly.com Is there a way to make it absolute if its not prepended by an http:// ? Or should I revert to jQuery for this?
2010/05/13
[ "https://Stackoverflow.com/questions/2829287", "https://Stackoverflow.com", "https://Stackoverflow.com/users/93311/" ]
Probably a good place to handle this is in a `before_save` on your model. I'm not aware of a predefined helper (though `auto_link` comes somewhat close) but a relatively simple regexp should do the job: ``` class User < ActiveRecord::Base before_save :check_links def check_links self.link = "http://" + self...
16,114,993
I have a `<div id="content">`. I want to load the content from <http://vietduc24h.com> into my `div`: ``` <html> <head> <script type="text/javascript"> $(document).ready(function() { $("#content").attr("src","http://vietduc24h.com"); }) </script> </head> <body> <div id="content"></div> </body>...
2013/04/19
[ "https://Stackoverflow.com/questions/16114993", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2300976/" ]
You need to think about CORS in this aspect. The code you need to have is: ``` <script type="text/javascript"> $(document).ready(function() { $("#content").load("http://vietduc24h.com"); }) </script> ``` When your domain is not inside `vietduc24h.com`, you might get some security exception. In or...
7,262,136
![http://farm4.static.flickr.com/3338/4564960137_0d3c09192d_o.png](https://i.stack.imgur.com/Y2gpf.png) can we change text in this lightbox want to change "This site requires that you Connect with Facebook." and "Connect with Facebook to Continue"
2011/08/31
[ "https://Stackoverflow.com/questions/7262136", "https://Stackoverflow.com", "https://Stackoverflow.com/users/922283/" ]
For most (if not all) arithmetic operations, Java will assume you want the maximum defined precision. Imagine if you did this: ``` long a = ...; int b = ...; long c = a % b + Integer.MAX_VALUE; ``` If Java automatically down-casted `a % b` to an `int`, then the above code would cause an `int` overflow rather than s...
45,507,197
This is about converting the enumeration values to a string array. I have an enumeration: ``` enum Weather { RAINY, SUNNY, STORMY } ``` And I want to convert this to a string array with minimal effort and no loops with Java 8+. This is the best I came up with: ``` Arrays.stream(Weather.values()).map(Enum::toStr...
2017/08/04
[ "https://Stackoverflow.com/questions/45507197", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2735286/" ]
Original post ============= Yes, that's a good Java 8 way, but... The `toString` can be overridden, so you'd better go with `Weather::name` which returns the name of an enum constant (exactly as declared in the enum declaration) and can't be changed: ``` Stream.of(Weather.values()).map(Weather::name).toArray(String[...
26,351
I was studying for icing and a tailplane stall. I have looked up some internet pages and instrument flying handbook, and found the procedure below. 1. raise flaps to the previous setting. (To reduce down wash from the main wing so that reducing negative angle of attack of the tail and break the stall) 2. apply nose up...
2016/03/23
[ "https://aviation.stackexchange.com/questions/26351", "https://aviation.stackexchange.com", "https://aviation.stackexchange.com/users/6831/" ]
Lets start with the very basic concepts.... In most aircraft, the Centre of Gravity (cg) is somewhat forward of the wing or mainplane Centre of Pressure. The exact distance between the cg and the Centre of pressure will depend on aircraft loading, configuration, thrust setting and drag. However, cg forward of the Cent...
2,093,466
I understand that division by zero isn't allowed, but we merely just multiplied $f(x) = 1$ by $\frac{x-1}{x-1}$ to get $f(x) = \frac{x-1}{x-1}$ and $a\cdot 1 = 1\cdot a = a$ so they're the **same function** but with **different domain** how is this possible? *Or in other words* why don't we simplify $f(x) = \frac{x-1}...
2017/01/11
[ "https://math.stackexchange.com/questions/2093466", "https://math.stackexchange.com", "https://math.stackexchange.com/users/406041/" ]
They are the same *almost everywhere*. But clearly one of them does not exist for $x=1$ (since "$\tfrac{0}{0}$" is undefined), while the other one is simply $1$ at $x=1$. > > I understand that division by zero isn't allowed, but we merely just multiplied f(x) = 1 by (x-1)/(x-1) > > > You can multiply by any fract...
59,133,760
I have following HTML code ``` <div class="compatible-product ng-star-inserted"> <adapt-checkbox2 class="checkbox ng-valid ng-star-inserted ng-dirty ng-touched" ng-reflect-model="false"> <label class="checkbox__label" for= "adapt-checkbox-453-input"> <input class="checkbox__input" type="chec...
2019/12/02
[ "https://Stackoverflow.com/questions/59133760", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3189243/" ]
Basically, you are getting an **Array of Object** and you want to access the last element of the array, you can **get last array position by** `array.length - 1`, and access the gfs value. if you want to **check whether gfs value is array** not then you can **check by** `typeof gfs` ```js var data= [ { ...
299,700
I was following [this tutorial](https://www.youtube.com/watch?v=lrvLnhm6Rqw&list=PLpVC00PAQQxHi-llE9Z8-Q747NYWpsq6t&index=32) on Drupal module development. It talks about database query joins in module development. The tutorial is made for Drupal 8 and I'm using Drupal 9. Then I made this (look at the join part): ```...
2021/01/25
[ "https://drupal.stackexchange.com/questions/299700", "https://drupal.stackexchange.com", "https://drupal.stackexchange.com/users/102226/" ]
In PHP: * `.` is the string concatenation operator, not the one to call an object method * [`join()`](https://www.php.net/manual/en/function.join.php) is an alias for the [`implode()`](https://www.php.net/manual/en/function.implode.php) function, which effectively requires 2 arguments, not 3 This means that `$select....
74,243,879
I want to use UTC dates in my Node.js backend app, however, I need to be able to set time (hours and minutes) in a local/user-specified timezone. I am looking for a solution in either pure JS or using `dayjs`. I am not looking for a solution in `moment`. It seemed like using `dayjs` I could solve this problem quite e...
2022/10/29
[ "https://Stackoverflow.com/questions/74243879", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3408342/" ]
I created the following function that sets the time in a local timezone, for example, if you have `Date` object and you want to change its time (but not date in a particular timezone, regardless of the UTC date of that time), you provide this function with that `Date` object, the required time, timezone and optionally ...
199,880
Is there any way to show a calculated field when I'm filling out a new item for a list? For example: If I select "Blue" in field1, and "Bird" in field2, then, on the same page where I am filling in information, I can see field3(Calculated field) show a value of "Blue Jay" Currently, the calculated field doesn't sho...
2016/11/17
[ "https://sharepoint.stackexchange.com/questions/199880", "https://sharepoint.stackexchange.com", "https://sharepoint.stackexchange.com/users/61825/" ]
**As a short answer** : unfortunately , No, the calculated field is calculated after the item added or updated If you are using Enterprise Edition of SharePoint then try editing list form with InfoPath and insert field which will do the calculation for you. Make that field read-only and then publish the form. In Inf...
77,133
There seems to be a lot of software to control (or emulate) mouse input through the keyboard, but what about the opposite? Basically I'm looking for a way to emulate up/down/left/right clicks with mouse movement, at a fast rate (i.e. lots of very short and quick right clicks while I move the mouse to the right) If I ...
2009/11/30
[ "https://superuser.com/questions/77133", "https://superuser.com", "https://superuser.com/users/19668/" ]
OK, hopefully supplying a *useful* answer this time, instead of the inverse of the actual answer you wanted... How about an AutoHotkey script for [mouse gestures](http://www.autohotkey.com/docs/scripts/MouseGestures.htm)? You haven't indicated what sort of control you require, so perhaps a set of gestures is adequate....
95,407
I was playing some math games intended for children, in Japanese, and the subject was 引き算. The isolated question came up "14は10といくつ?" In the context of 引き算 it makes sense that the answer turned out to be 4, but I don't understand the question structurally. How does it imply "If you take 10 away from 14, what's left?" ...
2022/07/15
[ "https://japanese.stackexchange.com/questions/95407", "https://japanese.stackexchange.com", "https://japanese.stackexchange.com/users/41549/" ]
> > Is this to be understood only in the context? Assuming the と is conditional > > > The と is not conditional, and you can tell that from the word followed by the と. **The conditional と should follow 活用語の終止形/the terminal form of a conjugatable word**, such as verb, i/na-adjective, auxiliary, eg 「話す」「寒い」「静かだ」「〇〇だ...
57,779,158
I am using material-ui for my project and I have a need to get the selected text (not the value) and do some parsing. I can't seem to find a way to do this. Here is what my component looks like: ``` <TextField select margin="dense" ...
2019/09/03
[ "https://Stackoverflow.com/questions/57779158", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8484824/" ]
This regex match should get you what you're looking for ```js let regex = /1-[0-9]{3}-[0-9]{3}-[0-9]{4}/ ```
2,554,836
I have $\ln (D(x)+1) $. What is the way to prove , that this is a Lebesgue measurable function ?
2017/12/07
[ "https://math.stackexchange.com/questions/2554836", "https://math.stackexchange.com", "https://math.stackexchange.com/users/503239/" ]
You're on the right path. You need to argue that $\sum a^{-1} = \sum a$ because the map $a \mapsto a^{-1}$ is a bijection. Then you can finish as you have done: $$ \sum a^{-1} = \sum a = \frac{(p-1)p}{2} = \frac{(p-1)}{2}p \equiv 0 \bmod p $$ Note where you need $p$ to be odd.
55,620
I want to cite an IEEE norm in a document. They provide several way to cite it on their website and in particular `bibTeX`. This is perfect because I use LaTeX. However, the citation does not contain any author field. This raise a warning. Should I keep this warning or modify the entry to avoid it? And in this case, ...
2015/10/07
[ "https://academia.stackexchange.com/questions/55620", "https://academia.stackexchange.com", "https://academia.stackexchange.com/users/14659/" ]
I assume that the venue you want to publish in follows the [IEEE editorial style guide](http://www.ieee.org/documents/style_manual.pdf). On page 38, the guide shows how to reference standards: > > Basic Format: > > > [1] *Title of Standard*, Standard number, date. > > > Examples: > > > [1] *IEEE Criteria for Cl...
195,501
Is it coherent to suggest that it is possible to iterate, one-by-one, through every single item in an infinite set? Some have suggested that it is possible to iterate (or count) completely through an infinite set with no start (or lower bound), making infinite regress a genuinely possible reality. Mathematically, is t...
2012/09/14
[ "https://math.stackexchange.com/questions/195501", "https://math.stackexchange.com", "https://math.stackexchange.com/users/40191/" ]
We may count through the integers by listing them $0,1,-1,2,-2,\dots$. This is an infinite set without a lower bound. In general, if you have a bijection $f:\mathbb{N} \to X$ where $X$ is an infinite set, then you can "iterate" through them by listing $f(1),f(2),f(3), \dots$.
69,581,492
I have string column in my `df` table, like this below: ``` d = {'col1': ['1.2', '3.4', '1.99', '0.14', '2.9', '', '2.3']} df = pd.DataFrame(data=d) df ``` [![enter image description here](https://i.stack.imgur.com/X2WXJ.png)](https://i.stack.imgur.com/X2WXJ.png) I would like to convert this column, so that all val...
2021/10/15
[ "https://Stackoverflow.com/questions/69581492", "https://Stackoverflow.com", "https://Stackoverflow.com/users/16734748/" ]
Use [`str.ljust`](https://pandas.pydata.org/docs/reference/api/pandas.Series.str.ljust.html): ``` df['col1'] = df['col1'].str.ljust(4, '0') ``` output: ``` col1 0 1.20 1 3.40 2 1.99 3 0.14 4 2.90 5 2.30 ``` To leave empty rows intact: ``` df['col1'] = df['col1'].mask(df['col1'].astype(bool), df['col1']....
2,435,039
Sorry the title's so convoluted... I must've tried for ten minutes to get a good, descriptive title! Basically, here's the scenario. Let's say a user can pick fifty different hat colors and styles to put on an avatar. The avatar can move his head around, so we'd need the same types of movements in the symbol for when...
2010/03/12
[ "https://Stackoverflow.com/questions/2435039", "https://Stackoverflow.com", "https://Stackoverflow.com/users/48957/" ]
[debu's suggestion](https://stackoverflow.com/questions/2435039/best-way-to-be-able-to-pick-multiple-colors-designs-of-symbols-dynamically-from-f/2435101#2435101) about a hat container makes sense in order to separate out control of the hat movement. You could take this further by separating out different aspects of t...
26,678,924
I'm writing a Linux device driver using kernel 3.13.0 and I'm confused as to why I'm getting this warning. ``` warning: initialization from incompatible pointer type [enabled by default] .read = read_proc, ^ warning: (near initialization for ‘proc_fops.read’) [enabled by default] ``` As far as I can tell m...
2014/10/31
[ "https://Stackoverflow.com/questions/26678924", "https://Stackoverflow.com", "https://Stackoverflow.com/users/289746/" ]
The return type of your `read_proc` function (which throws the warning) does not match the the function that compiles cleanly. ``` static ssize_t dev_read(struct file *pfil, char __user *pBuf, size_t len, loff_t *p_off) ``` vs. ``` static int read_proc(struct file *pfil, char __user *pBuf, size_t len, loff_t *p_off...
8,499
I am writing an application, running on a server, where multiple users access data from a database which is AES encrypted with a master secret. The master secret itself is initially randomly generated, and then AES encrypted with a user-secret to yield a 'user-hash'. The master secret is never stored, but the user-hash...
2013/05/30
[ "https://crypto.stackexchange.com/questions/8499", "https://crypto.stackexchange.com", "https://crypto.stackexchange.com/users/7065/" ]
If a user has a copy of both the encrypted and decrypted data, he is in a position to perform at least a [known-plaintext attack](http://en.wikipedia.org/wiki/Known-plaintext_attack). If users can submit arbitrary plaintexts for encryption, they can conduct a [chosen-plaintext attack](http://en.wikipedia.org/wiki/Chose...
2,055,713
In his book "Men of Mathematics", Eric Temple Bell repeatedly makes the point that a student of mathematics must read the classics. My question is what are some classic books in mathematics ( Dictionary definition : judged over a period of time to be of the highest quality and outstanding of its kind.) that can be use...
2016/12/12
[ "https://math.stackexchange.com/questions/2055713", "https://math.stackexchange.com", "https://math.stackexchange.com/users/-1/" ]
I don’t agree with Bell on this point: one may well learn better and more easily from a book that is *not* generally considered a classic. For example, most people have never even heard of John Greever’s modified Moore method textbook *Theory and Examples of Point-Set Topology*, but for me it was the ideal introduction...
36,447,958
I'm using the [jQuery Validate Plugin](http://jqueryvalidation.org/validate) and I want to be able to hide the error messages next to my inputs and have a main error message at the bottom, I have this working kind of but the error messages are showing next to my input fields. (Obviously I would clean up the styling if ...
2016/04/06
[ "https://Stackoverflow.com/questions/36447958", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4532646/" ]
May be use the Validator method ``` errorPlacement: function(error,element) { return true; } ``` It will not append the error to the inputs.
9,994,676
I have checked out many pages but most of the tutorials and script return an error code with this type of JSON output. So how would I be able to extract the data from this JSON in Java?: ``` [ { "user":{"id":"1","username":"user1"}, "item_name":"item1", "custom_field":"custom1" }, { "user":{"id":...
2012/04/03
[ "https://Stackoverflow.com/questions/9994676", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1310575/" ]
If you want to use Gson, then first you declare classes for holding each element and sub elements: ``` public class MyUser { public String id; public String username; } public class MyElement { public MyUser user; public String item_name; public String custom_field; } ``` Then you declare an array of the ...
10,839
I am reading Novuum Lumen Chemicum with the help of Waite’s English translation. (<https://www.sacred-texts.com/alc/hm2/hm204.htm>) The following passage I cannot understand clearly. It seems that Waite had skipped this.(org.: Musaeum Hermeticum, Frankfurt, 1677, p.545 – page number misprinted as 454) > > Nos dum ill...
2019/05/24
[ "https://latin.stackexchange.com/questions/10839", "https://latin.stackexchange.com", "https://latin.stackexchange.com/users/2954/" ]
To supplement, I've located [a different published (i.e. professional) English translation](https://archive.org/details/alchymytakenouto00sedz): that of a Dr John French, published in 1674. Here's what he has to say [for this section](https://archive.org/details/alchymytakenouto00sedz/page/2): > > If *Hermes* himfelf...
72,026,622
I have an array of objects: ``` this.array = [{name: null}, {name: null}, {name: null}] ``` and array of reservend names: ``` this.reserved = ["name2", "name3"] ``` I loop through array and try to set uniques name (not included inside `reserved` array) ``` for (let i = 0; i < array.length; i++) { this.setD...
2022/04/27
[ "https://Stackoverflow.com/questions/72026622", "https://Stackoverflow.com", "https://Stackoverflow.com/users/16078729/" ]
**Update:** In the meantime, GitLab have released a new version of their Docker Machine fork which upgrades the default AMI to Ubuntu 20.04. That means that upgrading Docker Machine to the latest version released by GitLab will fix the issue without changing your runner configuration. The latest release can be found [...
32,251,446
I am developing an Android application and I have trouvble making javascript work. Here is my main activity code : ``` protected void onCreate(Bundle savedInstanceState) { Log.i(TAG, "create LocalDialogActivity"); super.onCreate(savedInstanceState); setContentView(R.layout.activity_local_d...
2015/08/27
[ "https://Stackoverflow.com/questions/32251446", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3664585/" ]
Just add ``` webView.getSettings().setDomStorageEnabled(true); ```
49,336,275
Prestashop 1.6 has some strange functions. One of them is: ``` \themes\my_theme\js\autoload\15-jquery.uniform-modified.js ``` Which add span to radio, input button. For example: ``` <div class="checker" id="uniform-cgv"> <span class="checked"> <input name="cgv" id="cgv" value="1" type="checkbox"> </span> <...
2018/03/17
[ "https://Stackoverflow.com/questions/49336275", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9368657/" ]
If you want to get the same checkbox like with uniform you just need to invoke method bindUniform() after your button was handled. I assume that you get an answer after form handling with an ajax response, so you need to add `if (typeof bindUniform !=='undefined') { bindUniform(); }` after you get response and DOM ...
12,023,986
Today I noticed that new MVC projects in VS 2012 are using [WebMatrix.WebData.WebSecurity](http://msdn.microsoft.com/en-us/library/webmatrix.webdata.websecurity%28v=vs.99%29.aspx) to handle membership related tasks. I went to msdn to a quick look at the documentation and was surprised. Lot's of good stuff in there and...
2012/08/19
[ "https://Stackoverflow.com/questions/12023986", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1061342/" ]
Found the answer at MSDN: <http://msdn.microsoft.com/en-us/library/webmatrix.webdata.simplemembershipprovider%28v=vs.111%29> > > In ASP.NET Web Pages sites, you can access the functionality of the SimpleMembershipProvider class by using the Membership property of a web page. You do not (in fact, cannot) initialize a ...
60,655,194
everyone! I am trying to render the exchange rates from a server to my page. Here is my React code: ``` import React from 'react'; import ReactDOM from 'react-dom'; class App extends React.Component { constructor() { super(); this.state = { exRates: [] }; } getCurrency...
2020/03/12
[ "https://Stackoverflow.com/questions/60655194", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11894807/" ]
1. You must not had an empty line beetween `@app.route("/profile/<name>")` and `def profile(name):` 2. You have to set the html file in a folder called templates. 3. You have to set the templates folder and run.py in the same folder
35,285,191
I am executing a stored procedure but it is failing at some point, Current error code is not helping me to find where and exactly what the error is I wanted to know where it is exactly failing so wanted to print line by line output while executing. for eg : ``` create or replace -- decaring required variabl...
2016/02/09
[ "https://Stackoverflow.com/questions/35285191", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1767969/" ]
Your code will look like this; additionally you can write a procedure with autonomous transactions to log all error or logs. you will also get online code for this functionality. [http://log4plsql.sourceforge.net/](http://logs) ``` create or replace procedure proc_data_table_details is tablename varchar2(30); ...
9,094,681
I am having string like this ``` abcdedfd?xyz adcdefghdfd?red ``` so i wanted to remove the characters after the `?
2012/02/01
[ "https://Stackoverflow.com/questions/9094681", "https://Stackoverflow.com", "https://Stackoverflow.com/users/551179/" ]
``` NSString *newString = [[yourString componentsBySeparatedByString: @"?"] objectAtIndex: 0]; ``` This assuming the string you want to trim is in `NSString *yourString`.
29,908,287
I need help with my program. I declared a one-dimensional array of 6 and I want to show random values between 1-6 in a text box My question is how do I show values in my array in textbox1.text? Here is my code: ``` Public Sub ClickMyFirstClassButton() If FirstClass.Checked = True Then 'This piece of co...
2015/04/28
[ "https://Stackoverflow.com/questions/29908287", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4601982/" ]
As suggested by @eryksun, this solves the issue: ``` p = subprocess.Popen('clip.exe', stdin=subprocess.PIPE, stdout=subprocess.PIPE, universal_newlines=True) p.communicate('hello \n world') p.wait() ```
11,881,490
In a C# enumeration, are there any negative side effects of using a negative number? I am modelling response codes and one of the codes in negative. This compiles but I want to know if there are any negative side effects to this. ``` public enum ResponseCodes { InvalidServerUserPasswordCombo = -1, // etc. } ...
2012/08/09
[ "https://Stackoverflow.com/questions/11881490", "https://Stackoverflow.com", "https://Stackoverflow.com/users/64226/" ]
> > negative side effects of using a negative number > > > Clearly, with any underlying signed type, any bitwise operations are going to get "interesting" very quickly. But using an enum as a collection of related constants can quite happily use negative values.
261,384
I am trying to install additional drivers on Ubuntu 12.04. The application is returning an error. In the log file I can see various NVIDIA module failed to load. However, my PC do not have NVIDIA graphics card. Its Intel card, then why is Ubuntu searching for NVIDIA card? I have installed Ubuntu 12.04 and additional d...
2013/02/26
[ "https://askubuntu.com/questions/261384", "https://askubuntu.com", "https://askubuntu.com/users/135680/" ]
**Yes**, but you will need Ubuntu 12.10. 1. Download Steam from Ubuntu Software Center 2. Start it up, you will be asked to log in with your Steam account. If you don't have one you can choose the create account option. 3. Go to the Store tab 4. Enter Don't Starve in the search bar in the top-right and click Don't Sta...
3,195,720
I know the question has been asked thousands of times, but I'll ask it again: is there a way (even patchy) to write/read a dumb text file with Javascript or Protoype ? This is only for debug purposes, and is not designed for production. The thing is I need it to work with (at least) both Firefox and IE (preferably und...
2010/07/07
[ "https://Stackoverflow.com/questions/3195720", "https://Stackoverflow.com", "https://Stackoverflow.com/users/277128/" ]
Writing to a file is not possible, you'd have to write a server-side script and make a request to that script. Reading is possible if you use an iframe with the text file's location as source, and reading the iframe contents.
945,527
Isn't that nicely recursive? I've got a portable command prompt on my external drive, and it has a nice .bat file to configure some initial settings, but I'd like more! Here's what I know how to set from .bat: * Colors = (color XY) where x and y are hex digits for the predefined colors * Prompt = (prompt $p$g) set...
2009/06/03
[ "https://Stackoverflow.com/questions/945527", "https://Stackoverflow.com", "https://Stackoverflow.com/users/93221/" ]
Regarding setting the buffer size: Using `mode con: cols=XX lines=YY` sets not only the window (screen) size, but the buffer size too. If you specify a size allowed by your system, based on available screen size, you'll see that both window and buffer dimension are set to the same value; .e.g: ``` mode con: cols=100...
53,386,051
I would like to append a 256 digits to thousands of number in notepad plus to appear as below: ``` 776333533 774361221 772333707 771615215 784713890 786164089 777664662 ``` I would want all these numbers to appear as below: ``` 256776333533 256774361221 256772333707 256771615215 256784713890 256786164089 2567776646...
2018/11/20
[ "https://Stackoverflow.com/questions/53386051", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10626686/" ]
Here below is I think a good example of your requirement. Modules will be loaded with page properties. As page property is depended on iron-page, `selected='{{page}}'` when page value has been changed with iron-page's name properties, its observer loads the that page's modules. : ``` static get properties() { return ...
223,590
Where does this meme come from (as in a *trip down memory lane*) ? Is it from a book ?
2015/01/25
[ "https://english.stackexchange.com/questions/223590", "https://english.stackexchange.com", "https://english.stackexchange.com/users/64820/" ]
Christine Ammer, *The Facts on File Dictionary of Clichés*, second edition (2006) has this entry for the phrase "down memory lane": > > **down memory lane** Looking back on the past. Often put in a nostalgic way, this term may have originated as the title of a popular song of 1924, "Memory Lane," words by Bud de Sylv...
41,983,979
Configuring multiple sources for an agent throwing me lock error using FILE channel. Below is my config file. ``` a1.sources = r1 r2 a1.sinks = k1 k2 a1.channels = c1 c3 #sources a1.sources.r1.type=netcat a1.sources.r1.bind=localhost a1.sources.r1.port=4444 a1.sources.r2.type=exec a1.sources.r2.command=tail -f /opt/...
2017/02/01
[ "https://Stackoverflow.com/questions/41983979", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4029265/" ]
Check your php.ini for: **session.gc\_maxlifetime** - Default 1440 secs - 24 mins > > **session.gc\_maxlifetime** specifies the number of seconds after which data will be seen as 'garbage' and potentially cleaned up. Garbage collection may occur during session start (depending on session.gc\_probability and session....
22,153,836
I am curious as to why Start-Job increments in twos. My worry is that I am doing something wrong that makes the ID of a new job jump by 2. ``` Start-Job -ScriptBlock {Get-WinEvent -LogName system -MaxEvents 1000} ``` Results as shown by Get-Job ``` Id Name State HasMoreData Command ...
2014/03/03
[ "https://Stackoverflow.com/questions/22153836", "https://Stackoverflow.com", "https://Stackoverflow.com/users/200586/" ]
Each time you start a job, it consists of a parent job and one or more child jobs. If you run `get-job | fl` you'll see the child jobs, and you'll see that their names are the "missing" odd numbered names.
4,554,498
I am creating a Chart (DataVisualization.Charting.Chart) programmatically, which is a Stacked Bar chart. I am also adding Legend entries programmatically to it. I want to show the Legend at the bottom of the chart. But, while doing so, the Legend overlapps with the X-axis of the chart. Here is the code I am using: ...
2010/12/29
[ "https://Stackoverflow.com/questions/4554498", "https://Stackoverflow.com", "https://Stackoverflow.com/users/557172/" ]
I had the same problem today. Try adding: ``` objLegend.Position.Auto = true objLegend.DockedToChartArea = "yourChartAreaName" ``` That did not help me but I found on the net that this might be helpful (and clean solution). What actually worked for me was moving chart area to make space for legend so it no longer o...
68,722,703
I understand this is usually a pointer error. However, I can't seem to solve it here is what I have tried: * Repair visual studio * Repair .NET core * Reinstall visual studio * Reinstall .NET core * Clean and rebuild the solution After doing all of these I am still getting the same error. Does anyone have any more id...
2021/08/10
[ "https://Stackoverflow.com/questions/68722703", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4990927/" ]
I managed to solve this by having to install an older depreciated version of .NET alongside the version of .NET being used for the project with the older version that was required to be installed being version [2.0.9](https://dotnet.microsoft.com/download/dotnet/2.0/runtime?utm_source=getdotnetcore&utm_medium=referral)
15,759,186
Ok this is my JavaScript ``` <script type="text/javascript" language="JavaScript"> function manageCart(task,item) { var url = 'managecart.php'; var params = 'task=' + task + '&item=' + item; var ajax = new Ajax.Updater( {success: ''}, url, {method: 'get', parameters: params, onFailure: re...
2013/04/02
[ "https://Stackoverflow.com/questions/15759186", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2181279/" ]
For this type of Ajax call do not use `Ajax.Updater` as that is designed to update a specific element with the contents of the ajax response. I believe that you want to just make a simple single ajax call so using `Ajax.Request` would be what you want to use. Original Code using Ajax.Updater ``` var url = 'managecart...
35,854,555
We will be developing a new web site for a client who already has a Kentico 8.2 license. I am trying to make a case for developing the site using Kentico 9. Some key features I have found so far include: * faster performance (how much in real-world terms?) * better integration with .Net MVC * content staging tasks can...
2016/03/07
[ "https://Stackoverflow.com/questions/35854555", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5971415/" ]
There are many tools available to you to persist data from an app. Choosing an appropriate one requires some understanding of your needs, or at least making a guess. Here's where I would start but keep an eye out in case my assumptions don't match your needs. *What type of data do you want to persist?* Presumably you...
9,415
What does テラス means in the context of declining an invitation, like below? > > うううううう!!いきたい!けどその時間帯もろに仕事だ:::またやって!!テラスーーーーー > > > I guess it is slang? I am familiar with テラワロス but it seems different in both spelling and context. More context: Public comment sent on a night-time birthday event page on a social n...
2012/11/13
[ "https://japanese.stackexchange.com/questions/9415", "https://japanese.stackexchange.com", "https://japanese.stackexchange.com/users/107/" ]
So far the only viable explanation I can think of is that テラス is a contracted form of テラワロス. * [ニコニコ[百科]{ひゃっか} entry for テラス](http://dic.nicovideo.jp/a/%E3%83%86%E3%83%A9%E3%82%B9) defines it as: `3. テラワロスの略` + 3rd sense: Contraction of "terawarosu" * [a 2ch.net post](http://2chnull.info/r/train/1273323743/901-1000) ...
471,151
$(l^2,\|\cdot\|\_2)$ is a Hilbert space with scalar product $\langle x,y\rangle=\sum^{\infty}\_{k=1}x\_ky\_k$. How can I show that every vector $x\in l^2$ can be written in a form $\sum^{\infty}\_{k=1}x\_ke^k$ where $e^k,k\in N$ are unit vectors?
2013/08/19
[ "https://math.stackexchange.com/questions/471151", "https://math.stackexchange.com", "https://math.stackexchange.com/users/20885/" ]
By definition equality $$ x=\sum\limits\_{k=1}^\infty x\_k e^k $$ means that $$ x=\lim\limits\_{n\to\infty}\sum\limits\_{k=1}^n x\_k e^k $$ which by definition means that $$ \lim\limits\_{n\to\infty}\left\Vert x-\sum\limits\_{k=1}^n x\_k e^k\right\Vert\_2=0\tag{1} $$ Now use the fact that $\Vert z\Vert\_2^2=\langle...
177,933
Harry Potter chose to come back from the dead because he was the master of death. But how could he be the master of death as he never had the Elder Wand? If Harry could come back does that mean that Dumbledore could come back from the dead too? Why/why not? After all, Dumbledore did have the three Deathly Hallows. He...
2018/01/02
[ "https://scifi.stackexchange.com/questions/177933", "https://scifi.stackexchange.com", "https://scifi.stackexchange.com/users/93971/" ]
There are many fundamental errors in your question itself. I really suggest you go back and read the books because your understanding of both the Hallows and Harry's resurrection is wrong. Firstly, Harry was the owner of Elder Wand having won it from Draco Malfoy when he escaped from Malfoy Manor. Draco became the ow...
95,207
How does a Stack Overflow moderator know about sock puppet accounts? How do they trap the user?
2011/06/15
[ "https://meta.stackexchange.com/questions/95207", "https://meta.stackexchange.com", "https://meta.stackexchange.com/users/161645/" ]
I am not going to answer this directly, for reasons that should be obvious. However; this isn't a "trap" - it is our attempt at *enforcing reasonable behaviour*; using a sock-puppet for *any purpose* (most commonly, but not exclusively: upvoting yourself) is unacceptable. If you want the vote of the masses; write goo...
71,288,129
I am trying to extend the symbols available to me for plotting in 3D. In 2D, I use: ``` x1 <- sort(rnorm(10)) y1 <- rnorm(10) z1 <- rnorm(10) + atan2(x1, y1) x2 <- sort(rnorm(10)) y2 <- rnorm(10) z2 <- rnorm(10) + atan2(x2, y2) x3 <- sort(rnorm(10)) y3 <- rnorm(10) z3 <- rnorm(10) + atan2(x3, y3) new.styles <- -1*c(98...
2022/02/27
[ "https://Stackoverflow.com/questions/71288129", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3236841/" ]
I was able to only get a solution using `text3d()` -- hopefully there exists a better solution. ``` x1 <- sort(rnorm(12)) y1 <- rnorm(12) z1 <- rnorm(12) + atan2(x1, y1) x2 <- sort(rnorm(12)) y2 <- rnorm(12) z2 <- rnorm(12) + atan2(x2, y2) x3 <- sort(rnorm(12)) y3 <- rnorm(12) z3 <- rnorm(12) + atan2(x3, y3) new.style...
1,336,337
I've got my first RoR app deployed to Dreamhost and it's using Passenger. The one note on Dreamhost's wiki about slow response mentioned changing a RewriteRules line in the public/.htaccess file to use FastCGI. But I assume this will have no effect if I'm using Passenger, is that right? I've looked at the logs and com...
2009/08/26
[ "https://Stackoverflow.com/questions/1336337", "https://Stackoverflow.com", "https://Stackoverflow.com/users/26270/" ]
You must be running in Development mode. Try running in Production mode to see if it is still slow. Post below may help: [Ruby On Rails is slow...?](https://stackoverflow.com/questions/566401/ruby-on-rails-is-slow)
205,706
I can't find a way to toggle mc internal editor in hex mode. [Here](http://www.tldp.org/LDP/LG/issue23/wkndmech_dec97/mc_article.html) it says to use F4 however it suggest to replace. How to do it?
2015/05/26
[ "https://unix.stackexchange.com/questions/205706", "https://unix.stackexchange.com", "https://unix.stackexchange.com/users/50426/" ]
You can open file with `F3`. Hex view - `F4`. Start edit - `F2`.
6,061,310
I'm getting crazy, cause I cannot find what are the "default" keys you would have in a PDF Document. For example, if I want to retrieve an hyperlink from a CGPDFDocument, I do this: ``` CGPDFStringRef uriStringRef; if(!CGPDFDictionaryGetString(aDict, "URI", &uriStringRef)) { break; } ``` In this case, the key i...
2011/05/19
[ "https://Stackoverflow.com/questions/6061310", "https://Stackoverflow.com", "https://Stackoverflow.com/users/287454/" ]
It's absurd that you would have to go read 1300 page long specs just to find what keys a dictionary contains, a dictionary that could contain anything depending on what kind of annotation it is. To get a list of keys in a `CGPDFDictionaryRef` you do: ``` // temporary C function to print out keys void printPDFKeys(con...
36,711,776
This is the HTML I want to extract from. ``` <input type="hidden" id="continueTo" name="continueTo" value="/oauth2/authz/?response_type=code&client_id=localoauth20&redirect_uri=http%3A%2F%2Fbg-sip-activemq%3A8080%2Fjbpm-console%2Foauth20Callback&state=72a37ba7-2033-47f4-8e7e-69a207406dfb" /> ``` I need a Xpath to ex...
2016/04/19
[ "https://Stackoverflow.com/questions/36711776", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5850305/" ]
The XPATH: ``` //input[@id="continueTo"]/@value ``` It will get the value of the node `input` with id `continueTo`. Then it will need to be processed with a Regex first to get a final result. The Regex: ``` `[^=]+$` ``` `$` means the end of the string. It will get everything on the end of the string which is not...
25,242,580
I am working on node.js where forever is installed. I am not sure where is intalled . when i go to project directory then type command `forever list` then it will display no forever Can any body tell me how to check and how to resart processes. My website is running. it means forever may be running
2014/08/11
[ "https://Stackoverflow.com/questions/25242580", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3883164/" ]
If `forever list` is empty, your nodeJS app is not running. You have to start it first by doing `forever start yourApp.js`
60,784
I'm starting a VPN connection using Network Manager. Once the connection is established I have to change [MTU](http://en.wikipedia.org/wiki/Maximum_transmission_unit) in order it to work properly. For example: ``` sudo ifconfig ppp0 mtu 777 ``` It is very annoying to execute this command every time I open a VPN conn...
2011/09/10
[ "https://askubuntu.com/questions/60784", "https://askubuntu.com", "https://askubuntu.com/users/24741/" ]
Create a script in `/etc/network/if-up.d`, containing ``` #!/bin/sh if [ "$IFACE" = "ppp0" ]; then ifconfig ppp0 mtu 777 fi ``` and [make it executable](https://askubuntu.com/questions/122428/how-to-run-sh-file).
9,479,819
Sorry for the very noob question. Let's suppose I have an enum like so ``` public enum MyElementType { TYPE_ONE, TYPE_TWO, TYPE_THREE; } ``` When I want to loop over this enum, I always see this solution: ``` for(MyElementType type: MyElementType.values()) { //do things } ``` I wonder if there exist a viable solu...
2012/02/28
[ "https://Stackoverflow.com/questions/9479819", "https://Stackoverflow.com", "https://Stackoverflow.com/users/740480/" ]
Why do you want to use a while loop rather than the for-each you more typically see? In any case, it's pretty simple ``` Set<MyElementType> elements = EnumSet.allOf(MyElementType.class); Iterator<MyElementType> it = elements.iterator(); while (it.hasNext()) { MyElementType el = it.next(); // etc } // or Iter...
2,855
Consider an application that currently uses a combination of license file and/or subscription to verify which features to activate. I can use a smart contract instead of the license file, and potentially the subscription. But today, the subscription check requires an online validation and associated credential check. ...
2016/04/10
[ "https://ethereum.stackexchange.com/questions/2855", "https://ethereum.stackexchange.com", "https://ethereum.stackexchange.com/users/1161/" ]
When your app is able to sync with the blockchain (network connection available), the check the blockchain and update your app settings file to allow use for up to e.g. 1 week after the blockchain subscription check. Just tell the user that they have to sync before the period is up. One extra feature you can add: * Y...
4,347,995
I ask this as someone who loves maths but has no ability. So 2 axioms & a question. Axiom 1 - a digital processor exists that can find the n'th prime number of any size instantly. Axiom 2 - all natural numbers can be expressed as the sum of 2 primes. Would it take more/less/same amount of bits to define a natural num...
2022/01/03
[ "https://math.stackexchange.com/questions/4347995", "https://math.stackexchange.com", "https://math.stackexchange.com/users/603487/" ]
The ordinary way of storing natural numbers by means of bits is already optimal. This can easily be seen: Each of the $2^n$ combinations of assignments of $n$ bits represents exactly one distinct natural number between $0$ and $2^n-1$. If there was a way of storing more numbers with the same amount of bits, and we woul...
4,568,514
I'm working through Example 2.22 in Steward and Tall's Algebraic Number Theory book. The goal is to determine the ring of integers of $\mathbb Q(\sqrt[3]5)$. Let $\theta\in\mathbb R$ such that $\theta^3=5$. Let $\omega=e^{2\pi i/3}$. I'm at the point where I need to check whether $$ \alpha=\frac 13(1+\theta+\theta^2) $...
2022/11/03
[ "https://math.stackexchange.com/questions/4568514", "https://math.stackexchange.com", "https://math.stackexchange.com/users/405827/" ]
[![enter image description here](https://i.stack.imgur.com/7hWo2.png)](https://i.stack.imgur.com/7hWo2.png) As pointed out by dezdichado, the problem can be done by two applications of Cosine Formula. Refer to the figure, One such formula is: $$\cos \alpha=\frac{(c-x)^2+y^2-a^2}{2(c-x)y}$$ Applying Cosine Formula ...
4,605,482
I want my marker to appear not in the center of the screen, but 25% of the way up to give extra room for the popup box. Although sticking an offset in is easy, the offset depends on the zoom level as if you're zoomed far out, you'll want to center the map quite far up (such as 50km). If you're really zoomed in, then yo...
2011/01/05
[ "https://Stackoverflow.com/questions/4605482", "https://Stackoverflow.com", "https://Stackoverflow.com/users/174375/" ]
Try this: Take the height of the plugin and get 25% of that. Then you need to multiply that by the degrees or kilometres per pixel scale at that height (if you can't get it straight from the plugin then I guess do the math), then centre the screen at that point on the globe.
44,487,654
I know this is a very classical question which might be answered many times in this forum, however I could not find any clear answer which explains this clearly from scratch. Firstly, imgine that my dataset called my\_data has 4 variables such as my\_data = variable1, variable2, variable3, target\_variable So, let's ...
2017/06/11
[ "https://Stackoverflow.com/questions/44487654", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8010314/" ]
First off, you are using the deprecated package `cross-validation` of scikit library. New package is named `model_selection`. So I am using that in this answer. Second, you are importing `RandomForestRegressor`, but defining `RandomForestClassifier` in the code. I am taking `RandomForestRegressor` here, because the me...
10,248,776
Requirements for a TextBox control were to accept the following as valid inputs: 1. A sequence of numbers. 2. Literal string 'Number of rooms'. 3. No value at all (left blank). Not specifying a value at all should allow for the RegularExpressionValidator to pass. Following RegEx yielded the desired results (successf...
2012/04/20
[ "https://Stackoverflow.com/questions/10248776", "https://Stackoverflow.com", "https://Stackoverflow.com/users/988951/" ]
The order matters since that is the order which the Regex engine will try to match. Case 1: `Number of rooms|[0-9]*` In this case the regex engine will first try to match the text "Number of room". If this fails will then try to match numbers or nothing. Case 2: `[0-9]*|Number of rooms`: In this case the engine wil...
83,623
I am trying to round the corners of a custom shape, but it is just straightening the original curves out. *Note: This is in Illustrator CS5* **Here is the shape before the effect:** [![enter image description here](https://i.stack.imgur.com/luohd.png)](https://i.stack.imgur.com/luohd.png) The 3 "corners should be r...
2017/01/20
[ "https://graphicdesign.stackexchange.com/questions/83623", "https://graphicdesign.stackexchange.com", "https://graphicdesign.stackexchange.com/users/84489/" ]
I don't have CS5, but this should work: Select your path. With the pen tool selected, create points on each side of the anchor points, something like the following: [![Path with new anchor points added near the original cusp points.](https://i.stack.imgur.com/U3Mk7.png)](https://i.stack.imgur.com/U3Mk7.png) With the...
66,920,844
I use a custom hook to support dark mode with tailwindcss in my new react-native app, created with Expo CLI. The TailwindProvider with the dark mode logic looks like this: ```js const TailwindProvider: React.FC = ({ children }) => { const [currentColorScheme, setcurrentColorScheme] = useState(Appearance.getColorSche...
2021/04/02
[ "https://Stackoverflow.com/questions/66920844", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10183816/" ]
Use `systimestamp` since that includes a time zone. ``` select systimestamp at time zone 'US/Eastern' from dual; ``` should return a timestamp in the Eastern time zone (assuming your database time zone files are up to date). Note that if you ask for a timestamp in EST, that should be an hour earlier than the curr...
65,536,088
I have a dataframe which is called "df". It looks like this: ``` a 0 2 1 3 2 0 3 5 4 1 5 3 6 1 7 2 8 2 9 1 ``` I would like to produce a cummulative sum column which: * Sums the contents of column "a" cumulatively; * Until it gets a sum of "5"; * Resets the cums...
2021/01/02
[ "https://Stackoverflow.com/questions/65536088", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11622176/" ]
You can get the cumsum, and floor divide by 5. Then subtract the result of the floor division, multiplied by 5, from the below row's cumulative sum: ``` c = df['a'].cumsum() g = 5 * (c // 5) df['a_cumm_sum'] = (c.shift(-1) - g).shift().fillna(df['a']).astype(int) df Out[1]: a a_cumm_sum 0 2 2 1 3 ...
325,415
(<https://webapps.stackexchange.com/review/suggested-edits/111499> shows action by both.) [Edit: At first glance they both looked like special users. Not so.]
2019/03/18
[ "https://meta.stackexchange.com/questions/325415", "https://meta.stackexchange.com", "https://meta.stackexchange.com/users/218120/" ]
Community♦ is [a special user](https://meta.stackexchange.com/questions/19738/who-is-the-community-user). Community is credited for reviews when they are: * Done by deleted users * Improved, in which case Community is shown as having approved the edit * Rejected and edited, in which case Community is shown as having r...
48,751,289
My project can switch between languages. The items are stored in a database, and using $\_GET['lang'] in the database gives back the correct items. For now, only English and French are in use, so it works with this code : ``` if ($_GET['lang'] == 'fr' OR ($_GET['lang'] == 'en')) { $header = getTranslation('header'...
2018/02/12
[ "https://Stackoverflow.com/questions/48751289", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9244707/" ]
You should move the else part outside of the loop, as otherwise you will always execute it at some point in the loop iterations. Only when you have iterated through *all* possibilities, and you still have no match, then you can be sure there to have to navigate to the language page: ``` $header = null; while ($transla...
36,937,302
I have a list of strings (see below) how do I concatenate these strings into one list containing one string. ``` ["hello","stack","overflow"] ``` to ``` ["hellostackoverflow"] ``` I am just allowed to import Data.Char and Data.List
2016/04/29
[ "https://Stackoverflow.com/questions/36937302", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6219741/" ]
Consider each string in a list as a list of characters ``` ["hello","stack","overflow"] :: [[Char]] ``` Concatenation is a process of connecting several lists into one. It must have a following type: ``` concat :: [[a]] -> [a] ``` If you will have such a function, you'll get a half of job done. You are looking fo...
5,809,104
Here T could be an array or a single object. How can add the array to an arraylist or add a single object to the same arraylist. This gives me a build-time error that the overloaded match for `AddRange` has invalid arguments. ``` T loadedContent; if (typeof(T).IsArray) { contentArrayList.AddRange(loadedContent); }...
2011/04/27
[ "https://Stackoverflow.com/questions/5809104", "https://Stackoverflow.com", "https://Stackoverflow.com/users/727904/" ]
Make sure you have set the correct editor associations and content types Go to settings (`Window -> preferences`) **Content Types** 1. Type in `Content Types` in the search box (should show under `General -> Types` 2. Click on the arrow next to `Text`, select `PHP Content Type` 3. Add `*.ctp` by clicking on the Add ...
55,102,475
I read that 'It is not recommended you use insertAdjacentHTML() when inserting plain text' [here](https://developer.mozilla.org/en-US/docs/Web/API/Element/insertAdjacentHTML) . I do see those tags which differentiate a plain text from tags+text+tags combination. Is it safe to use `insertAdjacentHTML()` method to ...
2019/03/11
[ "https://Stackoverflow.com/questions/55102475", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10197341/" ]
Well really the answer to your question is in the link you provided. Is it derived from user input? Then it's unsafe without proper anti-XSS procedures. Is it something you typed from the server and will only ever be something that you intend it to be? Then feel free to use `insertAdjacentHTML()`. See Vinz243's link ab...
133,508
I've tried connecting a camera to my Raspberry Pi and I've enabled it on `raspi-config` but `vcgencmd get_camera` still shows `supported=0` `detected=0`. Also, in my `boot/config.txt`, `start_x=1` is not even commented nor enabled upon enabling camera interface. Another thing to note is my Raspberry Pi constantly shows...
2021/11/25
[ "https://raspberrypi.stackexchange.com/questions/133508", "https://raspberrypi.stackexchange.com", "https://raspberrypi.stackexchange.com/users/141166/" ]
Thanks to the comments, I have rectified the issue. The issue was with the bullseye version of the os. I used a buster version and it worked just fine
21,876,004
I am having problems while doing some test for a new app. I have an activity in which I execute an asynctask to communicate with my server and ask for a json file. I want that this file is downloaded periodically (don't know, 3-4 seconds) so I created a handler in my activity to execute it each time. It works fine wi...
2014/02/19
[ "https://Stackoverflow.com/questions/21876004", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1463191/" ]
You cannot execute the same `AsyncTask` multiple times. Before executing the `AsyncTask`, instantiate a new instance first: ``` private void askForData(){ asyncTask = new MyTask(); asyncTask.delegate = this; asyncTask.execute(urlServer+"test.php"); } ``` Also remove the instantiation of the `AsyncTask` ...
17,206,523
I was processing my `resultset` to get the details. I need to return an `ArrayList`, so how can I put the key,values from the `resultset` to any of the collection objects and then put the same to an `ArrayList`? Here is the code: ``` public List<Bike> addBikes() throws ClassNotFoundException, SQLException{ Li...
2013/06/20
[ "https://Stackoverflow.com/questions/17206523", "https://Stackoverflow.com", "https://Stackoverflow.com/users/930544/" ]
For each result in the result set, create a `new Bike()` and copy the values from that result to the new bikes fields. At the end, add the bike to the list. ``` Bike bike = new Bike() bike.setName(rs.getString("name")); //... bikeList.add(bike); ```
72,632,348
In Visual Studio there is a possibility to mute an exception when it happens in particular place, e.g. We are aware that there is some `NullRefereneceException` in `Calculator.cs` and we still want to catch those types of exceptions when thrown from all other places in code, but `Calculator.cs`. How it looks like in V...
2022/06/15
[ "https://Stackoverflow.com/questions/72632348", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10049966/" ]
I wasn't able to find a solution to your question. The only thing I found is to not break on a specific exception type - but that's unrelated to the line. For example, let's take the following code: ```cs public class OtherClass { public void ThrowNullReferenceException() { try { ...
4,268,625
What is the best and/or fastest to learn Java API for consuming XML feeds like this: ``` <body copyright="Company"> <student id="1" fname="Anthony" lname="Hopkins"/> <student id="2" fname="John" lname="Anderson"/> <student id="3" fname="Will" lname="Smitherman"/> </body> ``` As you can see it provides a...
2010/11/24
[ "https://Stackoverflow.com/questions/4268625", "https://Stackoverflow.com", "https://Stackoverflow.com/users/311263/" ]
Easiest way is to use JaxB to generate the Java classes for you. If you have a schema you use xjb tool that will create the classes and can let java do all the parsing without you needing to do anything. Look at <http://www.javaworld.com/javaworld/jw-06-2006/jw-0626-jaxb.html>
25,656,841
I'm trying to make a Greasemonkey script to hide a really annoying div, on a website, that pops up after a few seconds. Neither of these works: ``` $("#flyin").hide(); $(document).ready(function(){ $("#flyin").hide(); }); ``` I assume it's because the `#flyin` div is not created, yet. How do I tell jQuery to keep ...
2014/09/04
[ "https://Stackoverflow.com/questions/25656841", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1347640/" ]
There's [a utility for that (waitForKeyElements)](https://gist.github.com/2625891). Your **whole script** would simply be: ``` // ==UserScript== // @name _YOUR_SCRIPT_NAME // @include http://YOUR_SERVER.COM/YOUR_PATH/* // @require http://ajax.googleapis.com/ajax/libs/jquery/2.1.0/jquery.min.js // @require http...
180,502
I wrote a selector for several countries. This selector allows the user to choose a country, then a region and then a city. After the user chooses a city, it displays the selected object's country code, region code and area code (in terms of the [VK API](https://vk.com/dev/database.getCities) social network). The sele...
2017/11/15
[ "https://codereview.stackexchange.com/questions/180502", "https://codereview.stackexchange.com", "https://codereview.stackexchange.com/users/91959/" ]
1. There is too much nesting, which, for me, makes the logic hard to read. A good rule of thumb is to aim for two levels of nesting, by using the Extract Method refactoring. 2. When the user clicks on the input, nothing happens. When the user starts typing a name that isn't in the list, sometimes the list pops up (if t...
83,635
I'm a complete cooking newb. I saw on youtube the other day that you should cook steak in an oven before frying it. I think it makes it softer (not sure, please let me know). But anyway, I never used an oven in my entire life. And I looked inside the oven and there are no trays in there. So I went to the store and th...
2017/08/10
[ "https://cooking.stackexchange.com/questions/83635", "https://cooking.stackexchange.com", "https://cooking.stackexchange.com/users/60749/" ]
To answer your question directly, if the method of cooking is what I think it is, the pan you use should be fine, even if it has a nonstick coating on it. You can read the second section to see if my assumption about your cooking method is correct. It's important that you don't use nonstick cookware for extremely high...
31,714,522
I have two strings. ``` str_a = "the_quick_brown_fox" str_b = "the_quick_red_fox" ``` I want to find the first index at which the two strings differ (i.e. `str_a[i] != str_b[i]`). I know I could solve this with something like the following: ``` def diff_char_index(str_a, str_b) arr_a, arr_b = str_a.split(""), st...
2015/07/30
[ "https://Stackoverflow.com/questions/31714522", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3295407/" ]
Something like this ought to work: ``` str_a.each_char.with_index .find_index {|char, idx| char != str_b[idx] } || str_a.size ``` **Edit:** It works: <http://ideone.com/Ttwu1x> **Edit 2:** My original code returned `nil` if `str_a` was shorter than `str_b`. I've updated it to work correctly (it will return `str...
2,015
So this question... <https://serverfault.com/questions/45734/the-coolest-server-names> It's horribly off topic. It's got a few votes to delete it right now because the community does not want it here (it's already been deleted once by the community). I understand that it's being kept around for its historical signifi...
2011/09/04
[ "https://meta.serverfault.com/questions/2015", "https://meta.serverfault.com", "https://meta.serverfault.com/users/33118/" ]
Throw this question into the sun.
115,769
I have a 40 gallon (bladdered) pressure tank in the basement which keeps pressure to my office building, and a 2-inch 2 horsepower submersible pump in a dug well 450 feet away. The pump is cycling waaay too fast, and the tank will hold pressure at 41 pounds to 43 pounds but not at 60 pounds at shut-off pressure. (The...
2017/06/02
[ "https://diy.stackexchange.com/questions/115769", "https://diy.stackexchange.com", "https://diy.stackexchange.com/users/70373/" ]
The bladder is there to flatten the pressure/volume curve so pressure doesn't change rapidly as water is pumped. This allows for a longer duty cycle. The expected symptom of a burst bladder is just as you describe.
9,482,602
I'm working on a Google Chrome extension with a popup, in which I load a page from a node.js + express.js server. The page I load changes depending on the status of the `req.session.user` in this way: ``` app.get('/', function(req, res){ if(req.session.user){ res.render(__dirname + '/pages/base.jade', {});...
2012/02/28
[ "https://Stackoverflow.com/questions/9482602", "https://Stackoverflow.com", "https://Stackoverflow.com/users/617461/" ]
The problem is how you have set up your server - you're using the `cookieParser` and `session` middlewares twice: ``` var app = express.createServer( express.logger(), express.cookieParser(), express.session({ secret: 'keyboard cat' }) ); app.use(express.cookieParser()); app.use(express.session({ secret: ...
19,270,638
I am creating a BitSet with a fixed number of bits. In this case the length of my String holding the binary representation is 508 characters long. So I create BitSet the following way: ``` BitSet bs = new BitSet(binary.length()); // binary.length() = 508 ``` But looking at the size of bs I always get a size of 512....
2013/10/09
[ "https://Stackoverflow.com/questions/19270638", "https://Stackoverflow.com", "https://Stackoverflow.com/users/664010/" ]
The number of bits in the constructor is a sizing hint, not a limit on the number of bits allowed. The `size()` of a Bitset is effectively its current *capacity*, though the specification is rather more rubbery than that. > > So I can't rely on the size if I get passed another bitset? There may also be some bits app...
41,004,429
hi guys this is my "login.php": ``` <?php session_start(); // connect to database if (isset($_POST['login_btn'])) { $username =$_POST['username']; $password =$_POST['password']; $_SESSION['username'] = $_POST['username']; $conn = oci_connect('insidedba', 'progetto16', 'localhost/XE'); if (!$conn) ...
2016/12/06
[ "https://Stackoverflow.com/questions/41004429", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7160791/" ]
If it's stored in session you can. ``` session_start(); if(!empty($_SESSION['username'])) $username = $_SESSION['username']; else $username = "guest"; ```
65,915,932
I tried to look in other solutions. But it didn't help me out. Kindly look into this. my html code. ``` <tbody> {% for st in stu %} <tr> <th scope="row">{{st.id}}</th> <td>{{st.name}}</td> <td>{{st.email}}</td> <td>{{st.role}}</td> <td> <a href="{}" class="btn btn-warning b...
2021/01/27
[ "https://Stackoverflow.com/questions/65915932", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13533843/" ]
You are using `re_path` like it is `path`. `re_path` expects regex, it does not have path converters like `path`. You can either write a regex or switch to `path`. Regex solution: ``` urlpatterns=[ re_path(r'delete/(?P<pk>\d+)/',views.delete_data,name="deletedata") ] ``` path solution: ``` from django.urls i...
12,165,002
You know how PHP's `isset()` can accept multiple (no limit either) arguments? Like I can do: ``` isset($var1,$var2,$var3,$var4,$var5,$var6,$var7,$var8,$var9,$var10,$var11); //etc etc ``` How would I be able to do that in my own function? How would I be able to work with infinity arguments passed? How do they do it...
2012/08/28
[ "https://Stackoverflow.com/questions/12165002", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
[`func_get_args`](http://php.net/manual/en/function.func-get-args.php) will do what you want: ``` function infinite_parameters() { foreach (func_get_args() as $param) { echo "Param is $param" . PHP_EOL; } } ``` You can also use `func_get_arg` to get a specific parameter (it's zero-indexed): ``` func...
75,277
I've seen quite a few security camera examples and many have options for a duty schedule that activates the camera during certain specified days/hours to set up a routine. However I have fairly dynamic schedule and would like for my security cameras to turn on when our phones are not on the WiFi network. This would be ...
2017/11/16
[ "https://raspberrypi.stackexchange.com/questions/75277", "https://raspberrypi.stackexchange.com", "https://raspberrypi.stackexchange.com/users/54665/" ]
You'd need to know either the MAC or IP address of the phones you want to monitor but you could just `ping` or `arping` each one in turn and if none reply start your recording otherwise stop recording. Calling something like this from `cron` might do the trick: ``` #!/bin/bash # # Determine if we should be recording ...
58,655,207
I'm currently trying to extend [a model](https://github.com/microsoft/MASS) that is based on FairSeq/PyTorch. During training I need to train two encoders: one with the target sample, and the original one with the source sample. So the current forward function looks like this: ``` def forward(self, src_tokens=None, s...
2019/11/01
[ "https://Stackoverflow.com/questions/58655207", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3128562/" ]
First of all you should **always use and define `forward`** not some other methods that you call on the `torch.nn.Module` instance. **Definitely do not overload `eval()` as shown by [trsvchn](https://stackoverflow.com/a/58659193/10886420) as it's evaluation method defined by PyTorch ([see here](https://pytorch.org/do...
3,829,211
I did some changes at my CoreData Model. So far, I added a attribute called 'language'. When my application is launched and I click on "Create new Customer" a instance variable Customer is created. This variable is created by: ``` Customer *newCustomer = [NSEntityDescription insertNewObjectForEntityForName:@"Customer"...
2010/09/30
[ "https://Stackoverflow.com/questions/3829211", "https://Stackoverflow.com", "https://Stackoverflow.com/users/455928/" ]
What I did to get around this problem was to add this > > [[NSFileManager defaultManager] removeItemAtURL:storeURL error:nil]; > > > to my appDelegate in the persistentStoreCoordinator before adding the persistent store. This deletes the existing store that no longer is compatible with your data model. Remember t...
11,678,794
I have problem with dll file and have project which need this file System.Windows.Controls.dll for ``` listBox1.ItemsSource ``` error fix , and add reference with this dll to fix error. Where i can find this dll file? Is there any download link ? Share please ! Thanks ! In "Add Reference" it doesn't exist ! Solut...
2012/07/26
[ "https://Stackoverflow.com/questions/11678794", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1539124/" ]
Here are the steps: 1. Right click on `References` in the `Solutions Explorer` (Solutions explorer is on the right of your IDE) 2. Select `Add Reference` 3. In the window that opens, Select `Assemblies > Framework` 4. Check the `PresentationFramework` component box and click ok
9,525,464
So I am figuring out how to set up some options for a class. 'options' is a hash. I want to 1) filter out options I don't want or need 2) set some instance variables to use elsewhere 3) and set up another hash with the processed options as @current\_options. ``` def initialize_options(options) @whitelisted_optio...
2012/03/01
[ "https://Stackoverflow.com/questions/9525464", "https://Stackoverflow.com", "https://Stackoverflow.com/users/697364/" ]
Your `@current_options` is initialized as an empty hash. When you filter the `options` passed as params, none of the keys will be present in `@current_options` so `n_options` will end up empty. Then when you set up `@current_options` in the following lines, it will always grab the default values `(0, false, false)`, a...
47,539,905
I am very new to CSS and javascript, so take it easy on me. I am trying to remove the class `disable-stream` from each of the div elements under the div class="stream-notifications". (See image, below) I have tried the following in Tampermonkey, but it doesn't seem to work: ``` (function() { 'use strict'; disable-st...
2017/11/28
[ "https://Stackoverflow.com/questions/47539905", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6632302/" ]
That looks to be an AJAX-driven web page, so you need to use AJAX-aware techniques to deal with it. EG [waitForKeyElements](https://gist.github.com/2625891), or `MutationObserver`, or similar. Here's **a complete script** that should work: ``` // ==UserScript== // @name _Remove a select class from nodes // @match...