id stringlengths 3 6 | prompt stringlengths 100 55.1k | response_j stringlengths 30 18.4k |
|---|---|---|
27993 | I am trying to make a plugin which lists all users from a database with for each user a button to send an email to them. So the only way I can get with their username their email adress is to use the $POST which is given after the button is clicked. With their username I can search the db table to retreive the email. T... | Without using `typedef` or `using` then it's not possible to access to the container's type. However you can specialize the `bar` function where you know what the container's type is.
```
template<> void bar<Parent::Inner>()
{
// Here, you know what the parent is
}
``` |
28134 | I want to organize my Scala packages and love how Python solves this issue with `pip`.
**Can you recommend a similar tool for the management of Scala packages?**
**EDIT:**
I am looking for an easy installation of new packages with all it's dependencies like
```
>>> pip install <a_package> # installs a_package with... | The most directly similar is probably [Scala Build Tool](http://www.scala-sbt.org/). Specifically, [Library Dependencies](http://www.scala-sbt.org/release/docs/Getting-Started/Library-Dependencies.html). The Java ecosystem includes many libraries and build tools, Scala is built on Java. So you gain the ability to lever... |
28275 | I use FME a lot for manipulation of spatial data, and would like to leverage it's Python library, fmeobjects in PyQgis.
If I run the following in my standard Python IDE it works fine:
```
import sys
sys.path.append("C:\\Program Files (x86)\\fme\\fmeobjects\\python27")
import fmeobjects
```
But the exact same code... | 2016 update! Been trying to get this to work myself and thought I'd put what I've researched so far. This is done on Windows 10. For Linux users - try [this](https://knowledge.safe.com/questions/21273/run-fmeobjects-on-linux.html) if you're encountering problems.
Warning: For those wanting to integrate FME 2016 into p... |
28424 | Could anybody provide an example how to get the attributes of selected features?
I tried the following code in the Python Console : but I'm stuck at the point where I'd like to get the attributes:
```py
from qgis.utils import iface
canvas = iface.mapCanvas()
cLayer = canvas.currentLayer()
selectList = []
if cLayer:... | This will work:
```py
layer = iface.activeLayer()
features = layer.selectedFeatures()
for f in features:
print f.attributeMap()
```
In PyQGIS 3:
```py
layer = iface.activeLayer()
features = layer.selectedFeatures()
for f in features:
# refer to all attributes
print (f.attributes()) # results in [3, ... |
28737 | I was just watching a History Channel documentary [on YouTube](http://www.youtube.com/watch?v=R6JOMvOwECo) called "Kingjongilia" about people who have managed to escape North Korea.
Having visited South Korea a bunch of times now, I realize I didn't notice any kind of museum on these people and their plight. Googling ... | Unfortunately, I do not have a positive answer to this question. I have been looking around the web for a few days now and I am almost sure there is no such museum. I have been through the [list of museums in South Korea](http://en.wikipedia.org/wiki/List_of_museums_in_South_Korea) with the help of Google Translate but... |
29411 | I'm bit confused with how MessageContract Attribute works in WCF.
When I put the MessageContract the proxy shows two parameters instead of 1.
e.g.
```
GetResultResponse GetOperation(GetResultRequest request)
[MessageContract]
public class GetResultRequest
{
[MessageHeader]
public Header Header { get; set; }
... | That is default behavior. When you generate proxy it doesn't create message contracts by default. You can turn this on in [advanced configuration](http://msdn.microsoft.com/en-us/library/bb514724.aspx) in *Add Service reference* (by checking *Always generate message contracts*) or by `/messageContract` switch in [svcut... |
29510 | My program generates doc file on browser and i want to save this file to my C drive dynamically
```
string filename = "fileName";
Response.Clear();
Response.Buffer = true;
Response.AddHeader("content-disposition", "attachment;filename= " + filename +".doc" );
Response.Charset = "";
Response.ContentType = "applicati... | You cannot decide for the user where to save the file. User decides that. |
30027 | We are working with Python 3, where we have a list of datetimes, which looks like this:
```
first_datetime = {2019-08-08 14:00:00, 2019-08-08 14:10:00, 2019-08-08 14:20:00, 2019-08-08 14:30:00, 2019-08-08 14:40:00, 2019-08-08 14:50:00, 2019-08-08 15:00:00}
```
What we want is to only append datetimes, where minutes ... | You can check the minutes using `time.minute in [0, 20, 40]`, so your snippet of code could look like
```py
for i in range(len(first_datetime)):
time = datetime.datetime.strptime(first_datetime[i], '%Y-%m-%d %H:%M:%S')
if time != x and time.minute in [0, 20, 40]:
new_datetime_list.append(first_datetime... |
30171 | I want to write an JUnit @Rule (version 4.10) to setup some objects (an Entity Manager) and make them available in the test, by "injecting" it into an variable.
Something like this:
```
public class MyTestClass() {
@Rule
MyEntityManagerInjectRule = new MyEntityManagerInjectRule():
//MyEntityManagerInjectRule ... | How about:
```
public class MyTestClass() {
@Rule
public TestRule MyEntityManagerInjectRule =
new MyEntityManagerInjectRule(this); // pass instance to constructor
//MyEntityManagerInjectRule "inject" the entity manager
EntityManger em;
@Test...
}
```
Just add the test class instance to the const... |
30634 | For example, I have a 100 row table with a `varchar` column.
I run these queries:
```
SELECT count(*) FROM myTable WHERE myText LIKE '%hello%'
SELECT count(*) FROM myTable WHERE myText NOT LIKE '%hello%'
```
I am not getting a total count of 100. It is not picking up some of the rows for some reason. Why would this... | Check for `NULL` values, neither `LIKE` nor `NOT LIKE` will count these. |
30736 | we have an app running in bluemix under two different routes:
myapp.shortname.com
myapp.reallyreallyreallyreallylongname.com
but the SSO service does not work with myapp.shortname.com giving an error:
>
> CWOAU0062E: The OAuth service provider could not redirect the request
> because the redirect URI was not valid.... | That's easy, just define a dictionary which maps characters to their replacement.
```
>>> replacers = {'A':'Z', 'T':'U', 'H':'F'}
>>> inp = raw_input()
A T H X
>>> ''.join(replacers.get(c, c) for c in inp)
'Z U F X'
```
I don't know where exactly you want to go and whether case-sensitivity matters, or if there's a m... |
30774 | I'm reaching out to see if the community can help identify a book (or series of books) from my childhood in the 80s.
To the best of my recollection, the stories were about a family of vampires - but they may have been nonspecific "monsters."
I believe one among them was considered very handsome because he looked almo... | I think that this may be a book by Angela Sommer-Bodenburg. Originally published in 1986 as My Friend The Vampire, it was apparently republished In 2005 under the title The Little Vampire, possibly to tie in with the movie made based on it. That was the first of a series so you might have read a later one possibly.
B... |
31068 | I am mixing C with C++ source code using GNU. `_Decimal64` is recognised fine in C, but not in C++. C++ complains `error: '_Decimal64' does not name a type`.
Is there any way I can fix this? Should I consider it a compiler bug?
**Update 20-Mar-2017 18:19**:
None of the answers meet my requirements so far. I don't wa... | For C++ "decimal64"
use `std::decimal::decimal64`
the standard says:
<https://gcc.gnu.org/onlinedocs/libstdc++/libstdc++-api-4.6/a00454.html> |
31322 | **Note:**
Before marking this question as duplicate, please verify that the other question answers the topic for this setup:
* OS: Windows 10, 64-bit
* Python version: 3.6 or higher
* Python Compiler: Nuitka, development version 0.5.30rc5
* MSVC compiler: Visual Studio 2017 Community, vcvars64.bat
1. How I build m... | Easier than Nuitka for a single executable is e.g. PyInstaller:
`pyinstaller --onefile program.py` (to disable the console window for GUI applications add the `-w` option).
To create a single executable with Nuitka, you can create a SFX archive from the generated files. You can run Nuitka with the `--standalone` optio... |
31495 | I've got a working migration on dev and I'm trying to migrate in test. `rake:migrate` works up until the latest migration that I added today. I was running `db:migrate` and it the output was inclusive of the latest migration. I have also confirmed that the table in question exists in my local DB.
When I tried to run `... | Usually you don't have to migrate your test database. It sounds like the development database is not migrated yet. Every time you are running your tests, the development schema is used as a basis for testing db.
Try migrating your development database before running tests:
```
rake db:migrate
```
Maybe that's it. |
31608 | The following code defines my Bitmap:
```
Resources res = context.getResources();
mBackground = BitmapFactory.decodeResource(res, R.drawable.background);
// scale bitmap
int h = 800; // height in pixels
int w = 480; // width in pixels
// Make sure w and h are in the correct order
Bitmap scaled = Bitmap.createScaledB... | Define a new class member variable:
`Bitmap mScaledBackground;`
Then, assign your newly created scaled bitmap to it:
`mScaledBackground = scaled;`
Then, call in your draw method:
`canvas.drawBitmap(mScaledBackground, 0, 0, null);`
Note that it is not a good idea to hard-code screen size in the way you did in your snip... |
31684 | I'm considering a passive solar radiant heating installation in the Chicago area and was wondering if it would be feasible to store enough water/energy to support heating for most of the night. The house already has a gas central furnace, and can serve as backup, but the winter bills have been as high as $300-400 (for ... | You could use a plug cutter to remove the screw and surrounding wood.
 |
32269 | [](https://i.stack.imgur.com/tVxUX.png)
I'm using ggplot and I get those weird horizontal lines out of geom\_bar. I cannot provide a minimal working example: the same code works with few observations and it relies on data I am importing and transformi... | I'm guessing the lines are due to a plotting bug between observations that go into each bar. (That could be related to the OS, the graphics device, and/or how ggplot2 interacts with them...)
I expect it'd go away if you summarized before ggplot2, e.g.:
```
library(dplyr);
data %>%
count(Horizon, Groups, wt = Impo... |
32460 | I am in the final stages of my PhD and have been applying for postdocs for the last six months. Recently, I heard back from the job I applied for, we had a phone interview and he was very happy with my experience and skills. In fact he was looking for a new postdoc with the same experience what I did in my PhD. We comm... | I will share some information with you, based on two things you mentioned:
>
> a) You said your advisor is very aggressive and loves to make racist jokes
>
>
> b) You suspect your advisor soured your postdoc application through negative remarks to your prospective employer
>
>
>
This sounds like a situation whi... |
32843 | I tried to find this in the relevant RFC, [IETF RFC 3986](https://www.rfc-editor.org/rfc/rfc3986), but couldn't figure it.
Do URIs for HTTP allow Unicode, or non-ASCII of any kind?
Can you please cite the section and the RFC that supports your answer.
*NB: For those who might think this is not programming related - ... | Here is an example: ☃.net.
In terms of the relevant section of RFC 3986, I think you are looking at [2.5](https://www.rfc-editor.org/rfc/rfc3986#section-2.5).
EDIT:
Apparently stack overflow doesn't detect this as a proper URL. You'll have to copy&paste into your browser. |
33365 | The following doesn't compile
```
public static T Retrieve<T>(this NameValueCollection collection, String key) where T : Object
{
if (collection.AllKeys.Contains(key))
{
try
{
val = (T)Convert.ChangeType((object)collection[key], typeof(T));
}
catch { }
}
re... | ```
where T : class
```
Your current constraint, `where T : Object` says "anything which is or inherits from System.Object", which is: everything. All types, including Int32 and String, inherit from System.Object. So constraining on Object would do nothing.
Edit: as usual, Eric shines a light on this [in a far more ... |
33416 | I am pretty new to TestNG framework. I did download TestNG from the link <http://beust.com/eclipse>. Post this I created a new Java Project named as MyProject and a new TestNG class file "NewTest". I did write a small piece of Code with @Test annotation to launch Firefox browser and navigate to Google. I tried searchin... | You just need to append an `'m'` to each time and the `strptime` will parse it.
Oneliner
--------
```
list(map(lambda s: datetime.strptime(s+'m', '%I:%M%p'), s) for s in (s.strip().split('-') for s in l)
```
Output (*redacted for clarity*):
```
[[datetime(…, 06, 0), datetime(…, 11, 0)],
[datetime(…, 19, 0), datet... |
33784 | I have a class with a private static method with an optional parameter. How do I invoke it from another class via Reflection? There is a similar [question](https://stackoverflow.com/questions/135443/how-do-i-use-reflection-to-invoke-a-private-method-in-c), but it does not address static method or optional parameters.
... | Optional parameter values in C# are compiled by injection those values at the callsite. I.e. even though your code is
```
Foo.Bar()
```
The compiler actually generates a call like
```
Foo.Bar("")
```
When finding the method you need to treat the optional parameters as regular parameters.
```
var method = typeof(... |
34372 | I have this part of query:
```
IF(orders = NULL OR orders = '', "value1', 'value2')
```
which works with empty cells but not with null ones, any help?
When it's NULL it doesn't make anything but when it's '' it runs the query | It's spelled `orders is NULL` (not `orders = NULL`). |
34725 | I'm trying to send to a ArrayList Strings that come from the user input:
```
private static void adicionarReserva() {
Scanner adiciona = new Scanner(System.in);
System.out.println("Numero da pista: ");
int nPista = adiciona.nextInt();
System.out.println("Numero de jogadores: ");
int nJogado... | It's very meaningful error you're getting.
This is your `ArrayList`:
```
ArrayList<Jogadores> nome_jogador = new ArrayList();
↑
```
What are you trying to insert to it? a `String`, but it suppose to have `Jogadores` in it.
Now look at your `addJogadores` method signature:
```
public void addJogadores(J... |
34956 | This is a sample of the code that I am using to instantiate a JFrame:
```
public class TestFrame{
public static void main(String[] args){
JFrame frame = new JFrame();
Insets insets = frame.getInsets();
frame.setSize(new Dimension(insets.right + insets.left + 400, insets.bottom + insets.top + 400));
Sys... | 1. If you want your content pane to be precisely 400x400, then I would consider setting its preferredSize to 400x400 (although I don't like to force preferred size, on a content pane, it may be acceptable, in some cases).
2. After setting that preferred size and before showing the frame, call `pack()` on the frame.
Th... |
35217 | PS E:\React Native\contacts> npm i @react-navigation/native
npm WARN jscodeshift@0.11.0 requires a peer of @babel/preset-env@^7.1.6 but none is installed. You must install peer dependencies yourself.
npm WARN react-native@0.64.2 requires a peer of react@17.0.1 but none is installed. You must install peer dependencies y... | The reason behind this is that npm deprecated [auto-installing of peerDependencies] since npm@3, so required peer dependencies like babel-core and webpack must be listed explicitly in your `package.json.`
All that you need to do is to install babel-core.
<https://github.com/npm/npm/issues/6565> |
35237 | I am trying to ultimately use php's `shell_exec` function to create new Linux users. I am, however, running into problems even with the debugging. Here is my code
```
<?PHP
function adduser($username,$password,$server){
try{
//3 debug statements
$output=shell_exec("pwd");
echo $output;
... | a) This is true, if the class defines *other* constructors - thereby suppressing generation of a default constructor.
```
struct Foo {
Foo(int n) : mem(n) {}
int mem;
};
```
This class can't be value-initialized.
b) If the class has *no* constructors defined, value-initialization will simply value-initialize al... |
35409 | I am reading a Codeigniter book, it said like this,
>
> When using the keywords TRUE,FALSE, and NULL in your
> application, you should always write
> them in Uppercase letters.
>
>
>
Why does Codeigniter need all the keywords write as uppercase letters? | CodeIgniter/PHP does not require that you write those words in uppercase letters of not.
However it is [CodeIgniter's Coding Style](http://codeigniter.com/user_guide/general/styleguide.html) to write them like this.
CodeIgniter has been developing following that Coding Style, so if you want your code to look like Cod... |
35608 | i'm trying to catch an discord.js error
This error pops up when internet is off, but i want some clean code instead this messy one...
How can i catch this?
I did really try everything..
code:
```
(node:11052) UnhandledPromiseRejectionWarning: Error: getaddrinfo ENOTFOUND disc
ordapp.com
at GetAddrInfoReqWrap.onl... | I'm not sure I fully understand your use case, the way I'd model the relationship between your types is something like the following
```js
type Season =
| "winter"
| "spring"
| "summer"
| "fall"
type Month =
| "January"
| "February"
| "March"
| "April"
| "May"
| "June"
| "July"
| "August"
| ... |
35770 | Well so I'm trying to parse a bit of JSon. I succeeded to parse:
Member.json:
```
{"member":{"id":585897,"name":"PhPeter","profileIconId":691,"age":99,"email":"peter@adress.com "}}
```
but what if I need to parse:
```
{"Members":[{"id":585897,"name":"PhPeter","profileIconId":691,"age":99,"email":"peter@adress.... | Start new `Activity` and give `overridePendingTransition(R.anim.zoom_enter, R.anim.zoom_exit);`
where zoom\_enter.xml has
```
<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android"
android:interpolator="@android:anim/decelerate_interpolator">
<scale android:fromXScal... |
36070 | I have 3 tables: Posts, Tags and Post\_tag. The last one is just a pivot table:
Posts:
```
+-------------+------------------+------+-----+---------+----------------+
| Field | Type | Null | Key | Default | Extra |
+-------------+------------------+------+-----+---------+----------------+
| ... | You can load posts with related tags by using [`with`](https://laravel.com/docs/5.5/eloquent-relationships#eager-loading) method:
```
$posts = Post::with('tags')
->where('town_id', session('citySelected')->id)
->latest()
->paginate(10);
```
Then you'll be able to do this:
```
@foreach ($posts as $post)
... |
36084 | Assuming this table with nearly 5 000 000 rows
```
CREATE TABLE `author2book` (
`author_id` int(11) NOT NULL,
`book_id` int(11) NOT NULL,
KEY `author_id_INDEX` (`author_id`),
KEY `paper_id_INDEX` (`book_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci
```
is it possible to add a primary inde... | Create a new table with the structure you want and the auto-incrementing key, and then insert all of the records from this table into that new table... then drop (or rename) the original table, and rename the new table to the original name.
```
insert into newTable (author_id, book_id)
select * from author2book
```
... |
36805 | En *La escuadra chilena en México* (1971) está reproducido un documento del Archivo General de Indias «sobre la captura de la "Cazadora" por la goleta "Chilena"» que léese así:
>
> Noticia de los individuos que tomaron partido en la goleta *Chilena*, Corsario.
>
>
> * Primer guardia, Juan Portugues
> * Marinero, Jo... | La sigla "Fd." parece corresponder al rango de
>
> "Fuerza de desembarco" o su equivalente "infante de marina"
>
>
>
La literatura naval bélica comprende elementos de asalto anfibio (agua y tierra) para lo cual hay una categoría especial de infantería de marina(una especie de soldado de tierra en la flota) para ... |
36916 | ```
SELECT SQL_NO_CACHE TIME_FORMAT(ADDTIME(journey.departure
, SEC_TO_TIME(SUM(link2.elapsed))), '%H:%i') AS departure
FROM journey
JOIN journey_day
ON journey_day.journey = journey.code
JOIN pattern
ON pattern.code = journey.pattern
JOIN service
ON service.code = pattern.service
JOIN link
... | As the error tells you R requires at least one of the three options, e.g.,
```
Rserve(args="--no-save")
``` |
37343 | I am trying to pull data from my populated javascript table. How do I pull the value from a javascript row? I am using
```
for (var i = 0; i < rowCount; i++) {
var row = table.rows[i];
//This is where I am having trouble
var chkboxIndicator = row.cells[0].childNode... | jQuery is an option because it makes event handling consistent across browsers, however, writing a simple function that does it is across all browsers in a concise manner is fairly trivial too, so just for this widget I wouldn't recommend creating a dependency on jQuery.
Oh, and think of the input type as a widget or ... |
37480 | Okay, so I have an image for a background that has 1px of a blur filter in the CSS.
That works.
*Then*, I added a CSS :hover selector to a *new* CSS rule that changes the blur filter to 0.
When I hover over it on the browser, however, it doesn't change the blur at all! (I went into Google Chrome Inspect Element a... | You haven't already added the `:hover` pseudo-class.
```css
#bgimage:hover {
/* the styles you want to display on hover */
}
``` |
37662 | I have spent way to much time trying to figure this out.... looking a dozens of other answers.
I have table in SQL Server with a column of type `Char(32) NULL`. All items in the table column are only `char(9)`, but I have blanks in the remaining spots (when running `select ascII(right(myField, 1))` there is a 32 in t... | You must distinguish between
* strings with **fixed width** and
* strings with **variable width**.
In your case you are dealing with a fixed width. That means, that the string is always padded to its defined length. *Fixed-width-strings* live together with datetime or int values *within* the row.
If you define your ... |
38015 | I have a asn.1 file whose content is unknown as I am unable to read it properly.
I found some answer in stackoverflow but i have some doubt regarding this.
```
public static void main(String[] args) throws IOException {
ASN1InputStream ais = new ASN1InputStream( new FileInputStream(new File("asnfile")));
while... | You appear to be using the Bouncy Castle ASN1 reading class. That is a very well-regarded library; it's quite unlikely that it produces the wrong answer. So, it seems, the answer to your question is that you are already using the right tool. Why don't you find a tool that just dumps ASN.1 files outside of Java and comp... |
38168 | I'm wondering how to use `RequireJS` with `JS` libraries like: *html5shiv* and *retina.js*, libraries like these don't need to be use the way we use jquery or something else. We just need to include it.
I'm currently using it an ugly way:
```
require(["html5shiv"], function () {
//doing nothing here..
});
```
Any... | You are forgetting that the divs are part of the DOM tree now, you either target them as well or you remove them.
```
div {
counter-increment: chapter;
counter-reset: section;
}
div:before {
content: "Chapter " counter(chapter) " ";
}
``` |
38367 | Extent report version - 3.0
Language - Java and TestNG classes
I have a class - ExtentManager.java
```
package framewrk;
import com.aventstack.extentreports.ExtentReports;
import com.aventstack.extentreports.ExtentTest;
import com.aventstack.extentreports.reporter.ExtentHtmlReporter;
public class ExtentManager ... | In the above approach, you are creating a new extent report in each Class. That is why you are getting only the latest executed test result.
You can create a common superclass for both TC1 and TC2 classes. In the superclass you can create @AfterClass and @BeforeClass functions. Then it should work.
Hope it helps! |
38381 | ### Requirements
[Word frequency algorithm for natural language processing](https://stackoverflow.com/questions/90580/word-frequency-algorithm-for-natural-language-processing)
### Using Solr
While the answer for that question is excellent, I was wondering if I could make use of all the time I spent getting to know S... | I guess you can use Solr and combine it with other tools.
Tokenization, stop word removal, stemming, and even synonyms come out of the box with Solr.
If you need named entity recognition or base noun-phrase extraction, you need to use [OpenNLP](http://opennlp.sourceforge.net/) or an equivalent tool as a pre-processing ... |
38386 | I'm trying to write a piece of code for encrypting/decrypting data (e.g. passwords) which will be stored in DB. The goal is that data can be used in C++, PHP and Java. The problem is I’m not getting same encrypted data in C++ and PHP (I’m not dealing with Java jet).
C++ code:
```
void CSSLtestDlg::TryIt()
{
CStrin... | So the problem was in C++ code in StrToHex() function (which I forget to post in original question) so here it is:
```
CString StrToHex(unsigned char* str)
{
CString tmp;
CString csHexString;
int nCount = strlen((char *)str);
for( int nIdx =0; nIdx < nCount; nIdx++ )
{ ... |
38736 | Consider the following query...
```
SELECT
*
,CAST(
(CurrentSampleDateTime - PreviousSampleDateTime) AS FLOAT
) * 24.0 * 60.0 AS DeltaMinutes
FROM
(
SELECT
C.SampleDateTime AS CurrentSampleDateTime
,C.Location
,C.CurrentValue
,(
SELEC... | OK - so I've done some more research and I have most of the answers now.
First of all, a correction. Addresses are not obtained via `PD` with DHCP. That is how DHCP servers obtain a network prefix to use for the DHCP clients they host. There is another DHCP server which deals with handing out these prefixes. Thus, `PD... |
38829 | For some reason I'm getting this error:
>
> Uncaught ReferenceError: $stateProvider is not defined
>
>
>
even though `angular-ui-router.js` is being loaded fine.
Here is my code
```
(function () {
var mod = angular.module('MyApp', ['ui.router']);
debugger;
mod.config(['$stateProvider', '$locationPr... | I had a similar problem, when doing apt-get upgrade... The problem is that apt-get was trying to use python2.7, but the symlink was pointing to python3.4:
```
debian:/usr/bin# cat /etc/debian_version
8.10
debian:/usr/bin# ll /usr/bin/python
lrwxrwxrwx 1 root root 18 Feb 26 17:02 /usr/bin/python -> /usr/bin/python3.4
... |
38853 | I've a problem with my sendto function in my code, when I try to send a raw ethernet packet.
I use a Ubuntu 12.04.01 LTS, with two tap devices connected over two vde\_switches and a dpipe
Example:
my send programm create the packet like below, the programm is binded by the socket from tap0 and send the packet to tap... | Just use a standard javascript object:
```
var dictionary = {};//create new object
dictionary["key1"] = value1;//set key1
var key1 = dictionary["key1"];//get key1
```
NOTE: You can also get/set any "keys" you create using dot notation (i.e. `dictionary.key1`)
---
You could take that further if you wanted specific ... |
38997 | [Here](https://www.youtube.com/watch?v=LOoM3qlpYuU&list=PLHXZ9OQGMqxcJXnLr08cyNaup4RDsbAl1&index=12) (and [*here*](http://lie.math.okstate.edu/%7Ebinegar/2233/2233-l31.pdf)), I saw an equation for a horizontal frictionless harmonic oscillator (a mass on a spring) that was suddenty hit by a hummer (i.e. the duration of ... | You seem to be new to the concept of the $\delta$-function.
Therefore I will try to motivate this now.
Let's hit the oscillator body with a hammer made of soft rubber.
The force-time graph will look like this:
[](https://i.stack.imgur.com/DRkCp.png... |
39079 | Let $X\_1,...,X\_n$ be mutually independent RVs.
Suppose $X\_i \perp \mathcal F $ for $1\ \leq \forall i \leq n$.
How can I show that:
$$\sigma (X\_1,...,X\_n) \perp \mathcal F$$ ?
What I have tried:
$\sigma (X\_1...X\_n) = \sigma(\cup\_{i=1} ^n \sigma(X\_i))$ holds. I think I need some Dynkin's lemma-ish argum... | I doubt the conclusion. I remember that there is something like "pairwise independent does not imply independent".
More precisely, let $X\_1$, $X\_2$, $X\_3$ be random variables such that for any $i\neq j$, $X\_i$ and $X\_j$ are independent. However, $X\_1$, $X\_2$, $X\_3$ need not be independent. If my memory is corr... |
39133 | I am trying to convert a bitcoin address and have the following code from here ([Calculate Segwit address from public address](https://bitcoin.stackexchange.com/questions/65404/calculate-segwit-address-from-public-address), 2nd answer):
```
Step1: $ printf 1L88S26C5oyjL1gkXsBeYwHHjvGvCcidr9 > adr.txt
Step2: $ printf $... | Payment routing could handle this. Any business has operational costs and will have to make outgoing payments.
If your concern is that channels will mostly consist of payments in a single direction (i.e. from customers to larger businesses), and that this will lead to a high frequency of channel closings or on-chain s... |
39458 | The GFI in our bathroom was tripping somewhat frequently when my wife used the blow dryer. Other than the vanity light there were not other things operating on this circuit. If the GFI did not trip, the plug to the hair dryer would be quite hot to the touch. To my limited knowledge, a danger sign.
After a ridiculous q... | My understanding is that you can have multiple 15 amp outlets on a 20 Amp circuit but not just one. GFCI's trip on a fault, not an overload so the existing GFCI was probably going bad. Hair dryers can easily use 15 amps and that would heat up the plug a bit. If the GFCI outlet was old and had been used a lot, the plug ... |
39655 | [](https://i.stack.imgur.com/Xx84o.png)I am working on Firstcry .com website for automation. After searched for Shoes int he search box, I need to scroll down to the bottom of the page to click "View All products" link. BUt scrolling is not happening..... | After searching for Shoes in the search box and selecting the first suggestion, to scroll down to the bottom of the page to click on the element with text as **View All Products** you need to induce [WebDriverWait](https://stackoverflow.com/questions/48989049/selenium-how-selenium-identifies-elements-visible-or-not-is-... |
39685 | It's very strange, I cannot find any **standard** way with Ruby to copy a directory recursively while dereferencing symbolic links. The best I could find is `FindUtils.cp_r` but it only supports dereferencing the root src directory.
`copy_entry` is the same although documentation falsely shows that it has an option `d... | The standard way to recurse into directories is to use the [Find](http://www.ruby-doc.org/stdlib-2.1.2/libdoc/find/rdoc/index.html) class but I think you're going to have to write something. The built-in [FileUtils](http://www.ruby-doc.org/stdlib-2.1.2/libdoc/fileutils/rdoc/index.html) methods are building blocks for n... |
39801 | I have a table within a form. The table contains some form fields, but there are form fields outside of the table (but still within the form) too.
I know that Enter and Return are traditionally used to submit a form via the keyboard, but I want to stop this behaviour for fields within the table. For example, if I focu... | ```
base.keypress(function(e) {
var code = e.keyCode || e.which;
if(code == 13)
return false;
});
```
or for only inputs:
```
$(':input', base).keypress(function(e) {
var code = e.keyCode || e.which;
if(code == 13)
return false;
});
``` |
40118 | >
> Theorem:
>
>
> Let M be a topological manifold and let U be any open subset of M, with the subspace topology. Then U is a topological manifold.
>
>
>
Now, the only problem I face is showing that U is locally euclidean.
>
> Recall: Locally euclidean
>
>
> A topological space U is locally euclidean if, $\e... | (y-np+0.5 #continuous correction
)/(npq^1/2)
<(9.5-7.5)/2.5
=0.8
so
result is Pr(Y>9.5)=1-Φ(0.8)=1-0.788=0.212 |
40222 | I am using this code for uploading image. I have given write permission to the folder where image will be stored. Following is my code:
```
Dim con As New System.Data.SqlClient.SqlConnection("Data Source=Biplob-PC\SQLEXPRESS; database =a;Integrated Security=True")
Dim smemberid As Integer
Dim photoid As Integ... | You'll need to do it yourself, including the controls. You might use the transparent controls here: <http://brandonwalkin.com/bwtoolkit/> |
40562 | I want to design a widget of shape of a chat bubble where one corner is pinned and its height should adjust to the lines of the text? For now I'm using ClipRRect widget with some borderRadius. But I want one corner pinned. Any suggestions ?
[](https://i.stack.im... | For someone who want this get done with library. You can add `bubble: ^1.1.9+1` (Take latest) package from pub.dev and wrap your message with Bubble.
```
Bubble(
style: right ? styleMe : styleSomebody,
//Your message content child here...
)
```
Here `right` is boolean which tells the bubble is at right or left, Writ... |
41136 | With regards to the below code, I am trying to return a variable from inside of loop. I am calling the loop from inside of a function, however when the script is run I get "Uncaught ReferenceError: newVar is not defined".
Could someone explain why the value isn't being returned?
<https://jsfiddle.net/95nxwxf4/>
``... | You need to assign the value returned from `loopFunction`:
```
var privateFunction = (function privateFunction() {
var newVar = loopFunction();
document.querySelector('.result').innerHTML = newVar;
})();
```
Edit:
This is because the `newVar` assigned in `loopFunction` is scoped to that function, meaning it on... |
41500 | sorry about the code it is sloppy right now because I've been trying to fix it. Im using a function from another file to remove even numbers from my list but after I call the function the list returns empty.
```
from usefullFunctions import *
def main ():
mylist1 = uRandomList(10,0,15)
listLength = len(mylist1... | Its either a subquery or a group by query. Cant tell without the schema. Add the table definitions to your question and it will likely be a simple answer, unless this is already enough information.
As a completely guessed view of your data, it will be:
```
select CourseNumber,CourseName,Department,count(*) as Number... |
41751 | Trying to convert some code, but for all my googling I can't figure out how to convert this bit.
```
float fR = fHatRandom(fRadius);
float fQ = fLineRandom(fAngularSpread ) * (rand()&1 ? 1.0 : -1.0);
float fK = 1;
```
This bit
```
(rand()&1 ? 1.0 : -1.0);
```
I can't figure out. | It's 1 or -1 with 50/50 chance.
An equivalent C# code would be:
```
((new Random().Next(0, 2)) == 0) ? 1.0 : -1.0;
```
`Next(0,2)` will return either 0 or 1.
If the code gets called a lot you should store the instance of `Random` and re-use it. When you create a new instance of `Random` it gets initialized with a... |
42045 | Please see link below for a sample. Depending on a condition (text) in column A, cell E1 & E2 should auto-populate. This should depend on the condition (text) in column A and total in E5 etc.
[Google Docs sample](https://docs.google.com/spreadsheets/d/1IbUthijitKFUsdY-eV9upWNcWhP7AvAGRR842WpkWW8/edit?usp=sharing) | **Method 1: use SUMIF()**
Cell E1: `=SUMIF(A5:A,"ORDER",E5:E)`
Cell E2: `=SUMIF(A5:A,"SALE",E5:E)`
---
**Method 2: use SUMIFS()**
Cell E1: `=SUMIFS(E5:E,A5:A,"ORDER")`
Cell E2: `=SUMIFS(E5:E,A5:A,"SALE")`
---
**Method 3: Use SUM() and FILTER()**
Cell E1: `=SUM(FILTER(E5:E,A5:A="ORDER"))`
Cell E2: `=SUM(FILTER... |
42336 | I have a collection of data like so
```
Programme title | Episode | Subtitle | Performers | Description
```
Initially I normalised this into two table like so
```
PROGRAMME
progid | progtitle | description
EPISODE
epid | progid | episode | subtitle | description
```
I'm thinking I'd like to ... | It's many-to-many. One performer can be in multiple programs, and one program can have multiple performers.
There's plenty of information on the net (and in textbooks) about setting up many-to-may relationships. One such resource is here:
<http://www.tekstenuitleg.net/en/articles/software/database-design-tutorial/ma... |
42566 | As title, I use C to do this job between two programs in Linux system.
But, I encounter some problem.
Assuming that I have a server write data to FIFO in ten rounds, and
the client will read each round data and write another FIFO to feed
back to server.
The client will block in each round until that the server writer ... | as TonyB said, the `fopen()` function will return a file pointer `FILE*`
```
FILE *fp_R, *fp_W;
char temp[100];
fp_R = fopen(FIFO_R,"rb");
fp_W = fopen(FIFO_W,"wb");
for ( i = 0 ; i < 10 ; i ++ ) {
char* ret = fgets(temp, 100, fp_R);
while(ret == null)
{
Sleep(1);
}
Handle Data;
fprintf(fp_W,DATA... |
43006 | A PDF output is obtained by compiling the following code.
```
\documentclass{article}
\usepackage{xcolor}
\usepackage{listings}
\lstset
{
language={[LaTeX]TeX},
numbers=left,
numbersep=1em,
numberstyle=\tiny,
frame=single,
framesep=\fboxsep,
framerule=\fboxrule,
rulecolor=\... | This solution is *very* similar to that contained in [How to make text copy in PDF previewers ignore lineno line numbers?](https://tex.stackexchange.com/questions/30783/5764) `\protect`ing the [`accsupp`](http://ctan.org/pkg/accsupp) is the only requirement, perhaps due to the nature in which [`listings`](http://ctan.o... |
43126 | I have a Common Stock certificate for 310 shares of Antares Resources Corporation issued March 24, 1997. The corporate seal shows a 1958 date. I believe the company changed its name and ticker symbol and may have been delisted at some point. Is the company still in business and is there any value in the shares I have? | Antares Resources was delisted from Nasdaq in Feb 1997 due to it having too low a price (it closed at $1.375 on 4 Feb 1997).
It then went and traded as an OTC stock and did not make any SEC filings until 2006 (apart from a minor filing for issue of securities to employees). In 19976 SEC queried them about not reporti... |
43208 | I have to handle some strings, I should put them **N** positions to left to organize the string.
Here's my code for while:
```
private String toLeft() {
String word = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"; // Example
byte lpad = 2; // Example
StringBuilder sb = new StringBuilder();
for (int i = 0; i < word.len... | I think you have misunderstood what your (homework?) requirements are asking you to do. Lets look at your examples:
>
> VQREQFGT // 2 positions to left == TOPCODER
>
>
>
Makes sense. Each character in the output is two characters before the corresponding input. But read on ...
>
> ABCDEFGHIJKLMNOPQRSTUVWXYZ // ... |
43690 | I don't understand how to run c++ code in java using JNI.
I think there's some error in the makefile, I think some lib are missing.
I have this code in java class:
```
private native void getCanny(long mat);
getCanny(mat.getNativeObjAddr());
```
and the Mat2Image.h generated:
```
/* DO NOT EDIT THIS FILE - it is m... | The missing part was `env: flex`
So, the right yaml file should look like this:
```
runtime: python
threadsafe: yes
env: flex
entrypoint: gunicorn -b :$PORT main:app
runtime_config:
python_version: 3
handlers:
- url: .*
script: main.app
``` |
43755 | I got this error while debugging in SSIS:
>
>
> >
> > Error: 0xC0049064 at Data Flow Task, Derived Column [70]: An error occurred while attempting to perform a type cast.
> > Error: 0xC0209029 at Data Flow Task, Derived Column [70]: SSIS Error Code DTS\_E\_INDUCEDTRANSFORMFAILUREONERROR. The "component "Derived Co... | I suspect that there are some date time values which are not in the correct format .So SSIS throws error while parsing them .
In order to find to incorrect date time value from your source table try to redirect the error rows from `Derived Transformation` and check the incorrect data using a data viewer
The problem ... |
43855 | Do you know any PDF reader which remembers the last page for each document?
The usage scenario should be something like this:
* A new PDF file is loaded into the reader
* The PDF file is opened on page 0
* Reading, reading, reading ... Reading finished at page 37.
* Reader closed
...
* The same PDF file is loaded in... | [Evince](http://projects.gnome.org/evince/) does that...it's for Linux, but hey you never said anything about the OS: ;) |
44396 | I am getting "can only concatenate list (not "MultiValue") to list" highlighting map (float portion, while running below resampling, this code is very commonly used throughout image segmentation like lungs etc, I am thinking maybe this is issue with Python 3 and was working for earlier versions, any help is much apprec... | Change
```
spacing = map(float, ([scan[0].SliceThickness] + scan[0].PixelSpacing))
```
To
```
spacing = map(float, ([scan[0].SliceThickness] + list(scan[0].PixelSpacing)))
```
Basically scan[0].PixelSpacing is a MultiValue and need to be converted into list before concatenation to another list. |
44452 | Updated with actual JSON Response, Messed up last time.
It is my second day with JSON, and i am stuck at the first step of my project.
i created a wcf rest service which gives this test json response.
```
[{
"busyEndTime":"\/Date(928164000000-0400)\/",
"busyStartTime":"\/Date(928164000000-0400)\/",
"endGradient":1.2... | **Update**: Now that you've posted the actual JSON text, here's an example of using it:
```
$.getJSON(url, function(data) {
// jQuery will deserialize it into an object graph for
// us, so our `data` is now a JavaScript object --
// in this case, an array. Show how many entries we got.
display("Data received, ... |
44531 | I want the item to be replaced with an another item when the overridden function fires.
```java
@Override
public ActionResultType itemInteractionForEntity(ItemStack stack, PlayerEntity playerIn, LivingEntity target, Hand hand) {
if (!playerIn.world.isRemote()) {
// Replace an item with xyz... | * Have you called the function yet?
* Don't use `list` as a name of the variable
* Update the function to return `True` only when all elements have a perfect square.
code:
```
num_list = [4, 9, 16]
def check_is_quadratic(x):
result = []
for i in x:
if math.sqrt(i).is_integer():
result.appen... |
44735 | I want to compare two datagridviews, and use the `Except` method on the `IEnumerable` interface, in order to know the difference among them.
One example of my datagridviews:
```
DG1
idProduct Item
1 Item A
1 Item B
2 Item C
2 Item D
DG2
idProduct Item Price I... | Font size does not depend on button height. If you set it too small to fit the text, you will get the result you observe
**EDIT**
`wrap_content` would usually do the trick, however Button class sets some layout parameters like margin, background so it takes more space. You may get rid of Button and use i.e. `TextView... |
45179 | I'm using MVC4, .NET 4.5, VS2012, C#, Razor
I need the public IP of client on my website. To clarify, i need the kind of IP that whatismyip shows.
I know about querying whatismyip's automation page. But, I need to obtain the IP myself rather than using some other website for it. Following is my present code.
Controll... | There is a [winsorize function in scipy.stats.mstats](http://docs.scipy.org/doc/scipy-0.14.0/reference/generated/scipy.stats.mstats.winsorize.html) which you might consider using. Note however, that it returns slightly different values than `winsorize_series`:
```
In [126]: winsorize_series(pd.Series(range(20), dtype=... |
45996 | The Riemann zeta function $ζ(s)$ is defined for all complex numbers $s ≠ 1$ with a simple pole at $s = 1$. It has zeros at the **negative even integers**, i.e., at $s = −2, −4, −6, ...$.
My question: How one can obtain these roots. | These roots arise from that the Riemann zeta function satisfies the following *functional equation*
$$
\zeta(s)=2^s \pi^{s-1} sin(\frac{\pi s}{2}) \Gamma(1-s)\zeta(1-s)
$$
Thus, when s=-2n, we get that
$$
\zeta(-2n)=2^{-2n} \pi^{-(2n+1)} sin(-n\pi ) \Gamma(1+2n)\zeta(1+2n)
$$
which gives us
$$
\zeta(-2n) = 0
$$... |
46065 | I'd like to disable the NVidia GTX 750M GPU on my MacBook Pro 15" (Retina, Mid 2014, Mac OS X 10.10 Yosemite). I know I can use GfxCardStatus but I read I could have a more permanent solution by changing some EFI flag.
**My question is:**
* **How can I disable the discrete GPU from EFI?**
I assume this is persistent... | ### Your Dilemma
I'm in full sympathy with your wish "save on battery and reduce heat, without paying the noise cost" of using the discrete graphics card inside a MacBook Pro.
### Warning
Before you do anything which will disable your display, please make sure you are able to [log in to your MacBook Pro using SSH](h... |
46344 | I can't select look up field in my SharePoint 2013 List.
also I can't filter base on a Look up field.
for example I have List with Name Test and this list has fields: Title, Company, Province
the Company and Province is look up fields I want to filter based on Province which is a look up field
using REST query it give... | How to filter by lookup field value using SharePoint REST
---------------------------------------------------------
Assume a `Contacts` list that contains a lookup field named `Province`
**Option 1**
When a lookup column is being added into list, its `ID` become accessible automatically via REST. For example, when t... |
46798 | I have channels table:
```
+----+-------------------+---------+
| id | sort | bouquet |
+----+-------------------+---------+
| 1 | ["1","2","3","4"] | ["1"] |
| 2 | ["4"] | ["4"] |
+----+-------------------+---------+
```
And need to remove "2" value from id 1 so i need to get this:
`... | Try:
```sql
SELECT
`id`,
`sort`,
`bouquet`,
JSON_REMOVE(`sort`,
JSON_UNQUOTE(
JSON_SEARCH(`sort`, 'one', 2)
))
FROM `channels`
WHERE `id` = 1;
```
See [db-fiddle](https://www.db-fiddle.com/f/i9Lcw5BTdTtsjgtPHohAMq/3). |
47836 | The external API that my application is using, sometimes returns no values for one of the float64 fields. When that happens, I cannot unmarshal the rest of the document.
Here is the sample code in Go playground:
<http://play.golang.org/p/Twv8b6KCtw>
```
package main
import (
"encoding/xml"
"fmt"
)
func ma... | Is this what you are looking for?
```
SELECT DATEDIFF(`pro_masastr`, NOW()) as DiffDate
FROM `i2n_profiler_users`
WHERE `userid` = 725;
```
This is no need for the additional subquery. Note thate `datediff()` is `expr1 - expr2`, so you might want the arguments in the other order:
```
SELECT DATEDIFF(now(), `pro_mas... |
47845 | Can anyone tell me how to solve these things?
1.if the list is pressed, I'd like to change the background color of the list
beige(#FFF5E7) to white(#FBFBFB)
2.Also, I'd like to change the read value of the Object fales to true with useState
Problem is that if I pressed the list, whole background color of the list ... | One way using `heapq.nlargest`:
```
from heapq import nlargest
df["col2"] = df["col2"].apply(lambda x: nlargest(2, x, key=d.get))
print(df)
```
Output:
```
col1 col2
0 A [x, y]
1 B [z]
2 C [q, p]
3 D [q, t]
``` |
47860 | I want to do parser, which will print out expressions into steps of their calculation. And when I compile my code, I cannot solve these problem. I always get error
```
code.l:13:1: error: expected expression before '=' token
yylval.name = strdup(yytext);
^
code.l:18:1: error: expected expression before '=' token
... | The action in a lex rule must start on the same line as the pattern. So you need to write, for example
```
[a-zA-Z]+ {
yylval.name = strdup(yytext);
return(ID);
}
```
For what it's worth, this requirement is clearly stated in the [flex manual section on the format of an input file](http://westes.github.... |
47881 | My conection string was
```
string connStr = @"Data Source=(local)\SQLEXPRESS
Initial Catalog=University11;
Integrated Security=True";
```
But then I copied my database to
```
C:\Users\Чак\Desktop\ботанизм\ООП\coursework.start\CourseWorkFinal\CourseWorkFinal\
```
An... | The connection string (`Data Source=(local)\SQLEXPRESS`...) is intended for hiding the physical location of the database files when you decide to move files. No matter where your files are, the programs that use your database should not care, because logically it's the same database. When you move your DB files, you ne... |
49099 | So my htaccess lines look like this:
```
RewriteRule ^meniu/([a-zA-Z0-9]+)/$ produse.php?categorie=$1
RewriteRule ^meniu/([a-zA-Z0-9]+)/([a-zA-Z0-9]+)/$ produse.php?categorie=$1&produs=$2
```
* www.mysite.com/meniu/pizza/ works
* www.mysite.com/meniu/pizza/Quatro\_Formaggi/ **doesn't** work, it displays 404 not fou... | Your URL has the `underscore` character
`www.mysite.com/meniu/pizza/Quatro_Formaggi/`
so just add the `_` to the `RewriteRule` to match it
```
RewriteRule ^meniu/([a-zA-Z0-9]+)/$ produse.php?categorie=$1
RewriteRule ^meniu/([a-zA-Z0-9]+)/([a-zA-Z0-9_]+)/$ produse.php?categorie=$1&produs=$2
``` |
49171 | I am currently using Python to create a program that accepts user input for a two digit number and will output the numbers on a single line.
For Example:
My program will get a number from the user, lets just use 27
I want my program to be able to print "The first digit is 2" and "The second digit is 7"
I know I will ... | Try this:
```
val = raw_input("Type your number please: ")
for i, x in enumerate(val, 1):
print "#{0} digit is {1}".format(i, x)
``` |
51074 | So I'm new to MVC4 and C#, I have been designing this website for about 2 weeks now and there have not been any issues with the intelisense.
For 2 days now Visual studio is telling me that @Viewbag and other @ commands are not part of my project and i may be missing something or it tells me that Viewbag doesn't exist ... | Make sure you have specified the Razor version you are using in the `appSettings` of your web.config:
```
<appSettings>
<add key="webpages:Version" value="2.0.0.0" />
<add key="ClientValidationEnabled" value="true" />
<add key="UnobtrusiveJavaScriptEnabled" value="true" />
</appSettings>
```
Also make su... |
51479 | I am trying to check a condition using the logical or operator and seems like I am doing that wrong. It works of course if it is just 1, but when I add other values it seems to be incorrect as in below. How do I make this work to check if it's more than one. Does something go in quotes instead?
```js
if (data.Items.fi... | You can't compare against multiple values like that. You could use `Array#includes` instead.
```
if([110 , 120 , 130 ,140].includes(data.Items.find((item) => item.OrgUnit?.Id === (parseInt(match))).Role.Id)){
}
``` |
51908 | I have 2 `DropDownList`s with same contents (i.e. finance, marketing, promotion). I want to remove already-selected values from the rest of the list.
Example: If I select "finance" for the 1st list, it should be removed on other list; the 2nd list should only display "marketing" and "promotion".
However, the current ... | You have a several syntax error in your code. Maybe this is not an answer, but for code formatting, I need to be use the answer box.
There is an unopened `*/` after
```
$this->db->join('job_title jt', 'j.job_title = jt.id', 'INNER');
```
You are closing the string here:
```
$this->db->select('e.fname,e.lname,e.nik... |
52115 | I am setting a `TextBox` controls value via an ajax post.
```
$('#txtSite').val(msg.d.SiteName);
```
This is working and the value of the `TextBox` is altered correctly. But, when I come to posting the information to the database, the `txtSite.Text` value is empty!!
Any ideas? Am I going mad?
Code to populate the ... | You have your textbox set to `Enabled="false"` which renders in the browser with a `disabled="disabled"`. **[Disabled form inputs are not submitted.](http://msdn.microsoft.com/en-us/library/system.web.ui.htmlcontrols.htmlcontrol.disabled.aspx)**
The solution is either to make the textbox enabled and read-only:
```
tx... |
52550 | Hi i am getting a null pointer exception while running my application..
Here is my code :
ProductAdapter.java
```
public class ProductAdapter extends BaseAdapter {
Context context;
List<Product> products = new ArrayList<Product>();
private boolean showCheckbox;
public ProductAdapter(Context context,... | There's some more documentation on the CHM format here: <http://www.russotto.net/chm/chmformat.html> which might help you to write your own decoding code if you're not willing to use a library to do it.
Alternatively, there are plenty of freely downloadable decoders that will convert CHM back to HTML - have you consid... |
52612 | So today I opened my email and found another email from a recruiter who clearly did not look at my resume or any details about me. Here is the email (with [PII](https://en.wikipedia.org/wiki/Personal_data) removed):
>
> Hi,
>
>
> My name is [redacted], I’m a Technical Recruiter for [redacted]. I’m
> reaching out b... | Ignore it, unfortunately it's par for the course when looking for jobs or signing up to recruitment websites. If you respond to them negatively then you run the risk of them not contacting you in the future even for relevant positions. |
52891 | I have an Android game that uses the Libgdx game engine. I have an Android activity (mAndroidLauncher) that extends Libgdx's AndroidApplication class. There is a method that creates an Android alert dialog:
```
mAndroidLauncher.runOnUiThread(new Runnable() {
@Override
public void run() {
AlertDialog.Bu... | It looks like [this](https://sqa.stackexchange.com/questions/10450/selenium-sendkeys-not-completing-data-entry-before-moving-to-next-field) is a common issue.
Before trying the workarounds, as a sanity check, make sure that the input field is ready to receive input by the time you are sending keys. You could also try ... |
53902 | Does anyone have any advice on how one might georeference/orthorectify oblique imagery taken over the open ocean from a manned aircraft? The aircraft will have an RTK-enabled GNSS/INS onboard. I was thinking we could use the timestamps to link the position of the aircraft with the imagery. However, this is only one pie... | Orthorectification consists of two image adjustments corresponding to the sensor model and the terrain relief. Over the ocean you should be able to ignore the latter because the ocean is defined as 'sea level' so ellipsoidal height is sufficient.
[OSSIM has a utility](https://trac.osgeo.org/ossim/wiki/orthorectificati... |
54021 | i have some code that sets user's properties like so:
```
us = new UserSession();
us.EmailAddr = emailAddr;
us.FullName = fullName;
us.UserROB = GetUserROB(uprUserName);
us.UserID = GetUserID(uprUserName);
us.UserActive = GetUserActive(uprUserName);
```
where `GetUserROB`, `GetUserID` and `GetUserActive` all look si... | You can create a method that accepts a `UserSession` object as parameter, then set all three properties in it. I changed your `GetUserActive` a bit here:
```
private static void GetUserData(string userName, UserSession user)
{
using (Entities ctx = CommonSERT.GetContext())
{
var result ... |
54130 | I have built Boost in Release configuration and have staged it into one folder.
Now when I add Boost libraries into project and try to build it in Debug configuration - linker fails because there are no Debug versions libraries.
Is there a way to make MSVC 9.0 use Release version of libraries when building Debug confi... | You can do two things:
* Build the debug version for boost (this is the best option).
* Add debugging symbols to your release build.
You can't use the release version of boost with your debug build because boost depends on the CRT, which is different in debug/release builds. |
54255 | I keep getting an "invalid syntax" notification around `room105`
```
*room15 = room("Check out the lab")
room15.setDescription("You look around the lab. You find nothing of importance, really."
room105 = room("Continue to look around")
room105.setDescription("You still don't find anything.")
room16 = room("Go back... | ```
*room15 = room("Check out the lab")
room15.setDescription("You look around the lab. You find nothing of importance, really."
room105 = room("Continue to look around")
```
You are missing a closing parenthesis on the second line. |
54447 | I am quite a newbie with wpf...any help will be appreciated.
I started a small project with a listview that displays content from MySQL. So far I had no problems except a column that has 2 items in it. I need to **separate each item in its own column.**
It was easy to do with date and time but this one is beyond my ski... | Something like this might work if you want the horizontal column ordering reversed:
```
<div class="row">
<div class="col-xs-5 col-sm-push-7">
This should show on right
</div>
<div class="col-xs-7 col-sm-pull-5">
This should show on left
</div>
</div>
```
Here is a [JSFiddle demo](http:... |
54807 | I am using `OAuth 2.0` for authorization according to this documentation :(<https://developers.vendhq.com/documentation/oauth.html#oauth>) and having this error:
>
> "error": "invalid\_request", "error\_description": "The request is missing a required parameter, includes an invalid parameter value, includes a paramet... | As per the [RFC6749, section 4.1.3](https://www.rfc-editor.org/rfc/rfc6749#section-4.1.3), the encoded body of a POST request should look like `code={code}&client_id={app_id}&client_secret={app_secret}&grant_type=authorization_code&redirect_uri={redirect_uri}`.
Example:
>
> grant\_type=authorization\_code&code=Splxl... |
54836 | See comments for question. Remove N elements selectively (Condition is that list element matches 'remove')
```
List<String> mylist = new ArrayList<>();
mylist.add("remove");
mylist.add("all");
mylist.add("remove");
mylist.add("remove");
mylist.add("good");
mylist.add("remove");
// Remove first X "remove".
// if X i... | How about this:
```
List<String> filter(List<String> mylist, int x){
AtomicInteger index = new AtomicInteger(0);
mylist.removeIf(p -> p.equals("remove") && index.getAndIncrement() < x);
return myList;
}
```
With x=0, it prints:
>
> [remove, all, remove, remove, good, remove]
>
>
>
With x=1, it prin... |
54956 | I am designing a threaded message display for a PHP/MySQL application - like comments on Slashdot or Youtube - and am wondering how I should go about ordering the comments and separating it into pages so that you can have, say, 20 comments to a page but still have them nested.
Comments in my app can be nested unlimite... | I assume that the reason you want nested comments at all is because your users tend to want to read through a single thread of interest at a time. That is, you have reason to believe users will create threads of coherent chains of thought, and/or what gets discussed in one thread will interest some users but not others... |
55010 | I just implemented jwt-simple,on my backend in nodejs.i want to expire token by given time.
```
var jwt = require('jwt-simple');
Schema.statics.encode = (data) => {
return JWT.encode(data, CONSTANT.ADMIN_TOKEN_SECRET, 'HS256');
};
Schema.statics.decode = (data) => {
return JWT.decode(data, CONSTANT.ADMIN... | There is no default `exp`. Two ways you can add it mannually:
1. With plain js:
iat: Math.round(Date.now() / 1000),
exp: Math.round(Date.now() / 1000 + 5 \* 60 \* 60)
2. With `moment.js`:
iat: moment().unix(),
exp: moment().add(5, 'hours').unix()
[Source](https://github.com/hokaccha/node-jwt-simple/issues/50) from ... |
55412 | I was puzzled to find out the definition of “discursus” incidentally in Readers Plus English Japanese Dictionary, one of the best-selling English Japanese dictionaries, which is published by Kenkyusha, a well-reputed foreign language dictionary publisher in Japan.
It defines ‘discursus’ as;
n. 理路整然たる討議、説明 (logically... | [Discursus](http://dictionary.reference.com/browse/discursus), ([Ngram](https://books.google.com/ngrams/graph?content=discursus%2C&year_start=1800&year_end=2000&corpus=15&smoothing=3&share=&direct_url=t1%3B%2Cdiscursus%3B%2Cc0)) is a formal, uncommon term used with the below definitions (actually a Latin term). I think... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.