qid int64 10 74.7M | question stringlengths 15 26.2k | date stringlengths 10 10 | metadata list | response_j stringlengths 27 28.1k | response_k stringlengths 23 26.8k |
|---|---|---|---|---|---|
44,672,854 | I want to set the condition using `AND` and `OR` in `WHERE` clause. But the problem is AND condition is not setting to all other `OR` Condition
ex:
```
SELECT
Item,
Name,
Brand,
Date,
StoreID
FROM
Item
WHERE
Date between '01-01-2017' and '30-01-2017'
OR Brand = 'Nike' or Brand = 'Jhon... | 2017/06/21 | [
"https://Stackoverflow.com/questions/44672854",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7734785/"
] | We have two Scenario here as follows
```
SELECT
Item,
Name,
Brand,
Date,
StoreID
FROM
Item
WHERE
Date between '01-01-2017' and '30-01-2017'
OR (Brand = 'Nike' or Brand = 'Jhonson' OR Brand = 'Polo')
SELECT
Item,
Name,
Brand,
D... | ```
SELECT
Item,
Name,
Brand,
Date,
StoreID
FROM
Item
WHERE
Date between '01-01-2017' and '30-01-2017'
AND ( Brand = 'Nike' or Brand = 'Jhonson' OR Brand = 'Polo')
```
It can be right with your result. |
22,342,450 | I am doing a project on spring MVC with maven.I pass my data using Ajax to the controller.it is ok..but when i call the function for delete,i got org.hibernate.MappingException: Unknown entity: java.lang.Integer . below my codes..waiting for your reply
web.xml
```
<?xml version="1.0" encoding="UTF-8"?>
... | 2014/03/12 | [
"https://Stackoverflow.com/questions/22342450",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3011943/"
] | Notice the hibernate method `getCurrentSession().delete(Object obj)`, not just give an `id` as parameter.
```
@Override
public void delete(int id) {
Account accounts = new Accounts();
// hibernate deletes objects by the primary key
accounts.setId(id);
getCurrentSession().delete(accounts);
}
``` | The `getCurrentSession()` method would return an implementation of the `session` interface. Looking up the [javadocs](http://docs.jboss.org/hibernate/orm/3.6/javadocs/) from 3.6 and further for Hibernate.
It supports 2 methods for deletion
```
void delete(Object object)
Remove a persistent instance from t... |
40,728,432 | I need help making a php function. I want to create a function that removes everything before a specific word or character in a string. I know how to do that part, but I am new to making a function out of it, and I need to add an option to it... for example. If I have this string...
```
$str="I like to eat cheese, cra... | 2016/11/21 | [
"https://Stackoverflow.com/questions/40728432",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3067447/"
] | What you're looking for is something like this:
```
<?php
function remove_before($needle, $haystack, $removeNeedle=false) {
$pos = strpos($haystack, $needle);
if (($pos !== false)) {
return substr($haystack, $pos + (strlen($needle) * $removeNeedle));
}
return $haystack; // if word not found,... | ```
<?php
$str = "I like to eat cheese, crackers and ham";
function remove_before($needle, $haystack, $include = false)
{
$pos = strpos($haystack, $needle);
if ($pos !== false) {
if (!$include) {
$pos += strlen($needle);
}
return substr($haystack, $pos, strlen($haystack));
... |
19,527,898 | I ran into a pointer dereferencing problem.
In C, &a means the address of a. If a is a pointer ,then &a simply means the address of that pointer.
So if we have:
```
char ptr [] = "abcd"
```
ptr should be a pointer pointing to the first character, which is 'a'. therefore,
```
&ptr
```
should be the address o... | 2013/10/22 | [
"https://Stackoverflow.com/questions/19527898",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1391850/"
] | >
> So if we have: `char ptr [] = "abcd"`, ptr should be a pointer pointing to the first character.
>
>
>
**No. Not at all.**
`ptr` is an **array.** And **an array is not a pointer.**
Indeed, if you declared `ptr` as a real pointer, then you would get the expected behavior:
```
const char *ptr = "abcd";
printf(... | `char a[] = "abcd"` does not declare a pointer `a` to `"abcd"` but an array. Even if an array can decay to a pointer, it is a different type for which `&a` and `a` yield the same address.
Basically `a` yields the address to the first element of the array, so it is equivalent to `&a` (and to `&a[0]`). |
40,029,839 | So i'm having trouble finding the index of the first vowel in a string. This is the code I came up with but its not returning anything.
Its supposed to return the index of the first vowel for example if the string was "Hello World" it should return 1 because the index of the first vowel is 'e'. If there is no vowel in ... | 2016/10/13 | [
"https://Stackoverflow.com/questions/40029839",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7015821/"
] | Utilize a private static method to check if a certain character is a vowel:
```
public static int firstVowelPos(String s) {
for (int i = 0; i < s.length(); i++) {
char c = s.charAt(i);
if (isVowel(c))
return s.indexOf(c);
}
return -1;
}
private static boolean isVowel(char c)... | The reason why your method isn't returning anything is because it's checking for the index of an integer within a string of all vowels. What you should do is check the character at i within s, see if it's a vowel, and then return that index.
Also, I would recommend renaming your method to something like "indexFirstVow... |
23,568,084 | I'm doing [this tutorial](http://tutorials.jumpstartlab.com/projects/blogger.html#i3%3a-tagging) and am stuck in the Tagging part. Basically I have articles that can have a list of tags. As one article can has multiple tags and vice versa, there is an additional `taggings` model, through which this association is model... | 2014/05/09 | [
"https://Stackoverflow.com/questions/23568084",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3344078/"
] | Upgrade to Rails 4.0.13 (or later) or downgrading to Ruby 2.1.1 solves the problem. | FYI, I can confirm this is an issue with ActiveRecord and Ruby 2.2. I was using ActiveRecord 3.2 and since changing to the 3-2-stable branch, the issue is gone. I believe this is fixed now in 4.x branches. I have raised an issue for this at <https://github.com/rails/rails/issues/18991>. |
8,273 | Betrayal at House on the Hill features character pentagons with 4 traits that can increase or decrease and are marked by clips.

I find (at least with my copy) that the clips slip and slide too easily; we often lose track of our s... | 2012/09/02 | [
"https://boardgames.stackexchange.com/questions/8273",
"https://boardgames.stackexchange.com",
"https://boardgames.stackexchange.com/users/2133/"
] | My friend inserted a small slither of black electrical tape inside the slider. This tightened the grip when applied and was invisible to the eye. I still find the sliders too short to align with the number, but this at least keeps them attached firmly! | I use 8 sided dice by each trait. It's easy to see and keep track, but I like the paper clip suggestion. |
64,338,446 | I am trying to make a video chat platform and I can not work out how to detect if a user does not have a webcam available and if they don't, it sets the video feed to a static image or name and profile picture.
here is my current way of getting the webcam:
```
navigator.mediaDevices.getUserMedia(with_video).then((str... | 2020/10/13 | [
"https://Stackoverflow.com/questions/64338446",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/11583514/"
] | You do not need to add the steps between 1 and 2 seperately, the third argument of the range function lets you the the step size, here 1/16.
The steps between 1 and 2 are not integers, they are float numbers. Unfortunately Pythons `.range()` is unable to handle that natively. One option is to use numpys arange() which... | You can use numpy's arange function as already suggested, or you can use a while loop like in the example below.
The problem with python's range funtions is that it only accepts integers as arguments.
```
x = 1/16
import numpy as np
for i in np.arange(1,2,x):
print(i)
value = 1.0
while value < 2:
prin... |
60,628,832 | Scenario
--------
I was running into some trouble trying to assign values from a command into a variable in a makefile. Using backtick notation seems to work fine, but as soon as I use the more modern `$(pwd)` notation, the value of the variable returns nothing.
```sh
$ cat Makefile
FOO=moo
BAR=$(pwd)
BAZ=`pwd`
all:... | 2020/03/11 | [
"https://Stackoverflow.com/questions/60628832",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4440053/"
] | Make doesn't support backticks. Makefiles are not shell scripts. However, makefiles do *run* shell scripts, and shell scripts support backticks. You wrote this:
```
$ cat Makefile
FOO=moo
BAR=$(pwd)
BAZ=`pwd`
all: foo bar baz
foo:
@echo foo:$(FOO)';'
bar:
@echo bar:$(BAR)';'
baz:
@echo baz:$... | To expand on answer <https://stackoverflow.com/a/60628899> by <https://stackoverflow.com/users/1899640>, adding a working example:
```
SHELL=/bin/env bash
FOO=$(shell pwd)
BAR=$(FOO)/src
BUZ=ext
all: foo bar baz
foo:
@echo foo:$(FOO)';' # returns /home/mazunki
bar:
@echo bar:$(BAR)';' # returns /home/maz... |
32,313 | I have a linear regression model that is used to forecast the 'afluent natural energy' (ANE) of some region.
The predictors for this model are:
* the previous month ANE (`ANE0`)
* the previous month rain volume (`PREC0`)
* the current month forecast for rain volume (`PREC1`)
We have 7 years of historical data for al... | 2012/07/15 | [
"https://stats.stackexchange.com/questions/32313",
"https://stats.stackexchange.com",
"https://stats.stackexchange.com/users/12626/"
] | The best way to test out of sample prediction is to do a pseudo out of sample forecasting experiment. Use about 75 percent of the data to train the models, make the prediction, record the forecast error, update the information set, and repeat. At the end, you can use all of the forecast errors to get the mean-squared f... | If you have data beyond the range of the fit to test the forecasts then that would be good to compare the models. If you don't have that then fit criteria that don't require nested models and penalize for overparameterization would be best. I recommend using information criteria for that (versions of AIC or BIC). But i... |
49,925,748 | I am trying to switch my remote from HTTPS to SSH. First I verify that it started out as HTTPS. I run:
`$ git remote get-url origin`
result: `https://<repo>.git`
I then run `$ git remote set-url origin git@github.com:<repo>.git`
Then I run so set the remote URL that I want:
`$ git remote get-url origin`
and it S... | 2018/04/19 | [
"https://Stackoverflow.com/questions/49925748",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5953635/"
] | Check git global config
-----------------------
Check the global git config for any [insteadOf](https://git-scm.com/docs/git-config#Documentation/git-config.txt-urlltbasegtinsteadOf) settings which automatically replace git urls with https urls.
```
git config -l
...
url.https://github.com/.insteadof=git@github.com... | Try removing and then adding the `origin` again, if that is ok for you.
To remove origin,
```
$ git remote rm origin
```
Verify if the origin actully removed. The secondnd command should have given you a error.
```
$ git remote -v
$ git pull
```
Now add origin and verify,
```
$ git remote add origin git@github.... |
23,726,344 | I'm embedding tweet on a website and I would like to remove the follow button and also the *reply*, *favorite* and *retweet* buttons that are in the footer. A minimal HTML example is the following
```
<blockquote class="twitter-tweet">
<a href="https://twitter.com/StackCareers/statuses/468107750333894656"></a>
</... | 2014/05/18 | [
"https://Stackoverflow.com/questions/23726344",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1852681/"
] | I've managed to do this with the `widget` that returns a `Shadow DOM element`. I read [here](http://www.html5rocks.com/en/tutorials/webcomponents/shadowdom-201/) that you can manipulate `CSS` from `shadow elements`. The `Twitter Widget` defines a `Shadow element` that, in my case where I just have one tweet embedded, h... | in case you have multiple widgets
```
<style>
[id*="twitter-widget"]::shadow div.Tweet-brand { display: none; }
</style>
``` |
1,745,888 | I see the term "dirty" or "dirty objects" a lot in programming.
What does this mean? | 2009/11/17 | [
"https://Stackoverflow.com/questions/1745888",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/75500/"
] | A dirty object is an object that has changed in its content, but this content has not been synchronized back into the database/disk. It's a typical situation of desynchronization between a cache and a storage. | *EDIT: original question was phrased as `I find a lot in "programming dirty"`, this answer attempts to address that. The accepted answer is about `dirty objects`, which signifies changed status or content.*
*"Programming dirty"* as you quote it, also means that you use a ["quick and dirty" method for solving a problem... |
11,686,361 | I need to let the user open a specific album from their gallery, and let them to do something with images.
In order to retrieve an image from an album, I'm using:
`Bitmap bitmap = MediaStore.Images.Media.getBitmap(contentResolver, uri).`
Everything works fine, except the fact that if the album contains many pictu... | 2012/07/27 | [
"https://Stackoverflow.com/questions/11686361",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1271435/"
] | As others have mentioned, you loop over a function reference and not the result from executing `smalls`.
Yet, as you use jQuery, you can write shorter/simpler code:
```
var smalls = $("#box-table-a").find("small"); // this var really contains the elements
smalls.addClass("form-absolute-right").wrapInner("<span class=... | Try
```
var smalls = function(){
var table = $("#box-table-a");
return table.find("small");
}, smallContent;
for(var i = 0; i<smalls().length; i++){
smallContent = smalls()[i].innerHTML;
smalls()[i].parentElement.className += "relative";
smalls()[i].className += "form-absolute-right";
smalls()... |
22,624,027 | I want to use Js to calculate the running time of my function, but it seems only the first time the time interval is not zero.
```
var i = 0;
//var timeArray = new Array();
//var date1;
//var date2;
var time = 0;
while(i < 5) {
var date1 = new Date();
var date2 = new Date();
var t = decide_class(attr[i]);... | 2014/03/25 | [
"https://Stackoverflow.com/questions/22624027",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3263729/"
] | You need to use high precision timers. The following is not completely my code.
```
window["performance"] = window.performance || {};
performance.now = (function() {
return performance.now ||
performance.webkitNow ||
performance.msNow ||
performance.oNow ||
performance.mozNo... | What about calculating all the loop?
```
var i = 0;
//var timeArray = new Array();
//var date1;
//var date2;
var date1 = Date.now();
alert(date1)
while(i < 5) {
var t = decide_class(attr[i]);
i++;
}
var date2 = Date.now();
var time = (date2-date1);
```
This could help to eliminate some imprecision if... |
34,489,320 | I've seen a lot of different topics and suggestions on aligning and inputting buttons/text, but the ways I've seen seem kind of risky.
What is the optimal way, for example, to add two buttons, stack them together, and have them be 10% from the bottom of the screen, and centered horizontally on all devices? | 2015/12/28 | [
"https://Stackoverflow.com/questions/34489320",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5484801/"
] | Learn Auto Layout if you haven't yet. Use constraints for achieving the following:
>
> 1. For centrally Horizontal on all devices: Use Center X with SuperView.
> 2. For having them 10% from bottom, use multiplier value say **0.10** .
>
>
> | For iOS 9, an even simpler Auto Layout approach would be to use [UIStackView](https://developer.apple.com/library/ios/documentation/UIKit/Reference/UIStackView_Class_Reference/).
As you can see, no constraints are needed for the buttons embedded in the stack view, as the stack view lays out the buttons for you. All yo... |
13,000,266 | I've got problem with dynamically background changing in whole HTML document. Here is piece of code:
```
function changeHTMLBackground() {
var html = document.getElementsByTagName('html')[0];
html.style.background = "#ff00ff";
}
```
Problem appears only in IE9. In Chrome, FF, Opera works fine. I know there... | 2012/10/21 | [
"https://Stackoverflow.com/questions/13000266",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1643940/"
] | I'm not sure what the problem is but here are a few possible solutions.
1) Maybe the selector isn't working.
try using
```
document.html.style.backgroundColor = "#977689";
```
2) Maybe IE9 has an issue with html bg colors anyway. is the CSS code working?
3) try adding a class and id to the html tag, and selecting t... | Pretty sure that IE does not support applying CSS to the html tag itself, nor am I sure that's expected by the standard. As a trivial test, try:
```
<!doctype html><html style="background: green"><body>Testing</body></html>
``` |
24,708,285 | Let's say a method returns a `CFErrorRef` via a pointer. This returned error may be `NULL`. So would it be safe to perform a `__bridge_transfer` still or should I check for `NULL`.
E.g.
```
CFErrorRef cfError;
ABAddressBookRef addressBookRef = ABAddressBookCreateWithOptions(NULL, &cfError);
NSError *error = (__bridg... | 2014/07/12 | [
"https://Stackoverflow.com/questions/24708285",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1979235/"
] | You do not need to check for NULL.
ARC is a strictly compile-time mechanism. When you use `__bridge_transfer` you are merely transferring memory management responsibility of a variable to the compiler. Whether `cfError` happens to be NULL or not at runtime is completely irrelevant to the compiler.
In your case, ARC w... | Unlike NSObjects, sending messages to NULL CF objects is not ok. I don't know about bridging casts specifically, but I would guess that no, casting a CF object to an NSObject using \_\_bridge\_transfer is NOT ok.
Why not try it and see? Cast it to a variable in the local scope of an instance method. That way, as soon ... |
54,993,836 | I use ajax get a json like this:
```
{"dataStore":"[{\"delete_flag\":\"false\",\"id\":\"74\",\"icon_img\":\"img/a5.jpeg\"}]"}
```
How to append "delete\_flag" , "id" , "icon\_img" to 3 different places on html ? | 2019/03/05 | [
"https://Stackoverflow.com/questions/54993836",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/11070790/"
] | You can use this pure javascript method like below.
The code basically uses [`document.getElementById()`](https://developer.mozilla.org/en-US/docs/Web/API/Document/getElementById) to get the element, and [`.innerHTML`](https://developer.mozilla.org/en-US/docs/Web/API/Element/innerHTML) to set the inside of the elemen... | you can use jQuery [.html()](http://api.jquery.com/html/) or [.text()](http://api.jquery.com/text/)
For example:
```js
var json = {"id" : "74"};
$( "#content" )
.html( "<span>This is the ID: " + json.id + "</span>" );
```
```html
<html>
<head>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.... |
36,025,580 | I start a new project from File -> New -> project
I add a button to ViewController.
I open UITest folder which created by xcode by default. Run the test code.
It fails:
```
2016-03-16 12:57:09.191 XCTRunner[3511:150419] Continuing to run tests in the background with task ID 1
t = 10.18s Assertion Fai... | 2016/03/16 | [
"https://Stackoverflow.com/questions/36025580",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1679519/"
] | I was also facing same issues and none of the available solutions worked for me. Issue was not letting app to attach to the simulator itself.
I checked the log and saw that i did a mistake in code while locating the element. for Predicate instead of BEGINSWITH i wrote STARTSWITH and this was stopping the app to get att... | I was getting this error happening when the iOS simulator was already launched (which may not necessarily mean you can see it in the OS X dock). You can check the state of the various simulators using the `simctl` command.
I.e.
```
xcrun simctl list devices
```
Then, ensure that any devices listed as "Booted" are s... |
7,846,591 | i want to acess the web config value in javascript
config entry:
```
<add key ="RootPath" value ="C:\Test" />
```
javascript code:
```
var v1 = '<%=ConfigurationManager.AppSettings["RootPath"].ToString() %>'
```
The output that i am getting is
```
C:Test
```
but what i want is C:\Test
Any idea how to a... | 2011/10/21 | [
"https://Stackoverflow.com/questions/7846591",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | Try this
```
ConfigurationManager.AppSettings["RootPath"].ToString().Replace(@"\", @"\\")
``` | **if you adding this**
```
<add key ="RootPath" value ="C:\\Test" />
```
then you will retrive like `"C:\Test"`.
**Its behavior of .net.** |
116,735 | I propose a new Gold level Sportsmanship badge. I earned the silver badge June 4th, and I continue to vote for competing answers. I would like to feel that I am working toward something, not because I would otherwise cease to vote for these answers, which clearly I have not, but because it adds to the fun of the site, ... | 2011/12/21 | [
"https://meta.stackexchange.com/questions/116735",
"https://meta.stackexchange.com",
"https://meta.stackexchange.com/users/158428/"
] | I really do like the incentive to vote for competing answers,
but maybe this badge is a little bit more easy to grind at than a gold badge ought to be.
---
There's also the room people to avoid the incentive by up-voting on questions that are weeks or months old(thus not putting their own answer in jeopardy). You m... | I am not going to discus the name nor the number of votes necesary for such badge, just going to quote the Tour:
>
> Good answers are voted up and rise to the top.
>
>
>
If this is really what we want, such badge will be useful, as it would motivate even people with upvoted answers vote for other good answers. |
59,849,484 | I am a little confused on the idea of using props in the context I am using for my React app. In my component, I need to check if the value of a certain prop (`props.companyCode`) matches a certain string, and only then will it print out a `<p>` of what I need. Below is what I have for calling the prop in the component... | 2020/01/21 | [
"https://Stackoverflow.com/questions/59849484",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6122293/"
] | I'm assuming you are getting an error somewhere because of `this` not having `props` and `this.props.companyInfoList.companyCode` trying to access a property on a non object. `this.props.companyInfoList` is initially set to `null` so accessing a property on it will break.
A few strategies to fix the problem:
1. Defau... | I would personally refactor that component logic and directly use the prop value inside the render method like:
```
class CompanyContact extends React.Component {
render() {
const { companyInfoList } = this.props;
return companyInfoList && companyInfoList.companyCode === '1234' ? (
<p>something</p>
... |
11,362 | The product I work on has a communication network of 192.168.0 (four systems 100, 101, 102, and 103). From time to time there is a desire to patch in a set of these systems (using their 192 addresses) to the site network to communicate using various instrumentation tools that have tight licensing that is bound to a sit... | 2009/05/22 | [
"https://serverfault.com/questions/11362",
"https://serverfault.com",
"https://serverfault.com/users/3376/"
] | A router of some sort (i.e. router or firewall) is the obvious answer to connect the two networks. If IP address conflicts are a concern, then using NAT will prevent problems.
Always be careful when connecting development to production. You could accidentally bind to the production database and delete a table or some... | If you need an exception for a system to jump subnets look into the [windows route](http://www.cisco.com/en/US/products/sw/custcosw/ps1001/products_tech_note09186a0080150baf.shtml) command. It is often the solution to these kinds of things (assuming your on a windows machine). This works especially well in a temporary ... |
27,897,157 | Below mentioned is html details of Accept/Reject button.
```html
<div id="ContentPlaceHolder1_EmployeeProfile_divAction" class="btn-row btn-accept-recet" style="display:block;">
<button onclick="__doPostBack('ctl00$ContentPlaceHolder1$EmployeeProfile$btnAccept','')" id="ContentPlaceHolder1_EmployeeProfile_btnAccept"... | 2015/01/12 | [
"https://Stackoverflow.com/questions/27897157",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4444272/"
] | You can try the below approach
```
driver.findElement(By.xpath("//button[contains(.,'Accept')]".submit();
driver.findElement(By.xpath("//button[contains(.,'Reject')]".submit();
``` | ```
driver.manage().window().maximize();
WebElement scroll = driver.findElement(By.id("ContentPlaceHolder1_EmployeeProfile_btnAccept"));
scroll.sendKeys(Keys.PAGE_DOWN);
driver.findElement(By.id("ContentPlaceHolder1_EmployeeProfile_btnAccept")).click();
``` |
18,868 | I found some papers that use fuzzy logic to solve robotics algorithmic problems. But I have recently been told by a few roboticists that fuzzy logic should not be used in robotics because it has recently been proven by some theoreticians to be a mathematically dubious field. And so any results that you generate using f... | 2019/05/30 | [
"https://robotics.stackexchange.com/questions/18868",
"https://robotics.stackexchange.com",
"https://robotics.stackexchange.com/users/14868/"
] | Short answer: Fuzzy logic (FL) isn't applicable for robotics research, The long answer is, that in the 1980s as part of the fifth computer generation fuzzy logic was researched in Japan with the attempt to build intelligent advanced parallel computers, but the Japanese researchers have failed. Fuzzy logic isn't a techn... | I have not seen any industry-grade application of fuzzy logic in space, flight, automotive control systems. Fuzzy logic came during mid-60s and it gradually faded away due to several reasons:
1. It did not solve any control problem that cannot already be solved by the existing methods at that time. Bad news, no major ... |
248,711 | I am working with engineering equations in a vacuum system and want to emphasize that a certain set of parameters will not work. Usually, this is due to real world effects (friction, pump efficiency factors, wear and tear of bearings, etc), but I want to emphasize that a particular setup **wouldn't work even under perf... | 2015/05/26 | [
"https://english.stackexchange.com/questions/248711",
"https://english.stackexchange.com",
"https://english.stackexchange.com/users/123046/"
] | Just from reading the question's title, I would've suggested *taboo*... but, obviously, that doesn't fit in the physics world.
So instead, I'd recommend something like **infeasible**, i.e. the antonym of *feasible*, defined as "capable of being done, effected, or accomplished". (Note that you could [also use](https://... | "Inherently unrealizeable" works for me. |
12,778,209 | Is a PostgreSQL function such as the following automatically transactional?
```
CREATE OR REPLACE FUNCTION refresh_materialized_view(name)
RETURNS integer AS
$BODY$
DECLARE
_table_name ALIAS FOR $1;
_entry materialized_views%ROWTYPE;
_result INT;
BEGIN
EXECUTE 'TRUNCATE TABLE ' || _t... | 2012/10/08 | [
"https://Stackoverflow.com/questions/12778209",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2648/"
] | **PostgreSQL 12 update**: [there is limited support for top-level `PROCEDURE`s that can do transaction control](https://www.postgresql.org/docs/12/plpgsql-transactions.html). You still cannot manage transactions in regular SQL-callable functions, so the below remains true except when using the new top-level procedures.... | Postgres 14 update: All statements written in between the `BEGIN` and `END` block of a Procedure/Function is executed in a single transaction. Thus, any errors arising while execution of this block will cause automatic roll back of the transaction. |
73,553,464 | I just looking for a widget type where it provides a simple default solution to draw shared border lines between children widgets, instead of touching two different borders or turning a widget into a border. Basically it's just a table thing with the children as it's cell widgets.
There's `Table` in Flutter. But sadly... | 2022/08/31 | [
"https://Stackoverflow.com/questions/73553464",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1297048/"
] | [`random.choices` returns a list of random elements from an iterable, with replacement](https://docs.python.org/3/library/random.html#random.choices)
Either use `+=` ([to add two lists together](https://stackoverflow.com/questions/1720421/how-do-i-concatenate-two-lists-in-python)):
```py
players_card += random.choic... | `random.choices(cards, k=1)` returns a list having only one value.
You can concatenate the two lists like this
```
players_card = players_card+random.choices(cards, k=1)
```
OR you could also do
```
players_card.append(random.choices(cards, k=1)[0])
``` |
60,892,474 | I have a chart with lines in it, and when I mouseover a line I want to display a text in the svg. Here is the code :
```
let lines = svg.append("g").attr("class", "lines");
lines
.selectAll(".line-group")
.data(data)
.enter()
.append("g")
.attr("clas... | 2020/03/27 | [
"https://Stackoverflow.com/questions/60892474",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7695244/"
] | The `mouseover` event will not trigger if the group `<g>` does not contain any element for the mouse to be on. You must append something to the groups so that the event will be triggered once the mouse enters. | you have to use .text(function(d){return d.name})
instead of .text(d.name) |
25,321 | I recently upgraded to Lion and since then I haven't been able to use Keychain to look at my stored passwords. When I click on the checkbox to show them it prompts me for my master password, then pops up a dialog that says "Access to this item is restricted".
Based on reading questions here and on other support sites,... | 2011/09/18 | [
"https://apple.stackexchange.com/questions/25321",
"https://apple.stackexchange.com",
"https://apple.stackexchange.com/users/11122/"
] | There are several reasons Keychain does this. Often it's because a new account that you might have switched to does not have the same/correct paths to Keychain that it used to. For starters try changing the main login password of your account; if that doesn't do anything try this in terminal:
```
$ sudo touch login.ke... | Keychain says “Access to this item is restricted”
As posted by Matt: This worked for me as well.
* open Keychain access, click the lock to lock the keychains, then unlock again! -
Its the simplest least potentially destructive option and I was very sceptical, but it worked. So worth a shot as it takes seconds. I'm r... |
589,997 | As another user asked about firefox:
[Increase limit of bookmark folders in Firefox?](https://superuser.com/questions/38325/increase-limit-of-bookmark-folders-in-firefox)
I would like to increase the number of folders that you are presented with when you press the add bookmark star in Chrome. As it is now, you get a c... | 2013/05/01 | [
"https://superuser.com/questions/589997",
"https://superuser.com",
"https://superuser.com/users/221208/"
] | The limit of 5 folders is [hardcoded](https://github.com/chromium/chromium/blob/318345ccda37a7f187e6014baff53a2d4eb2bdab/chrome/browser/ui/bookmarks/recently_used_folders_combo_model.cc#L21-L22).
I've been [patching chromium](https://gist.github.com/gg7/8172378) for years because of this. | According to this forum <https://productforums.google.com/forum/#!topic/chrome/yQ3jbWf0DgU> it has never been a feature to create a top level folder in bookmarks. I have noticed that connecting a chrome account on iOS has created a "Mobile Bookmarks" folder, but otherwise seems impossible to create or edit the top leve... |
7,024,777 | I've got problem with local copy of SVN folder
```
$ svn up
svn: REPORT of '/svn-xxx/!svn/vcc/default': Could not read chunk size: connection was closed by server (http://127.0.0.1)
$ svn cleanup
$ svn up
svn: REPORT of '/svn-xxx/!svn/vcc/default': Could not read chunk size: connection was closed by server (http://127... | 2011/08/11 | [
"https://Stackoverflow.com/questions/7024777",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/872856/"
] | * Rename the folder
* Checkout the folder (`svn co path/to/folder/`)
* Copy files from the old folder to the new one (but avoid `.svn` directories!)
* When everything works: delete renamed old folder | I would probably go with copying all files as you suggested (voted up)
* Checkout to new folder
* Copy all from old to new without overwriting and without .svn
```
rsync -av --exclude=.svn --ignore-existing old/ new/
``` |
4,837,616 | Hi im having a problem to figure this out, i am literally going nuts. I got a scenario like this. Category , Category-SubCategory, Category-SubCategory-SubSubCategory
I cant for the life of me figure out this route. My last and current is like this
```
routes.MapRoute(
"Navigation",
"Navigati... | 2011/01/29 | [
"https://Stackoverflow.com/questions/4837616",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/148601/"
] | Cut it to one route by cheating a bit.
```
routes.MapRoute(
"navigation",
"{nav}/{name}",
new { controller = "Navigation", action = "Page", nav = UrlParameter.Optional, name = UrlParameter.Optional }
);
```
and i write all the categories, subcategories in the nav like
``... | I agree with @Darin that you might want to think a little more about your architecture, but I believe this series of routes would work for you:
```
routes.MapRoute(
"Navigation",
"Navigation/{nav}/{sub}/{subsub}/{id}",
new { controller = "Navigation", action = "Site", nav = "", sub = "", subsub = "", id... |
47,828,275 | From my android app, I am connecting to `MongoDB` through `mLab` and seeking some clarifications.
As per [mlab documentation](http://docs.mlab.com/connecting/) it is mentioned to use `MongoDB Driver` for better security and performance instead of using `mLab Data API`.
But Is it a good practice to connect to MongoDB ... | 2017/12/15 | [
"https://Stackoverflow.com/questions/47828275",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | I definitely strongly recommend to provide your own Web API / restful API. The benefits are huge. I recommend making your android app completely mongodb agnostic. Behind your own API, you do what you like, you might want to be able to consider moving to another data store solution in the future. You make your applicati... | try stitch . it's still in beta and currently you can use it only on atlas but in some days you can use it locally also.Please go through the link
<https://www.mongodb.com/cloud/stitch> |
119,420 | shall i wait more or its hanged????
[](https://i.stack.imgur.com/j2w9y.png)
[2016-06-05 16:35:03 CEST] Job "maintenance\_mode {"enable":true}" has been started
[2016-06-05 16:35:03 CEST] Magento maintenance mode is enabled.
[2016-06-05 16:35:03 CEST]... | 2016/06/05 | [
"https://magento.stackexchange.com/questions/119420",
"https://magento.stackexchange.com",
"https://magento.stackexchange.com/users/40487/"
] | I was having the same problem when trying to upgrade from the web. I ended up trying to do the upgrade from the command line and it worked. Here are the commands I used to upgrade from the command line.
```
composer require magento/product-community-edition 2.1.0 --no-update
composer update
rm -rf var/di var/generat... | Don't wait longer. It doesn't take half an hour to update, unless you have slow internet or a slow computer I'd stop it and try again.
Also: You shouldn't be running Magento on localhost, set up a virtual host.
<https://john-dugan.com/wamp-vhost-setup/> |
40,967,422 | I have a question relating to scheduled jobs in SQL Server. Well, I guess it isn't exactly related to scheduled jobs, but in fact related to SQL queries.
Anyway I have 2 tables Table\_1 and Table\_2 in my database.
I wish to run a scheduled job every 5 minutes that would update Table\_2 with all the missing records f... | 2016/12/05 | [
"https://Stackoverflow.com/questions/40967422",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4529764/"
] | ```
DECLARE @TAB AS TABLE (Id int, Duplicate varchar(20))
INSERT INTO @TAB
SELECT 1, 'ABC' UNION ALL
SELECT 2, 'ABC' UNION ALL
SELECT 3, 'LMN' UNION ALL
SELECT 4, 'XYZ' UNION ALL
SELECT 5, 'XYZ'
DELETE FROM @TAB WHERE Id IN (
SELECT Id FROM (
SELECT
Id
,ROW_NUMBER() OVER (PARTITION BY [Duplicate... | First you create trigger on table 1
```
CREATE TRIGGER trgAfterupdate ON [sfs_test].dbo.[Table_1]
FOR update
AS
declare @empid int;
declare @empname varchar(30);
select @empid=i.UserID from inserted i;
select @empname=i.UserName from inserted i;
if update(UserID)
UPDATE [sfs_test2].dbo.[Table... |
133,570 | My background is in Electrical and Electronic Engineering.
Last year I paid and attended [android developer nano-degree by google](https://www.udacity.com/course/android-developer-nanodegree-by-google--nd801) course.
At the end of it I uploaded my [capstone](https://play.google.com/store/apps/details?id=theo.easy.n... | 2019/04/09 | [
"https://workplace.stackexchange.com/questions/133570",
"https://workplace.stackexchange.com",
"https://workplace.stackexchange.com/users/85518/"
] | There is a bit of a false dichotomy in your final question.
First of all, training courses are not considered professional (or commercial) experience, because it does not meet the definition of professional experience. There may be courses where you may have a placement within a professional environment, working on pr... | It's good to have a certain course completed from a widely-known certification authority (online of offline) and have the certificate, but most of the time, that counts towards your proficiency level and theoretical knowledge.
Majority of the cases, they are **not** considered as professional experience.
If you have... |
30,660,119 | I try to attach a click handler for links with a specific class within an anonymous function definition which is unfortunately not working. Why?
```
(function($) {
var init = function() {
console.log('init...');
mediaPlayer($('.media-toggle'));
};
var mediaPlayer = function(mediaLink) {
console.lo... | 2015/06/05 | [
"https://Stackoverflow.com/questions/30660119",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3703096/"
] | I missed a very important part on my example. A piece of JS code after this function is or was responsible for the not working code. Which removed all the event handlers by moving a parent div element (with all the links inside) to another part within the DOM tree.
Instead of
```js
$(".preview-audio").remove().insert... | You have defined a function `mediaPlayer` but you have a typo when calling it: `medialPlayer($('.media-toggle'));`
It's likely you would see an error in the console.
Also, make sure you've got this inside an `onload` or `$(document).on('ready')` function to ensure that the DOM node you're interested in (`.media-toggl... |
72,937,810 | So i made a template struct cause i want to be able to decide what type i give to my `val`. But when creating a function i don't know how to do it.
Here's what i'm doing:
**In my .hpp**
```
template<typename T>
struct Integer
{
T val;
void setUint(const T &input);
};
```
Now i can set what variable i want i... | 2022/07/11 | [
"https://Stackoverflow.com/questions/72937810",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/15469942/"
] | A template function is a way to operate with generic types (you may consider the type as an argument). Your template parameter `T` allows to pass different types to a function when you invoke the function (which means, simply said, you may replace `T` with some other types `int, double`, ...)
Please, have a look at th... | Also for templates, check if T actually matches your expectations. Your template will not make sense for types that are not Integers. Example on how to add these constraints here : <https://godbolt.org/z/YsneKe7vj> (both C++17 SFINAE, and C++20 concept)
```
#include <type_traits>
#include <string>
//-----------------... |
6,932,617 | So I am starting to learn C#, like literally just started learning, and coming from a Java background, it doesn't look too bad. However, I have a question. I am following [THIS](http://msdn.microsoft.com/en-us/library/ee857094%28office.14%29.aspx#SP2010ClientOM_Creating_Populating_List) tutorial on using the client-obj... | 2011/08/03 | [
"https://Stackoverflow.com/questions/6932617",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/810860/"
] | 1. Add required references to the solution.
2. Make sure that the **target framework is 4 for SP2013**(3.5 for SP2010). | Thanks to those who mentioned the 4.0 framework.
Mine defaulted to .NET Framework 4 Client Profile (and I have no idea what that means), and the Namespaces looked good in Intellisense, but the build would say they weren't found! Crazy. |
4,841,781 | I am not too familiar with queries but here is the question:
My 'neighbourhood' table has columns:
```
n_id, name, country_id, continent_id, city_id.
```
Where n\_id = PK and country\_id, continent\_id, city\_id are FKs to their own tables.
Sample data is:
```
34, Brooke, 23, 3, 1456
```
This output is good fo... | 2011/01/30 | [
"https://Stackoverflow.com/questions/4841781",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/570181/"
] | When you add duplicate names in the neighborhood table, you are de-normalizing it. De-normalization will make queries faster, especially if the load on your system is very high. But denormalization comes at a cost, because you must write and maintain additional code to keep your redundant data in sync.
I would keep 2 ... | The major disadvantage of your proposed denormalized design is that the correct referential integrity constraints and update actions become excessively complicated. If the data associated with City\_ID 1456 changes, you not only have to change the one row in the City table, you also have to change the stored value in e... |
3,277,172 | I want to use a pair from STL as a key of a map.
```
#include <iostream>
#include <map>
using namespace std;
int main() {
typedef pair<char*, int> Key;
typedef map< Key , char*> Mapa;
Key p1 ("Apple", 45);
Key p2 ("Berry", 20);
Mapa mapa;
mapa.insert(p1, "Manzana");
mapa.insert(p2, "Arandano");
return 0;
}
``... | 2010/07/18 | [
"https://Stackoverflow.com/questions/3277172",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/91945/"
] | `std::map::insert` takes a single argument: the key-value pair, so you would need to use:
```
mapa.insert(std::make_pair(p1, "Manzana"));
```
You should use `std::string` instead of C strings in your types. As it is now, you will likely not get the results you expect because looking up values in the map will be done... | Alternatively to what James McNellis stated:
```
mapa.insert(std::make_pair(p1, "Manzana"));
```
you could use `mapa.insert({p1, "Manzana"});` |
61,671 | When a space craft enters the atmosphere, it gets hot and heat shielding is needed. Do objects with more surface area and less density heat up less then heavier, smaller objects? Could an object with a large enough weight to area ratio be air cooled and not burn? I understand that when entering the atmosphere it is not... | 2023/01/28 | [
"https://space.stackexchange.com/questions/61671",
"https://space.stackexchange.com",
"https://space.stackexchange.com/users/35950/"
] | The heat to be dissipated by an object re-entering from orbit is $64$ megajoules per kilogram. There is no dependence here on density: that is the amount of kinetic energy it starts with and has to lose.
In a hyper-gradual re-entry the object can radiate the heat as it goes. But slow deceleration requires lower drag t... | >
> Do lighter objects heat less while entering the atmosphere?
>
>
>
They heat more, not less. The square-cube law comes into play. Heating is proportional to an object's surface area and inversely proportional to mass. All other things being equal, that means heating is inversely proportional to the square of an... |
42,598,475 | I would like to display IP cameras streaming in RTSP into a web page.
I've tried many solutions, like using VLC to transcode the stream, but none of them seems to be reliable enough to create a real web service.
I'm thinking on using some media server like flussonic or Red5. But I don't know if it will work.
This is ... | 2017/03/04 | [
"https://Stackoverflow.com/questions/42598475",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2654121/"
] | >
> ...to create a real web service.
>
>
>
I've been looking for an answer for the past two or three days (I need support on as many browsers as possible, and latency as low as possible, so WebRTC was the way to go (is there anything better?)) and I've finally found it.
Check out [this](https://github.com/deepch/... | You can integrate VLC library into your website and VLC will take care of everything you need for playing RTSP stream:
<https://wiki.videolan.org/index.php?title=HowTo_Integrate_VLC_plugin_in_your_webpage&action=edit&oldid=19150> |
8,972,758 | We have application that runs 24h per day and 7 days per week. Sometimes CPU go to 100% and then go back to 80%. The same with RAM. Is it smart to manually call `GC.Collect` after few hours or betterto leave it automatically.
We are using C# 2010, SQL 2008 and Fluent Nhiberanet. This is desktop application. | 2012/01/23 | [
"https://Stackoverflow.com/questions/8972758",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/267679/"
] | normally the framework itself will handle calling the GC when it's needed
you could try to run it without calling it yourself for a day | I would refrain from calling `GC.Collect` - exceptional cases as described [here](http://blogs.msdn.com/b/scottholden/archive/2004/12/28/339733.aspx) and [here](https://stackoverflow.com/a/478177/847363) aside.
IF you have any application running 24/7 then I would recommend the following:
* check real hard for memory... |
3,460,304 | Within a standard code block, should HTML appear exactly as written?
For example, if I put the following:
```
<code>
<script type="text/javascript">Something in javascript</script>
</code>
```
Should it appear exactly as above?
I assume the code button here on stackoverflow is doing something else other than just ... | 2010/08/11 | [
"https://Stackoverflow.com/questions/3460304",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/229558/"
] | There are certain characters that must be encoded even in the code block. My preference is converting the less than, greater than and ampersand. This handles most of the code. | No. `<code>` isn't even block-level. It also depends on whether you mean "traditional" HTML or XHTML. |
2,412,450 | I am writing a pre-commit hook. I want to run `php -l` against all files with .php extension. However I am stuck.
I need to obtain a list of new/changed files that are staged. deleted files should be excluded.
I have tried using `git diff` and `git ls-files`, but I think I need a hand here. | 2010/03/09 | [
"https://Stackoverflow.com/questions/2412450",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/289985/"
] | `git diff --cached --name-status` will show a summary of what's staged, so you can easily exclude removed files, e.g.:
```
M wt-status.c
D wt-status.h
```
This indicates that wt-status.c was modified and wt-status.h was removed in the staging area (index). So, to check only files that weren't removed:
`... | None of the answers here support filenames with spaces. The best way for that is to add the `-z` flag in combination with `xargs -0`
```
git diff --cached --name-only --diff-filter=ACM -z | xargs -0 ...
```
This is what is given by git in built-in samples (see **.git/hooks/pre-commit.sample**) |
1,078,319 | I am trying to get a better feel for both the exterior derivative of a form and the contraction of a form by a vector field $X$.
Basically, when are these inverses? If I have a one-form $\omega$ and I compute $dw$, getting a 2-form. When can I find a vector field $X$ so that $w = i\_Xdw$? Is there a general result de... | 2014/12/23 | [
"https://math.stackexchange.com/questions/1078319",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/197865/"
] | Here is an example Python code that solves the optimization problem suggested by @DeepSea
```
import casadi as ca
opti = ca.Opti()
# Line segment
t = opti.variable()
line_seg = opti.bounded(0, t, 1)
p0 = (-4.0, 0.5)
p1 = (-2.0, 1.5)
x = (1 - t) * p0 + t * p1
# Circle
y = opti.variable(2)
circ = y[0]**2 + y[1]**2 == ... | Assuming that you are talking about the perpendicular distance of a point on the circle closest to the given line.
equation of line $P\_1P\_2$ is $(y-y\_1)=\dfrac{y\_2-y\_1}{x\_2-x\_1}(x-x\_1)$
The formulae for the distance will be $\perp$ distance from the center of the circle to the line - radius of the circle. bec... |
11,182,725 | I'm writing a fairly complicated multi-node proxy, and at one point I need to handle an HTTP request, but read from that request outside of the "http.Server" callback (I need to read from the request data and line it up with a different response at a different time). The problem is, the stream is no longer readable. Be... | 2012/06/25 | [
"https://Stackoverflow.com/questions/11182725",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/23837/"
] | Each bit level has a pattern consisting of `2^power` 0s followed by `2^power` 1s.
So there are three cases:
1. When `M` and `N` are such that `M = 0 mod 2^(power+1)` and `N = 2^(power+1)-1 mod 2^(power+1)`. In this case the answer is simply `(N-M+1) / 2`
2. When `M` and `N` are such that both M and N = the same numbe... | It can be kept as simple as -
Take x1 = 0001(for finding 1's at rightmost column), x2 = 0010, x3 = 0100 and so on..
Now, in a single loop -
```
n1 = n2 = n3 = 0
for i=m to n:
n1 = n1 + (i & x1)
n2 = n2 + (i & x2)
n3 = n3 + (i & x3)
```
where -
ni = number of 1's in i'th column(from right) |
61,357,383 | I would like to label my plot, possibly using the equation method from ggpmisc to give an informative label that links to the colour and equation (then I can remove the legend altogether). For example, in the plot below, I would ideally have the factor levels of 4, 6 and 8 in the equation LHS.
```
library(tidyverse)
l... | 2020/04/22 | [
"https://Stackoverflow.com/questions/61357383",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4927395/"
] | What about a manual solution where you can add your equation as `geom_text` ?
Pros: Highly customization / Cons: Need to be manually edited based on your equation
Here, using your example and the linear regression:
```r
library(tidyverse)
df_label <- df_mtcars %>% group_by(factor_cyl) %>%
summarise(Inter = lm(mpg... | An alternative to labelling with the equation is to label with the fitted line. Here is an approach adapted from an answer on a related question [here](https://stackoverflow.com/a/61362537/4927395)
```
#example of loess for multiple models
#https://stackoverflow.com/a/55127487/4927395
library(tidyverse)
library(ggpmis... |
4,197,674 | I have the following setup:
```
CREATE TABLE dbo.Licenses
(
Id int IDENTITY(1,1) PRIMARY KEY,
Name varchar(100),
RUser nvarchar(128) DEFAULT USER_NAME()
)
GO
CREATE VIEW dbo.rLicenses
AS
SELECT Name
FROM dbo.Licenses
WHERE RUser = USER_NAME()
GO
```
When I try to insert data using the view...
```
INSER... | 2010/11/16 | [
"https://Stackoverflow.com/questions/4197674",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/509905/"
] | You just need to specify which columns you're inserting directly into:
```
INSERT INTO [dbo].[rLicenses] ([Name]) VALUES ('test')
```
Views can be picky like that. | ```
INSERT INTO dbo.rLicenses
SELECT 'test'
```
Based on [sqlhack](https://www.sqlshack.com/create-view-sql-inserting-data-through-views-in-sql-server/) in chapter "Data modifications through views" |
381,772 | I want to submit the values of a flex form to a ColdFusion cfc.
If I have a flex form (see below) is the data in the form an object? Or do I have to create an object based on the id's in the form and then pass that new object to the coldfusion component?
```
<mx:Form x="10" y="10" width="790" id="myFrom" defaultButt... | 2008/12/19 | [
"https://Stackoverflow.com/questions/381772",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/24563/"
] | I think in the late 70s it was called [time-sharing](https://en.wikipedia.org/wiki/Time-sharing) :) | 1) They've been using it for years, so I'm thinking yeah.
2) They have web browsers, so yeah.
3) O yes my brothers.
4) The vogue for the term, where it's used like it has some kind of cosmic significance that "Web 2.0" and "software as a service" didn't, is definitely overdone and will fizzle, and it really can't ha... |
20,471,181 | I am using Android 4.3 on VirtualBox, for testing apps. However, I'm running the VM on my computer, which is behind a proxy (without DHCP), so I cannot connect to the Internet from the VM.
What I need to accomplish:
1. Setup the Android machine to use a static IP (192.168.1.213/24, with gateway 192.168.1.1)
2. Setup ... | 2013/12/09 | [
"https://Stackoverflow.com/questions/20471181",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1374462/"
] | This article about [Android x86: setting-up IP Address using command line](http://tutorialtabai.blogspot.com/2013/05/android-x86-setting-up-ip-address.html) may helpful to you.
Proxy setup
```
sqlite3 /data/data/com.android.providers.settings/databases/settings.db
INSERT INTO system VALUES(99, 'http_proxy', '<proxy_s... | The above answers only work on Android < 6.
If you are using something newer, the following has worked for me
Alt + F1 to get into the shell
```
settings put global http_proxy <address>:<port>
``` |
50,111,863 | First of all I know that there are many questions already regarding this.After reading all answers and trying it out ..but none of them worked.So I'm uploading a question here.Please don't delete it.
So,I created a html file with a form and then sent the form data using ajax jQuery to PHP file as follows.
```
$("#for... | 2018/05/01 | [
"https://Stackoverflow.com/questions/50111863",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/8420732/"
] | You can use javascript getelementbyid as following:
```
document.getElementById("login-button").click();
``` | The only way it comes to my mind to do it is using jQuery to select the element (button) and then trigger the click:
```
$( "#login-button" ).trigger( "click" );
```
Try it and let us know if it works, here you are a JSFiddle: [link](https://jsfiddle.net/vhbazan/mesg71ww/) |
345,704 | I was wondering when and how the expression "Whatever floats your boat", meaning "What makes you happy; what stimulates you" ([Wiktionary](https://en.wiktionary.org/wiki/whatever_floats_your_boat)) came to be.
My research hasn't yielded anything which could be described as objective. Thus, I'll leave the urban diction... | 2016/08/30 | [
"https://english.stackexchange.com/questions/345704",
"https://english.stackexchange.com",
"https://english.stackexchange.com/users/184706/"
] | First off, the question of origin for such a colloquial phrase is a hard one to answer. Oral language is often only documented after it has been in use for some time, and anything before the first documented use is going to involve a lot of guesswork. This answer will give (a) predecessors that used similar "whatever v... | The idiom, ***whatever floats your boat***, could refer to the American slang, *floating*, meaning *high* or intoxicated by drugs. The term [“whatever”](https://en.wikipedia.org/wiki/Whatever_(slang)) also hints that the speaker is indifferent to the outcome or choice about to be made.
The following extract is from t... |
3,985,886 | $(a+c)(b+d)=1$, $a,b,c,d \in R^{+}$. Prove that
$$\frac{a^3}{b+c+d} + \frac{b^3}{a+c+d} + \frac{c^3}{a+b+d} + \frac{d^3}{a+b+c} \geq \frac{1}{3}$$
rather annoying that the powers of denominators and numerators are not the same and can't think of easy way to flatten them.. | 2021/01/15 | [
"https://math.stackexchange.com/questions/3985886",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/219483/"
] | **Hint**: Use holders inequality
>
> $$\left(\sum\_{cyc} \frac{a^3}{b+c+d}\right)(1+1+1+1)\left(\sum\_{cyc} b+c+d\right)\ge {\left(\sum\_{cyc} a\right)}^3$$
>
>
>
>
> Apply AM-GM inequality :$$a+b+c+d\ge 2\sqrt{(a+c)(b+d)}$$ to finish
>
>
> | The naive Titu also works
WTS
$$ \sum\_{cyc} \frac{a^3}{b+c+d} = \sum\_{cyc} \frac{ a^4 } { ab+ac+ad } \geq \frac{ (\sum a^2 )^2 } { 2 ( ab+ac+ad+bc+bd+da) } \geq \frac{1}{3}.$$
This follows because
>
> 1. $ a^2 + b^2 + c^2 + d^2 \geq \frac{ 2}{3} ( ab+ac+ad+bc+bd+da)$, and
>
>
>
>
> 2. $a^2 +b^2 + c^2 + d^... |
576,417 | I was trying to install Cinnamon from Source code in a CentOS v.6.4.
Unfortunately, I was stumbling upon dependencies that were becoming weird each and every time.
Some of them, I tried to build, but didn't work. They needed things like GTK+ of certain version that wasn't available for CentOS.
Do you know if there i... | 2013/04/01 | [
"https://superuser.com/questions/576417",
"https://superuser.com",
"https://superuser.com/users/206520/"
] | Cinnamon 2.0 is now available in CentOS 7. You can install it from the epel repository.
You can also install the latest Cinnamon 2.8 from epel-testing:
```
yum install --enablerepo=epel-testing cinnamon*
``` | You can always use an [RPM search engine](http://rpm.pbone.net/) to find a [`cinnamon` RPM](http://rpm.pbone.net/index.php3?stat=26&dist=0&size=1513965&name=cinnamon-1.4-1.src.rpm) and install that way. Just download the RPM and install using
```
rpm -ivh cinnamon-1.4-1.src.rpm
``` |
68,769,380 | I have this recyclerview
```
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/serviceRecyclerView"
android:layout_width="match_parent"
android:layout_height="0dp"
app:layout_constraintTop_toBottomOf="@+id/addNewServiceBtn"
app:layout_constraintBottom_toBottomOf="parent"
android:paddi... | 2021/08/13 | [
"https://Stackoverflow.com/questions/68769380",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/16316184/"
] | I haven't tried with your code but putting your recyclerview inside of scrollview might solve your problem. When keyboard opens screen will scroll and try to fit content to the the screen :
```
<androidx.core.widget.NestedScrollView
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://s... | Just add
```
android:windowSoftInputMode="adjustResize"
```
or
```
android:windowSoftInputMode="adjustPan|adjustResize"
```
or
you can add this line in your onCreate
```
getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_VISIBLE|WindowManager.LayoutParams.SOFT_INPUT_ADJUST_RESIZE);
``` |
17,360,847 | Code that requires `break` statements or `continue` statements in other languages can be done with `block` & `return-from` or `catch` & `throw` in Common Lisp and Emacs Lisp. Then there is code that requires `redo` statements, or at least best written with `redo`. And `redo` statements don't have to be about loops. How... | 2013/06/28 | [
"https://Stackoverflow.com/questions/17360847",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1446335/"
] | In Common Lisp:
```
(tagbody
start
(do-something)
(go start))
(dotimes (i some-list)
redo
(when (some-condition-p)
(go redo))
(some-more))
``` | **Update: Emacs 24.4 (soon to be released) has tagbody. cl-lib that comes with Emacs 24.4 includes cl-tagbody.**
For a dialect of Lisp which doesn't have tagbody, one can still implement redo as long as the dialect has a catch/throw equivalent.
For Emacs Lisp:
```
;; with-redo version 0.1
(defmacro with-redo (tag &r... |
8,642 | If a congregation forgot to say *birkas hachodesh* on the *Shabas* before *rosh chodesh*, should it say it another time? When? (Does it, perhaps, depend on what day(s) of the week *rosh chodesh* is?)
Note: AFAICT, *Shaare Efrayim* and *Mishna B'rura* say nothing about this. | 2011/07/03 | [
"https://judaism.stackexchange.com/questions/8642",
"https://judaism.stackexchange.com",
"https://judaism.stackexchange.com/users/170/"
] | Nitei Gavriel, in the introduction to the second volume of his Laws of Niddah, quotes the Sefer Imrei Yehudah Al Hatorah. (It starts [here](http://www.hebrewbooks.org/pdfpager.aspx?req=46550&st=&pgnum=40), but the part that's relevant to us is [here](http://www.hebrewbooks.org/pdfpager.aspx?req=46550&st=&pgnum=41)).
T... | The laws of Kiddush HaChodesh, when to make 2 days or 1 day Rosh Chodesh, and when to make a leap year. |
45,557,161 | I'm trying to make a program that counts the number of vowels in a sentence, but for some reason my for-loop keeps iterating by 2 (figured this out by printing out the value of i during each iteration). What's wrong with it?
```
//input
Scanner input = new Scanner(System.in);
String sentence;
//prompt
... | 2017/08/07 | [
"https://Stackoverflow.com/questions/45557161",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/8431324/"
] | There are two times when you're incrementing `i` , once in your for loop definition, and once in your `sentence.substring`
Any time you put `i++` the variable `i` will be increased by 1, regardless of it being in the for loop's definition or in another part of the loop.
```
for(int i = 0; i < sentence.length(); i++)
... | I suggest you don't use the `substring` method as it creates a new string from the original string.
**From the documentation:**
```
String substring(int beginIndex)
Returns a new string that is a substring of this string.
```
Instead, use the `charAt` method which returns the character value at the specified index... |
18,780,043 | I have some content in div, basically div will be hide, now i want when i press button the div content will be show with fadeIn function, now my problem i want show the div content one by one means one alphabet fadeIn then other but in my case it will be done word by word.
HTML
```
<div>
<span> THIS IS EXAMPLE ... | 2013/09/13 | [
"https://Stackoverflow.com/questions/18780043",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2331073/"
] | The trick is to split your span into smaller spans, one for every letter, and to use `setTimeout` to fade those spans one after the other :
```
$("input[type=button]").click(function(){
var $div = $('div');
$div.html($div.text().split('').map(function(l){
return '<span style="display:none;">'+l+'</span>'
}... | [**DEMO**](http://jsfiddle.net/cse_tushar/jYz6J/)
```
$(function () {
$('#test').click(function () {
var dest = $('div span#char');
var c = 0;
var string = dest.text();
dest.text('').parent().show();
var q = jQuery.map(string.split(''), function (letter) {
return... |
33,224,761 | I've implemented a function that returns a string. It takes an integer as a parameter (`age`), and returns a formatted string.
All is working well, except from the fact that I have some crazy memory leaks. I know strdup() is the cause of this, but I've tried to research some fixes to no avail.
My code is:
```
const... | 2015/10/19 | [
"https://Stackoverflow.com/questions/33224761",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | strdup() is essentially equivalent to
```
char* dup = malloc(strlen(original) + 1);
strcpy(dup, original);
```
So you need to remember to call `free()` after you're finished using the string.
```
const char* name = returnName(20);
/* do stuff with name */
free((void*)name);
```
If you don't call `free()`, then o... | **strdup** looks something like this:
```
char *strdup(const char *str){
size_t n = strlen(str) + 1;
char *dup = malloc(n);
if(dup){
strcpy(dup, str);
}
return dup;
}
```
As you can see there is `malloc` involved too, which means that at some point after you dynamically allocate that me... |
15,556,341 | I have a JTable with multiple rows and every row is presented via Point on a scatter plot. What I have to do is when a given point is selected on the scatter plot I have to associate this selection with selecting of the corresponding row in the JTable.
I have an Integer that represents, which row I have to highlight.
... | 2013/03/21 | [
"https://Stackoverflow.com/questions/15556341",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1479895/"
] | It also works without using the ListSelectionModel:
```
table.clearSelection();
table.addRowSelectionInterval(1, 1);
table.addRowSelectionInterval(15, 15);
table.addRowSelectionInterval(28, 28);
...
```
Just don't call the setRowSelectionInterval, as it always clears the current selection before. | There is no way to set a random selection with a one method call, you need more than one to perform this kind of selection
```
table.setRowSelectionInterval(1, 1);
table.addRowSelectionInterval(15, 15);
table.setRowSelectionInterval(28, 28);
table.addRowSelectionInterval(188 , 188 );
```
And So On.... |
33,470,993 | I have a string:
```
1 Vectorial position [X Y] X 682.9 1.0 -1.0 X 682.6 X -0.3 ----.-----
```
In this string there are spaces which are to be replaced by any special character for splitting the string.
Required output is:
```
1 ~ Vectorial position [X Y] ~ X ~ 682.9 ~ 1.0 ~ -1.0 ~ X ~ 682.6 ~ X ~-0.3 ~ ----.---... | 2015/11/02 | [
"https://Stackoverflow.com/questions/33470993",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5506017/"
] | I would split the original string on spaces, and then do some creative field extraction: I assume the first word and the last 9 words in the string are separate fields, and what's left over is to become the 2nd field in the output.
```
$str = "1 Vectorial position [X Y] X 682.9 1.0 -1.0 X 682.6 X -0.3 ----.-----";
@wo... | I would split your data into a description and data, and then operate on the data. This makes it easier to understand and debug.
```
#!/usr/bin/perl
use warnings;
use strict;
my $str = '1 Vectorial position [X Y] X 682.9 1.0 -1.0 X 682.6 X -0.3 ----.-----';
my ($description, $data) = $str =~ m|^(.*\])(.*)$|; # $1 - ... |
528,759 | I would like to draw the following images on my paper. I tried to import the image using `graphicx`, but LaTeX could not find it (the image is in the same file as my `tex`), so I decided to draw them out. Please teach me what package to use and what code would display the following images. Thank you!
[![enter image de... | 2020/02/17 | [
"https://tex.stackexchange.com/questions/528759",
"https://tex.stackexchange.com",
"https://tex.stackexchange.com/users/207127/"
] | This code requires the [experimental library `3dtools`](https://github.com/tallmarmot/pgf/tree/master/experiments/Marmot/3dtools).
```
\documentclass[tikz,border=3mm]{standalone}
\usepackage{tikz-3dplot}
\usetikzlibrary{backgrounds,3dtools,shapes.geometric}
\tikzset{pics/isocahedron/.style={code={
\path foreach \Coor... | Please see if this meets the requirement
[](https://i.stack.imgur.com/6UNGV.png)
```
\documentclass[a4paper]{amsart}
\usepackage{graphics, tkz-berge}
\begin{document}
\begin{figure}
\begin{tikzpicture}
\begin{scope}[rotate=90]
\SetVertexNoLabel... |
24,270,637 | I was trying out few examples on do's and dont's of typecasting. I could not understand why the following code snippets failed to output the correct result.
```
/* int to float */
#include<stdio.h>
int main(){
int i = 37;
float f = *(float*)&i;
printf("\n %f \n",f);
return 0;
}
```
Th... | 2014/06/17 | [
"https://Stackoverflow.com/questions/24270637",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/713179/"
] | Read about the representation of floating point numbers in systems. Its not the way you're expecting it to be. Cast made through `(float *)` in your first snippet read the most significant first 16 bits. And if your system is little endian, there will be always zeros in most significant bits if the value containing in ... | If you need to convert int to float, the conversion is straight, because the promotion rules of C.
So, it is enough to write:
```
int i = 37;
float f = i;
```
This gives the result `f == 37.0`.
However, int the cast `(float *)(&i)`, the result is an object of type "pointer to float".
In this case, t... |
24,263,648 | Can't understand, why buttons are not identical in their sizes. Earlier, I used LinearLayout instead of RelativeLayout as a root, but after some googling I understand, there is no chance to make footer with LL, so I make it RL and adjusted by coping previous LL with buttons to RL, but.. [Look at this. I found it with r... | 2014/06/17 | [
"https://Stackoverflow.com/questions/24263648",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2653714/"
] | As noted in the comments, `isPrime` only needs to evaluate the result of `factorsOf` deeply enough to determine if it is an empty list or not. You could write `isPrime` more idiomatically like this:
```
isPrime = null . factorsOf
```
where null is simply
```
null (_:_) = False
null _ = True
```
Note that as soon ... | The basic principle of laziness is that nothing is evaluated unless it is really really needed. Really needed in your case means that the first function must return so that the other function gets its input. You can read more about Haskell's Laziness [here](http://en.wikibooks.org/wiki/Haskell/Laziness) |
30,587,459 | ```
#include "stdafx.h"
int main() {
char name;
printf("What is your name:"); // I enter my name..
scanf_s("%c", &name); // Should grab my name in this case (Brian)
printf("Hello, %c\n", name); //Should print "Hello, Brian."
return 0;
}
```
What's wrong? Why is it not storing the whole name and ... | 2015/06/02 | [
"https://Stackoverflow.com/questions/30587459",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4682427/"
] | @BeforeMethod - executes before every test method e.g. The Method which uses @Test annotation
@BeforeTest - executes only before tag given in testng.xml file.
In a nutshell, @BeforeMethod works on test defined in Java classes.
And @BeforeTest works on test defined in testng.xml i.e XML files. | ```
@BeforeClass: The annotated method will be run before the first test method in the current class is invoked.
@BeforeMethod: The annotated method will be run before each test method.
The annotations above will also be honored (inherited) when placed on a superclass of a TestNG class. This is useful for example to ... |
32,453,461 | CORS is enabled and working.
We have a Cordova App which is syncing fine the first time it connects to the CouchDB. After that the db.sync() is not working. Only if we go offline and online with the Fly-mode it syncs again for a short time.
We have a angular.factory which creates the local pouch db and sets up the ... | 2015/09/08 | [
"https://Stackoverflow.com/questions/32453461",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4862292/"
] | Ok, I just figured out what the error means... :-) I have to create the new directory in advance and now I can copy everything...
```
dir.create('new_folder')
file.copy("my_folder", "new_folder", recursive=TRUE)
```
This works as expected. | I'd rather write an R function that copies the directory using the Terminal. Here's what I use, but note that I wrote it only for Linux and OSX thus far.
```
dir.copy <- function(from, to) {
os <- Sys.info()['sysname']
if (os == "Darwin" || os == "Linux") {
command <- sprintf("cp -R '%s' '%s'", from, to)
s... |
57,882,874 | I was using SQL statement to bring an aggregate (MAX) for a column and rest of the columns should come from that row. I was using group by clause but for other columns I must also use either max or min, etc. This was budget oriented project so I could not have time to do it using LINQ. (Where I could have used first or... | 2019/09/11 | [
"https://Stackoverflow.com/questions/57882874",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/11205838/"
] | Your question is a bit light on details but it sounds like you want to know, for some set of items, which item has the maximum of something and then what it’s other properties are.
You cannot group by all the non max columns because this breaks the group down into too small chunks to make the max work
You cannot max... | You don't want a `group by`. You seem to want a window function:
```
select t.*, max(col) over () as overall_max
from t;
``` |
12,781,830 | I want Radio Group implementation on GridView, so that only single item can be selected among the elements of grid.
Please help. | 2012/10/08 | [
"https://Stackoverflow.com/questions/12781830",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1383964/"
] | The purpose to restrict the select of element from the grid can be accomplished as follows:
1.Creation of Grid element.
```
<LinearLayout
android:id="@+id/item_layout"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical"
android:gravity="center... | An alternative approach to this is to create your own subclass of `RadioButton` which has an extra XML attribute (such as `group`). This specifies (as a string) to which group the button belongs. In the subclass, you then ensure that within any particular group, only one radio button is selected.
You can do this as fo... |
27,122,426 | ```
$table_name = $wpdb->prefix . 'offline_card';
// function to create the DB / Options / Defaults
function offline_card_install() {
global $wpdb;
global $table_name;
// create the ECPT metabox database table
if($wpdb->get_var("show tables like '$table_name'") != $table_name)
... | 2014/11/25 | [
"https://Stackoverflow.com/questions/27122426",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2812955/"
] | Please see a working example of how to delete a row here.
<http://plnkr.co/edit/6TiFC6plEMJMD4U6QmyS?p=preview>
The key is to use `indexOf(row.entity)` and not relying on `row.index` as it doesn't dynamically get updated.
```
$scope.deleteRow = function(row) {
var index = $scope.gridOptions.data.indexOf(row.entity)... | Just remove the row you want to delete from ui-grids data source model using splice.
For example
```
$scope.myGridOptions.data.splice(<YOUR ROW INDEX HERE>, 1);
``` |
44,080,870 | I Have to draw Herringbone pattern on canvas and fill with image
----------------------------------------------------------------
some one please help me I am new to canvas 2d drawing.
I need to draw mixed tiles with cross pattern (Herringbone)
```
var canvas = this.__canvas = new fabric.Canvas('canvas');
var can... | 2017/05/20 | [
"https://Stackoverflow.com/questions/44080870",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7015792/"
] | Trippy disco flooring
---------------------
To get the pattern you need to draw rectangles one horizontal tiled one space left or right for each row down and the same for the vertical rectangle.
The rectangle has an aspect of width 2 time height.
Drawing the pattern is simple.
Rotating is easy as well the harder pa... | The best way to approach this is to examine the pattern and analyse its symmetry and how it repeats.
You can look at this several ways. For example, you could rotate the patter 45 degrees so that the tiles are plain orthogonal rectangles. But let's just look at it how it is. I am going to assume you are happy with it ... |
49,347,055 | I have the following code:
```
x = range(100)
M = len(x)
sample=np.zeros((M,41632))
for i in range(M):
lista=np.load('sample'+str(i)+'.npy')
for j in range(41632):
sample[i,j]=np.array(lista[j])
print i
```
to create an array made of sample\_i numpy arrays.
sample0, sample1, sample3, etc. are n... | 2018/03/18 | [
"https://Stackoverflow.com/questions/49347055",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7702895/"
] | Please configure you JPA Configuration as per your requirement. I've configured as below. You need to add below configuration in application.properties file.
```
# PROFILES
spring.profiles.active=dev
# JPA (JpaBaseConfiguration, HibernateJpaAutoConfiguration)
spring.jpa.generate-ddl=true
spring.jpa.hibernate.ddl-auto=... | The default driver used by derby is `org.apache.derby.jdbc.AutoloadedDriver`, but springboot and other framework choice `org.apache.derby.jdbc.EmbeddedDriver`.
It causes the driver to be unable to find the driver when using the datasource for the first time.
About `Schema 'SA' does not exist`.
I think that you use th... |
7,715,009 | Im trying to post some information in my api which is programmed using WCF Web Api. In the client, I'm using restsharp which is a rest client for restful services. However, when I try to post adding some parameters to the request, the post method in the service is never called, and my response object in the client gets... | 2011/10/10 | [
"https://Stackoverflow.com/questions/7715009",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/925714/"
] | Well after going around this problem over and over again, I finally found a solution, however, I can't explain why this is happening.
I replaced the addParameter method for addBody, and everything worked as expected, I could post information on the server.
The problem seems to be that whenever I'm adding parameters t... | I'm not familiar with the objects you're calling but is game.Name a string? If it's not, that might explain why AddParameter is failing. |
106,267 | I have a hard drive with a virus that I removed from a PC. I can scan the file system of it as an attached USB drive. But how do I scan the registry of that USB drive since it is not booted up like a regular hard drive?
To clarify, the USB drive was a regular hard drive in a PC that got infected. I cannot boot into th... | 2010/02/08 | [
"https://superuser.com/questions/106267",
"https://superuser.com",
"https://superuser.com/users/7498/"
] | What you want to do is called 'offline registry editing'. You can load the registry hives from the old hard disk drive into your registry editor. Here's a tutorial:
*[Load registry hive for offline registry editing](http://smallvoid.com/article/winnt-offline-registry-edit.html)*
However, I'd recommend to use BartPE i... | You might not need to worry about scanning the registry file on the infected drive.
Removing the infected files by the scans you are able to run (antivirus and antimalware/spyware) will most likely kill the infections. The registry entries will now point to missing files and so on... most likely. Put the drive back i... |
303,160 | I tried to install **DIA** from the **Software Center** and from the **Terminal** (dia and dia-gnome), but it didn't seem to work. I couldn't find DIA in the **Application Menu** and I also couldn't find it by searching.
Any ideas? | 2013/06/02 | [
"https://askubuntu.com/questions/303160",
"https://askubuntu.com",
"https://askubuntu.com/users/163825/"
] | Dia cannot be found in the application centre. You have to launch by typing the command `dia` from the terminal or from Alt+F2.
I think this is a bug in 13.04.
Hope this helps. | >
> Dia is an editor for diagrams, graphs, charts etc. There is support
> for UML static structure diagrams (class diagrams),
> Entity-Relationship diagrams, network diagrams and much more. Diagrams
> can be exported to postscript and many other formats.
>
>
>
This package contains the GNOME version of Dia.
To... |
24,098,464 | I am making a bat file which will change the extension then move it to another folder
I have managed to do the replace part like so:
```
ren *.txt *.jpg
```
However I would like to move all .jpg file without moving the .bat file that renamed them.
Thank you. | 2014/06/07 | [
"https://Stackoverflow.com/questions/24098464",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | Just use [move](http://technet.microsoft.com/en-us/library/cc772528%28v=ws.10%29.aspx):
```
ren *.txt *.jpg
move *.jpg \NewDestination
```
Of course, you should replace `\NewDestination` with the actual path to the folder on your system where you want the files to be moved.
I find the [TechNet Command Line Referenc... | you can use something like:
```
move dir1\*.jpg dir2\...
``` |
71,555,622 | I want to add to the user all possible group memberships in the Azure Active Directory, but there are so many groups so I dont want to do it manually, is there any script or button to do this quickly? | 2022/03/21 | [
"https://Stackoverflow.com/questions/71555622",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/12398280/"
] | • Yes, you can surely do that through a powershell script wherein you would need to export the details of all the groups present in Azure AD to a CSV file or to the console. And then call every group to add the said user whose object ID is specified in the powershell command to every group. Please find the below prepar... | Kartik and Vineesh answers are pretty good, but If you want to get all available groups and you are already a member of some groups you should use this script
```
try
{
Connect-AzureAD
$groups=Get-AzureADGroup -All $true ` | Select-Object ObjectID
foreach($group in $groups) {
$Members = $group | Get... |
64,936,541 | I want to make one list of multiple sublists without using the `flatten` predicate in Prolog.
This is my code:
```ml
acclistsFromList([],A,A).
acclistsFromList([H|T],Listwithinlist,A):-
not(is_list(H)),
acclistsFromList(T,Listwithinlist,A).
acclistsFromList([H|T],Listwithinlist,A):-
is_list(H),
append([H],L... | 2020/11/20 | [
"https://Stackoverflow.com/questions/64936541",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/14676776/"
] | This is a one-liner,
```ml
foo(X,L) :-
findall(Z, (member(A,X),is_list(A),member(Z,A)), L).
```
(as seen [here](https://stackoverflow.com/a/64919078/849891)).
To deal with multi-layered nested lists, we need to use a recursive predicate,
```ml
nembr(Z,A) :- % member in nested lists
is_list(A), member(B,A),... | A solution that uses an "open list" to append the elements encountered while walking the list-of-lists, which is essentially a tree, in prefix fashion.
The indicated examples indicate that non-list elements at depth 0 shall be discarded, and the other elements sorted by depth. However, no precise spec is given.
Indee... |
18,782,291 | I have two objects in two separate files:
```
import FooResults = require('fooresults');
class FooViewModel {
Results = ko.observable<FooResults[]>();
}
export = FooViewModel;
```
And:
```
class FooResults {
Id = ko.observable<number>();
Text = ko.observable<string>();
}
export = FooResults;
```
But `... | 2013/09/13 | [
"https://Stackoverflow.com/questions/18782291",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1369663/"
] | you can try this. `R+` will replace one or more `R`
```
String str = "i want hello RRRRRRRRRRRR My name RRR is RRRRRRRR arvind RR";
System.out.println(str.replaceAll("R+","A"));
``` | ```
String input = "i want hello RRRRRRRRRRRR My name RRR is RRRRRRRR arvind RR";
String output = input.replaceAll("R+" "A")
``` |
58,414,577 | My app running on Swift UI, and my main page is `Home()`, In the home page there is `NavigationView` and `NavigationLink(destination: SaveThePlanet())`, I have hide the Navigation View on the main page "Home", its also hide in `SaveThePlanet()`.
How can I unhide the navigation back button in the `SaveThePlanet()` page?... | 2019/10/16 | [
"https://Stackoverflow.com/questions/58414577",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/12226760/"
] | I'm answering because I think the solution nowadays is pretty easier. So for people having the same problem just add a
```
.navigationBarHidden(true)
```
on your Home() component and you should be fine. This solution works for sure in Swift 5.5, there is to do the onAppear and onDisappear trick of the other answers.... | It's a little hard to tell based on the code you've posted, but it looks like you are trying to present a view that slides up from the bottom when `showSaveThePlanet` is true, and also show the navigation bar only when that view appears.
This can be accomplished by setting `.navigationBarHidden(!showSaveThePlanet)` an... |
31,263,567 | I'm new in Javascript and i'm good familiar with `Thread.sleep` in Java. As far as i know, Javascript uses `setTimeout` which is similar to `Thread.sleep`.
I'm using `phantomjs` to print my thread:
```
function doThing(i){
setTimeout(function(){
console.log(i);
}, 100);
}
for(var i=1; i<20; i++){ ... | 2015/07/07 | [
"https://Stackoverflow.com/questions/31263567",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5088561/"
] | Try this
```
function doThing(i, last){
setTimeout(function(){
console.log(i);
if (last) phantom.exit();
}, 100 * i);
}
for(var i=1; i<20; i++){
doThing(i, i >= 19);
}
```
There are 2 fixes in this code (in comparison to origin):
1. phantom.exit() must be called just after last oper... | Java and javascript are separate languages. So you can't compare features of those languages. setTimeout executes the block of code after a specified interval.
<http://www.w3schools.com/jsref/met_win_settimeout.asp> |
19,824,312 | Given the following JSON
```
$first = array('code'=>'200','message'=>'ok');
{
"code": "200",
"message": "ok"
}
$second = array("user"=>array('fname'=>'Fred','lname'=>'Flintstone','status'=>'1'))
{
"user": [
{
"fname": "Fred",
"lname": "Flintstone",
"status": "1"
}
]
}
```
How do I co... | 2013/11/06 | [
"https://Stackoverflow.com/questions/19824312",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/505055/"
] | Try merging the arrays
```
$json = json_encode(array_merge($first, $second));
``` | using [array\_merge](http://php.net/manual/en/function.array-merge.php) you can combine the arrays then encode it:
```
//arrays
$first = array('code'=>'200','message'=>'ok');
$second = array("user"=>array('fname'=>'Fred','lname'=>'Flintstone','status'=>'1'));
//merging
$merged_arrays = array_merge($first, $second);
p... |
21,191 | Is this even possible? Can a Tor binary file be compiled to work on Linux, Windows, OSX, iOS, and Android? We would like to package the binary file so we can launch Tor from our application. Could we build Tor from source on a Linux computer for the different CPU architectures? Is the Tor binary all we need? We current... | 2020/05/09 | [
"https://tor.stackexchange.com/questions/21191",
"https://tor.stackexchange.com",
"https://tor.stackexchange.com/users/-1/"
] | This [defcon 22 talk](https://www.youtube.com/watch?v=tlxmUfnpr8w) covers most of the possible ways to get caught using Tor:
* All tor nodes are known (except bridges). ISP or system administrator can figure out who was using tor at a given time and from what IP. That information can be used to narrow down who is usin... | There is many steps he did wrong that got him caught.
Most of them are not related to tor\exit nodes directly.
>
> 1. He boasted about running his international multimillion dollar drugs marketplace on his LinkedIn profile
> 2. He used a real photograph of himself for a fake ID to rent servers to run his internationa... |
36,245,037 | I would like to be able to find the first occurrence of m² and then numbers in front of it, could be integers or decimal numbers.
*E.g.*
>
> "some text" 38 m² "some text" ,
>
>
> "some text" 48,8 m² "some text",
>
>
> "some text" 48 m² "some text", etc..
>
>
>
What I have so far is:
```
\d\d,\d\s*(\m\u00B2)|... | 2016/03/27 | [
"https://Stackoverflow.com/questions/36245037",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2757390/"
] | To get the first match, you just need to use `Matcher#find()` inside an `if` block:
```
String rx = "\\d+(?:,\\d+)?\\s*m\\u00B2";
Pattern p = Pattern.compile(rx);
Matcher matcher = p.matcher("E.g. : 4668,68 m² some text, some text 48 m² etc");
if (matcher.find()){
System.out.println(matcher.group());
}
```
See ... | This is what I came up with you help :) (work in progress, later it should return BigDecimal value), for now it seems to work:
```
public static String findArea(String description) {
String tempString = "";
Pattern p = Pattern.compile("\\d+(?:,\\d+)?\\s*m\\u00B2");
Matcher m = p.matcher(desc... |
27,913,009 | Update:
I think the leak is coming from `getActivity().getSupportLoaderManager().restartLoader(getLoaderId(), null, this);`
where i have my object implement LoaderCallback. Is there a way for me to clear the callback i tired setting it to
```
getActivity().getSupportLoaderManager().restartLoader(getLoaderId(), null,... | 2015/01/13 | [
"https://Stackoverflow.com/questions/27913009",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1634451/"
] | By calling `addToBackStack()`, you're requesting the `FragmentManager` that the `Fragment` being replaced be just **stopped** and not **destroyed** because you're either anticipating that a back button press is very likely or, the `Fragment` is heavy on initialization and you would still like to avoid doing it again ev... | It's not a memory leak. You need to decide how to deal with your fragment's state.
Ideally you implement `onSaveInstanceState` and `onViewStateRestored` saving your state to the bundle and restoring it from the bundle respectively.
Alternatively, if you're able to re-create your state easily, you may want to save the... |
6,544,899 | I am Using SOAP WS for getting the Data. I got the four Parameters in Response - Topic\_Name, Topic\_Id, Topic\_ImagePath and Topic\_Details. Now I have All the Images of Topic Locally with the same name as i got from the web service for Particular Topic\_ID.
My question is I want to use Local image instead using the... | 2011/07/01 | [
"https://Stackoverflow.com/questions/6544899",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/421003/"
] | I guess this will help:
<http://stevesouders.com/hpws/>
Steve is an employee at google who works on Latency. He is also the mind behind Firefox YSlow. His set of rules are good read to consider for fast apps. | Google created their own tools that you might want to look at: [Closure](http://code.google.com/closure/). You can check out the O'Reilly title: [Closure The Definitive Guide](https://rads.stackoverflow.com/amzn/click/com/1449381871) as well. |
43,199,572 | I'm having some problems with my program and it gives me `java.nio.file.NoSuchFileException` I'm trying to copy folder and files to another but others are working as well. I'm trying to copy folder and files from the `Arraylist` the values from the arraylist was from the `DEL_COPY_DIR` which is properties file. This is... | 2017/04/04 | [
"https://Stackoverflow.com/questions/43199572",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7772560/"
] | You can simply combine an image and a gradient, like this
```css
div {
height: 200px;
width: 500px;
background-image:
linear-gradient(black,
transparent 20%,
transparent 80%,
black),
url(http://lorempixel.com/500/200/nature/1/);
}
```
... | Inset Box-Shadow
----------------
**Advantage:** slim on code, no additional pseudoelement needed
**Disadvantage:** Box shadow **size and offset values** can for current w3 standard be **ONLY absolute** (not percentual), therefore dynamic/various size of the shadowed element cannot be solved without JavaScript calcul... |
40,708,016 | I am newbie to redux and making a todo list in the redux. My action creator code looks like :
```
/**
* This file is called Action Creator (creates actions)
*
* Actions are objects as :
* {
* type : 'ADD_TODO' //the only thing needed is type
* text: 'this is our first to do'
* }
*/
module.expor... | 2016/11/20 | [
"https://Stackoverflow.com/questions/40708016",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2648216/"
] | Your reducer signature is `(state, actions)` but in the function body you have `action`. You probably meant:
```
function reducer (state, action) {
// code
}
``` | There is a typo in your reducer. You define `actions` as second parameter, but on one line (I added a comment there) you try to read from `action`, which is not defined.
```
export default function reducer(state, actions) {
switch (actions.type) {
case 'ADD_TODO':
Object.assign({}, state, {
... |
2,480,116 | There is an insightful question about [reading a C/C++ data structure in C# from a byte array](https://stackoverflow.com/questions/2871/reading-a-c-c-data-structure-in-c-from-a-byte-array), but I cannot get the code to work for my collection of big-endian (network byte order) bytes. (EDIT: Note that my real struct has ... | 2010/03/19 | [
"https://Stackoverflow.com/questions/2480116",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/116891/"
] | I finally figured out a way that didn't involve reflection and is mostly user-friendly. It uses Mono's [DataConverter](http://www.mono-project.com/Mono_DataConvert) class ([source](http://anonsvn.mono-project.com/viewvc/trunk/mcs/class/corlib/Mono/DataConverter.cs?view=log)) which, unfortunately, is fairly buggy at thi... | From my point of view you just need to add an Array.Reverse() before the conversion of the byte array. |
39,273,936 | I'm pretty new to Java, and I know what packages do. You use them to sort multiple files of a Java application together. However, is it standard to put it in a package if your application only has a single class? What are the pros and cons of doing this?
EDIT: I'm packaging this single class into a `.jar` file after. | 2016/09/01 | [
"https://Stackoverflow.com/questions/39273936",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6072571/"
] | It really depends on how you're compiling and running the program, but ultimately it's **your choice**.
Let's have a look at some of the different ways you might build your program.
### 1. Compiling the file with `javac`
If you're compiling the file using `javac` then the package will not matter. It will generate th... | It is probably non-production application if it has a single class and doesn't have any dependencies or resource files. So it is completely up to you how you will start your app.
If you want to distribute your app - make it in compliance with the standards, put it in a jar, publish to maven... |
20,956,944 | I have some text:
>
> The great red fox. Which are not blue foxes. But foxes which are red are not any more faster.
>
>
>
Basically I want to match sentences where "red" and "fox" both appear in that order and another regex where it is not in that order.
How would I do that ? | 2014/01/06 | [
"https://Stackoverflow.com/questions/20956944",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/697795/"
] | Assuming that there is no abbreviations with dots in your sentences:
for any order:
```
(?=[^.!?]*fox)(?=[^.!?]*red)[^.!?]+[.!?]
```
for "red" before "fox":
```
[^.!?]*?red[^.!?]+?fox[^.!?]*[.!?]
``` | For "red" following "fox":
```
\b[^.?!]+red.*?fox[.?!]+
```
for "fox" following "red":
```
\b[^.?!]+fox.*?red[.?!]+
```
to capture all other sentences except ones have "red" following "fox":
```
(?:\b[^.?!]+red.*?fox[.?!]+)(.*?[.?!]+)
```
as you work with Javascript don't forget to put `g` modifier to capture ... |
31,431,002 | I am new to installing new python modules.
I installed tweepy using pip install tweepy. The installation was successful and 2 folders tweepy & tweepy-3.3.0.dist-info are created in the Lib/site-packages, hence I assumed all should be fine.
However, when I went to the IDE and import tweepy. It is unable to detect the ... | 2015/07/15 | [
"https://Stackoverflow.com/questions/31431002",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5117769/"
] | I tried this command `py -m pip install tweepy` and worked for me | If you are using Jupyter Notebook, the only thing that worked for me was to first install Jupyter again
```
pip install jupyter
```
and then install tweepy
```
pip install tweepy
``` |
38,601,784 | I am working on an asp.net mvc web application. now i have a value for operating system which equal to :-
[](https://i.stack.imgur.com/FF8ck.png)
and i am using the following code to build a url containing the above value as follow:-
```
var query =... | 2016/07/27 | [
"https://Stackoverflow.com/questions/38601784",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1146775/"
] | Try this:
```
url.Query = Uri.EscapeUriString(HttpUtility.UrlDecode(query.ToString()));
```
As mentioned here [HttpUtility.ParseQueryString() always encodes special characters to unicode](https://stackoverflow.com/questions/26789168/httputility-parsequerystring-always-encodes-special-characters-to-unicode) | Use `Uri.EscapeDataString()` to escape data (containing any special characters) before adding it in the Query String |
8,919,481 | I want to use oracle syntax to select only 1 row from table `DUAL`. For example, I want to execute this query:
```
SELECT user
FROM DUAL
```
...and it'd have, like, 40 records. But I need only one record. ...AND, I want to make it happen without a `WHERE` clause.
I need something in the table\_name field such as... | 2012/01/19 | [
"https://Stackoverflow.com/questions/8919481",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1037298/"
] | You use ROWNUM.
ie.
```
SELECT user FROM Dual WHERE ROWNUM = 1
```
<http://docs.oracle.com/cd/B19306_01/server.102/b14200/pseudocolumns009.htm> | More flexible than `select max()` is:
```
select distinct first_row(column_x) over (order by column_y,column_z,...) from Table_A
``` |
24,408,002 | Scenario:
I want to execute multiple `Drools` flow one after another.
That is, I've one input, I'll pass it to on my first DRL/XLS file. Output of this first flow will act as input to second DRL.
My question is, does DROOLS have the facility to execute one flow after another in sequence. If so, how?
Till now, I'm g... | 2014/06/25 | [
"https://Stackoverflow.com/questions/24408002",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1433826/"
] | Try using ruleflow diagrams. In which you have the luxury of using sub process. With this feature you can create a master flow that will call sub flows and in those sub flows you can have your rules tagged under particular ruleflow groups. If you could tell the scenario exactly I can provide in depth answer. Thanks. | You could tag both of your DRL files with `agenda-group "SomeGroupName"`. Your first DRL file could have a trigger rule that activates the second agenda-group. |
46,755,568 | Trying to use the new cypress framework with a maven project - the documentation has only an npm module setup example (npm install cypress) and a package.json usage example.
How would this be converted to usage in a maven dependency? | 2017/10/15 | [
"https://Stackoverflow.com/questions/46755568",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6900033/"
] | You can also download Cypress directly without `npm`.
There are instructions as well as the direct download [here](https://on.cypress.io/installing-cypress#Direct-Download). | Here's a [great article](https://www.wimdeblauwe.com/blog/2019/2019-06-15-running-cypress-tests-with-testcontainers-for-a-spring-boot-with-thymeleaf-application/) on using maven to run Cypress tests.
You should be able to use a [Docker container](https://hub.docker.com/u/cypress) for Cypress via the maven [Testcontaine... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.